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

Side by Side 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: 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/sync/glue/autofill_profile_data_type_controller.h" 5 #include "chrome/browser/sync/glue/autofill_profile_data_type_controller.h"
6 6
7 #include "chrome/browser/sync/glue/autofill_data_type_controller.h" 7 #include "base/metrics/histogram.h"
8 #include "chrome/browser/sync/profile_sync_factory.h" 8 #include "chrome/browser/sync/profile_sync_factory.h"
9 9
10 namespace browser_sync { 10 namespace browser_sync {
11 11
12 AutofillProfileDataTypeController::AutofillProfileDataTypeController( 12 AutofillProfileDataTypeController::AutofillProfileDataTypeController(
13 ProfileSyncFactory* profile_sync_factory, 13 ProfileSyncFactory* profile_sync_factory,
14 Profile* profile, 14 Profile* profile)
15 ProfileSyncService* sync_service) : AutofillDataTypeController( 15 : AutofillDataTypeController(
16 profile_sync_factory, 16 profile_sync_factory,
17 profile, 17 profile) {}
18 sync_service) {}
19 18
20 AutofillProfileDataTypeController::~AutofillProfileDataTypeController() {} 19 AutofillProfileDataTypeController::~AutofillProfileDataTypeController() {}
21 20
22 syncable::ModelType AutofillProfileDataTypeController::type() const { 21 syncable::ModelType AutofillProfileDataTypeController::type() const {
23 return syncable::AUTOFILL_PROFILE; 22 return syncable::AUTOFILL_PROFILE;
24 } 23 }
25 24
26 std::string AutofillProfileDataTypeController::name() const { 25 void AutofillProfileDataTypeController::CreateSyncComponents() {
27 // For logging only. 26 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
28 return "autofill_profile"; 27 ProfileSyncFactory::SyncComponents sync_components =
28 profile_sync_factory()->
29 CreateAutofillProfileSyncComponents(
30 profile_sync_service(),
31 web_data_service()->GetDatabase(),
32 personal_data(),
33 this);
34 set_model_associator(sync_components.model_associator);
35 set_change_processor(sync_components.change_processor);
29 } 36 }
30 37
31 ProfileSyncFactory::SyncComponents 38 void AutofillProfileDataTypeController::RecordUnrecoverableError(
32 AutofillProfileDataTypeController::CreateSyncComponents( 39 const tracked_objects::Location& from_here,
33 ProfileSyncService* profile_sync_service, 40 const std::string& message) {
34 WebDatabase* web_database, 41 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
35 PersonalDataManager* personal_data, 42 UMA_HISTOGRAM_COUNTS("Sync.AutofillProfileRunFailures", 1);
36 browser_sync::UnrecoverableErrorHandler* error_handler) {
37 return profile_sync_factory_->CreateAutofillProfileSyncComponents(
38 profile_sync_service,
39 web_database,
40 personal_data,
41 this);
42 } 43 }
44
45 void AutofillProfileDataTypeController::RecordAssociationTime(
46 base::TimeDelta time) {
47 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
48 UMA_HISTOGRAM_TIMES("Sync.AutofillProfileAssociationTime", time);
49 }
50
51 void AutofillProfileDataTypeController::RecordStartFailure(StartResult result) {
52 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
53 UMA_HISTOGRAM_ENUMERATION("Sync.AutofillProfileStartFailures",
54 result,
55 MAX_START_RESULT);
56 }
57
43 } // namepsace browser_sync 58 } // namepsace browser_sync
44 59
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698