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

Unified Diff: components/sync_driver/non_blocking_data_type_controller.h

Issue 1763953002: [USS] Change the place where SharedModelTypeProcessor got created (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 4 years, 9 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/non_blocking_data_type_controller.h
diff --git a/components/sync_driver/non_blocking_data_type_controller.h b/components/sync_driver/non_blocking_data_type_controller.h
index eeeaeb94f6a99ea52465701a387d9d1c6c6869f9..3d426aa2b14d954f386f04e2994687762eaf0d66 100644
--- a/components/sync_driver/non_blocking_data_type_controller.h
+++ b/components/sync_driver/non_blocking_data_type_controller.h
@@ -81,15 +81,11 @@ class NonBlockingDataTypeController : public sync_driver::DataTypeController {
virtual void RunOnUIThread(const tracked_objects::Location& from_here,
const base::Closure& task) = 0;
- // The function will create SharedModelTypeProcessor on model thread.
- void InitializeProcessor();
-
private:
void RecordStartFailure(ConfigureResult result) const;
void RecordUnrecoverableError();
void ReportLoadModelError(ConfigureResult result,
const syncer::SyncError& error);
- void InitializeProcessorOnModelThread();
// If the DataType controller is waiting for models to load, once the models
// are loaded this function should be called to let the base class
@@ -109,6 +105,10 @@ class NonBlockingDataTypeController : public sync_driver::DataTypeController {
syncer::SyncError error,
scoped_ptr<syncer_v2::ActivationContext> activation_context);
+ // The function LoadModels() will call this function to do some works which
+ // need to be done on model thread.
+ void LoadModelsOnModelThread();
+
// Model Type for this controller
syncer::ModelType model_type_;
@@ -125,6 +125,9 @@ class NonBlockingDataTypeController : public sync_driver::DataTypeController {
// callback and must temporarily own it until ActivateDataType is called.
scoped_ptr<syncer_v2::ActivationContext> activation_context_;
+ // TODO(gangwu): We can complete remove holding this pointer since the only
+ // place we use it is when we stop the data type. We can let ModelTypeService
+ // to stop the processor.
// A weak pointer to the actual SharedModelTypeProcessor
base::WeakPtr<syncer_v2::SharedModelTypeProcessor> type_processor_;
« no previous file with comments | « components/sync_driver/device_info_service_unittest.cc ('k') | components/sync_driver/non_blocking_data_type_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698