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 "jingle/notifier/listener/non_blocking_push_client.h" | 5 #include "jingle/notifier/listener/non_blocking_push_client.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 create_blocking_push_client_callback); | 33 create_blocking_push_client_callback); |
34 | 34 |
35 // Must be called before being destroyed. | 35 // Must be called before being destroyed. |
36 void DestroyOnDelegateThread(); | 36 void DestroyOnDelegateThread(); |
37 | 37 |
38 void UpdateSubscriptions(const SubscriptionList& subscriptions); | 38 void UpdateSubscriptions(const SubscriptionList& subscriptions); |
39 void UpdateCredentials(const std::string& email, const std::string& token); | 39 void UpdateCredentials(const std::string& email, const std::string& token); |
40 void SendNotification(const Notification& data); | 40 void SendNotification(const Notification& data); |
41 void SendPing(); | 41 void SendPing(); |
42 | 42 |
43 virtual void OnNotificationsEnabled() OVERRIDE; | 43 virtual void OnNotificationsEnabled() override; |
44 virtual void OnNotificationsDisabled( | 44 virtual void OnNotificationsDisabled( |
45 NotificationsDisabledReason reason) OVERRIDE; | 45 NotificationsDisabledReason reason) override; |
46 virtual void OnIncomingNotification( | 46 virtual void OnIncomingNotification( |
47 const Notification& notification) OVERRIDE; | 47 const Notification& notification) override; |
48 virtual void OnPingResponse() OVERRIDE; | 48 virtual void OnPingResponse() override; |
49 | 49 |
50 private: | 50 private: |
51 friend class base::RefCountedThreadSafe<NonBlockingPushClient::Core>; | 51 friend class base::RefCountedThreadSafe<NonBlockingPushClient::Core>; |
52 | 52 |
53 // Called on either the parent thread or the delegate thread. | 53 // Called on either the parent thread or the delegate thread. |
54 virtual ~Core(); | 54 virtual ~Core(); |
55 | 55 |
56 const scoped_refptr<base::SingleThreadTaskRunner> parent_task_runner_; | 56 const scoped_refptr<base::SingleThreadTaskRunner> parent_task_runner_; |
57 const scoped_refptr<base::SingleThreadTaskRunner> delegate_task_runner_; | 57 const scoped_refptr<base::SingleThreadTaskRunner> delegate_task_runner_; |
58 | 58 |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 FOR_EACH_OBSERVER(PushClientObserver, observers_, | 236 FOR_EACH_OBSERVER(PushClientObserver, observers_, |
237 OnIncomingNotification(notification)); | 237 OnIncomingNotification(notification)); |
238 } | 238 } |
239 | 239 |
240 void NonBlockingPushClient::OnPingResponse() { | 240 void NonBlockingPushClient::OnPingResponse() { |
241 DCHECK(thread_checker_.CalledOnValidThread()); | 241 DCHECK(thread_checker_.CalledOnValidThread()); |
242 FOR_EACH_OBSERVER(PushClientObserver, observers_, OnPingResponse()); | 242 FOR_EACH_OBSERVER(PushClientObserver, observers_, OnPingResponse()); |
243 } | 243 } |
244 | 244 |
245 } // namespace notifier | 245 } // namespace notifier |
OLD | NEW |