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

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

Issue 2427633005: Improve GCM enum switch type safety (Closed)
Patch Set: Rebase Created 4 years, 2 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 <stddef.h> 7 #include <stddef.h>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 std::string MCSClient::GetStateString() const { 148 std::string MCSClient::GetStateString() const {
149 switch(state_) { 149 switch(state_) {
150 case UNINITIALIZED: 150 case UNINITIALIZED:
151 return "UNINITIALIZED"; 151 return "UNINITIALIZED";
152 case LOADED: 152 case LOADED:
153 return "LOADED"; 153 return "LOADED";
154 case CONNECTING: 154 case CONNECTING:
155 return "CONNECTING"; 155 return "CONNECTING";
156 case CONNECTED: 156 case CONNECTED:
157 return "CONNECTED"; 157 return "CONNECTED";
158 default:
159 NOTREACHED();
160 return std::string();
161 } 158 }
159 NOTREACHED();
160 return std::string();
162 } 161 }
163 162
164 MCSClient::MCSClient(const std::string& version_string, 163 MCSClient::MCSClient(const std::string& version_string,
165 base::Clock* clock, 164 base::Clock* clock,
166 ConnectionFactory* connection_factory, 165 ConnectionFactory* connection_factory,
167 GCMStore* gcm_store, 166 GCMStore* gcm_store,
168 GCMStatsRecorder* recorder) 167 GCMStatsRecorder* recorder)
169 : version_string_(version_string), 168 : version_string_(version_string),
170 clock_(clock), 169 clock_(clock),
171 state_(UNINITIALIZED), 170 state_(UNINITIALIZED),
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after
963 reinterpret_cast<mcs_proto::DataMessageStanza*>(packet->protobuf.get()); 962 reinterpret_cast<mcs_proto::DataMessageStanza*>(packet->protobuf.get());
964 CollapseKey collapse_key(*data_message); 963 CollapseKey collapse_key(*data_message);
965 if (collapse_key.IsValid()) 964 if (collapse_key.IsValid())
966 collapse_key_map_.erase(collapse_key); 965 collapse_key_map_.erase(collapse_key);
967 } 966 }
968 967
969 return packet; 968 return packet;
970 } 969 }
971 970
972 } // namespace gcm 971 } // namespace gcm
OLDNEW
« no previous file with comments | « google_apis/gcm/engine/connection_handler_impl.cc ('k') | google_apis/gcm/engine/registration_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698