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

Side by Side Diff: chrome/browser/sync/glue/preference_data_type_controller.cc

Issue 8065016: [Sync] Refactor non-frontend DTC to handle new API properly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reffffactor Created 9 years, 2 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/preference_data_type_controller.h" 5 #include "chrome/browser/sync/glue/preference_data_type_controller.h"
6 6
7 #include "base/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/sync/api/syncable_service.h" 9 #include "chrome/browser/sync/api/syncable_service.h"
10 #include "chrome/browser/sync/glue/generic_change_processor.h" 10 #include "chrome/browser/sync/glue/generic_change_processor.h"
(...skipping 15 matching lines...) Expand all
26 26
27 syncable::ModelType PreferenceDataTypeController::type() const { 27 syncable::ModelType PreferenceDataTypeController::type() const {
28 return syncable::PREFERENCES; 28 return syncable::PREFERENCES;
29 } 29 }
30 30
31 void PreferenceDataTypeController::CreateSyncComponents() { 31 void PreferenceDataTypeController::CreateSyncComponents() {
32 ProfileSyncFactory::SyncComponents sync_components = 32 ProfileSyncFactory::SyncComponents sync_components =
33 profile_sync_factory_->CreatePreferenceSyncComponents(sync_service_, 33 profile_sync_factory_->CreatePreferenceSyncComponents(sync_service_,
34 this); 34 this);
35 set_model_associator(sync_components.model_associator); 35 set_model_associator(sync_components.model_associator);
36 set_change_processor(sync_components.change_processor); 36 change_processor_.reset(reinterpret_cast<GenericChangeProcessor*>(
akalin 2011/10/11 22:41:08 static_cast
Nicolas Zea 2011/10/12 04:24:19 Done.
37 sync_components.change_processor));
38 }
39
40 ChangeProcessor* PreferenceDataTypeController::change_processor() const {
41 return change_processor_.get();
37 } 42 }
38 43
39 void PreferenceDataTypeController::RecordUnrecoverableError( 44 void PreferenceDataTypeController::RecordUnrecoverableError(
40 const tracked_objects::Location& from_here, 45 const tracked_objects::Location& from_here,
41 const std::string& message) { 46 const std::string& message) {
42 UMA_HISTOGRAM_COUNTS("Sync.PreferenceRunFailures", 1); 47 UMA_HISTOGRAM_COUNTS("Sync.PreferenceRunFailures", 1);
43 } 48 }
44 49
45 void PreferenceDataTypeController::RecordAssociationTime(base::TimeDelta time) { 50 void PreferenceDataTypeController::RecordAssociationTime(base::TimeDelta time) {
46 UMA_HISTOGRAM_TIMES("Sync.PreferenceAssociationTime", time); 51 UMA_HISTOGRAM_TIMES("Sync.PreferenceAssociationTime", time);
47 } 52 }
48 53
49 void PreferenceDataTypeController::RecordStartFailure(StartResult result) { 54 void PreferenceDataTypeController::RecordStartFailure(StartResult result) {
50 UMA_HISTOGRAM_ENUMERATION("Sync.PreferenceStartFailures", 55 UMA_HISTOGRAM_ENUMERATION("Sync.PreferenceStartFailures",
51 result, 56 result,
52 MAX_START_RESULT); 57 MAX_START_RESULT);
53 } 58 }
54 59
55 } // namespace browser_sync 60 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698