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

Side by Side Diff: sync/notifier/sync_invalidation_listener.cc

Issue 12094113: Migrate invalidator client IDs out of sync (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix sync_client compile errors Created 7 years, 10 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/notifier/sync_invalidation_listener.h" 5 #include "sync/notifier/sync_invalidation_listener.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 88
89 int client_type = ipc::invalidation::ClientType::CHROME_SYNC; 89 int client_type = ipc::invalidation::ClientType::CHROME_SYNC;
90 invalidation_client_.reset( 90 invalidation_client_.reset(
91 create_invalidation_client_callback.Run( 91 create_invalidation_client_callback.Run(
92 &sync_system_resources_, client_type, client_id, 92 &sync_system_resources_, client_type, client_id,
93 kApplicationName, this)); 93 kApplicationName, this));
94 invalidation_client_->Start(); 94 invalidation_client_->Start();
95 95
96 registration_manager_.reset( 96 registration_manager_.reset(
97 new RegistrationManager(invalidation_client_.get())); 97 new RegistrationManager(invalidation_client_.get()));
98
99 // TODO(rlarocque): This call exists as part of an effort to move the
100 // invalidator's ID out of sync. It writes the provided (sync-managed) ID to
101 // storage that lives on the UI thread. Once this has been in place for a
102 // milestone or two, we can remove it and start looking for invalidator client
103 // IDs exclusively in the InvalidationStateTracker. See crbug.com/124142.
104 invalidation_state_tracker_.Call(
105 FROM_HERE,
106 &InvalidationStateTracker::SetInvalidatorClientId,
107 client_id);
98 } 108 }
99 109
100 void SyncInvalidationListener::UpdateCredentials( 110 void SyncInvalidationListener::UpdateCredentials(
101 const std::string& email, const std::string& token) { 111 const std::string& email, const std::string& token) {
102 DCHECK(CalledOnValidThread()); 112 DCHECK(CalledOnValidThread());
103 sync_system_resources_.network()->UpdateCredentials(email, token); 113 sync_system_resources_.network()->UpdateCredentials(email, token);
104 } 114 }
105 115
106 void SyncInvalidationListener::UpdateRegisteredIds(const ObjectIdSet& ids) { 116 void SyncInvalidationListener::UpdateRegisteredIds(const ObjectIdSet& ids) {
107 DCHECK(CalledOnValidThread()); 117 DCHECK(CalledOnValidThread());
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 EmitStateChange(); 373 EmitStateChange();
364 } 374 }
365 375
366 void SyncInvalidationListener::OnIncomingNotification( 376 void SyncInvalidationListener::OnIncomingNotification(
367 const notifier::Notification& notification) { 377 const notifier::Notification& notification) {
368 DCHECK(CalledOnValidThread()); 378 DCHECK(CalledOnValidThread());
369 // Do nothing, since this is already handled by |invalidation_client_|. 379 // Do nothing, since this is already handled by |invalidation_client_|.
370 } 380 }
371 381
372 } // namespace syncer 382 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/notifier/invalidation_state_tracker.h ('k') | sync/notifier/sync_invalidation_listener_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698