OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |