| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |