| 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/invalidation_notifier.h" | 5 #include "sync/notifier/invalidation_notifier.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop_proxy.h" | 9 #include "base/message_loop_proxy.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 invalidation_client_id_, client_info_, invalidation_state_, | 87 invalidation_client_id_, client_info_, invalidation_state_, |
| 88 initial_max_invalidation_versions_, | 88 initial_max_invalidation_versions_, |
| 89 invalidation_state_tracker_, | 89 invalidation_state_tracker_, |
| 90 this); | 90 this); |
| 91 invalidation_state_.clear(); | 91 invalidation_state_.clear(); |
| 92 state_ = STARTED; | 92 state_ = STARTED; |
| 93 } | 93 } |
| 94 invalidation_client_.UpdateCredentials(email, token); | 94 invalidation_client_.UpdateCredentials(email, token); |
| 95 } | 95 } |
| 96 | 96 |
| 97 void InvalidationNotifier::SendNotification(ModelTypeSet changed_types) { | 97 void InvalidationNotifier::SendNotification( |
| 98 const ObjectIdStateMap& id_state_map) { |
| 98 DCHECK(CalledOnValidThread()); | 99 DCHECK(CalledOnValidThread()); |
| 99 // Do nothing. | 100 // Do nothing. |
| 100 } | 101 } |
| 101 | 102 |
| 102 void InvalidationNotifier::OnInvalidate(const ObjectIdStateMap& id_state_map) { | 103 void InvalidationNotifier::OnInvalidate(const ObjectIdStateMap& id_state_map) { |
| 103 DCHECK(CalledOnValidThread()); | 104 DCHECK(CalledOnValidThread()); |
| 104 registrar_.DispatchInvalidationsToHandlers(id_state_map, REMOTE_NOTIFICATION); | 105 registrar_.DispatchInvalidationsToHandlers(id_state_map, REMOTE_NOTIFICATION); |
| 105 } | 106 } |
| 106 | 107 |
| 107 void InvalidationNotifier::OnNotificationsEnabled() { | 108 void InvalidationNotifier::OnNotificationsEnabled() { |
| 108 DCHECK(CalledOnValidThread()); | 109 DCHECK(CalledOnValidThread()); |
| 109 registrar_.EmitOnNotificationsEnabled(); | 110 registrar_.EmitOnNotificationsEnabled(); |
| 110 } | 111 } |
| 111 | 112 |
| 112 void InvalidationNotifier::OnNotificationsDisabled( | 113 void InvalidationNotifier::OnNotificationsDisabled( |
| 113 NotificationsDisabledReason reason) { | 114 NotificationsDisabledReason reason) { |
| 114 DCHECK(CalledOnValidThread()); | 115 DCHECK(CalledOnValidThread()); |
| 115 registrar_.EmitOnNotificationsDisabled(reason); | 116 registrar_.EmitOnNotificationsDisabled(reason); |
| 116 } | 117 } |
| 117 | 118 |
| 118 } // namespace syncer | 119 } // namespace syncer |
| OLD | NEW |