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

Unified Diff: chrome/browser/extensions/settings/settings_storage.h

Issue 8587025: Extension settings API: force through changes that come from sync (ignoring (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 9 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
Index: chrome/browser/extensions/settings/settings_storage.h
diff --git a/chrome/browser/extensions/settings/settings_storage.h b/chrome/browser/extensions/settings/settings_storage.h
index 56225c8bf8783f0f656a77d3c0b82ff751a7d2c2..aefc41a5c2f4c73e8f815fbad7166a75742d177e 100644
--- a/chrome/browser/extensions/settings/settings_storage.h
+++ b/chrome/browser/extensions/settings/settings_storage.h
@@ -89,6 +89,17 @@ class SettingsStorage {
scoped_refptr<Inner> inner_;
};
+ // Options for write operations.
+ enum WriteOptions {
+ // Callers should usually use this.
+ DEFAULTS,
+
+ // Ignore restrictions, such as quota. It is still possible for the
+ // operation to fail, such as on hard drive failure or if the storage area
+ // is configured to fail.
+ FORCE
+ };
+
virtual ~SettingsStorage() {}
// Gets a single value from storage.
@@ -101,10 +112,12 @@ class SettingsStorage {
virtual ReadResult Get() = 0;
// Sets a single key to a new value.
- virtual WriteResult Set(const std::string& key, const Value& value) = 0;
+ virtual WriteResult Set(
+ WriteOptions options, const std::string& key, const Value& value) = 0;
// Sets multiple keys to new values.
- virtual WriteResult Set(const DictionaryValue& values) = 0;
+ virtual WriteResult Set(
+ WriteOptions options, const DictionaryValue& values) = 0;
// Removes a key from the storage.
virtual WriteResult Remove(const std::string& key) = 0;

Powered by Google App Engine
This is Rietveld 408576698