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

Side by Side Diff: components/sync/driver/frontend_data_type_controller.cc

Issue 2886933003: Use stricter type checking in UMA_HISTOGRAM_ENUMERATION (Closed)
Patch Set: simplify type checking Created 3 years, 5 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "components/sync/driver/frontend_data_type_controller.h" 5 #include "components/sync/driver/frontend_data_type_controller.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/threading/thread_task_runner_handle.h" 9 #include "base/threading/thread_task_runner_handle.h"
10 #include "components/sync/base/data_type_histogram.h" 10 #include "components/sync/base/data_type_histogram.h"
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 void FrontendDataTypeController::RecordAssociationTime(base::TimeDelta time) { 231 void FrontendDataTypeController::RecordAssociationTime(base::TimeDelta time) {
232 DCHECK(CalledOnValidThread()); 232 DCHECK(CalledOnValidThread());
233 #define PER_DATA_TYPE_MACRO(type_str) \ 233 #define PER_DATA_TYPE_MACRO(type_str) \
234 UMA_HISTOGRAM_TIMES("Sync." type_str "AssociationTime", time); 234 UMA_HISTOGRAM_TIMES("Sync." type_str "AssociationTime", time);
235 SYNC_DATA_TYPE_HISTOGRAM(type()); 235 SYNC_DATA_TYPE_HISTOGRAM(type());
236 #undef PER_DATA_TYPE_MACRO 236 #undef PER_DATA_TYPE_MACRO
237 } 237 }
238 238
239 void FrontendDataTypeController::RecordStartFailure(ConfigureResult result) { 239 void FrontendDataTypeController::RecordStartFailure(ConfigureResult result) {
240 DCHECK(CalledOnValidThread()); 240 DCHECK(CalledOnValidThread());
241 // TODO(wychen): enum uma should be strongly typed. crbug.com/661401
241 UMA_HISTOGRAM_ENUMERATION("Sync.DataTypeStartFailures", 242 UMA_HISTOGRAM_ENUMERATION("Sync.DataTypeStartFailures",
242 ModelTypeToHistogramInt(type()), MODEL_TYPE_COUNT); 243 ModelTypeToHistogramInt(type()),
244 static_cast<int>(MODEL_TYPE_COUNT));
243 #define PER_DATA_TYPE_MACRO(type_str) \ 245 #define PER_DATA_TYPE_MACRO(type_str) \
244 UMA_HISTOGRAM_ENUMERATION("Sync." type_str "ConfigureFailure", result, \ 246 UMA_HISTOGRAM_ENUMERATION("Sync." type_str "ConfigureFailure", result, \
245 MAX_CONFIGURE_RESULT); 247 MAX_CONFIGURE_RESULT);
246 SYNC_DATA_TYPE_HISTOGRAM(type()); 248 SYNC_DATA_TYPE_HISTOGRAM(type());
247 #undef PER_DATA_TYPE_MACRO 249 #undef PER_DATA_TYPE_MACRO
248 } 250 }
249 251
250 AssociatorInterface* FrontendDataTypeController::model_associator() const { 252 AssociatorInterface* FrontendDataTypeController::model_associator() const {
251 return model_associator_.get(); 253 return model_associator_.get();
252 } 254 }
253 255
254 void FrontendDataTypeController::set_model_associator( 256 void FrontendDataTypeController::set_model_associator(
255 AssociatorInterface* model_associator) { 257 AssociatorInterface* model_associator) {
256 model_associator_.reset(model_associator); 258 model_associator_.reset(model_associator);
257 } 259 }
258 260
259 ChangeProcessor* FrontendDataTypeController::GetChangeProcessor() const { 261 ChangeProcessor* FrontendDataTypeController::GetChangeProcessor() const {
260 return change_processor_.get(); 262 return change_processor_.get();
261 } 263 }
262 264
263 void FrontendDataTypeController::set_change_processor( 265 void FrontendDataTypeController::set_change_processor(
264 ChangeProcessor* change_processor) { 266 ChangeProcessor* change_processor) {
265 change_processor_.reset(change_processor); 267 change_processor_.reset(change_processor);
266 } 268 }
267 269
268 } // namespace syncer 270 } // namespace syncer
OLDNEW
« no previous file with comments | « components/sync/driver/data_type_manager_impl.cc ('k') | components/sync/driver/model_association_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698