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

Unified Diff: components/sync/driver/generic_change_processor.h

Issue 2593803002: Make sync's change processors sequence-affine. (Closed)
Patch Set: CR Created 4 years 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
« no previous file with comments | « no previous file | components/sync/driver/generic_change_processor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/driver/generic_change_processor.h
diff --git a/components/sync/driver/generic_change_processor.h b/components/sync/driver/generic_change_processor.h
index 96f580e34679faca46d1c818afb3cc9876787cc1..f8e5c530266b143afa557ea4780e54922f332386 100644
--- a/components/sync/driver/generic_change_processor.h
+++ b/components/sync/driver/generic_change_processor.h
@@ -14,7 +14,7 @@
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
-#include "base/threading/non_thread_safe.h"
+#include "base/sequence_checker.h"
#include "components/sync/model/attachments/attachment_service.h"
#include "components/sync/model/attachments/attachment_service_proxy.h"
#include "components/sync/model/attachments/attachment_store.h"
@@ -38,17 +38,16 @@ class Entry;
typedef std::vector<SyncData> SyncDataList;
// Datatype agnostic change processor. One instance of GenericChangeProcessor
-// is created for each datatype and lives on the datatype's thread. It then
+// is created for each datatype and lives on the datatype's sequence. It then
// handles all interaction with the sync api, both translating pushes from the
// local service into transactions and receiving changes from the sync model,
// which then get converted into SyncChange's and sent to the local service.
//
// As a rule, the GenericChangeProcessor is not thread safe, and should only
-// be used on the same thread in which it was created.
+// be used on the same sequence in which it was created.
class GenericChangeProcessor : public ChangeProcessor,
public SyncChangeProcessor,
- public AttachmentService::Delegate,
- public base::NonThreadSafe {
+ public AttachmentService::Delegate {
public:
// Create a change processor for |type| and connect it to the syncer.
// |attachment_store| can be null which means that datatype will not use sync
@@ -147,6 +146,8 @@ class GenericChangeProcessor : public ChangeProcessor,
void NotifyLocalChangeObservers(const syncable::Entry* current_entry,
const SyncChange& change);
+ base::SequenceChecker sequence_checker_;
+
const ModelType type_;
// The SyncableService this change processor will forward changes on to.
« no previous file with comments | « no previous file | components/sync/driver/generic_change_processor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698