OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef GOOGLE_APIS_GCM_GCM_CLIENT_IMPL_H_ | 5 #ifndef GOOGLE_APIS_GCM_GCM_CLIENT_IMPL_H_ |
6 #define GOOGLE_APIS_GCM_GCM_CLIENT_IMPL_H_ | 6 #define GOOGLE_APIS_GCM_GCM_CLIENT_IMPL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 // applications that send and receive messages. | 43 // applications that send and receive messages. |
44 class GCM_EXPORT GCMClientImpl : public GCMClient { | 44 class GCM_EXPORT GCMClientImpl : public GCMClient { |
45 public: | 45 public: |
46 GCMClientImpl(); | 46 GCMClientImpl(); |
47 virtual ~GCMClientImpl(); | 47 virtual ~GCMClientImpl(); |
48 | 48 |
49 // Overridden from GCMClient: | 49 // Overridden from GCMClient: |
50 virtual void Initialize( | 50 virtual void Initialize( |
51 const checkin_proto::ChromeBuildProto& chrome_build_proto, | 51 const checkin_proto::ChromeBuildProto& chrome_build_proto, |
52 const base::FilePath& store_path, | 52 const base::FilePath& store_path, |
| 53 const std::vector<std::string>& account_ids, |
53 const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner, | 54 const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner, |
54 const scoped_refptr<net::URLRequestContextGetter>& | 55 const scoped_refptr<net::URLRequestContextGetter>& |
55 url_request_context_getter, | 56 url_request_context_getter, |
56 Delegate* delegate) OVERRIDE; | 57 Delegate* delegate) OVERRIDE; |
57 virtual void CheckOut() OVERRIDE; | 58 virtual void CheckOut() OVERRIDE; |
58 virtual void Register(const std::string& app_id, | 59 virtual void Register(const std::string& app_id, |
59 const std::string& cert, | 60 const std::string& cert, |
60 const std::vector<std::string>& sender_ids) OVERRIDE; | 61 const std::vector<std::string>& sender_ids) OVERRIDE; |
61 virtual void Unregister(const std::string& app_id) OVERRIDE; | 62 virtual void Unregister(const std::string& app_id) OVERRIDE; |
62 virtual void Send(const std::string& app_id, | 63 virtual void Send(const std::string& app_id, |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 | 189 |
189 scoped_refptr<net::HttpNetworkSession> network_session_; | 190 scoped_refptr<net::HttpNetworkSession> network_session_; |
190 net::BoundNetLog net_log_; | 191 net::BoundNetLog net_log_; |
191 scoped_ptr<ConnectionFactory> connection_factory_; | 192 scoped_ptr<ConnectionFactory> connection_factory_; |
192 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_; | 193 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_; |
193 | 194 |
194 // Controls receiving and sending of packets and reliable message queueing. | 195 // Controls receiving and sending of packets and reliable message queueing. |
195 scoped_ptr<MCSClient> mcs_client_; | 196 scoped_ptr<MCSClient> mcs_client_; |
196 | 197 |
197 scoped_ptr<CheckinRequest> checkin_request_; | 198 scoped_ptr<CheckinRequest> checkin_request_; |
| 199 std::vector<std::string> account_ids_; |
198 | 200 |
199 // Currently pending registrations. GCMClientImpl owns the | 201 // Currently pending registrations. GCMClientImpl owns the |
200 // RegistrationRequests. | 202 // RegistrationRequests. |
201 PendingRegistrations pending_registrations_; | 203 PendingRegistrations pending_registrations_; |
202 STLValueDeleter<PendingRegistrations> pending_registrations_deleter_; | 204 STLValueDeleter<PendingRegistrations> pending_registrations_deleter_; |
203 | 205 |
204 // Currently pending unregistrations. GCMClientImpl owns the | 206 // Currently pending unregistrations. GCMClientImpl owns the |
205 // UnregistrationRequests. | 207 // UnregistrationRequests. |
206 PendingUnregistrations pending_unregistrations_; | 208 PendingUnregistrations pending_unregistrations_; |
207 STLValueDeleter<PendingUnregistrations> pending_unregistrations_deleter_; | 209 STLValueDeleter<PendingUnregistrations> pending_unregistrations_deleter_; |
208 | 210 |
209 // Factory for creating references in callbacks. | 211 // Factory for creating references in callbacks. |
210 base::WeakPtrFactory<GCMClientImpl> weak_ptr_factory_; | 212 base::WeakPtrFactory<GCMClientImpl> weak_ptr_factory_; |
211 | 213 |
212 DISALLOW_COPY_AND_ASSIGN(GCMClientImpl); | 214 DISALLOW_COPY_AND_ASSIGN(GCMClientImpl); |
213 }; | 215 }; |
214 | 216 |
215 } // namespace gcm | 217 } // namespace gcm |
216 | 218 |
217 #endif // GOOGLE_APIS_GCM_GCM_CLIENT_IMPL_H_ | 219 #endif // GOOGLE_APIS_GCM_GCM_CLIENT_IMPL_H_ |
OLD | NEW |