Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(887)

Unified Diff: extensions/browser/api/storage/storage_api.cc

Issue 702303002: Raise the throttling limits of the storage API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: better limits Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | extensions/common/api/storage.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/api/storage/storage_api.cc
diff --git a/extensions/browser/api/storage/storage_api.cc b/extensions/browser/api/storage/storage_api.cc
index 5e984bc8f95362c6034de5f8bd265264cf2c79c1..38c8e7181ac47b48fb7146eb5d3fb3a441aba76a 100644
--- a/extensions/browser/api/storage/storage_api.cc
+++ b/extensions/browser/api/storage/storage_api.cc
@@ -149,14 +149,18 @@ std::vector<std::string> GetKeys(const base::DictionaryValue& dict) {
// Creates quota heuristics for settings modification.
void GetModificationQuotaLimitHeuristics(QuotaLimitHeuristics* heuristics) {
- QuotaLimitHeuristic::Config longLimitConfig = {
- // See storage.json for current value.
- core_api::storage::sync::MAX_WRITE_OPERATIONS_PER_HOUR,
- base::TimeDelta::FromHours(1)
- };
+ // See storage.json for the current value of these limits.
+ QuotaLimitHeuristic::Config short_limit_config = {
+ core_api::storage::sync::MAX_WRITE_OPERATIONS_PER_MINUTE,
+ base::TimeDelta::FromMinutes(1)};
+ QuotaLimitHeuristic::Config long_limit_config = {
+ core_api::storage::sync::MAX_WRITE_OPERATIONS_PER_HOUR,
+ base::TimeDelta::FromHours(1)};
+ heuristics->push_back(new QuotaService::TimedLimit(
+ short_limit_config, new QuotaLimitHeuristic::SingletonBucketMapper(),
+ "MAX_WRITE_OPERATIONS_PER_MINUTE"));
heuristics->push_back(new QuotaService::TimedLimit(
- longLimitConfig,
- new QuotaLimitHeuristic::SingletonBucketMapper(),
+ long_limit_config, new QuotaLimitHeuristic::SingletonBucketMapper(),
"MAX_WRITE_OPERATIONS_PER_HOUR"));
};
« no previous file with comments | « no previous file | extensions/common/api/storage.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698