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

Unified Diff: chrome/browser/extensions/settings/settings_api.cc

Issue 10266006: Define the storage API throttling constants in storage.json so that they are (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 8 months 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 | chrome/common/extensions/api/storage.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/settings/settings_api.cc
diff --git a/chrome/browser/extensions/settings/settings_api.cc b/chrome/browser/extensions/settings/settings_api.cc
index cfb749c82c07b49e98d8ff6c2f88e16753f662d0..d64409a90f2e72faf8d9c3f381efc31c23611e85 100644
--- a/chrome/browser/extensions/settings/settings_api.cc
+++ b/chrome/browser/extensions/settings/settings_api.cc
@@ -11,6 +11,7 @@
#include "chrome/browser/extensions/settings/settings_api.h"
#include "chrome/browser/extensions/settings/settings_frontend.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/common/extensions/api/storage.h"
#include "content/public/browser/browser_thread.h"
namespace extensions {
@@ -118,10 +119,10 @@ std::vector<std::string> GetKeys(const DictionaryValue& dict) {
// Creates quota heuristics for settings modification.
static void GetModificationQuotaLimitHeuristics(
QuotaLimitHeuristics* heuristics) {
- // A max of 1000 operations per hour.
QuotaLimitHeuristic::Config longLimitConfig = {
- 1000,
- base::TimeDelta::FromHours(1)
+ // See storage.json for current value.
+ api::storage::sync::MAX_WRITE_OPERATIONS_PER_HOUR,
+ base::TimeDelta::FromHours(1)
};
heuristics->push_back(
new ExtensionsQuotaService::TimedLimit(
@@ -129,8 +130,9 @@ static void GetModificationQuotaLimitHeuristics(
// A max of 10 operations per minute, sustained over 10 minutes.
QuotaLimitHeuristic::Config shortLimitConfig = {
- 10,
- base::TimeDelta::FromMinutes(1)
+ // See storage.json for current value.
+ api::storage::sync::MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE,
+ base::TimeDelta::FromMinutes(1)
};
heuristics->push_back(
new ExtensionsQuotaService::SustainedLimit(
« no previous file with comments | « no previous file | chrome/common/extensions/api/storage.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698