OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/notifier/invalidation_notifier.h" | 5 #include "chrome/browser/sync/notifier/invalidation_notifier.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/message_loop_proxy.h" | 8 #include "base/message_loop_proxy.h" |
9 #include "chrome/browser/sync/notifier/sync_notifier_observer.h" | 9 #include "chrome/browser/sync/notifier/sync_notifier_observer.h" |
10 #include "chrome/browser/sync/protocol/service_constants.h" | 10 #include "chrome/browser/sync/protocol/service_constants.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 notifier_options_.request_context_getter, | 76 notifier_options_.request_context_getter, |
77 notifier::GetServerList(notifier_options_), | 77 notifier::GetServerList(notifier_options_), |
78 notifier_options_.try_ssltcp_first, | 78 notifier_options_.try_ssltcp_first, |
79 notifier_options_.auth_mechanism)); | 79 notifier_options_.auth_mechanism)); |
80 login_->StartConnection(); | 80 login_->StartConnection(); |
81 state_ = CONNECTING; | 81 state_ = CONNECTING; |
82 } | 82 } |
83 } | 83 } |
84 | 84 |
85 void InvalidationNotifier::UpdateEnabledTypes( | 85 void InvalidationNotifier::UpdateEnabledTypes( |
86 const syncable::ModelTypeSet& types) { | 86 const syncable::ModelTypeSet& enabled_types) { |
87 DCHECK(non_thread_safe_.CalledOnValidThread()); | 87 DCHECK(non_thread_safe_.CalledOnValidThread()); |
88 invalidation_client_.RegisterTypes(types); | 88 invalidation_client_.RegisterTypes(enabled_types); |
89 } | 89 } |
90 | 90 |
91 void InvalidationNotifier::SendNotification() { | 91 void InvalidationNotifier::SendNotification( |
| 92 const syncable::ModelTypeSet& changed_types) { |
92 DCHECK(non_thread_safe_.CalledOnValidThread()); | 93 DCHECK(non_thread_safe_.CalledOnValidThread()); |
| 94 // Do nothing. |
93 } | 95 } |
94 | 96 |
95 void InvalidationNotifier::OnConnect( | 97 void InvalidationNotifier::OnConnect( |
96 base::WeakPtr<talk_base::Task> base_task) { | 98 base::WeakPtr<talk_base::Task> base_task) { |
97 DCHECK(non_thread_safe_.CalledOnValidThread()); | 99 DCHECK(non_thread_safe_.CalledOnValidThread()); |
98 VLOG(1) << "OnConnect"; | 100 VLOG(1) << "OnConnect"; |
99 if (state_ >= STARTED) { | 101 if (state_ >= STARTED) { |
100 invalidation_client_.ChangeBaseTask(base_task); | 102 invalidation_client_.ChangeBaseTask(base_task); |
101 } else { | 103 } else { |
102 VLOG(1) << "First time connecting: starting invalidation client"; | 104 VLOG(1) << "First time connecting: starting invalidation client"; |
(...skipping 26 matching lines...) Expand all Loading... |
129 OnNotificationStateChange(has_session)); | 131 OnNotificationStateChange(has_session)); |
130 } | 132 } |
131 | 133 |
132 void InvalidationNotifier::WriteState(const std::string& state) { | 134 void InvalidationNotifier::WriteState(const std::string& state) { |
133 DCHECK(non_thread_safe_.CalledOnValidThread()); | 135 DCHECK(non_thread_safe_.CalledOnValidThread()); |
134 VLOG(1) << "WriteState"; | 136 VLOG(1) << "WriteState"; |
135 FOR_EACH_OBSERVER(SyncNotifierObserver, observers_, StoreState(state)); | 137 FOR_EACH_OBSERVER(SyncNotifierObserver, observers_, StoreState(state)); |
136 } | 138 } |
137 | 139 |
138 } // namespace sync_notifier | 140 } // namespace sync_notifier |
OLD | NEW |