blob: 40190db528027a9d7e4295ad42270baf93cf3a68 [file] [log] [blame]
[email protected]cd57f372014-06-09 17:13:061// Copyright 2014 The Chromium Authors. All rights reserved.
[email protected]e4097c82013-11-08 00:16:122// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]cd57f372014-06-09 17:13:065#ifndef COMPONENTS_GCM_DRIVER_GCM_CLIENT_IMPL_H_
6#define COMPONENTS_GCM_DRIVER_GCM_CLIENT_IMPL_H_
[email protected]e4097c82013-11-08 00:16:127
avi26062922015-12-26 00:14:188#include <stdint.h>
9
[email protected]b83122a92014-01-22 21:29:2910#include <map>
dchenga77e28eb2016-04-21 21:34:3711#include <memory>
[email protected]7df5ef22014-07-17 07:35:5812#include <set>
[email protected]b83122a92014-01-22 21:29:2913#include <string>
jianli7a0c9b62015-05-26 23:24:4714#include <utility>
[email protected]848b1b62014-01-30 23:51:0415#include <vector>
[email protected]b83122a92014-01-22 21:29:2916
[email protected]e4097c82013-11-08 00:16:1217#include "base/compiler_specific.h"
avi26062922015-12-26 00:14:1818#include "base/macros.h"
[email protected]79994f42014-01-16 16:05:3619#include "base/memory/ref_counted.h"
[email protected]955e0ff2014-01-31 20:42:1220#include "base/memory/weak_ptr.h"
[email protected]cd57f372014-06-09 17:13:0621#include "components/gcm_driver/gcm_client.h"
22#include "components/gcm_driver/gcm_stats_recorder_impl.h"
[email protected]b83122a92014-01-22 21:29:2923#include "google_apis/gcm/base/mcs_message.h"
24#include "google_apis/gcm/engine/gcm_store.h"
[email protected]06e45272014-05-06 03:41:3425#include "google_apis/gcm/engine/gservices_settings.h"
[email protected]b83122a92014-01-22 21:29:2926#include "google_apis/gcm/engine/mcs_client.h"
[email protected]b4dd0232014-02-08 02:37:3127#include "google_apis/gcm/engine/registration_request.h"
[email protected]0e88e1d12014-03-19 06:53:0828#include "google_apis/gcm/engine/unregistration_request.h"
[email protected]436bcb82014-04-18 00:40:5729#include "google_apis/gcm/protocol/android_checkin.pb.h"
[email protected]2c4d4cd2014-04-10 21:10:2230#include "google_apis/gcm/protocol/checkin.pb.h"
[email protected]b83122a92014-01-22 21:29:2931#include "net/url_request/url_request_context_getter.h"
[email protected]e4097c82013-11-08 00:16:1232
[email protected]2bbe0a682014-03-26 00:08:3133class GURL;
34
[email protected]79994f42014-01-16 16:05:3635namespace base {
[email protected]955e0ff2014-01-31 20:42:1236class Clock;
[email protected]764c0442014-05-01 04:30:5537class Time;
[email protected]79994f42014-01-16 16:05:3638} // namespace base
39
[email protected]436bcb82014-04-18 00:40:5740namespace mcs_proto {
41class DataMessageStanza;
42} // namespace mcs_proto
43
[email protected]b83122a92014-01-22 21:29:2944namespace net {
45class HttpNetworkSession;
[email protected]955e0ff2014-01-31 20:42:1246} // namespace net
[email protected]b83122a92014-01-22 21:29:2947
[email protected]e4097c82013-11-08 00:16:1248namespace gcm {
49
[email protected]b83122a92014-01-22 21:29:2950class CheckinRequest;
51class ConnectionFactory;
52class GCMClientImplTest;
[email protected]79994f42014-01-16 16:05:3653
[email protected]2bbe0a682014-03-26 00:08:3154// Helper class for building GCM internals. Allows tests to inject fake versions
55// as necessary.
[email protected]cd57f372014-06-09 17:13:0656class GCMInternalsBuilder {
[email protected]2bbe0a682014-03-26 00:08:3157 public:
58 GCMInternalsBuilder();
59 virtual ~GCMInternalsBuilder();
60
dchenga77e28eb2016-04-21 21:34:3761 virtual std::unique_ptr<base::Clock> BuildClock();
62 virtual std::unique_ptr<MCSClient> BuildMCSClient(
[email protected]2bbe0a682014-03-26 00:08:3163 const std::string& version,
64 base::Clock* clock,
65 ConnectionFactory* connection_factory,
[email protected]436bcb82014-04-18 00:40:5766 GCMStore* gcm_store,
67 GCMStatsRecorder* recorder);
dchenga77e28eb2016-04-21 21:34:3768 virtual std::unique_ptr<ConnectionFactory> BuildConnectionFactory(
[email protected]2bbe0a682014-03-26 00:08:3169 const std::vector<GURL>& endpoints,
70 const net::BackoffEntry::Policy& backoff_policy,
mmenkee65e7af2015-10-13 17:16:4271 net::HttpNetworkSession* gcm_network_session,
72 net::HttpNetworkSession* http_network_session,
[email protected]9df5b932014-04-30 00:39:0673 GCMStatsRecorder* recorder);
[email protected]2bbe0a682014-03-26 00:08:3174};
75
[email protected]b83122a92014-01-22 21:29:2976// Implements the GCM Client. It is used to coordinate MCS Client (communication
77// with MCS) and other pieces of GCM infrastructure like Registration and
78// Checkins. It also allows for registering user delegates that host
79// applications that send and receive messages.
[email protected]cd57f372014-06-09 17:13:0680class GCMClientImpl
[email protected]c31e1b52014-06-12 21:00:4781 : public GCMClient, public GCMStatsRecorder::Delegate,
82 public ConnectionFactory::ConnectionListener {
[email protected]e4097c82013-11-08 00:16:1283 public:
jianlif3e52af42015-01-21 23:18:4784 // State representation of the GCMClient.
85 // Any change made to this enum should have corresponding change in the
86 // GetStateString(...) function.
87 enum State {
88 // Uninitialized.
89 UNINITIALIZED,
90 // Initialized,
91 INITIALIZED,
92 // GCM store loading is in progress.
93 LOADING,
94 // GCM store is loaded.
95 LOADED,
96 // Initial device checkin is in progress.
97 INITIAL_DEVICE_CHECKIN,
98 // Ready to accept requests.
99 READY,
100 };
101
dchenga77e28eb2016-04-21 21:34:37102 explicit GCMClientImpl(
103 std::unique_ptr<GCMInternalsBuilder> internals_builder);
dcheng00ea022b2014-10-21 11:24:56104 ~GCMClientImpl() override;
[email protected]e4097c82013-11-08 00:16:12105
[email protected]c31e1b52014-06-12 21:00:47106 // GCMClient implementation.
dcheng00ea022b2014-10-21 11:24:56107 void Initialize(
[email protected]8ad80512014-05-23 09:40:47108 const ChromeBuildInfo& chrome_build_info,
[email protected]e2a4a8012014-02-07 22:32:52109 const base::FilePath& store_path,
110 const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner,
111 const scoped_refptr<net::URLRequestContextGetter>&
[email protected]5799d052014-02-12 20:47:39112 url_request_context_getter,
dchenga77e28eb2016-04-21 21:34:37113 std::unique_ptr<Encryptor> encryptor,
mostynbfe59f482014-10-06 15:04:46114 GCMClient::Delegate* delegate) override;
jianlif3e52af42015-01-21 23:18:47115 void Start(StartMode start_mode) override;
dcheng00ea022b2014-10-21 11:24:56116 void Stop() override;
jianli7a0c9b62015-05-26 23:24:47117 void Register(const linked_ptr<RegistrationInfo>& registration_info) override;
118 void Unregister(
119 const linked_ptr<RegistrationInfo>& registration_info) override;
dcheng00ea022b2014-10-21 11:24:56120 void Send(const std::string& app_id,
121 const std::string& receiver_id,
122 const OutgoingMessage& message) override;
peteree284ba52016-02-01 11:53:28123 void RecordDecryptionFailure(const std::string& app_id,
peter266a2aa42016-02-19 18:51:39124 GCMEncryptionProvider::DecryptionResult result)
peteree284ba52016-02-01 11:53:28125 override;
dcheng00ea022b2014-10-21 11:24:56126 void SetRecording(bool recording) override;
127 void ClearActivityLogs() override;
128 GCMStatistics GetStatistics() const override;
129 void SetAccountTokens(
mostynbfe59f482014-10-06 15:04:46130 const std::vector<AccountTokenInfo>& account_tokens) override;
dcheng00ea022b2014-10-21 11:24:56131 void UpdateAccountMapping(const AccountMapping& account_mapping) override;
132 void RemoveAccountMapping(const std::string& account_id) override;
fgorski5df101702014-10-28 02:09:31133 void SetLastTokenFetchTime(const base::Time& time) override;
dchenga77e28eb2016-04-21 21:34:37134 void UpdateHeartbeatTimer(std::unique_ptr<base::Timer> timer) override;
jianli10018b2d2015-05-11 21:14:13135 void AddInstanceIDData(const std::string& app_id,
jianli7a0c9b62015-05-26 23:24:47136 const std::string& instance_id,
137 const std::string& extra_data) override;
jianli10018b2d2015-05-11 21:14:13138 void RemoveInstanceIDData(const std::string& app_id) override;
jianli7a0c9b62015-05-26 23:24:47139 void GetInstanceIDData(const std::string& app_id,
140 std::string* instance_id,
141 std::string* extra_data) override;
fgorski22754462015-05-14 00:05:22142 void AddHeartbeatInterval(const std::string& scope, int interval_ms) override;
143 void RemoveHeartbeatInterval(const std::string& scope) override;
[email protected]c31e1b52014-06-12 21:00:47144
145 // GCMStatsRecorder::Delegate implemenation.
dcheng00ea022b2014-10-21 11:24:56146 void OnActivityRecorded() override;
[email protected]e4097c82013-11-08 00:16:12147
[email protected]c31e1b52014-06-12 21:00:47148 // ConnectionFactory::ConnectionListener implementation.
dcheng00ea022b2014-10-21 11:24:56149 void OnConnected(const GURL& current_server,
150 const net::IPEndPoint& ip_endpoint) override;
151 void OnDisconnected() override;
[email protected]c31e1b52014-06-12 21:00:47152
[email protected]e4097c82013-11-08 00:16:12153 private:
[email protected]7df5ef22014-07-17 07:35:58154 // The check-in info for the device.
155 // TODO(fgorski): Convert to a class with explicit getters/setters.
[email protected]cd57f372014-06-09 17:13:06156 struct CheckinInfo {
[email protected]7df5ef22014-07-17 07:35:58157 CheckinInfo();
158 ~CheckinInfo();
[email protected]5799d052014-02-12 20:47:39159 bool IsValid() const { return android_id != 0 && secret != 0; }
[email protected]7df5ef22014-07-17 07:35:58160 void SnapshotCheckinAccounts();
161 void Reset();
[email protected]b83122a92014-01-22 21:29:29162
[email protected]7df5ef22014-07-17 07:35:58163 // Android ID of the device as assigned by the server.
avi26062922015-12-26 00:14:18164 uint64_t android_id;
[email protected]7df5ef22014-07-17 07:35:58165 // Security token of the device as assigned by the server.
avi26062922015-12-26 00:14:18166 uint64_t secret;
[email protected]7df5ef22014-07-17 07:35:58167 // True if accounts were already provided through SetAccountsForCheckin(),
168 // or when |last_checkin_accounts| was loaded as empty.
169 bool accounts_set;
170 // Map of account email addresses and OAuth2 tokens that will be sent to the
171 // checkin server on a next checkin.
172 std::map<std::string, std::string> account_tokens;
173 // As set of accounts last checkin was completed with.
174 std::set<std::string> last_checkin_accounts;
[email protected]848b1b62014-01-30 23:51:04175 };
176
jianli7a0c9b62015-05-26 23:24:47177 // Collection of pending registration requests. Keys are RegistrationInfo
178 // instance, while values are pending registration requests to obtain a
179 // registration ID for requesting application.
dchenga77e28eb2016-04-21 21:34:37180 using PendingRegistrationRequests =
181 std::map<linked_ptr<RegistrationInfo>,
182 std::unique_ptr<RegistrationRequest>,
183 RegistrationInfoComparer>;
[email protected]848b1b62014-01-30 23:51:04184
jianli7a0c9b62015-05-26 23:24:47185 // Collection of pending unregistration requests. Keys are RegistrationInfo
186 // instance, while values are pending unregistration requests to disable the
187 // registration ID currently assigned to the application.
limasdf20c5d7a2015-12-01 01:16:19188 using PendingUnregistrationRequests =
189 std::map<linked_ptr<RegistrationInfo>,
dchenga77e28eb2016-04-21 21:34:37190 std::unique_ptr<UnregistrationRequest>,
limasdf20c5d7a2015-12-01 01:16:19191 RegistrationInfoComparer>;
[email protected]e4007042014-02-15 20:34:28192
[email protected]b83122a92014-01-22 21:29:29193 friend class GCMClientImplTest;
jianlic02d25e2015-05-27 22:24:31194 friend class GCMClientInstanceIDTest;
[email protected]b83122a92014-01-22 21:29:29195
[email protected]35601812014-03-07 19:52:43196 // Returns text representation of the enum State.
197 std::string GetStateString() const;
198
[email protected]b83122a92014-01-22 21:29:29199 // Callbacks for the MCSClient.
200 // Receives messages and dispatches them to relevant user delegates.
201 void OnMessageReceivedFromMCS(const gcm::MCSMessage& message);
202 // Receives confirmation of sent messages or information about errors.
avi26062922015-12-26 00:14:18203 void OnMessageSentToMCS(int64_t user_serial_number,
[email protected]b83122a92014-01-22 21:29:29204 const std::string& app_id,
205 const std::string& message_id,
206 MCSClient::MessageSendStatus status);
207 // Receives information about mcs_client_ errors.
208 void OnMCSError();
209
210 // Runs after GCM Store load is done to trigger continuation of the
211 // initialization.
dchenga77e28eb2016-04-21 21:34:37212 void OnLoadCompleted(std::unique_ptr<GCMStore::LoadResult> result);
jianlif3e52af42015-01-21 23:18:47213 // Starts the GCM.
214 void StartGCM();
[email protected]b83122a92014-01-22 21:29:29215 // Initializes mcs_client_, which handles the connection to MCS.
jianlif3e52af42015-01-21 23:18:47216 void InitializeMCSClient();
[email protected]b83122a92014-01-22 21:29:29217 // Complets the first time device checkin.
218 void OnFirstTimeDeviceCheckinCompleted(const CheckinInfo& checkin_info);
219 // Starts a login on mcs_client_.
220 void StartMCSLogin();
jianli00b4600f2015-02-10 23:32:49221 // Resets the GCM store when it is corrupted.
222 void ResetStore();
[email protected]86625df2014-01-31 03:47:58223 // Sets state to ready. This will initiate the MCS login and notify the
224 // delegates.
fgorski5df101702014-10-28 02:09:31225 void OnReady(const std::vector<AccountMapping>& account_mappings,
226 const base::Time& last_token_fetch_time);
[email protected]b83122a92014-01-22 21:29:29227
[email protected]5799d052014-02-12 20:47:39228 // Starts a first time device checkin.
[email protected]25b5f50e2014-04-03 08:27:23229 void StartCheckin();
[email protected]2c4d4cd2014-04-10 21:10:22230 // Completes the device checkin request by parsing the |checkin_response|.
231 // Function also cleans up the pending checkin.
232 void OnCheckinCompleted(
233 const checkin_proto::AndroidCheckinResponse& checkin_response);
[email protected]06e45272014-05-06 03:41:34234
235 // Callback passed to GCMStore::SetGServicesSettings.
236 void SetGServicesSettingsCallback(bool success);
237
[email protected]764c0442014-05-01 04:30:55238 // Schedules next periodic device checkin and makes sure there is at most one
239 // pending checkin at a time. This function is meant to be called after a
240 // successful checkin.
241 void SchedulePeriodicCheckin();
242 // Gets the time until next checkin.
243 base::TimeDelta GetTimeToNextCheckin() const;
[email protected]7df5ef22014-07-17 07:35:58244 // Callback for setting last checkin information in the |gcm_store_|.
245 void SetLastCheckinInfoCallback(bool success);
[email protected]b83122a92014-01-22 21:29:29246
247 // Callback for persisting device credentials in the |gcm_store_|.
248 void SetDeviceCredentialsCallback(bool success);
249
[email protected]3a20a4d2014-03-21 22:54:21250 // Callback for persisting registration info in the |gcm_store_|.
251 void UpdateRegistrationCallback(bool success);
252
[email protected]72d4f252014-08-20 22:34:28253 // Callback for all store operations that do not try to recover, if write in
254 // |gcm_store_| fails.
255 void DefaultStoreCallback(bool success);
256
fgorski9a405102014-11-19 01:25:16257 // Callback for store operation where result does not matter.
258 void IgnoreWriteResultCallback(bool success);
259
jianli78b56042015-06-17 01:21:22260 // Callback for destroying the GCM store.
261 void DestroyStoreCallback(bool success);
262
263 // Callback for resetting the GCM store. The store will be reloaded.
jianli00b4600f2015-02-10 23:32:49264 void ResetStoreCallback(bool success);
265
[email protected]848b1b62014-01-30 23:51:04266 // Completes the registration request.
jianli7a0c9b62015-05-26 23:24:47267 void OnRegisterCompleted(
268 const linked_ptr<RegistrationInfo>& registration_info,
269 RegistrationRequest::Status status,
270 const std::string& registration_id);
[email protected]848b1b62014-01-30 23:51:04271
[email protected]e4007042014-02-15 20:34:28272 // Completes the unregistration request.
jianli7a0c9b62015-05-26 23:24:47273 void OnUnregisterCompleted(
274 const linked_ptr<RegistrationInfo>& registration_info,
275 UnregistrationRequest::Status status);
[email protected]e4007042014-02-15 20:34:28276
[email protected]d3a4b2e2014-02-27 13:46:54277 // Completes the GCM store destroy request.
278 void OnGCMStoreDestroyed(bool success);
279
[email protected]c6fe36b2014-03-11 10:58:12280 // Handles incoming data message and dispatches it the delegate of this class.
[email protected]b83122a92014-01-22 21:29:29281 void HandleIncomingMessage(const gcm::MCSMessage& message);
282
[email protected]c6fe36b2014-03-11 10:58:12283 // Fires OnMessageReceived event on the delegate of this class, based on the
284 // details in |data_message_stanza| and |message_data|.
285 void HandleIncomingDataMessage(
johnme627dc8c72016-08-19 21:49:39286 const std::string& app_id,
287 bool was_subtype,
[email protected]c6fe36b2014-03-11 10:58:12288 const mcs_proto::DataMessageStanza& data_message_stanza,
289 MessageData& message_data);
290
johnme627dc8c72016-08-19 21:49:39291 // Fires OnMessageSendError event on the delegate of this class, based on the
[email protected]c6fe36b2014-03-11 10:58:12292 // details in |data_message_stanza| and |message_data|.
293 void HandleIncomingSendError(
johnme627dc8c72016-08-19 21:49:39294 const std::string& app_id,
[email protected]c6fe36b2014-03-11 10:58:12295 const mcs_proto::DataMessageStanza& data_message_stanza,
296 MessageData& message_data);
[email protected]848b1b62014-01-30 23:51:04297
jianlif3e52af42015-01-21 23:18:47298 // Is there any standalone app being registered for GCM?
299 bool HasStandaloneRegisteredApp() const;
300
jianli78b56042015-06-17 01:21:22301 // Destroys the store when it is not needed.
302 void DestroyStoreWhenNotNeeded();
303
304 // Reset all cahced values.
305 void ResetCache();
306
[email protected]2bbe0a682014-03-26 00:08:31307 // Builder for the GCM internals (mcs client, etc.).
dchenga77e28eb2016-04-21 21:34:37308 std::unique_ptr<GCMInternalsBuilder> internals_builder_;
[email protected]b83122a92014-01-22 21:29:29309
[email protected]436bcb82014-04-18 00:40:57310 // Recorder that logs GCM activities.
[email protected]025adfa2014-06-03 21:51:12311 GCMStatsRecorderImpl recorder_;
[email protected]436bcb82014-04-18 00:40:57312
[email protected]b83122a92014-01-22 21:29:29313 // State of the GCM Client Implementation.
314 State state_;
315
[email protected]7de78802014-05-10 19:49:40316 GCMClient::Delegate* delegate_;
[email protected]5799d052014-02-12 20:47:39317
jianlif3e52af42015-01-21 23:18:47318 // Flag to indicate if the GCM should be delay started until it is actually
319 // used in either of the following cases:
320 // 1) The GCM store contains the registration records.
321 // 2) GCM functionailities are explicitly called.
322 StartMode start_mode_;
323
[email protected]b83122a92014-01-22 21:29:29324 // Device checkin info (android ID and security token used by device).
325 CheckinInfo device_checkin_info_;
326
[email protected]848b1b62014-01-30 23:51:04327 // Clock used for timing of retry logic. Passed in for testing. Owned by
328 // GCMClientImpl.
dchenga77e28eb2016-04-21 21:34:37329 std::unique_ptr<base::Clock> clock_;
[email protected]b83122a92014-01-22 21:29:29330
331 // Information about the chrome build.
332 // TODO(fgorski): Check if it can be passed in constructor and made const.
[email protected]8ad80512014-05-23 09:40:47333 ChromeBuildInfo chrome_build_info_;
[email protected]b83122a92014-01-22 21:29:29334
335 // Persistent data store for keeping device credentials, messages and user to
336 // serial number mappings.
dchenga77e28eb2016-04-21 21:34:37337 std::unique_ptr<GCMStore> gcm_store_;
[email protected]b83122a92014-01-22 21:29:29338
jianlif3e52af42015-01-21 23:18:47339 // Data loaded from the GCM store.
dchenga77e28eb2016-04-21 21:34:37340 std::unique_ptr<GCMStore::LoadResult> load_result_;
jianlif3e52af42015-01-21 23:18:47341
jianli00b4600f2015-02-10 23:32:49342 // Tracks if the GCM store has been reset. This is used to prevent from
343 // resetting and loading from the store again and again.
344 bool gcm_store_reset_;
345
dchenga77e28eb2016-04-21 21:34:37346 std::unique_ptr<net::HttpNetworkSession> network_session_;
347 std::unique_ptr<ConnectionFactory> connection_factory_;
[email protected]b83122a92014-01-22 21:29:29348 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_;
349
350 // Controls receiving and sending of packets and reliable message queueing.
mmenkee65e7af2015-10-13 17:16:42351 // Must be destroyed before |network_session_|.
dchenga77e28eb2016-04-21 21:34:37352 std::unique_ptr<MCSClient> mcs_client_;
[email protected]b83122a92014-01-22 21:29:29353
dchenga77e28eb2016-04-21 21:34:37354 std::unique_ptr<CheckinRequest> checkin_request_;
[email protected]b83122a92014-01-22 21:29:29355
[email protected]3a20a4d2014-03-21 22:54:21356 // Cached registration info.
357 RegistrationInfoMap registrations_;
[email protected]848b1b62014-01-30 23:51:04358
[email protected]3a20a4d2014-03-21 22:54:21359 // Currently pending registration requests. GCMClientImpl owns the
360 // RegistrationRequests.
361 PendingRegistrationRequests pending_registration_requests_;
[email protected]3a20a4d2014-03-21 22:54:21362
363 // Currently pending unregistration requests. GCMClientImpl owns the
[email protected]e4007042014-02-15 20:34:28364 // UnregistrationRequests.
[email protected]3a20a4d2014-03-21 22:54:21365 PendingUnregistrationRequests pending_unregistration_requests_;
[email protected]e4007042014-02-15 20:34:28366
[email protected]764c0442014-05-01 04:30:55367 // G-services settings that were provided by MCS.
[email protected]06e45272014-05-06 03:41:34368 GServicesSettings gservices_settings_;
[email protected]764c0442014-05-01 04:30:55369
370 // Time of the last successful checkin.
371 base::Time last_checkin_time_;
372
jianli7a0c9b62015-05-26 23:24:47373 // Cached instance ID data, key is app ID and value is pair of instance ID
374 // and extra data.
375 std::map<std::string, std::pair<std::string, std::string>> instance_id_data_;
jianli10018b2d2015-05-11 21:14:13376
[email protected]764c0442014-05-01 04:30:55377 // Factory for creating references when scheduling periodic checkin.
378 base::WeakPtrFactory<GCMClientImpl> periodic_checkin_ptr_factory_;
379
jianli78b56042015-06-17 01:21:22380 // Factory for wiping out GCM store.
381 base::WeakPtrFactory<GCMClientImpl> destroying_gcm_store_ptr_factory_;
382
[email protected]955e0ff2014-01-31 20:42:12383 // Factory for creating references in callbacks.
384 base::WeakPtrFactory<GCMClientImpl> weak_ptr_factory_;
385
[email protected]e4097c82013-11-08 00:16:12386 DISALLOW_COPY_AND_ASSIGN(GCMClientImpl);
387};
388
389} // namespace gcm
390
[email protected]cd57f372014-06-09 17:13:06391#endif // COMPONENTS_GCM_DRIVER_GCM_CLIENT_IMPL_H_