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 "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 == UNRECOVERABLE_ERROR); | 13 return (result == UNRECOVERABLE_ERROR); |
14 } | 14 } |
15 | 15 |
16 SyncError DataTypeController::CreateAndUploadError( | 16 csync::SyncError DataTypeController::CreateAndUploadError( |
17 const tracked_objects::Location& location, | 17 const tracked_objects::Location& location, |
18 const std::string& message, | 18 const std::string& message, |
19 syncable::ModelType type) { | 19 syncable::ModelType type) { |
20 ChromeReportUnrecoverableError(); | 20 ChromeReportUnrecoverableError(); |
21 return SyncError(location, message, type); | 21 return csync::SyncError(location, message, type); |
22 } | 22 } |
23 | 23 |
24 void DataTypeController::RecordUnrecoverableError( | 24 void DataTypeController::RecordUnrecoverableError( |
25 const tracked_objects::Location& from_here, | 25 const tracked_objects::Location& from_here, |
26 const std::string& message) { | 26 const std::string& message) { |
27 DVLOG(1) << "Datatype Controller failed for type " | 27 DVLOG(1) << "Datatype Controller failed for type " |
28 << ModelTypeToString(type()) << " " | 28 << ModelTypeToString(type()) << " " |
29 << message << " at location " | 29 << message << " at location " |
30 << from_here.ToString(); | 30 << from_here.ToString(); |
31 UMA_HISTOGRAM_ENUMERATION("Sync.DataTypeRunFailures", type(), | 31 UMA_HISTOGRAM_ENUMERATION("Sync.DataTypeRunFailures", type(), |
32 syncable::MODEL_TYPE_COUNT); | 32 syncable::MODEL_TYPE_COUNT); |
33 ChromeReportUnrecoverableError(); | 33 ChromeReportUnrecoverableError(); |
34 } | 34 } |
35 | 35 |
36 } // namespace browser_sync | 36 } // namespace browser_sync |
OLD | NEW |