Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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, 124142): This call exists as part of an effort to move the | |
|
tim (not reviewing)
2013/02/05 20:04:33
nit - ooh, newfangled todo format? otherwise I'd s
rlarocque
2013/02/05 21:36:56
I thought I had seen that before... Maybe I just m
| |
| 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. | |
| 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 Loading... | |
| 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 |
| OLD | NEW |