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

Unified Diff: chrome/browser/bookmarks/bookmark_extension_api.cc

Issue 10871034: Make all quota-exceeding messages in the storage API explain what the failure (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update... the other error message Created 8 years, 4 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/browser/extensions/api/test/test_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/bookmarks/bookmark_extension_api.cc
diff --git a/chrome/browser/bookmarks/bookmark_extension_api.cc b/chrome/browser/bookmarks/bookmark_extension_api.cc
index e9f7cc4adf79320510a913e86ef290092fa37bef..6d7577ad275f4868e5e4155d442d782ee47652f2 100644
--- a/chrome/browser/bookmarks/bookmark_extension_api.cc
+++ b/chrome/browser/bookmarks/bookmark_extension_api.cc
@@ -805,21 +805,26 @@ class BookmarksQuotaLimitFactory {
private:
static void BuildWithMappers(QuotaLimitHeuristics* heuristics,
BucketMapper* short_mapper, BucketMapper* long_mapper) {
- const Config kShortLimitConfig = {
- 2, // 2 tokens per interval.
- TimeDelta::FromMinutes(1) // 1 minute long refill interval.
+ const Config kSustainedLimitConfig = {
+ // See bookmarks.json for current value.
+ bookmarks::MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE,
+ TimeDelta::FromMinutes(1)
};
- const Config kLongLimitConfig = {
- 100, // 100 tokens per interval.
- TimeDelta::FromHours(1) // 1 hour long refill interval.
+ heuristics->push_back(new SustainedLimit(
+ TimeDelta::FromMinutes(10),
+ kSustainedLimitConfig,
+ short_mapper,
+ "MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE"));
+
+ const Config kTimedLimitConfig = {
+ // See bookmarks.json for current value.
+ bookmarks::MAX_WRITE_OPERATIONS_PER_HOUR,
+ TimeDelta::FromHours(1)
};
-
- TimedLimit* timed = new TimedLimit(kLongLimitConfig, long_mapper);
- // A max of two operations per minute, sustained over 10 minutes.
- SustainedLimit* sustained = new SustainedLimit(TimeDelta::FromMinutes(10),
- kShortLimitConfig, short_mapper);
- heuristics->push_back(timed);
- heuristics->push_back(sustained);
+ heuristics->push_back(new TimedLimit(
+ kTimedLimitConfig,
+ long_mapper,
+ "MAX_WRITE_OPERATIONS_PER_HOUR"));
}
DISALLOW_IMPLICIT_CONSTRUCTORS(BookmarksQuotaLimitFactory);
« no previous file with comments | « no previous file | chrome/browser/extensions/api/test/test_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698