| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "blimp/common/logging.h" | 5 #include "blimp/common/logging.h" |
| 6 | 6 |
| 7 #include <iostream> | 7 #include <iostream> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 break; | 191 break; |
| 192 } | 192 } |
| 193 } | 193 } |
| 194 | 194 |
| 195 // Logs fields from PROTOCOL_CONTROL messages. | 195 // Logs fields from PROTOCOL_CONTROL messages. |
| 196 void ExtractProtocolControlMessageFields(const BlimpMessage& message, | 196 void ExtractProtocolControlMessageFields(const BlimpMessage& message, |
| 197 LogFields* output) { | 197 LogFields* output) { |
| 198 switch (message.protocol_control().connection_message_case()) { | 198 switch (message.protocol_control().connection_message_case()) { |
| 199 case ProtocolControlMessage::kStartConnection: | 199 case ProtocolControlMessage::kStartConnection: |
| 200 AddField("subtype", "START_CONNECTION", output); | 200 AddField("subtype", "START_CONNECTION", output); |
| 201 AddField("client_token", | 201 AddField( |
| 202 message.protocol_control().start_connection().client_token(), | 202 "client_token", |
| 203 output); | 203 message.protocol_control().start_connection().client_auth_token(), |
| 204 output); |
| 204 AddField("protocol_version", | 205 AddField("protocol_version", |
| 205 message.protocol_control().start_connection().protocol_version(), | 206 message.protocol_control().start_connection().protocol_version(), |
| 206 output); | 207 output); |
| 207 break; | 208 break; |
| 208 case ProtocolControlMessage::kCheckpointAck: | 209 case ProtocolControlMessage::kCheckpointAck: |
| 209 AddField("subtype", "CHECKPOINT_ACK", output); | 210 AddField("subtype", "CHECKPOINT_ACK", output); |
| 210 AddField("checkpoint_id", | 211 AddField("checkpoint_id", |
| 211 message.protocol_control().checkpoint_ack().checkpoint_id(), | 212 message.protocol_control().checkpoint_ack().checkpoint_id(), |
| 212 output); | 213 output); |
| 213 break; | 214 break; |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 for (size_t i = 0; i < fields.size(); ++i) { | 401 for (size_t i = 0; i < fields.size(); ++i) { |
| 401 out << fields[i].first << "=" << fields[i].second | 402 out << fields[i].first << "=" << fields[i].second |
| 402 << (i != fields.size() - 1 ? " " : ""); | 403 << (i != fields.size() - 1 ? " " : ""); |
| 403 } | 404 } |
| 404 out << ">"; | 405 out << ">"; |
| 405 | 406 |
| 406 return out; | 407 return out; |
| 407 } | 408 } |
| 408 | 409 |
| 409 } // namespace blimp | 410 } // namespace blimp |
| OLD | NEW |