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

Unified Diff: chrome/browser/sync/glue/autofill_profile_data_type_controller.cc

Issue 6811003: [Sync] Make generic non-frontend thread datatype controller. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix autofill 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
Index: chrome/browser/sync/glue/autofill_profile_data_type_controller.cc
diff --git a/chrome/browser/sync/glue/autofill_profile_data_type_controller.cc b/chrome/browser/sync/glue/autofill_profile_data_type_controller.cc
index 2203197e5e6811743b0165706e1e559f6d1dceaf..15c928a5da62a46d6c6fd02cc9e06371d26045b0 100644
--- a/chrome/browser/sync/glue/autofill_profile_data_type_controller.cc
+++ b/chrome/browser/sync/glue/autofill_profile_data_type_controller.cc
@@ -4,7 +4,7 @@
#include "chrome/browser/sync/glue/autofill_profile_data_type_controller.h"
-#include "chrome/browser/sync/glue/autofill_data_type_controller.h"
+#include "base/metrics/histogram.h"
#include "chrome/browser/sync/profile_sync_factory.h"
namespace browser_sync {
@@ -23,22 +23,37 @@ syncable::ModelType AutofillProfileDataTypeController::type() const {
return syncable::AUTOFILL_PROFILE;
}
-std::string AutofillProfileDataTypeController::name() const {
- // For logging only.
- return "autofill_profile";
+void AutofillProfileDataTypeController::CreateSyncComponents() {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
+ ProfileSyncFactory::SyncComponents sync_components = profile_sync_factory_->
+ CreateAutofillProfileSyncComponents(
+ sync_service_,
+ web_data_service_->GetDatabase(),
+ personal_data_,
+ this);
+ model_associator_.reset(sync_components.model_associator);
+ change_processor_.reset(sync_components.change_processor);
}
-ProfileSyncFactory::SyncComponents
- AutofillProfileDataTypeController::CreateSyncComponents(
- ProfileSyncService* profile_sync_service,
- WebDatabase* web_database,
- PersonalDataManager* personal_data,
- browser_sync::UnrecoverableErrorHandler* error_handler) {
- return profile_sync_factory_->CreateAutofillProfileSyncComponents(
- profile_sync_service,
- web_database,
- personal_data,
- this);
+void AutofillProfileDataTypeController::RecordUnrecoverableError(
+ const tracked_objects::Location& from_here,
+ const std::string& message) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
+ UMA_HISTOGRAM_COUNTS("Sync.AutofillProfileRunFailures", 1);
+}
+
+void AutofillProfileDataTypeController::RecordAssociationTime(
+ base::TimeDelta time) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
+ UMA_HISTOGRAM_TIMES("Sync.AutofillProfileAssociationTime", time);
}
+
+void AutofillProfileDataTypeController::RecordStartFailure(StartResult result) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ UMA_HISTOGRAM_ENUMERATION("Sync.AutofillProfileStartFailures",
+ result,
+ MAX_START_RESULT);
+}
+
} // namepsace browser_sync

Powered by Google App Engine
This is Rietveld 408576698