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

Side by Side Diff: chrome/browser/extensions/api/storage/settings_sync_processor.cc

Issue 16915006: Convert most of extensions and some other random stuff to using the base namespace for Values. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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/api/storage/settings_namespace.h" 5 #include "chrome/browser/extensions/api/storage/settings_namespace.h"
6 #include "chrome/browser/extensions/api/storage/settings_sync_processor.h" 6 #include "chrome/browser/extensions/api/storage/settings_sync_processor.h"
7 #include "chrome/browser/extensions/api/storage/settings_sync_util.h" 7 #include "chrome/browser/extensions/api/storage/settings_sync_util.h"
8 #include "content/public/browser/browser_thread.h" 8 #include "content/public/browser/browser_thread.h"
9 #include "sync/api/sync_change_processor.h" 9 #include "sync/api/sync_change_processor.h"
10 #include "sync/api/sync_data.h" 10 #include "sync/api/sync_data.h"
(...skipping 13 matching lines...) Expand all
24 initialized_(false) { 24 initialized_(false) {
25 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 25 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
26 CHECK(type == syncer::EXTENSION_SETTINGS || type == syncer::APP_SETTINGS); 26 CHECK(type == syncer::EXTENSION_SETTINGS || type == syncer::APP_SETTINGS);
27 CHECK(sync_processor); 27 CHECK(sync_processor);
28 } 28 }
29 29
30 SettingsSyncProcessor::~SettingsSyncProcessor() { 30 SettingsSyncProcessor::~SettingsSyncProcessor() {
31 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 31 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
32 } 32 }
33 33
34 void SettingsSyncProcessor::Init(const DictionaryValue& initial_state) { 34 void SettingsSyncProcessor::Init(const base::DictionaryValue& initial_state) {
35 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 35 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
36 CHECK(!initialized_) << "Init called multiple times"; 36 CHECK(!initialized_) << "Init called multiple times";
37 37
38 for (DictionaryValue::Iterator i(initial_state); !i.IsAtEnd(); i.Advance()) 38 for (base::DictionaryValue::Iterator i(initial_state); !i.IsAtEnd();
39 i.Advance())
39 synced_keys_.insert(i.key()); 40 synced_keys_.insert(i.key());
40 41
41 initialized_ = true; 42 initialized_ = true;
42 } 43 }
43 44
44 syncer::SyncError SettingsSyncProcessor::SendChanges( 45 syncer::SyncError SettingsSyncProcessor::SendChanges(
45 const ValueStoreChangeList& changes) { 46 const ValueStoreChangeList& changes) {
46 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 47 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
47 CHECK(initialized_) << "Init not called"; 48 CHECK(initialized_) << "Init not called";
48 49
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 for (ValueStoreChangeList::const_iterator i = changes.begin(); 102 for (ValueStoreChangeList::const_iterator i = changes.begin();
102 i != changes.end(); ++i) { 103 i != changes.end(); ++i) {
103 if (i->new_value()) 104 if (i->new_value())
104 synced_keys_.insert(i->key()); 105 synced_keys_.insert(i->key());
105 else 106 else
106 synced_keys_.erase(i->key()); 107 synced_keys_.erase(i->key());
107 } 108 }
108 } 109 }
109 110
110 } // namespace extensions 111 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698