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

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

Issue 2949923004: Reland: [Sync] Record sync memory usage in histogram broken by datatypes (Closed)
Patch Set: Fix linker error Created 3 years, 6 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/model_type_controller.h" 5 #include "components/sync/driver/model_type_controller.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 PostBridgeTask(FROM_HERE, base::Bind(&ModelTypeDebugInfo::GetAllNodes, 229 PostBridgeTask(FROM_HERE, base::Bind(&ModelTypeDebugInfo::GetAllNodes,
230 BindToCurrentThread(callback))); 230 BindToCurrentThread(callback)));
231 } 231 }
232 232
233 void ModelTypeController::GetStatusCounters( 233 void ModelTypeController::GetStatusCounters(
234 const StatusCountersCallback& callback) { 234 const StatusCountersCallback& callback) {
235 PostBridgeTask(FROM_HERE, 235 PostBridgeTask(FROM_HERE,
236 base::Bind(&ModelTypeDebugInfo::GetStatusCounters, callback)); 236 base::Bind(&ModelTypeDebugInfo::GetStatusCounters, callback));
237 } 237 }
238 238
239 void ModelTypeController::RecordMemoryUsageHistogram() {
240 PostBridgeTask(FROM_HERE,
241 base::Bind(&ModelTypeDebugInfo::RecordMemoryUsageHistogram));
242 }
243
239 void ModelTypeController::ReportModelError(const ModelError& error) { 244 void ModelTypeController::ReportModelError(const ModelError& error) {
240 DCHECK(CalledOnValidThread()); 245 DCHECK(CalledOnValidThread());
241 LoadModelsDone(UNRECOVERABLE_ERROR, 246 LoadModelsDone(UNRECOVERABLE_ERROR,
242 SyncError(error.location(), SyncError::DATATYPE_ERROR, 247 SyncError(error.location(), SyncError::DATATYPE_ERROR,
243 error.message(), type())); 248 error.message(), type()));
244 } 249 }
245 250
246 void ModelTypeController::RecordStartFailure(ConfigureResult result) const { 251 void ModelTypeController::RecordStartFailure(ConfigureResult result) const {
247 DCHECK(CalledOnValidThread()); 252 DCHECK(CalledOnValidThread());
248 UMA_HISTOGRAM_ENUMERATION("Sync.DataTypeStartFailures", 253 UMA_HISTOGRAM_ENUMERATION("Sync.DataTypeStartFailures",
(...skipping 12 matching lines...) Expand all
261 return base::Bind(&ReturnCapturedBridge, bridge); 266 return base::Bind(&ReturnCapturedBridge, bridge);
262 } 267 }
263 268
264 void ModelTypeController::PostBridgeTask( 269 void ModelTypeController::PostBridgeTask(
265 const tracked_objects::Location& location, 270 const tracked_objects::Location& location,
266 const BridgeTask& task) { 271 const BridgeTask& task) {
267 model_thread_->PostTask( 272 model_thread_->PostTask(
268 location, base::Bind(&RunBridgeTask, GetBridgeProvider(), task)); 273 location, base::Bind(&RunBridgeTask, GetBridgeProvider(), task));
269 } 274 }
270 } // namespace syncer 275 } // namespace syncer
OLDNEW
« no previous file with comments | « components/sync/driver/model_type_controller.h ('k') | components/sync/driver/proxy_data_type_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698