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

Unified Diff: chrome/browser/sync/glue/non_frontend_data_type_controller.h

Issue 9353005: Revert 120698 - [Sync] Fix thread-ordering-dependent NULL dereference in NewNonFrontendDTC (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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/sync/glue/non_frontend_data_type_controller.h
===================================================================
--- chrome/browser/sync/glue/non_frontend_data_type_controller.h (revision 120699)
+++ chrome/browser/sync/glue/non_frontend_data_type_controller.h (working copy)
@@ -66,8 +66,8 @@
// associate models. The default implementation is a no-op.
// Return value:
// True - if models are ready and association can proceed.
- // False - if models are not ready. StartAssociationAsync should be called
- // when the models are ready.
+ // False - if models are not ready. KickOffAssociation should be called
+ // when the models are ready. Refer to Start(_) implementation.
// Note: this is performed on the frontend (UI) thread.
virtual bool StartModels();
@@ -78,6 +78,10 @@
const tracked_objects::Location& from_here,
const base::Closure& task) = 0;
+ // Build sync components and associate models.
+ // Note: this is performed on the datatype's thread.
+ virtual void StartAssociation();
+
// Datatype specific creation of sync components.
// Note: this is performed on the datatype's thread.
virtual void CreateSyncComponents() = 0;
@@ -103,6 +107,10 @@
// Note: this is performed on the frontend (UI) thread.
virtual void StopModels();
+ // Disassociate the models and destroy the sync components.
+ // Note: this is performed on the datatype's thread.
+ virtual void StopAssociation();
+
// Implementation of OnUnrecoverableError that lives on UI thread.
virtual void OnUnrecoverableErrorImpl(
const tracked_objects::Location& from_here,
@@ -123,13 +131,13 @@
// Post the association task to the thread the datatype lives on.
// Note: this is performed on the frontend (UI) thread.
// Return value: True if task posted successfully, False otherwise.
- //
- // TODO(akalin): Callers handle false return values inconsistently;
- // some set the state to NOT_RUNNING, and some set the state to
- // DISABLED. Move the error handling inside this function to be
- // consistent.
- virtual bool StartAssociationAsync();
+ bool StartAssociationAsync();
+ // Post the StopAssociation task to the thread the datatype lives on.
+ // Note: this is performed on the frontend (UI) thread.
+ // Return value: True if task posted successfully, False otherwise.
+ bool StopAssociationAsync();
+
// Accessors and mutators used by derived classes.
ProfileSyncComponentsFactory* profile_sync_factory() const;
Profile* profile() const;
@@ -143,19 +151,6 @@
virtual void set_change_processor(ChangeProcessor* change_processor);
private:
- // Build sync components and associate models.
- // Note: this is performed on the datatype's thread.
- void StartAssociation();
-
- // Post the StopAssociation task to the thread the datatype lives on.
- // Note: this is performed on the frontend (UI) thread.
- // Return value: True if task posted successfully, False otherwise.
- bool StopAssociationAsync();
-
- // Disassociate the models and destroy the sync components.
- // Note: this is performed on the datatype's thread.
- void StopAssociation();
-
ProfileSyncComponentsFactory* const profile_sync_factory_;
Profile* const profile_;
ProfileSyncService* const profile_sync_service_;

Powered by Google App Engine
This is Rietveld 408576698