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

Unified Diff: google_apis/gcm/engine/mcs_client.h

Issue 148293002: [GCM] Add basic collapse key support for upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: google_apis/gcm/engine/mcs_client.h
diff --git a/google_apis/gcm/engine/mcs_client.h b/google_apis/gcm/engine/mcs_client.h
index 1b279508eea604458a02bcfd3c8df0c1f20be0d6..9b55beab3158fdf9551053c7b6ece015eab092b9 100644
--- a/google_apis/gcm/engine/mcs_client.h
+++ b/google_apis/gcm/engine/mcs_client.h
@@ -129,8 +129,10 @@ class GCM_EXPORT MCSClient {
private:
typedef uint32 StreamId;
typedef std::string PersistentId;
+ typedef std::string AppId;
fgorski 2014/01/28 18:10:27 If you mean to use project_id as a value of that f
fgorski 2014/01/28 18:13:31 And speaking of multi-profile scenario... what if
Nicolas Zea 2014/01/31 11:58:43 I've gone ahead and modified this to use a Collaps
typedef std::vector<StreamId> StreamIdList;
typedef std::vector<PersistentId> PersistentIdList;
+ typedef std::map<std::string, ReliablePacketInfo*> TokenMap;
typedef std::map<StreamId, PersistentId> StreamIdToPersistentIdMap;
typedef linked_ptr<ReliablePacketInfo> MCSPacketInternal;
@@ -212,6 +214,9 @@ class GCM_EXPORT MCSClient {
std::deque<MCSPacketInternal> to_send_;
std::deque<MCSPacketInternal> to_resend_;
+ // Map of collapse keys to their pending messages.
+ std::map<AppId, linked_ptr<TokenMap> > collapse_key_map_;
+
// Last device_to_server stream id acknowledged by the server.
StreamId last_device_to_server_stream_id_received_;
// Last server_to_device stream id acknowledged by this device.

Powered by Google App Engine
This is Rietveld 408576698