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

Side by Side Diff: components/sync/model_impl/passthrough_metadata_change_list.h

Issue 2470953002: [Sync] Adding a passthrough MetadataChangeList implementation. (Closed)
Patch Set: Last update for Max. Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 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_MODEL_IMPL_PASSTHROUGH_METADATA_CHANGE_LIST_H_
6 #define COMPONENTS_SYNC_MODEL_IMPL_PASSTHROUGH_METADATA_CHANGE_LIST_H_
7
8 #include <string>
9
10 #include "components/sync/model/metadata_change_list.h"
11 #include "components/sync/model/model_type_store.h"
12
13 namespace syncer {
14
15 // A thin wrapper around ModelTypeStore and WriteBatch to implement the
16 // MetadataChangeList interface. This class should never outlive any of the
17 // delegate objects it calls.
18 class PassthroughMetadataChangeList : public MetadataChangeList {
19 public:
20 PassthroughMetadataChangeList(ModelTypeStore* store,
21 ModelTypeStore::WriteBatch* batch);
22
23 // DataBatch MetadataChangeList.
24 void UpdateModelTypeState(
25 const sync_pb::ModelTypeState& model_type_state) override;
26 void ClearModelTypeState() override;
27 void UpdateMetadata(const std::string& storage_key,
28 const sync_pb::EntityMetadata& metadata) override;
29 void ClearMetadata(const std::string& storage_key) override;
30
31 private:
32 // Non owning references.
33 ModelTypeStore* store_;
34 ModelTypeStore::WriteBatch* batch_;
35 };
36
37 } // namespace syncer
38
39 #endif // COMPONENTS_SYNC_MODEL_IMPL_PASSTHROUGH_METADATA_CHANGE_LIST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698