| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef COMPONENTS_SYNC_API_DATA_TYPE_ERROR_HANDLER_H__ | |
| 6 #define COMPONENTS_SYNC_API_DATA_TYPE_ERROR_HANDLER_H__ | |
| 7 | |
| 8 #include <memory> | |
| 9 #include <string> | |
| 10 | |
| 11 #include "base/callback.h" | |
| 12 #include "base/location.h" | |
| 13 #include "components/sync/api/sync_error.h" | |
| 14 #include "components/sync/base/model_type.h" | |
| 15 | |
| 16 namespace syncer { | |
| 17 | |
| 18 class DataTypeErrorHandler { | |
| 19 public: | |
| 20 typedef base::Callback<void(const SyncError&)> ErrorCallback; | |
| 21 | |
| 22 virtual ~DataTypeErrorHandler() {} | |
| 23 | |
| 24 // Call this to disable a datatype while it is running. This is usually | |
| 25 // called for a runtime failure that is specific to a datatype. | |
| 26 virtual void OnUnrecoverableError(const SyncError& error) = 0; | |
| 27 | |
| 28 // This will create a SyncError object. This will also upload a breakpad call | |
| 29 // stack to crash server. A sync error usually means that sync has to be | |
| 30 // disabled either for that type or completely. | |
| 31 virtual SyncError CreateAndUploadError( | |
| 32 const tracked_objects::Location& location, | |
| 33 const std::string& message, | |
| 34 ModelType type) = 0; | |
| 35 | |
| 36 // Create a copy of this error handler. | |
| 37 virtual std::unique_ptr<DataTypeErrorHandler> Copy() const = 0; | |
| 38 }; | |
| 39 | |
| 40 } // namespace syncer | |
| 41 | |
| 42 #endif // COMPONENTS_SYNC_API_DATA_TYPE_ERROR_HANDLER_H__ | |
| OLD | NEW |