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