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

Side by Side Diff: google_apis/gcm/engine/mcs_client.cc

Issue 176823009: Show device information in chrome://gcm-internals page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years, 9 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 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 #include "google_apis/gcm/engine/mcs_client.h" 5 #include "google_apis/gcm/engine/mcs_client.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 119
120 // The protobuf of the message itself. 120 // The protobuf of the message itself.
121 MCSProto protobuf; 121 MCSProto protobuf;
122 }; 122 };
123 123
124 ReliablePacketInfo::ReliablePacketInfo() 124 ReliablePacketInfo::ReliablePacketInfo()
125 : stream_id(0), tag(0) { 125 : stream_id(0), tag(0) {
126 } 126 }
127 ReliablePacketInfo::~ReliablePacketInfo() {} 127 ReliablePacketInfo::~ReliablePacketInfo() {}
128 128
129 std::string MCSClient::GetStateString(State state) {
130 switch(state) {
131 case UNINITIALIZED:
132 return "UNINITIALIZED";
133 case LOADED:
134 return "LOADED";
135 case CONNECTING:
136 return "CONNECTING";
137 case CONNECTED:
138 return "CONNECTED";
139 }
140 return std::string();
141 }
142
129 MCSClient::MCSClient(const std::string& version_string, 143 MCSClient::MCSClient(const std::string& version_string,
130 base::Clock* clock, 144 base::Clock* clock,
131 ConnectionFactory* connection_factory, 145 ConnectionFactory* connection_factory,
132 GCMStore* gcm_store) 146 GCMStore* gcm_store)
133 : version_string_(version_string), 147 : version_string_(version_string),
134 clock_(clock), 148 clock_(clock),
135 state_(UNINITIALIZED), 149 state_(UNINITIALIZED),
136 android_id_(0), 150 android_id_(0),
137 security_token_(0), 151 security_token_(0),
138 connection_factory_(connection_factory), 152 connection_factory_(connection_factory),
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after
845 reinterpret_cast<mcs_proto::DataMessageStanza*>(packet->protobuf.get()); 859 reinterpret_cast<mcs_proto::DataMessageStanza*>(packet->protobuf.get());
846 CollapseKey collapse_key(*data_message); 860 CollapseKey collapse_key(*data_message);
847 if (collapse_key.IsValid()) 861 if (collapse_key.IsValid())
848 collapse_key_map_.erase(collapse_key); 862 collapse_key_map_.erase(collapse_key);
849 } 863 }
850 864
851 return packet; 865 return packet;
852 } 866 }
853 867
854 } // namespace gcm 868 } // namespace gcm
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698