Chromium Code Reviews| Index: components/sync/model_impl/on_disk_metadata_change_list.h |
| diff --git a/components/autofill/core/browser/webdata/autofill_metadata_change_list.h b/components/sync/model_impl/on_disk_metadata_change_list.h |
| similarity index 54% |
| rename from components/autofill/core/browser/webdata/autofill_metadata_change_list.h |
| rename to components/sync/model_impl/on_disk_metadata_change_list.h |
| index e924e2070a6a01e39125465a3476c8f9e6f0fd63..d043ef8443ddcabf4e6adabf14724d16e0549dca 100644 |
| --- a/components/autofill/core/browser/webdata/autofill_metadata_change_list.h |
| +++ b/components/sync/model_impl/on_disk_metadata_change_list.h |
| @@ -1,47 +1,43 @@ |
| -// 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_ON_DISK_METADATA_CHANGE_LIST_H_ |
| +#define COMPONENTS_SYNC_MODEL_IMPL_ON_DISK_METADATA_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/metadata_table.h" |
| #include "components/sync/model/model_error.h" |
| -#include "components/sync/model/sync_error.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 |
| +// A thin wrapper around an MetadataTable 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()| |
| // must be called before this object is destroyed to check whether any |
| // operations failed. |
| -class AutofillMetadataChangeList : public syncer::MetadataChangeList { |
| +class OnDiskMetadataChangeList : public MetadataChangeList { |
|
pavely
2017/04/06 22:56:42
Both OnDiskMetadataChangeList and PassthroughMetad
Gang Wu
2017/04/21 05:28:03
Done.
|
| public: |
| - AutofillMetadataChangeList(AutofillTable* table, syncer::ModelType type); |
| - ~AutofillMetadataChangeList() override; |
| + OnDiskMetadataChangeList(MetadataTable* table, syncer::ModelType type); |
| + ~OnDiskMetadataChangeList() 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(); |
| + base::Optional<syncer::ModelError> TakeError() override; |
| private: |
| - // The autofill table to store metadata in; always outlives |this|. |
| - AutofillTable* table_; |
| + // The metadata table to store metadata in; always outlives |this|. |
| + MetadataTable* table_; |
| // The sync model type for this metadata. |
| syncer::ModelType type_; |
| @@ -50,6 +46,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_ON_DISK_METADATA_CHANGE_LIST_H_ |