From 642b280b7200e23f6763f28ba584ed81c6d88480 Mon Sep 17 00:00:00 2001 From: Ryo Hashimoto Date: Thu, 21 May 2015 19:51:37 +0900 Subject: [PATCH] Tweak DOMStorageArea rate limit Increase the data rate and the commit rate. BUG=480228 Review URL: https://codereview.chromium.org/1136123006 Cr-Commit-Position: refs/heads/master@{#330278} (cherry picked from commit 588427cc4c76ed7ef48af26df8718469d1169d4b) TBR=hashimoto@chromium.org Review URL: https://codereview.chromium.org/1149893005 Cr-Commit-Position: refs/branch-heads/2403@{#47} Cr-Branched-From: f54b8097a9c45ed4ad308133d49f05325d6c5070-refs/heads/master@{#330231} --- content/browser/dom_storage/dom_storage_area.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/content/browser/dom_storage/dom_storage_area.cc b/content/browser/dom_storage/dom_storage_area.cc index 67c7b98ac1ad2..e76f5c94d5e18 100644 --- a/content/browser/dom_storage/dom_storage_area.cc +++ b/content/browser/dom_storage/dom_storage_area.cc @@ -37,8 +37,8 @@ const int kCommitDefaultDelaySecs = 5; // To avoid excessive IO we apply limits to the amount of data being written // and the frequency of writes. The specific values used are somewhat arbitrary. -const int kMaxBytesPerDay = kPerStorageAreaQuota * 2; -const int kMaxCommitsPerHour = 6; +const int kMaxBytesPerHour = kPerStorageAreaQuota; +const int kMaxCommitsPerHour = 60; } // namespace @@ -109,7 +109,7 @@ DOMStorageArea::DOMStorageArea(const GURL& origin, is_shutdown_(false), commit_batches_in_flight_(0), start_time_(base::TimeTicks::Now()), - data_rate_limiter_(kMaxBytesPerDay, base::TimeDelta::FromHours(24)), + data_rate_limiter_(kMaxBytesPerHour, base::TimeDelta::FromHours(1)), commit_rate_limiter_(kMaxCommitsPerHour, base::TimeDelta::FromHours(1)) { if (!directory.empty()) { base::FilePath path = directory.Append(DatabaseFileNameFromOrigin(origin_)); @@ -134,7 +134,7 @@ DOMStorageArea::DOMStorageArea(int64 namespace_id, is_shutdown_(false), commit_batches_in_flight_(0), start_time_(base::TimeTicks::Now()), - data_rate_limiter_(kMaxBytesPerDay, base::TimeDelta::FromHours(24)), + data_rate_limiter_(kMaxBytesPerHour, base::TimeDelta::FromHours(1)), commit_rate_limiter_(kMaxCommitsPerHour, base::TimeDelta::FromHours(1)) { DCHECK(namespace_id != kLocalStorageNamespaceId); if (session_storage_backing) {