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

Side by Side Diff: net/http/http_response_info.cc

Issue 2461683002: Slice enum HttpResponseInfo::ConnectionInfo by QUIC version. (Closed)
Patch Set: Update recently introduced CONNECTION_INFO_QUIC occurrences. Created 4 years, 1 month 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
« no previous file with comments | « net/http/http_response_info.h ('k') | net/quic/chromium/bidirectional_stream_quic_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 if (was_alpn_negotiated) 413 if (was_alpn_negotiated)
414 pickle->WriteString(alpn_negotiated_protocol); 414 pickle->WriteString(alpn_negotiated_protocol);
415 415
416 if (connection_info != CONNECTION_INFO_UNKNOWN) 416 if (connection_info != CONNECTION_INFO_UNKNOWN)
417 pickle->WriteInt(static_cast<int>(connection_info)); 417 pickle->WriteInt(static_cast<int>(connection_info));
418 418
419 if (ssl_info.is_valid() && ssl_info.key_exchange_group != 0) 419 if (ssl_info.is_valid() && ssl_info.key_exchange_group != 0)
420 pickle->WriteInt(ssl_info.key_exchange_group); 420 pickle->WriteInt(ssl_info.key_exchange_group);
421 } 421 }
422 422
423 bool HttpResponseInfo::DidUseQuic() const {
424 switch (connection_info) {
425 case CONNECTION_INFO_UNKNOWN:
426 case CONNECTION_INFO_HTTP1_1:
427 case CONNECTION_INFO_DEPRECATED_SPDY2:
428 case CONNECTION_INFO_DEPRECATED_SPDY3:
429 case CONNECTION_INFO_HTTP2:
430 case CONNECTION_INFO_DEPRECATED_HTTP2_14:
431 case CONNECTION_INFO_DEPRECATED_HTTP2_15:
432 case CONNECTION_INFO_HTTP0_9:
433 case CONNECTION_INFO_HTTP1_0:
434 return false;
435 case CONNECTION_INFO_QUIC_UNKNOWN_VERSION:
436 case CONNECTION_INFO_QUIC_32:
437 case CONNECTION_INFO_QUIC_33:
438 case CONNECTION_INFO_QUIC_34:
439 case CONNECTION_INFO_QUIC_35:
440 case CONNECTION_INFO_QUIC_36:
441 return true;
442 case NUM_OF_CONNECTION_INFOS:
443 NOTREACHED();
444 return false;
445 }
446 NOTREACHED();
447 return false;
448 }
449
423 // static 450 // static
424 std::string HttpResponseInfo::ConnectionInfoToString( 451 std::string HttpResponseInfo::ConnectionInfoToString(
425 ConnectionInfo connection_info) { 452 ConnectionInfo connection_info) {
426 switch (connection_info) { 453 switch (connection_info) {
427 case CONNECTION_INFO_UNKNOWN: 454 case CONNECTION_INFO_UNKNOWN:
428 return "unknown"; 455 return "unknown";
429 case CONNECTION_INFO_HTTP1_1: 456 case CONNECTION_INFO_HTTP1_1:
430 return "http/1.1"; 457 return "http/1.1";
431 case CONNECTION_INFO_DEPRECATED_SPDY2: 458 case CONNECTION_INFO_DEPRECATED_SPDY2:
432 NOTREACHED(); 459 NOTREACHED();
433 return ""; 460 return "";
434 case CONNECTION_INFO_DEPRECATED_SPDY3: 461 case CONNECTION_INFO_DEPRECATED_SPDY3:
435 return "spdy/3"; 462 return "spdy/3";
436 // Since ConnectionInfo is persisted to disk, deprecated values have to be 463 // Since ConnectionInfo is persisted to disk, deprecated values have to be
437 // handled. Note that h2-14 and h2-15 are essentially wire compatible with 464 // handled. Note that h2-14 and h2-15 are essentially wire compatible with
438 // h2. 465 // h2.
439 // Intentional fallthrough. 466 // Intentional fallthrough.
440 case CONNECTION_INFO_DEPRECATED_HTTP2_14: 467 case CONNECTION_INFO_DEPRECATED_HTTP2_14:
441 case CONNECTION_INFO_DEPRECATED_HTTP2_15: 468 case CONNECTION_INFO_DEPRECATED_HTTP2_15:
442 case CONNECTION_INFO_HTTP2: 469 case CONNECTION_INFO_HTTP2:
443 return "h2"; 470 return "h2";
444 case CONNECTION_INFO_QUIC: 471 case CONNECTION_INFO_QUIC_UNKNOWN_VERSION:
445 return "quic/1+spdy/3"; 472 return "http/2+quic";
473 case CONNECTION_INFO_QUIC_32:
474 return "http/2+quic/32";
475 case CONNECTION_INFO_QUIC_33:
476 return "http/2+quic/33";
477 case CONNECTION_INFO_QUIC_34:
478 return "http/2+quic/34";
479 case CONNECTION_INFO_QUIC_35:
480 return "http/2+quic/35";
481 case CONNECTION_INFO_QUIC_36:
482 return "http/2+quic/36";
446 case CONNECTION_INFO_HTTP0_9: 483 case CONNECTION_INFO_HTTP0_9:
447 return "http/0.9"; 484 return "http/0.9";
448 case CONNECTION_INFO_HTTP1_0: 485 case CONNECTION_INFO_HTTP1_0:
449 return "http/1.0"; 486 return "http/1.0";
450 case NUM_OF_CONNECTION_INFOS: 487 case NUM_OF_CONNECTION_INFOS:
451 break; 488 break;
452 } 489 }
453 NOTREACHED(); 490 NOTREACHED();
454 return ""; 491 return "";
455 } 492 }
456 493
457 } // namespace net 494 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_response_info.h ('k') | net/quic/chromium/bidirectional_stream_quic_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698