| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "net/http/http_response_info.h" | 5 #include "net/http/http_response_info.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/pickle.h" | 8 #include "base/pickle.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "net/base/auth.h" | 10 #include "net/base/auth.h" |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 } | 362 } |
| 363 | 363 |
| 364 HttpResponseInfo::ConnectionInfo HttpResponseInfo::ConnectionInfoFromNextProto( | 364 HttpResponseInfo::ConnectionInfo HttpResponseInfo::ConnectionInfoFromNextProto( |
| 365 NextProto next_proto) { | 365 NextProto next_proto) { |
| 366 switch (next_proto) { | 366 switch (next_proto) { |
| 367 case kProtoDeprecatedSPDY2: | 367 case kProtoDeprecatedSPDY2: |
| 368 return CONNECTION_INFO_DEPRECATED_SPDY2; | 368 return CONNECTION_INFO_DEPRECATED_SPDY2; |
| 369 case kProtoSPDY3: | 369 case kProtoSPDY3: |
| 370 case kProtoSPDY31: | 370 case kProtoSPDY31: |
| 371 return CONNECTION_INFO_SPDY3; | 371 return CONNECTION_INFO_SPDY3; |
| 372 case kProtoSPDY4: | 372 case kProtoSPDY4_14: |
| 373 return CONNECTION_INFO_SPDY4; | 373 return CONNECTION_INFO_HTTP2_14; |
| 374 case kProtoSPDY4_15: |
| 375 return CONNECTION_INFO_HTTP2_15; |
| 374 case kProtoQUIC1SPDY3: | 376 case kProtoQUIC1SPDY3: |
| 375 return CONNECTION_INFO_QUIC1_SPDY3; | 377 return CONNECTION_INFO_QUIC1_SPDY3; |
| 376 | 378 |
| 377 case kProtoUnknown: | 379 case kProtoUnknown: |
| 378 case kProtoHTTP11: | 380 case kProtoHTTP11: |
| 379 break; | 381 break; |
| 380 } | 382 } |
| 381 | 383 |
| 382 NOTREACHED(); | 384 NOTREACHED(); |
| 383 return CONNECTION_INFO_UNKNOWN; | 385 return CONNECTION_INFO_UNKNOWN; |
| 384 } | 386 } |
| 385 | 387 |
| 386 // static | 388 // static |
| 387 std::string HttpResponseInfo::ConnectionInfoToString( | 389 std::string HttpResponseInfo::ConnectionInfoToString( |
| 388 ConnectionInfo connection_info) { | 390 ConnectionInfo connection_info) { |
| 389 switch (connection_info) { | 391 switch (connection_info) { |
| 390 case CONNECTION_INFO_UNKNOWN: | 392 case CONNECTION_INFO_UNKNOWN: |
| 391 return "unknown"; | 393 return "unknown"; |
| 392 case CONNECTION_INFO_HTTP1: | 394 case CONNECTION_INFO_HTTP1: |
| 393 return "http/1"; | 395 return "http/1"; |
| 394 case CONNECTION_INFO_DEPRECATED_SPDY2: | 396 case CONNECTION_INFO_DEPRECATED_SPDY2: |
| 395 return "spdy/2"; | 397 return "spdy/2"; |
| 396 case CONNECTION_INFO_SPDY3: | 398 case CONNECTION_INFO_SPDY3: |
| 397 return "spdy/3"; | 399 return "spdy/3"; |
| 398 case CONNECTION_INFO_SPDY4: | 400 case CONNECTION_INFO_HTTP2_14: |
| 399 // This is the HTTP/2 draft-15 identifier. For internal | 401 // For internal consistency, HTTP/2 is named SPDY4 within Chromium. |
| 400 // consistency, HTTP/2 is named SPDY4 within Chromium. | 402 // This is the HTTP/2 draft-14 identifier. |
| 403 return "h2-14"; |
| 404 case CONNECTION_INFO_HTTP2_15: |
| 405 // This is the HTTP/2 draft-15 identifier. |
| 401 return "h2-15"; | 406 return "h2-15"; |
| 402 case CONNECTION_INFO_QUIC1_SPDY3: | 407 case CONNECTION_INFO_QUIC1_SPDY3: |
| 403 return "quic/1+spdy/3"; | 408 return "quic/1+spdy/3"; |
| 404 case NUM_OF_CONNECTION_INFOS: | 409 case NUM_OF_CONNECTION_INFOS: |
| 405 break; | 410 break; |
| 406 } | 411 } |
| 407 NOTREACHED(); | 412 NOTREACHED(); |
| 408 return ""; | 413 return ""; |
| 409 } | 414 } |
| 410 | 415 |
| 411 } // namespace net | 416 } // namespace net |
| OLD | NEW |