Chromium Code Reviews| Index: components/sync/model/model_type_change_processor.h |
| diff --git a/components/sync/model/model_type_change_processor.h b/components/sync/model/model_type_change_processor.h |
| index b001832855e7cbb246aaa2463c023b32ab8a4bdb..030e388f8700e856cac61af7da003b1d3983dee2 100644 |
| --- a/components/sync/model/model_type_change_processor.h |
| +++ b/components/sync/model/model_type_change_processor.h |
| @@ -8,11 +8,12 @@ |
| #include <memory> |
| #include <string> |
| +#include "base/location.h" |
| #include "components/sync/base/model_type.h" |
| #include "components/sync/engine/activation_context.h" |
| #include "components/sync/model/data_type_error_handler.h" |
| #include "components/sync/model/entity_data.h" |
| -#include "components/sync/model/sync_error_factory.h" |
| +#include "components/sync/model/model_error.h" |
| namespace syncer { |
| @@ -23,7 +24,7 @@ class SyncError; |
| // Interface used by the ModelTypeSyncBridge to inform sync of local |
| // changes. |
| -class ModelTypeChangeProcessor : public SyncErrorFactory { |
| +class ModelTypeChangeProcessor { |
| public: |
| typedef base::Callback<void(SyncError, std::unique_ptr<ActivationContext>)> |
| StartCallback; |
| @@ -34,7 +35,7 @@ class ModelTypeChangeProcessor : public SyncErrorFactory { |
| ModelTypeSyncBridge* bridge); |
| ModelTypeChangeProcessor(); |
| - ~ModelTypeChangeProcessor() override; |
| + virtual ~ModelTypeChangeProcessor(); |
| // Inform the processor of a new or updated entity. The |entity_data| param |
| // does not need to be fully set, but it should at least have specifics and |
| @@ -50,8 +51,7 @@ class ModelTypeChangeProcessor : public SyncErrorFactory { |
| // Accept the initial sync metadata loaded by the bridge. This should be |
| // called as soon as the metadata is available to the bridge. |
| - virtual void OnMetadataLoaded(SyncError error, |
| - std::unique_ptr<MetadataBatch> batch) = 0; |
| + virtual void OnMetadataLoaded(std::unique_ptr<MetadataBatch> batch) = 0; |
|
skym
2017/01/09 18:20:28
Would be nice to talk about about how the bridge n
maxbogue
2017/01/09 21:29:33
Done.
|
| // Indicates that sync wants to connect a sync worker to this processor. Once |
| // the processor has metadata from the bridge, it will pass the info needed |
| @@ -71,6 +71,15 @@ class ModelTypeChangeProcessor : public SyncErrorFactory { |
| // currently up to date and accurately tracking the model type's data. If |
| // false, calls to Put and Delete will no-op and can be omitted by bridge. |
| virtual bool IsTrackingMetadata() = 0; |
| + |
| + // Report an error in the model to sync. Must be called for any error that |
| + // happens outside the bridge methods that synchronously return an error. |
| + // This will result in disable being called asynchronously by the bridge. |
| + virtual void ReportError(const ModelError& error) = 0; |
|
skym
2017/01/09 18:20:28
Same as above.
maxbogue
2017/01/09 21:29:33
Done.
|
| + |
| + // A convenience form of the above. |
| + virtual void ReportError(const tracked_objects::Location& location, |
| + const std::string& message) = 0; |
| }; |
| } // namespace syncer |