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

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

Issue 9264062: [Sync] Consolidate DataTypeController methods that post on the backend thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add suppressions Created 8 years, 11 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
diff --git a/chrome/browser/sync/glue/non_frontend_data_type_controller.h b/chrome/browser/sync/glue/non_frontend_data_type_controller.h
index f1dd235ba32662db833aacc18b5f42a24a39b9a2..55f56d95f06f878c73f4b9247c7951e9a8955a74 100644
--- a/chrome/browser/sync/glue/non_frontend_data_type_controller.h
+++ b/chrome/browser/sync/glue/non_frontend_data_type_controller.h
@@ -9,6 +9,7 @@
#include <string>
#include "base/basictypes.h"
+#include "base/callback_forward.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "base/synchronization/waitable_event.h"
@@ -32,9 +33,8 @@ class ChangeProcessor;
// funtionality is implemented by default. Derived classes must implement:
// type()
// model_safe_group()
-// StartAssociationAsync()
+// PostTaskOnBackendThread()
// CreateSyncComponents()
-// StopAssociationAsync()
// RecordUnrecoverableError(...)
// RecordAssociationTime(...);
// RecordStartFailure(...);
@@ -71,10 +71,12 @@ class NonFrontendDataTypeController : public DataTypeController {
// Note: this is performed on the frontend (UI) thread.
virtual bool StartModels();
- // 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.
- virtual bool StartAssociationAsync() = 0;
+ // Posts the given task to the backend thread, i.e. the thread the
+ // datatype lives on. Return value: True if task posted successfully,
+ // false otherwise.
+ virtual bool PostTaskOnBackendThread(
+ 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.
@@ -105,11 +107,6 @@ class NonFrontendDataTypeController : public DataTypeController {
// Note: this is performed on the frontend (UI) thread.
virtual void StopModels();
- // 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.
- virtual bool StopAssociationAsync() = 0;
-
// Disassociate the models and destroy the sync components.
// Note: this is performed on the datatype's thread.
virtual void StopAssociation();
@@ -131,6 +128,16 @@ class NonFrontendDataTypeController : public DataTypeController {
// Record causes of start failure. Called on UI thread.
virtual void RecordStartFailure(StartResult result) = 0;
+ // 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.
+ 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;

Powered by Google App Engine
This is Rietveld 408576698