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

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

Issue 6811003: [Sync] Make generic non-frontend thread datatype controller. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Copy paste :( Created 9 years, 8 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
« no previous file with comments | « chrome/browser/profiles/profile_impl.cc ('k') | chrome/browser/sync/glue/autofill_data_type_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/glue/autofill_data_type_controller.h
diff --git a/chrome/browser/sync/glue/autofill_data_type_controller.h b/chrome/browser/sync/glue/autofill_data_type_controller.h
index 8df5fb8e1ba0aea76fb8531eea1511e7bc501390..ee58113e093ecf022a0ea7d1c91d8ee5af697a03 100644
--- a/chrome/browser/sync/glue/autofill_data_type_controller.h
+++ b/chrome/browser/sync/glue/autofill_data_type_controller.h
@@ -8,53 +8,31 @@
#include <string>
-#include "base/basictypes.h"
-#include "base/memory/scoped_ptr.h"
-#include "base/synchronization/waitable_event.h"
+#include "base/memory/ref_counted.h"
#include "chrome/browser/autofill/personal_data_manager.h"
-#include "chrome/browser/sync/profile_sync_factory.h"
-#include "chrome/browser/sync/profile_sync_service.h"
-#include "chrome/browser/sync/glue/data_type_controller.h"
+#include "chrome/browser/sync/glue/non_frontend_data_type_controller.h"
+#include "content/common/notification_observer.h"
+#include "content/common/notification_registrar.h"
-class Profile;
-class ProfileSyncFactory;
-class ProfileSyncService;
+class NotificationDetails;
+class NotificationType;
+class NotificationSource;
namespace browser_sync {
-class AssociatorInterface;
-class ChangeProcessor;
-
// A class that manages the startup and shutdown of autofill sync.
-class AutofillDataTypeController : public DataTypeController,
+class AutofillDataTypeController : public NonFrontendDataTypeController,
public NotificationObserver,
public PersonalDataManager::Observer {
public:
- AutofillDataTypeController(
- ProfileSyncFactory* profile_sync_factory,
- Profile* profile,
- ProfileSyncService* sync_service);
+ AutofillDataTypeController(ProfileSyncFactory* profile_sync_factory,
+ Profile* profile);
virtual ~AutofillDataTypeController();
- // DataTypeController implementation
- virtual void Start(StartCallback* start_callback);
-
- virtual void Stop();
-
- virtual bool enabled();
-
+ // NonFrontendDataTypeController implementation
virtual syncable::ModelType type() const;
-
virtual browser_sync::ModelSafeGroup model_safe_group() const;
- virtual std::string name() const;
-
- virtual State state() const;
-
- // UnrecoverableHandler implementation
- virtual void OnUnrecoverableError(const tracked_objects::Location& from_here,
- const std::string& message);
-
// NotificationObserver implementation.
virtual void Observe(NotificationType type,
const NotificationSource& source,
@@ -64,52 +42,26 @@ class AutofillDataTypeController : public DataTypeController,
virtual void OnPersonalDataLoaded();
protected:
- virtual ProfileSyncFactory::SyncComponents CreateSyncComponents(
- ProfileSyncService* profile_sync_service,
- WebDatabase* web_database,
- PersonalDataManager* personal_data,
- browser_sync::UnrecoverableErrorHandler* error_handler);
- ProfileSyncFactory* profile_sync_factory_;
-
+ // NonFrontendDataTypeController interface.
+ virtual bool StartModels();
+ virtual bool StartAssociationAsync();
+ virtual void CreateSyncComponents();
+ virtual void StopModels();
+ virtual bool StopAssociationAsync();
+ virtual void RecordUnrecoverableError(
+ const tracked_objects::Location& from_here,
+ const std::string& message);
+ virtual void RecordAssociationTime(base::TimeDelta time);
+ virtual void RecordStartFailure(StartResult result);
+
+ // Getters and setters
+ PersonalDataManager* personal_data() const;
+ WebDataService* web_data_service() const;
private:
- void StartImpl();
- void StartDone(StartResult result, State state);
- void StartDoneImpl(StartResult result, State state,
- const tracked_objects::Location& location);
- void StopImpl();
- void StartFailed(StartResult result);
- void OnUnrecoverableErrorImpl(const tracked_objects::Location& from_here,
- const std::string& message);
-
- // Second-half of "Start" implementation, called once personal data has
- // loaded.
- void ContinueStartAfterPersonalDataLoaded();
-
- void set_state(State state) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- state_ = state;
- }
-
- Profile* profile_;
- ProfileSyncService* sync_service_;
- State state_;
-
PersonalDataManager* personal_data_;
scoped_refptr<WebDataService> web_data_service_;
- scoped_ptr<AssociatorInterface> model_associator_;
- scoped_ptr<ChangeProcessor> change_processor_;
- scoped_ptr<StartCallback> start_callback_;
-
NotificationRegistrar notification_registrar_;
- base::Lock abort_association_lock_;
- bool abort_association_;
- base::WaitableEvent abort_association_complete_;
-
- // Barrier to ensure that the datatype has been stopped on the DB thread
- // from the UI thread.
- base::WaitableEvent datatype_stopped_;
-
DISALLOW_COPY_AND_ASSIGN(AutofillDataTypeController);
};
« no previous file with comments | « chrome/browser/profiles/profile_impl.cc ('k') | chrome/browser/sync/glue/autofill_data_type_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698