OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/gcm_driver/gcm_driver_desktop.h" | 5 #include "components/gcm_driver/gcm_driver_desktop.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 public: | 30 public: |
31 // Called on UI thread. | 31 // Called on UI thread. |
32 IOWorker(const scoped_refptr<base::SequencedTaskRunner>& ui_thread, | 32 IOWorker(const scoped_refptr<base::SequencedTaskRunner>& ui_thread, |
33 const scoped_refptr<base::SequencedTaskRunner>& io_thread); | 33 const scoped_refptr<base::SequencedTaskRunner>& io_thread); |
34 virtual ~IOWorker(); | 34 virtual ~IOWorker(); |
35 | 35 |
36 // Overridden from GCMClient::Delegate: | 36 // Overridden from GCMClient::Delegate: |
37 // Called on IO thread. | 37 // Called on IO thread. |
38 virtual void OnRegisterFinished(const std::string& app_id, | 38 virtual void OnRegisterFinished(const std::string& app_id, |
39 const std::string& registration_id, | 39 const std::string& registration_id, |
40 GCMClient::Result result) OVERRIDE; | 40 GCMClient::Result result) override; |
41 virtual void OnUnregisterFinished(const std::string& app_id, | 41 virtual void OnUnregisterFinished(const std::string& app_id, |
42 GCMClient::Result result) OVERRIDE; | 42 GCMClient::Result result) override; |
43 virtual void OnSendFinished(const std::string& app_id, | 43 virtual void OnSendFinished(const std::string& app_id, |
44 const std::string& message_id, | 44 const std::string& message_id, |
45 GCMClient::Result result) OVERRIDE; | 45 GCMClient::Result result) override; |
46 virtual void OnMessageReceived( | 46 virtual void OnMessageReceived( |
47 const std::string& app_id, | 47 const std::string& app_id, |
48 const GCMClient::IncomingMessage& message) OVERRIDE; | 48 const GCMClient::IncomingMessage& message) override; |
49 virtual void OnMessagesDeleted(const std::string& app_id) OVERRIDE; | 49 virtual void OnMessagesDeleted(const std::string& app_id) override; |
50 virtual void OnMessageSendError( | 50 virtual void OnMessageSendError( |
51 const std::string& app_id, | 51 const std::string& app_id, |
52 const GCMClient::SendErrorDetails& send_error_details) OVERRIDE; | 52 const GCMClient::SendErrorDetails& send_error_details) override; |
53 virtual void OnSendAcknowledged(const std::string& app_id, | 53 virtual void OnSendAcknowledged(const std::string& app_id, |
54 const std::string& message_id) OVERRIDE; | 54 const std::string& message_id) override; |
55 virtual void OnGCMReady( | 55 virtual void OnGCMReady( |
56 const std::vector<AccountMapping>& account_mappings) OVERRIDE; | 56 const std::vector<AccountMapping>& account_mappings) override; |
57 virtual void OnActivityRecorded() OVERRIDE; | 57 virtual void OnActivityRecorded() override; |
58 virtual void OnConnected(const net::IPEndPoint& ip_endpoint) OVERRIDE; | 58 virtual void OnConnected(const net::IPEndPoint& ip_endpoint) override; |
59 virtual void OnDisconnected() OVERRIDE; | 59 virtual void OnDisconnected() override; |
60 | 60 |
61 // Called on IO thread. | 61 // Called on IO thread. |
62 void Initialize( | 62 void Initialize( |
63 scoped_ptr<GCMClientFactory> gcm_client_factory, | 63 scoped_ptr<GCMClientFactory> gcm_client_factory, |
64 const GCMClient::ChromeBuildInfo& chrome_build_info, | 64 const GCMClient::ChromeBuildInfo& chrome_build_info, |
65 const base::FilePath& store_path, | 65 const base::FilePath& store_path, |
66 const scoped_refptr<net::URLRequestContextGetter>& request_context, | 66 const scoped_refptr<net::URLRequestContextGetter>& request_context, |
67 const scoped_refptr<base::SequencedTaskRunner> blocking_task_runner); | 67 const scoped_refptr<base::SequencedTaskRunner> blocking_task_runner); |
68 void Start(const base::WeakPtr<GCMDriverDesktop>& service); | 68 void Start(const base::WeakPtr<GCMDriverDesktop>& service); |
69 void Stop(); | 69 void Stop(); |
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
757 | 757 |
758 // Normally request_gcm_statistics_callback_ would not be null. | 758 // Normally request_gcm_statistics_callback_ would not be null. |
759 if (!request_gcm_statistics_callback_.is_null()) | 759 if (!request_gcm_statistics_callback_.is_null()) |
760 request_gcm_statistics_callback_.Run(stats); | 760 request_gcm_statistics_callback_.Run(stats); |
761 else | 761 else |
762 LOG(WARNING) << "request_gcm_statistics_callback_ is NULL."; | 762 LOG(WARNING) << "request_gcm_statistics_callback_ is NULL."; |
763 } | 763 } |
764 | 764 |
765 } // namespace gcm | 765 } // namespace gcm |
766 | 766 |
OLD | NEW |