Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(411)

Side by Side Diff: components/gcm_driver/gcm_client_impl.h

Issue 2111973002: Add support for GCM subtypes to desktop Instance ID implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@iid9push
Patch Set: address most of peter's concerns Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #ifndef COMPONENTS_GCM_DRIVER_GCM_CLIENT_IMPL_H_ 5 #ifndef COMPONENTS_GCM_DRIVER_GCM_CLIENT_IMPL_H_
6 #define COMPONENTS_GCM_DRIVER_GCM_CLIENT_IMPL_H_ 6 #define COMPONENTS_GCM_DRIVER_GCM_CLIENT_IMPL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 void RemoveAccountMapping(const std::string& account_id) override; 132 void RemoveAccountMapping(const std::string& account_id) override;
133 void SetLastTokenFetchTime(const base::Time& time) override; 133 void SetLastTokenFetchTime(const base::Time& time) override;
134 void UpdateHeartbeatTimer(std::unique_ptr<base::Timer> timer) override; 134 void UpdateHeartbeatTimer(std::unique_ptr<base::Timer> timer) override;
135 void AddInstanceIDData(const std::string& app_id, 135 void AddInstanceIDData(const std::string& app_id,
136 const std::string& instance_id, 136 const std::string& instance_id,
137 const std::string& extra_data) override; 137 const std::string& extra_data) override;
138 void RemoveInstanceIDData(const std::string& app_id) override; 138 void RemoveInstanceIDData(const std::string& app_id) override;
139 void GetInstanceIDData(const std::string& app_id, 139 void GetInstanceIDData(const std::string& app_id,
140 std::string* instance_id, 140 std::string* instance_id,
141 std::string* extra_data) override; 141 std::string* extra_data) override;
142 bool CategoryHasSubtype(const std::string& category) override;
142 void AddHeartbeatInterval(const std::string& scope, int interval_ms) override; 143 void AddHeartbeatInterval(const std::string& scope, int interval_ms) override;
143 void RemoveHeartbeatInterval(const std::string& scope) override; 144 void RemoveHeartbeatInterval(const std::string& scope) override;
144 145
145 // GCMStatsRecorder::Delegate implemenation. 146 // GCMStatsRecorder::Delegate implemenation.
146 void OnActivityRecorded() override; 147 void OnActivityRecorded() override;
147 148
148 // ConnectionFactory::ConnectionListener implementation. 149 // ConnectionFactory::ConnectionListener implementation.
149 void OnConnected(const GURL& current_server, 150 void OnConnected(const GURL& current_server,
150 const net::IPEndPoint& ip_endpoint) override; 151 const net::IPEndPoint& ip_endpoint) override;
151 void OnDisconnected() override; 152 void OnDisconnected() override;
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 277
277 // Completes the GCM store destroy request. 278 // Completes the GCM store destroy request.
278 void OnGCMStoreDestroyed(bool success); 279 void OnGCMStoreDestroyed(bool success);
279 280
280 // Handles incoming data message and dispatches it the delegate of this class. 281 // Handles incoming data message and dispatches it the delegate of this class.
281 void HandleIncomingMessage(const gcm::MCSMessage& message); 282 void HandleIncomingMessage(const gcm::MCSMessage& message);
282 283
283 // Fires OnMessageReceived event on the delegate of this class, based on the 284 // Fires OnMessageReceived event on the delegate of this class, based on the
284 // details in |data_message_stanza| and |message_data|. 285 // details in |data_message_stanza| and |message_data|.
285 void HandleIncomingDataMessage( 286 void HandleIncomingDataMessage(
287 const std::string& app_id,
288 bool use_subtype,
286 const mcs_proto::DataMessageStanza& data_message_stanza, 289 const mcs_proto::DataMessageStanza& data_message_stanza,
287 MessageData& message_data); 290 MessageData& message_data);
288 291
289 // Fires OnMessageSendError event on the delegate of this calss, based on the 292 // Fires OnMessageSendError event on the delegate of this calss, based on the
290 // details in |data_message_stanza| and |message_data|. 293 // details in |data_message_stanza| and |message_data|.
291 void HandleIncomingSendError( 294 void HandleIncomingSendError(
295 const std::string& app_id,
292 const mcs_proto::DataMessageStanza& data_message_stanza, 296 const mcs_proto::DataMessageStanza& data_message_stanza,
293 MessageData& message_data); 297 MessageData& message_data);
294 298
295 // Is there any standalone app being registered for GCM? 299 // Is there any standalone app being registered for GCM?
296 bool HasStandaloneRegisteredApp() const; 300 bool HasStandaloneRegisteredApp() const;
297 301
298 // Destroys the store when it is not needed. 302 // Destroys the store when it is not needed.
299 void DestroyStoreWhenNotNeeded(); 303 void DestroyStoreWhenNotNeeded();
300 304
301 // Reset all cahced values. 305 // Reset all cahced values.
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 383
380 // Factory for creating references in callbacks. 384 // Factory for creating references in callbacks.
381 base::WeakPtrFactory<GCMClientImpl> weak_ptr_factory_; 385 base::WeakPtrFactory<GCMClientImpl> weak_ptr_factory_;
382 386
383 DISALLOW_COPY_AND_ASSIGN(GCMClientImpl); 387 DISALLOW_COPY_AND_ASSIGN(GCMClientImpl);
384 }; 388 };
385 389
386 } // namespace gcm 390 } // namespace gcm
387 391
388 #endif // COMPONENTS_GCM_DRIVER_GCM_CLIENT_IMPL_H_ 392 #endif // COMPONENTS_GCM_DRIVER_GCM_CLIENT_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698