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

Unified Diff: chrome/browser/extensions/api/storage/settings_sync_util.cc

Issue 184043031: Split up extensions storage API implementations for sync and local storage. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: split sync_or_local Created 6 years, 10 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/api/storage/settings_sync_util.cc
diff --git a/chrome/browser/extensions/api/storage/settings_sync_util.cc b/chrome/browser/extensions/api/storage/settings_sync_util.cc
index b974aa3f619ed30642362b13f163d86e2edf8479..b7a598a5ecd2dfa548b7c3c6a3ad5ee2ee05dab5 100644
--- a/chrome/browser/extensions/api/storage/settings_sync_util.cc
+++ b/chrome/browser/extensions/api/storage/settings_sync_util.cc
@@ -6,6 +6,8 @@
#include "base/json/json_writer.h"
#include "base/values.h"
+#include "chrome/browser/extensions/api/storage/settings_frontend.h"
+#include "chrome/browser/extensions/api/storage/sync_value_store_cache.h"
#include "sync/protocol/app_setting_specifics.pb.h"
#include "sync/protocol/extension_setting_specifics.pb.h"
#include "sync/protocol/sync.pb.h"
@@ -105,6 +107,15 @@ syncer::SyncChange CreateDelete(
CreateData(extension_id, key, no_value, type));
}
+syncer::SyncableService* GetSyncableService(content::BrowserContext* context,
+ syncer::ModelType type) {
Devlin 2014/03/05 19:02:55 There used to be a DCHECK(OnFileThread) here (back
James Cook 2014/03/05 23:14:28 Added back. (I was relying on the DCHECK in SyncV
+ DCHECK(type == syncer::APP_SETTINGS || type == syncer::EXTENSION_SETTINGS);
+ SettingsFrontend* frontend = SettingsFrontend::Get(context);
+ SyncValueStoreCache* sync_cache = static_cast<SyncValueStoreCache*>(
+ frontend->GetValueStoreCache(settings_namespace::SYNC));
+ return sync_cache->GetSyncableService(type);
+}
+
} // namespace settings_sync_util
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698