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