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

Side by Side Diff: chrome/browser/extensions/settings/syncable_settings_storage.cc

Issue 9749012: [Sync] Have SyncableService's take ownership of their SyncChangeProcessor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix merge conflict Created 8 years, 9 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 "chrome/browser/extensions/settings/syncable_settings_storage.h" 5 #include "chrome/browser/extensions/settings/syncable_settings_storage.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "chrome/browser/extensions/settings/settings_namespace.h" 8 #include "chrome/browser/extensions/settings/settings_namespace.h"
9 #include "chrome/browser/extensions/settings/settings_sync_util.h" 9 #include "chrome/browser/extensions/settings/settings_sync_util.h"
10 #include "chrome/browser/sync/api/sync_data.h" 10 #include "chrome/browser/sync/api/sync_data.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 133
134 SyncError SyncableSettingsStorage::StartSyncing( 134 SyncError SyncableSettingsStorage::StartSyncing(
135 syncable::ModelType type, 135 syncable::ModelType type,
136 const DictionaryValue& sync_state, 136 const DictionaryValue& sync_state,
137 SyncChangeProcessor* sync_processor) { 137 SyncChangeProcessor* sync_processor) {
138 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 138 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
139 DCHECK(type == syncable::EXTENSION_SETTINGS || 139 DCHECK(type == syncable::EXTENSION_SETTINGS ||
140 type == syncable::APP_SETTINGS); 140 type == syncable::APP_SETTINGS);
141 DCHECK_EQ(sync_type_, syncable::UNSPECIFIED); 141 DCHECK_EQ(sync_type_, syncable::UNSPECIFIED);
142 DCHECK(!sync_processor_); 142 DCHECK(!sync_processor_);
143 DCHECK(sync_processor);
143 DCHECK(synced_keys_.empty()); 144 DCHECK(synced_keys_.empty());
144 145
145 sync_type_ = type; 146 sync_type_ = type;
146 sync_processor_ = sync_processor; 147 sync_processor_ = sync_processor;
147 148
148 ReadResult maybe_settings = delegate_->Get(); 149 ReadResult maybe_settings = delegate_->Get();
149 if (maybe_settings.HasError()) { 150 if (maybe_settings.HasError()) {
150 return SyncError( 151 return SyncError(
151 FROM_HERE, 152 FROM_HERE,
152 std::string("Failed to get settings: ") + maybe_settings.error(), 153 std::string("Failed to get settings: ") + maybe_settings.error(),
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 FROM_HERE, 453 FROM_HERE,
453 std::string("Error pushing sync remove to local settings: ") + 454 std::string("Error pushing sync remove to local settings: ") +
454 result.error(), 455 result.error(),
455 sync_type_); 456 sync_type_);
456 } 457 }
457 changes->push_back(SettingChange(key, old_value, NULL)); 458 changes->push_back(SettingChange(key, old_value, NULL));
458 return SyncError(); 459 return SyncError();
459 } 460 }
460 461
461 } // namespace extensions 462 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/settings/settings_sync_unittest.cc ('k') | chrome/browser/extensions/test_extension_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698