Chromium Code Reviews| Index: components/sync/driver/shared_change_processor.h |
| diff --git a/components/sync/driver/shared_change_processor.h b/components/sync/driver/shared_change_processor.h |
| index 3d4698f1441226e5043707484c87a53f2ce374e0..c1942375a34e4fdf29bfbd6c38b7fd8f4be3908d 100644 |
| --- a/components/sync/driver/shared_change_processor.h |
| +++ b/components/sync/driver/shared_change_processor.h |
| @@ -12,6 +12,7 @@ |
| #include "base/macros.h" |
| #include "base/memory/ref_counted.h" |
| #include "base/memory/weak_ptr.h" |
| +#include "base/sequenced_task_runner.h" |
| #include "base/single_thread_task_runner.h" |
| #include "base/synchronization/lock.h" |
| #include "components/sync/driver/data_type_controller.h" |
| @@ -78,8 +79,8 @@ class SharedChangeProcessor |
| std::unique_ptr<DataTypeErrorHandler> error_handler, |
| const base::WeakPtr<SyncMergeResult>& merge_result); |
| - // Disconnects from the generic change processor. May be called from any |
| - // thread. After this, all attempts to interact with the change processor by |
| + // Disconnects from the generic change processor. This method is thread-safe. |
| + // After this, all attempts to interact with the change processor by |
| // |local_service_| are dropped and return errors. The syncer will be safe to |
| // shut down from the point of view of this datatype. |
| // Note: Once disconnected, you cannot reconnect without creating a new |
| @@ -89,7 +90,7 @@ class SharedChangeProcessor |
| virtual bool Disconnect(); |
| // GenericChangeProcessor stubs (with disconnect support). |
| - // Should only be called on the same thread the datatype resides. |
| + // Should only be called on the same sequence the datatype resides. |
| virtual int GetSyncCount(); |
| virtual SyncError ProcessSyncChanges( |
| const tracked_objects::Location& from_here, |
| @@ -143,11 +144,11 @@ class SharedChangeProcessor |
| // destructed and/or disconnected on this loop, see ~SharedChangeProcessor. |
| const scoped_refptr<const base::SingleThreadTaskRunner> frontend_task_runner_; |
| - // The loop that all methods except the constructor, destructor, and |
| - // Disconnect() should be called on. Set in Connect(). |
| - scoped_refptr<base::SingleThreadTaskRunner> backend_task_runner_; |
| + // The sequence that all methods except the constructor, destructor, and |
|
stanisc
2016/12/21 18:48:09
I personally find the term sequence confusing in t
gab
2016/12/21 18:52:17
"execution sequence"?
stanisc
2016/12/21 18:57:27
execution sequence is better. Or task sequence.
Or
fdoray
2016/12/21 19:12:51
Done.
|
| + // Disconnect() should be called on. Set in Connect(). |
| + scoped_refptr<base::SequencedTaskRunner> backend_task_runner_; |
| - // Used only on |backend_loop_|. |
| + // Used only on |backend_task_runner_|. |
| GenericChangeProcessor* generic_change_processor_; |
| std::unique_ptr<DataTypeErrorHandler> error_handler_; |