Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / sync / glue / non_ui_data_type_controller.h
index 696aee2..29dbc98 100644 (file)
@@ -40,6 +40,7 @@ class NonUIDataTypeController : public DataTypeController {
   virtual void Stop() OVERRIDE;
   virtual syncer::ModelType type() const = 0;
   virtual syncer::ModelSafeGroup model_safe_group() const = 0;
+  virtual ChangeProcessor* GetChangeProcessor() const OVERRIDE;
   virtual std::string name() const OVERRIDE;
   virtual State state() const OVERRIDE;
   virtual void OnSingleDatatypeUnrecoverableError(
@@ -99,6 +100,10 @@ class NonUIDataTypeController : public DataTypeController {
   // Record causes of start failure.
   virtual void RecordStartFailure(StartResult result);
 
+  // To allow unit tests to control thread interaction during non-ui startup
+  // and shutdown, use a factory method to create the SharedChangeProcessor.
+  virtual SharedChangeProcessor* CreateSharedChangeProcessor();
+
   Profile* profile() const { return profile_; }
 
  private:
@@ -154,6 +159,10 @@ class NonUIDataTypeController : public DataTypeController {
   // reference).
   scoped_refptr<SharedChangeProcessor> shared_change_processor_;
 
+  // The UserShare to connect the SharedChangeProcessor to. NULL until set in
+  // LoadModels.
+  syncer::UserShare* user_share_;
+
   // A weak pointer to the actual local syncable service, which performs all the
   // real work. We do not own the object, and it is only safe to access on the
   // DataType's thread.