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

Side by Side Diff: chrome/browser/prefs/pref_model_associator.cc

Issue 11533008: Use delete journal to remove bookmarks that are already deleted in sync model (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 "chrome/browser/prefs/pref_model_associator.h" 5 #include "chrome/browser/prefs/pref_model_associator.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/json/json_reader.h" 8 #include "base/json/json_reader.h"
9 #include "base/json/json_string_value_serializer.h" 9 #include "base/json/json_string_value_serializer.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 JSONStringValueSerializer json(&serialized); 207 JSONStringValueSerializer json(&serialized);
208 if (!json.Serialize(value)) { 208 if (!json.Serialize(value)) {
209 LOG(ERROR) << "Failed to serialize preference value."; 209 LOG(ERROR) << "Failed to serialize preference value.";
210 return false; 210 return false;
211 } 211 }
212 212
213 sync_pb::EntitySpecifics specifics; 213 sync_pb::EntitySpecifics specifics;
214 sync_pb::PreferenceSpecifics* pref_specifics = specifics.mutable_preference(); 214 sync_pb::PreferenceSpecifics* pref_specifics = specifics.mutable_preference();
215 pref_specifics->set_name(name); 215 pref_specifics->set_name(name);
216 pref_specifics->set_value(serialized); 216 pref_specifics->set_value(serialized);
217 *sync_data = syncer::SyncData::CreateLocalData(name, name, specifics); 217 *sync_data = syncer::SyncData::CreateLocalData(name, name, specifics, false);
218 return true; 218 return true;
219 } 219 }
220 220
221 Value* PrefModelAssociator::MergeListValues(const Value& from_value, 221 Value* PrefModelAssociator::MergeListValues(const Value& from_value,
222 const Value& to_value) { 222 const Value& to_value) {
223 if (from_value.GetType() == Value::TYPE_NULL) 223 if (from_value.GetType() == Value::TYPE_NULL)
224 return to_value.DeepCopy(); 224 return to_value.DeepCopy();
225 if (to_value.GetType() == Value::TYPE_NULL) 225 if (to_value.GetType() == Value::TYPE_NULL)
226 return from_value.DeepCopy(); 226 return from_value.DeepCopy();
227 227
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 } 441 }
442 442
443 syncer::SyncError error = 443 syncer::SyncError error =
444 sync_processor_->ProcessSyncChanges(FROM_HERE, changes); 444 sync_processor_->ProcessSyncChanges(FROM_HERE, changes);
445 } 445 }
446 446
447 void PrefModelAssociator::SetPrefService(PrefService* pref_service) { 447 void PrefModelAssociator::SetPrefService(PrefService* pref_service) {
448 DCHECK(pref_service_ == NULL); 448 DCHECK(pref_service_ == NULL);
449 pref_service_ = pref_service; 449 pref_service_ = pref_service;
450 } 450 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698