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

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

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 #include "components/sync/model_impl/passthrough_metadata_change_list.h"
6
7 #include "base/logging.h"
8 #include "components/sync/protocol/entity_metadata.pb.h"
9 #include "components/sync/protocol/model_type_state.pb.h"
10
11 namespace syncer {
12
13 PassthroughMetadataChangeList::PassthroughMetadataChangeList(
14 ModelTypeStore* store,
15 ModelTypeStore::WriteBatch* batch)
16 : store_(store), batch_(batch) {
17 DCHECK(store_);
18 DCHECK(batch_);
19 }
20
21 void PassthroughMetadataChangeList::UpdateModelTypeState(
22 const sync_pb::ModelTypeState& model_type_state) {
23 store_->WriteGlobalMetadata(batch_, model_type_state.SerializeAsString());
24 }
25
26 void PassthroughMetadataChangeList::ClearModelTypeState() {
27 store_->DeleteGlobalMetadata(batch_);
28 }
29
30 void PassthroughMetadataChangeList::UpdateMetadata(
31 const std::string& storage_key,
32 const sync_pb::EntityMetadata& metadata) {
33 store_->WriteMetadata(batch_, storage_key, metadata.SerializeAsString());
34 }
35
36 void PassthroughMetadataChangeList::ClearMetadata(
37 const std::string& storage_key) {
38 store_->DeleteMetadata(batch_, storage_key);
39 }
40
41 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698