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

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

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_leveldb_storage.cc
diff --git a/chrome/browser/extensions/settings/settings_leveldb_storage.cc b/chrome/browser/extensions/settings/settings_leveldb_storage.cc
index 77971cabca5e25cdcd65b5d1cf715d25be46675d..b768e291604b710bf0e12a52d50281705ab77ba7 100644
--- a/chrome/browser/extensions/settings/settings_leveldb_storage.cc
+++ b/chrome/browser/extensions/settings/settings_leveldb_storage.cc
@@ -164,21 +164,20 @@ SettingsStorage::ReadResult SettingsLeveldbStorage::Get() {
}
SettingsStorage::WriteResult SettingsLeveldbStorage::Set(
- const std::string& key, const Value& value) {
+ WriteOptions options, const std::string& key, const Value& value) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
DictionaryValue settings;
settings.SetWithoutPathExpansion(key, value.DeepCopy());
- return Set(settings);
+ return Set(options, settings);
}
SettingsStorage::WriteResult SettingsLeveldbStorage::Set(
- const DictionaryValue& settings) {
+ WriteOptions options, const DictionaryValue& settings) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
std::string value_as_json;
leveldb::WriteBatch batch;
- scoped_ptr<SettingChangeList> changes(
- new SettingChangeList());
+ scoped_ptr<SettingChangeList> changes(new SettingChangeList());
for (DictionaryValue::Iterator it(settings); it.HasNext(); it.Advance()) {
scoped_ptr<Value> old_value;
@@ -246,16 +245,15 @@ SettingsStorage::WriteResult SettingsLeveldbStorage::Remove(
SettingsStorage::WriteResult SettingsLeveldbStorage::Clear() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
- leveldb::ReadOptions options;
+ leveldb::ReadOptions read_options;
// All interaction with the db is done on the same thread, so snapshotting
// isn't strictly necessary. This is just defensive.
leveldb::WriteBatch batch;
- scoped_ptr<SettingChangeList> changes(
- new SettingChangeList());
+ scoped_ptr<SettingChangeList> changes(new SettingChangeList());
ScopedSnapshot snapshot(db_.get());
- options.snapshot = snapshot.get();
- scoped_ptr<leveldb::Iterator> it(db_->NewIterator(options));
+ read_options.snapshot = snapshot.get();
+ scoped_ptr<leveldb::Iterator> it(db_->NewIterator(read_options));
for (it->SeekToFirst(); it->Valid(); it->Next()) {
const std::string key = it->key().ToString();
const std::string old_value_json = it->value().ToString();

Powered by Google App Engine
This is Rietveld 408576698