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 #ifndef SYNC_INTERNAL_API_PUBLIC_DATA_TYPE_ERROR_HANDLER_H__ | 5 #ifndef COMPONENTS_SYNC_CORE_DATA_TYPE_ERROR_HANDLER_H__ |
6 #define SYNC_INTERNAL_API_PUBLIC_DATA_TYPE_ERROR_HANDLER_H__ | 6 #define COMPONENTS_SYNC_CORE_DATA_TYPE_ERROR_HANDLER_H__ |
7 | 7 |
8 #include <string> | 8 #include <string> |
| 9 |
9 #include "base/location.h" | 10 #include "base/location.h" |
10 | 11 |
11 #include "sync/api/sync_error.h" | 12 #include "components/sync/api/sync_error.h" |
12 #include "sync/internal_api/public/base/model_type.h" | 13 #include "components/sync/base/model_type.h" |
13 #include "sync/internal_api/public/util/unrecoverable_error_handler.h" | 14 #include "components/sync/base/unrecoverable_error_handler.h" |
14 | 15 |
15 namespace syncer { | 16 namespace syncer { |
16 | 17 |
17 class DataTypeErrorHandler { | 18 class DataTypeErrorHandler { |
18 public: | 19 public: |
19 // Call this to disable a datatype while it is running. This is usually | 20 // Call this to disable a datatype while it is running. This is usually |
20 // called for a runtime failure that is specific to a datatype. | 21 // called for a runtime failure that is specific to a datatype. |
21 virtual void OnSingleDataTypeUnrecoverableError(const SyncError& error) = 0; | 22 virtual void OnSingleDataTypeUnrecoverableError(const SyncError& error) = 0; |
22 | 23 |
23 // This will create a SyncError object. This will also upload a breakpad call | 24 // This will create a SyncError object. This will also upload a breakpad call |
24 // stack to crash server. A sync error usually means that sync has to be | 25 // stack to crash server. A sync error usually means that sync has to be |
25 // disabled either for that type or completely. | 26 // disabled either for that type or completely. |
26 virtual SyncError CreateAndUploadError( | 27 virtual SyncError CreateAndUploadError( |
27 const tracked_objects::Location& location, | 28 const tracked_objects::Location& location, |
28 const std::string& message, | 29 const std::string& message, |
29 ModelType type) = 0; | 30 ModelType type) = 0; |
30 | 31 |
31 protected: | 32 protected: |
32 virtual ~DataTypeErrorHandler() {} | 33 virtual ~DataTypeErrorHandler() {} |
33 }; | 34 }; |
34 | 35 |
35 } // namespace syncer | 36 } // namespace syncer |
36 | 37 |
37 #endif // SYNC_INTERNAL_API_PUBLIC_DATA_TYPE_ERROR_HANDLER_H__ | 38 #endif // COMPONENTS_SYNC_CORE_DATA_TYPE_ERROR_HANDLER_H__ |
OLD | NEW |