Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Unified Diff: components/sync/api/data_type_error_handler.h

Issue 2289143003: [Sync] Convert DTCs to be not RefCounted and NonThreadSafe. (Closed)
Patch Set: Rebase. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/sync/BUILD.gn ('k') | components/sync/api/data_type_error_handler_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/api/data_type_error_handler.h
diff --git a/components/sync/core/data_type_error_handler.h b/components/sync/api/data_type_error_handler.h
similarity index 66%
rename from components/sync/core/data_type_error_handler.h
rename to components/sync/api/data_type_error_handler.h
index dbac7d33f9e03c2aa8b5898e85108117bbaef390..3448372db3f054805ebc6b831ddd01e274fbab31 100644
--- a/components/sync/core/data_type_error_handler.h
+++ b/components/sync/api/data_type_error_handler.h
@@ -2,24 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef COMPONENTS_SYNC_CORE_DATA_TYPE_ERROR_HANDLER_H__
-#define COMPONENTS_SYNC_CORE_DATA_TYPE_ERROR_HANDLER_H__
+#ifndef COMPONENTS_SYNC_API_DATA_TYPE_ERROR_HANDLER_H__
+#define COMPONENTS_SYNC_API_DATA_TYPE_ERROR_HANDLER_H__
+#include <memory>
#include <string>
+#include "base/callback.h"
#include "base/location.h"
-
#include "components/sync/api/sync_error.h"
#include "components/sync/base/model_type.h"
-#include "components/sync/base/unrecoverable_error_handler.h"
namespace syncer {
class DataTypeErrorHandler {
public:
+ typedef base::Callback<void(const syncer::SyncError&)> ErrorCallback;
+
+ virtual ~DataTypeErrorHandler() {}
+
// Call this to disable a datatype while it is running. This is usually
// called for a runtime failure that is specific to a datatype.
- virtual void OnSingleDataTypeUnrecoverableError(const SyncError& error) = 0;
+ virtual void OnUnrecoverableError(const SyncError& error) = 0;
// This will create a SyncError object. This will also upload a breakpad call
// stack to crash server. A sync error usually means that sync has to be
@@ -29,10 +33,10 @@ class DataTypeErrorHandler {
const std::string& message,
ModelType type) = 0;
- protected:
- virtual ~DataTypeErrorHandler() {}
+ // Create a copy of this error handler.
+ virtual std::unique_ptr<DataTypeErrorHandler> Copy() const = 0;
};
} // namespace syncer
-#endif // COMPONENTS_SYNC_CORE_DATA_TYPE_ERROR_HANDLER_H__
+#endif // COMPONENTS_SYNC_API_DATA_TYPE_ERROR_HANDLER_H__
« no previous file with comments | « components/sync/BUILD.gn ('k') | components/sync/api/data_type_error_handler_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698