OLD | NEW |
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 "chrome/browser/sync/glue/chrome_report_unrecoverable_error.h" | 5 #include "chrome/browser/sync/glue/chrome_report_unrecoverable_error.h" |
6 | 6 |
7 #include "chrome/browser/sync/glue/data_type_controller.h" | 7 #include "chrome/browser/sync/glue/data_type_controller.h" |
8 #include "chrome/browser/sync/util/data_type_histogram.h" | 8 #include "sync/util/data_type_histogram.h" |
9 | 9 |
10 namespace browser_sync { | 10 namespace browser_sync { |
11 | 11 |
12 bool DataTypeController::IsUnrecoverableResult(StartResult result) { | 12 bool DataTypeController::IsUnrecoverableResult(StartResult result) { |
13 return (result == ASSOCIATION_FAILED || result == UNRECOVERABLE_ERROR); | 13 return (result == ASSOCIATION_FAILED || result == UNRECOVERABLE_ERROR); |
14 } | 14 } |
15 | 15 |
16 void DataTypeController::RecordUnrecoverableError( | 16 void DataTypeController::RecordUnrecoverableError( |
17 const tracked_objects::Location& from_here, | 17 const tracked_objects::Location& from_here, |
18 const std::string& message) { | 18 const std::string& message) { |
19 DVLOG(1) << "Datatype Controller failed for type " | 19 DVLOG(1) << "Datatype Controller failed for type " |
20 << ModelTypeToString(type()) << " " | 20 << ModelTypeToString(type()) << " " |
21 << message << " at location " | 21 << message << " at location " |
22 << from_here.ToString(); | 22 << from_here.ToString(); |
23 UMA_HISTOGRAM_ENUMERATION("Sync.DataTypeRunFailures", type(), | 23 UMA_HISTOGRAM_ENUMERATION("Sync.DataTypeRunFailures", type(), |
24 syncable::MODEL_TYPE_COUNT); | 24 syncable::MODEL_TYPE_COUNT); |
25 ChromeReportUnrecoverableError(); | 25 ChromeReportUnrecoverableError(); |
26 } | 26 } |
27 | 27 |
28 } | 28 } |
OLD | NEW |