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

Unified Diff: components/sync_driver/data_type_controller.h

Issue 317453002: sync: cut a few profile deps from DataTypeControllers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: move OnUserShareReady Created 6 years, 6 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: components/sync_driver/data_type_controller.h
diff --git a/components/sync_driver/data_type_controller.h b/components/sync_driver/data_type_controller.h
index ebc6c6fbbf959de65087283c9e145dabc1b03d04..37fefc6bb330cf4f617b67919119871d593067c5 100644
--- a/components/sync_driver/data_type_controller.h
+++ b/components/sync_driver/data_type_controller.h
@@ -21,6 +21,7 @@
namespace syncer {
class SyncError;
+struct UserShare;
}
namespace browser_sync {
@@ -96,6 +97,11 @@ class DataTypeController
// Synchronously stops the data type. If StartAssociating has already been
// called but is not done yet it will be aborted. Similarly if LoadModels
// has not completed it will also be aborted.
+ // NOTE: Stop() should be called after sync backend machinery has stopped
+ // routing changes to this data type. Stop() should ensure the data type
+ // logic shuts down gracefully by flushing remaining changes and calling
+ // StopSyncing on the SyncableService. This assumes no changes will ever
+ // propagate from sync again from point where Stop() is called.
virtual void Stop() = 0;
// Unique model type for this data type controller.
@@ -123,6 +129,10 @@ class DataTypeController
const std::string& message,
syncer::ModelType type) OVERRIDE;
+ // Called when the sync backend has initialized. |share| is the
+ // UserShare handle to associate model data with.
+ void OnUserShareReady(syncer::UserShare* share);
+
protected:
friend class base::RefCountedDeleteOnMessageLoop<DataTypeController>;
friend class base::DeleteHelper<DataTypeController>;
@@ -144,7 +154,11 @@ class DataTypeController
const tracked_objects::Location& from_here,
const std::string& message);
+ syncer::UserShare* user_share() const;
+
private:
+ syncer::UserShare* user_share_;
+
// The callback that will be invoked when an unrecoverable error occurs.
base::Closure error_callback_;
};
« no previous file with comments | « chrome/browser/sync/sessions/session_data_type_controller.cc ('k') | components/sync_driver/data_type_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698