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

Side by Side Diff: sync/internal_api/write_node.cc

Issue 11734009: sync: Add ControlPreference protobuf and supporting code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Daily rebase Created 7 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "sync/internal_api/public/write_node.h" 5 #include "sync/internal_api/public/write_node.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "sync/internal_api/public/base_transaction.h" 9 #include "sync/internal_api/public/base_transaction.h"
10 #include "sync/internal_api/public/write_transaction.h" 10 #include "sync/internal_api/public/write_transaction.h"
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 SetEntitySpecifics(entity_specifics); 191 SetEntitySpecifics(entity_specifics);
192 } 192 }
193 193
194 void WriteNode::SetExperimentsSpecifics( 194 void WriteNode::SetExperimentsSpecifics(
195 const sync_pb::ExperimentsSpecifics& new_value) { 195 const sync_pb::ExperimentsSpecifics& new_value) {
196 sync_pb::EntitySpecifics entity_specifics; 196 sync_pb::EntitySpecifics entity_specifics;
197 entity_specifics.mutable_experiments()->CopyFrom(new_value); 197 entity_specifics.mutable_experiments()->CopyFrom(new_value);
198 SetEntitySpecifics(entity_specifics); 198 SetEntitySpecifics(entity_specifics);
199 } 199 }
200 200
201 void WriteNode::SetPriorityPreferenceSpecifics(
202 const sync_pb::PriorityPreferenceSpecifics& new_value) {
203 sync_pb::EntitySpecifics entity_specifics;
204 entity_specifics.mutable_priority_preference()->CopyFrom(new_value);
205 SetEntitySpecifics(entity_specifics);
206 }
207
201 void WriteNode::SetEntitySpecifics( 208 void WriteNode::SetEntitySpecifics(
202 const sync_pb::EntitySpecifics& new_value) { 209 const sync_pb::EntitySpecifics& new_value) {
203 ModelType new_specifics_type = 210 ModelType new_specifics_type =
204 GetModelTypeFromSpecifics(new_value); 211 GetModelTypeFromSpecifics(new_value);
205 DCHECK_NE(new_specifics_type, UNSPECIFIED); 212 DCHECK_NE(new_specifics_type, UNSPECIFIED);
206 DVLOG(1) << "Writing entity specifics of type " 213 DVLOG(1) << "Writing entity specifics of type "
207 << ModelTypeToString(new_specifics_type); 214 << ModelTypeToString(new_specifics_type);
208 // GetModelType() can be unspecified if this is the first time this 215 // GetModelType() can be unspecified if this is the first time this
209 // node is being initialized (see PutModelType()). Otherwise, it 216 // node is being initialized (see PutModelType()). Otherwise, it
210 // should match |new_specifics_type|. 217 // should match |new_specifics_type|.
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 MarkForSyncing(); 513 MarkForSyncing();
507 514
508 return true; 515 return true;
509 } 516 }
510 517
511 void WriteNode::MarkForSyncing() { 518 void WriteNode::MarkForSyncing() {
512 syncable::MarkForSyncing(entry_); 519 syncable::MarkForSyncing(entry_);
513 } 520 }
514 521
515 } // namespace syncer 522 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/internal_api/sync_manager_impl_unittest.cc ('k') | sync/protocol/priority_preference_specifics.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698