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

Unified Diff: chrome/browser/extensions/api/storage/settings_backend.h

Issue 15404005: sync: deferred initialization support for app/extension settings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: with util fix Created 7 years, 7 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_backend.h
diff --git a/chrome/browser/extensions/api/storage/settings_backend.h b/chrome/browser/extensions/api/storage/settings_backend.h
index 1706828b356f6ef4d3d696ea9d07fdb664d90f08..8fe9108fbda7b93ec153ba2f38f4325ca185101d 100644
--- a/chrome/browser/extensions/api/storage/settings_backend.h
+++ b/chrome/browser/extensions/api/storage/settings_backend.h
@@ -40,6 +40,7 @@ class SettingsBackend : public syncer::SyncableService {
SettingsBackend(
const scoped_refptr<SettingsStorageFactory>& storage_factory,
const base::FilePath& base_path,
+ syncer::ModelType sync_type,
const SettingsStorageQuotaEnforcer::Limits& quota,
const scoped_refptr<SettingsObserverList>& observers);
@@ -65,6 +66,11 @@ class SettingsBackend : public syncer::SyncableService {
const syncer::SyncChangeList& change_list) OVERRIDE;
virtual void StopSyncing(syncer::ModelType type) OVERRIDE;
+ // Provides a StartSyncFlare to the SyncableService. See
+ // sync_start_util for more.
+ void InjectStartSyncFlare(
+ const syncer::SyncableService::StartSyncFlare& flare);
+
private:
// Gets a weak reference to the storage area for a given extension,
// initializing sync with some initial data if sync enabled.
@@ -98,8 +104,7 @@ class SettingsBackend : public syncer::SyncableService {
StorageObjMap;
mutable StorageObjMap storage_objs_;
- // Current sync model type. Will be UNSPECIFIED if sync hasn't been enabled
- // yet, and either SETTINGS or APP_SETTINGS if it has been.
+ // Current sync model type. Either EXTENSION_SETTINGS or APP_SETTINGS.
syncer::ModelType sync_type_;
// Current sync processor, if any.
@@ -108,6 +113,8 @@ class SettingsBackend : public syncer::SyncableService {
// Current sync error handler if any.
scoped_ptr<syncer::SyncErrorFactory> sync_error_factory_;
+ syncer::SyncableService::StartSyncFlare flare_;
+
DISALLOW_COPY_AND_ASSIGN(SettingsBackend);
};

Powered by Google App Engine
This is Rietveld 408576698