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

Side by Side Diff: chrome/browser/sync/invalidations/invalidator_storage.cc

Issue 12847003: Separate invalidator and sync client ID (part 2/2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix sync_listen_notifications utility Created 7 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/sync/invalidations/invalidator_storage.h" 5 #include "chrome/browser/sync/invalidations/invalidator_storage.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 if (!syncer::RealModelTypeToObjectId(model_type, &id)) { 256 if (!syncer::RealModelTypeToObjectId(model_type, &id)) {
257 DLOG(WARNING) << "Invalid model type: " << model_type; 257 DLOG(WARNING) << "Invalid model type: " << model_type;
258 continue; 258 continue;
259 } 259 }
260 (*map)[id].version = max_version; 260 (*map)[id].version = max_version;
261 } 261 }
262 } 262 }
263 263
264 void InvalidatorStorage::SetInvalidatorClientId(const std::string& client_id) { 264 void InvalidatorStorage::SetInvalidatorClientId(const std::string& client_id) {
265 DCHECK(thread_checker_.CalledOnValidThread()); 265 DCHECK(thread_checker_.CalledOnValidThread());
266 Clear(); // We can't reuse our old invalidation state if the ID changes.
266 pref_service_->SetString(prefs::kInvalidatorClientId, client_id); 267 pref_service_->SetString(prefs::kInvalidatorClientId, client_id);
267 } 268 }
268 269
269 std::string InvalidatorStorage::GetInvalidatorClientId() const { 270 std::string InvalidatorStorage::GetInvalidatorClientId() const {
270 return pref_service_ ? 271 return pref_service_ ?
271 pref_service_->GetString(prefs::kInvalidatorClientId) : 272 pref_service_->GetString(prefs::kInvalidatorClientId) :
272 std::string(); 273 std::string();
273 } 274 }
274 275
275 void InvalidatorStorage::SetBootstrapData(const std::string& data) { 276 void InvalidatorStorage::SetBootstrapData(const std::string& data) {
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 return; 333 return;
333 it->second.current = ack_handle; 334 it->second.current = ack_handle;
334 335
335 base::ListValue state_map_list; 336 base::ListValue state_map_list;
336 SerializeToList(state_map, &state_map_list); 337 SerializeToList(state_map, &state_map_list);
337 pref_service_->Set(prefs::kInvalidatorMaxInvalidationVersions, 338 pref_service_->Set(prefs::kInvalidatorMaxInvalidationVersions,
338 state_map_list); 339 state_map_list);
339 } 340 }
340 341
341 } // namespace browser_sync 342 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/invalidations/invalidator_storage.h ('k') | chrome/browser/sync/profile_sync_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698