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

Unified Diff: components/sync/model_impl/sync_metadata_store_change_list.h

Issue 2794413002: [USS] Add SyncMetadataStore interface (Closed)
Patch Set: update names Created 3 years, 8 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
Index: components/sync/model_impl/sync_metadata_store_change_list.h
diff --git a/components/autofill/core/browser/webdata/autofill_metadata_change_list.h b/components/sync/model_impl/sync_metadata_store_change_list.h
similarity index 54%
rename from components/autofill/core/browser/webdata/autofill_metadata_change_list.h
rename to components/sync/model_impl/sync_metadata_store_change_list.h
index e924e2070a6a01e39125465a3476c8f9e6f0fd63..e1b949e17ca043cfd5b75e158b71df2e1575f452 100644
--- a/components/autofill/core/browser/webdata/autofill_metadata_change_list.h
+++ b/components/sync/model_impl/sync_metadata_store_change_list.h
@@ -1,47 +1,44 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
+// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_METADATA_CHANGE_LIST_H_
-#define COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_METADATA_CHANGE_LIST_H_
+#ifndef COMPONENTS_SYNC_MODEL_IMPL_SYNC_METADATA_STORE_CHANGE_LIST_H_
+#define COMPONENTS_SYNC_MODEL_IMPL_SYNC_METADATA_STORE_CHANGE_LIST_H_
#include <string>
#include "base/optional.h"
-#include "components/autofill/core/browser/webdata/autofill_table.h"
#include "components/sync/base/model_type.h"
#include "components/sync/model/metadata_change_list.h"
#include "components/sync/model/model_error.h"
-#include "components/sync/model/sync_error.h"
+#include "components/sync/model/sync_metadata_store.h"
#include "components/sync/protocol/entity_metadata.pb.h"
#include "components/sync/protocol/model_type_state.pb.h"
-namespace autofill {
+namespace syncer {
-// A thin wrapper around an AutofillTable that implements sync's
-// MetadataChangeList interface. Changes are passed directly into the table and
-// not stored inside this object. Since the table calls can fail, |TakeError()|
+// A thin wrapper around an SyncMetadataStore that implements sync's
+// MetadataChangeList interface. Changes are passed directly into the store and
+// not stored inside this object. Since the store calls can fail, |TakeError()|
// must be called before this object is destroyed to check whether any
// operations failed.
-class AutofillMetadataChangeList : public syncer::MetadataChangeList {
+class SyncMetadataStoreChangeList : public MetadataChangeList {
public:
- AutofillMetadataChangeList(AutofillTable* table, syncer::ModelType type);
- ~AutofillMetadataChangeList() override;
+ SyncMetadataStoreChangeList(SyncMetadataStore* store, syncer::ModelType type);
+ ~SyncMetadataStoreChangeList() override;
- // syncer::MetadataChangeList implementation.
+ // MetadataChangeList implementation.
void UpdateModelTypeState(
const sync_pb::ModelTypeState& model_type_state) override;
void ClearModelTypeState() override;
void UpdateMetadata(const std::string& storage_key,
const sync_pb::EntityMetadata& metadata) override;
void ClearMetadata(const std::string& storage_key) override;
-
- // Returns the value of |error_| and unsets it.
base::Optional<syncer::ModelError> TakeError();
private:
- // The autofill table to store metadata in; always outlives |this|.
- AutofillTable* table_;
+ // The metadata store to store metadata in; always outlives |this|.
+ SyncMetadataStore* store_;
// The sync model type for this metadata.
syncer::ModelType type_;
@@ -50,6 +47,6 @@ class AutofillMetadataChangeList : public syncer::MetadataChangeList {
base::Optional<syncer::ModelError> error_;
};
-} // namespace autofill
+} // namespace syncer
-#endif // COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_METADATA_CHANGE_LIST_H_
+#endif // COMPONENTS_SYNC_MODEL_IMPL_SYNC_METADATA_STORE_CHANGE_LIST_H_
« no previous file with comments | « components/sync/model/sync_metadata_store.h ('k') | components/sync/model_impl/sync_metadata_store_change_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698