OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/server_notifier_thread.h" | 5 #include "chrome/browser/sync/notifier/server_notifier_thread.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "chrome/browser/sync/notifier/cache_invalidation_packet_handler.h" | 11 #include "chrome/browser/sync/notifier/cache_invalidation_packet_handler.h" |
12 #include "chrome/browser/sync/notifier/chrome_invalidation_client.h" | 12 #include "chrome/browser/sync/notifier/chrome_invalidation_client.h" |
13 #include "chrome/browser/sync/notifier/chrome_system_resources.h" | 13 #include "chrome/browser/sync/notifier/chrome_system_resources.h" |
14 #include "chrome/browser/sync/notifier/invalidation_util.h" | 14 #include "chrome/browser/sync/notifier/invalidation_util.h" |
15 #include "chrome/common/net/notifier/listener/notification_defines.h" | 15 #include "chrome/common/net/notifier/listener/notification_defines.h" |
16 #include "google/cacheinvalidation/invalidation-client-impl.h" | 16 #include "google/cacheinvalidation/invalidation-client-impl.h" |
17 #include "talk/xmpp/jid.h" | 17 #include "talk/xmpp/jid.h" |
18 | 18 |
19 namespace sync_notifier { | 19 namespace sync_notifier { |
20 | 20 |
21 ServerNotifierThread::ServerNotifierThread( | 21 ServerNotifierThread::ServerNotifierThread() {} |
22 chrome_common_net::NetworkChangeNotifierThread* | |
23 network_change_notifier_thread) | |
24 : notifier::MediatorThreadImpl(network_change_notifier_thread) {} | |
25 | 22 |
26 ServerNotifierThread::~ServerNotifierThread() {} | 23 ServerNotifierThread::~ServerNotifierThread() {} |
27 | 24 |
28 void ServerNotifierThread::ListenForUpdates() { | 25 void ServerNotifierThread::ListenForUpdates() { |
29 DCHECK_EQ(MessageLoop::current(), parent_message_loop_); | 26 DCHECK_EQ(MessageLoop::current(), parent_message_loop_); |
30 worker_message_loop()->PostTask( | 27 worker_message_loop()->PostTask( |
31 FROM_HERE, | 28 FROM_HERE, |
32 NewRunnableMethod(this, | 29 NewRunnableMethod(this, |
33 &ServerNotifierThread::StartInvalidationListener)); | 30 &ServerNotifierThread::StartInvalidationListener)); |
34 } | 31 } |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 DCHECK_EQ(MessageLoop::current(), worker_message_loop()); | 189 DCHECK_EQ(MessageLoop::current(), worker_message_loop()); |
193 | 190 |
194 if (chrome_invalidation_client_.get()) { | 191 if (chrome_invalidation_client_.get()) { |
195 // TODO(akalin): Need to do unregisters here? | 192 // TODO(akalin): Need to do unregisters here? |
196 chrome_invalidation_client_->Stop(); | 193 chrome_invalidation_client_->Stop(); |
197 } | 194 } |
198 chrome_invalidation_client_.reset(); | 195 chrome_invalidation_client_.reset(); |
199 } | 196 } |
200 | 197 |
201 } // namespace sync_notifier | 198 } // namespace sync_notifier |
OLD | NEW |