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

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

Issue 9284013: Extension Storage API: expose storage quota information to extensions, via: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments Created 8 years, 11 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
Index: chrome/browser/extensions/settings/settings_frontend.cc
diff --git a/chrome/browser/extensions/settings/settings_frontend.cc b/chrome/browser/extensions/settings/settings_frontend.cc
index 8d7d914cff0d9cfaa6eddd268a89a3dc7f529eb5..f6ba2bb14b12a9fb042e9273e25d8f430cfbd3d9 100644
--- a/chrome/browser/extensions/settings/settings_frontend.cc
+++ b/chrome/browser/extensions/settings/settings_frontend.cc
@@ -23,29 +23,6 @@ namespace extensions {
namespace {
-const SettingsStorageQuotaEnforcer::Limits kSyncQuota = {
- // 100K should be enough for simple use, but this can be increased as demand
- // increases.
- 100 * 1024,
-
- // Sync supports 5k per settings, so be a bit more restrictive than that.
- 2048,
-
- // Keep low for sync.
- 512
-};
-
-const SettingsStorageQuotaEnforcer::Limits kLocalQuota = {
- // Same as localStorage (5MB).
- 5 * 1000 * 1024,
-
- // No need to be restrictive per key here.
- UINT_MAX,
-
- // Ditto.
- UINT_MAX
-};
-
// Settings change Observer which forwards changes on to the extension
// processes for |profile| and its incognito partner if it exists.
class DefaultObserver : public SettingsObserver {
@@ -111,6 +88,33 @@ void CallbackWithUnlimitedStorage(
} // namespace
+// The values in kSyncQuota and kLocalQuota must match those in
+// chrome/common/extensions/api/storage.json
+
+// static
+const SettingsStorageQuotaEnforcer::Limits SettingsFrontend::kSyncQuota = {
+ // 100K should be enough for simple use, but this can be increased as demand
+ // increases.
+ 100 * 1024,
+
+ // Sync supports 5k per settings, so be a bit more restrictive than that.
+ 2048,
+
+ // Keep low for sync.
+ 512
+};
+
+const SettingsStorageQuotaEnforcer::Limits SettingsFrontend::kLocalQuota = {
+ // Same as localStorage (5MB).
+ 5 * 1000 * 1024,
+
+ // No need to be restrictive per key here.
+ UINT_MAX,
+
+ // Ditto.
+ UINT_MAX
+};
+
// Ref-counted container for a SettingsBackend object.
class SettingsFrontend::BackendWrapper
: public base::RefCountedThreadSafe<BackendWrapper> {

Powered by Google App Engine
This is Rietveld 408576698