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

Side by Side Diff: net/log/net_log_util.cc

Issue 1084243003: Update NET_INFO_SOURCE macros. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/log/net_log_util.h" 5 #include "net/log/net_log_util.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 } 424 }
425 425
426 net::HttpNetworkSession* http_network_session = 426 net::HttpNetworkSession* http_network_session =
427 context->http_transaction_factory()->GetSession(); 427 context->http_transaction_factory()->GetSession();
428 428
429 if (info_sources & NET_INFO_SOCKET_POOL) { 429 if (info_sources & NET_INFO_SOCKET_POOL) {
430 net_info_dict->Set(NetInfoSourceToString(NET_INFO_SOCKET_POOL), 430 net_info_dict->Set(NetInfoSourceToString(NET_INFO_SOCKET_POOL),
431 http_network_session->SocketPoolInfoToValue()); 431 http_network_session->SocketPoolInfoToValue());
432 } 432 }
433 433
434 if (info_sources & NET_INFO_SPDY_SESSIONS) { 434 if (info_sources & NET_INFO_HTTP2_SESSIONS) {
435 net_info_dict->Set(NetInfoSourceToString(NET_INFO_SPDY_SESSIONS), 435 net_info_dict->Set(NetInfoSourceToString(NET_INFO_HTTP2_SESSIONS),
436 http_network_session->SpdySessionPoolInfoToValue()); 436 http_network_session->SpdySessionPoolInfoToValue());
437 } 437 }
438 438
439 if (info_sources & NET_INFO_SPDY_STATUS) { 439 if (info_sources & NET_INFO_HTTP2_STATUS) {
440 base::DictionaryValue* status_dict = new base::DictionaryValue(); 440 base::DictionaryValue* status_dict = new base::DictionaryValue();
441 441
442 status_dict->SetBoolean("spdy_enabled", 442 status_dict->SetBoolean("spdy_enabled",
443 net::HttpStreamFactory::spdy_enabled()); 443 net::HttpStreamFactory::spdy_enabled());
444 status_dict->SetBoolean( 444 status_dict->SetBoolean(
445 "use_alternate_protocols", 445 "use_alternate_protocols",
446 http_network_session->params().use_alternate_protocols); 446 http_network_session->params().use_alternate_protocols);
447 447
448 NextProtoVector next_protos; 448 NextProtoVector next_protos;
449 http_network_session->GetNextProtos(&next_protos); 449 http_network_session->GetNextProtos(&next_protos);
450 if (!next_protos.empty()) { 450 if (!next_protos.empty()) {
451 std::string next_protos_string; 451 std::string next_protos_string;
452 for (const NextProto proto : next_protos) { 452 for (const NextProto proto : next_protos) {
453 if (!next_protos_string.empty()) 453 if (!next_protos_string.empty())
454 next_protos_string.append(","); 454 next_protos_string.append(",");
455 next_protos_string.append(SSLClientSocket::NextProtoToString(proto)); 455 next_protos_string.append(SSLClientSocket::NextProtoToString(proto));
456 } 456 }
457 status_dict->SetString("next_protos", next_protos_string); 457 status_dict->SetString("next_protos", next_protos_string);
458 } 458 }
459 459
460 net_info_dict->Set(NetInfoSourceToString(NET_INFO_SPDY_STATUS), 460 net_info_dict->Set(NetInfoSourceToString(NET_INFO_HTTP2_STATUS),
461 status_dict); 461 status_dict);
462 } 462 }
463 463
464 if (info_sources & NET_INFO_SPDY_ALT_PROTO_MAPPINGS) { 464 if (info_sources & NET_INFO_HTTP2_ALT_SVC_MAPPINGS) {
465 const net::HttpServerProperties& http_server_properties = 465 const net::HttpServerProperties& http_server_properties =
466 *context->http_server_properties(); 466 *context->http_server_properties();
467 net_info_dict->Set( 467 net_info_dict->Set(
468 NetInfoSourceToString(NET_INFO_SPDY_ALT_PROTO_MAPPINGS), 468 NetInfoSourceToString(NET_INFO_HTTP2_ALT_SVC_MAPPINGS),
469 http_server_properties.GetAlternativeServiceInfoAsValue()); 469 http_server_properties.GetAlternativeServiceInfoAsValue());
470 } 470 }
471 471
472 if (info_sources & NET_INFO_QUIC) { 472 if (info_sources & NET_INFO_QUIC) {
473 net_info_dict->Set(NetInfoSourceToString(NET_INFO_QUIC), 473 net_info_dict->Set(NetInfoSourceToString(NET_INFO_QUIC),
474 http_network_session->QuicInfoToValue()); 474 http_network_session->QuicInfoToValue());
475 } 475 }
476 476
477 if (info_sources & NET_INFO_HTTP_CACHE) { 477 if (info_sources & NET_INFO_HTTP_CACHE) {
478 base::DictionaryValue* info_dict = new base::DictionaryValue(); 478 base::DictionaryValue* info_dict = new base::DictionaryValue();
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 537
538 net::NetLog::EntryData entry_data( 538 net::NetLog::EntryData entry_data(
539 net::NetLog::TYPE_REQUEST_ALIVE, request->net_log().source(), 539 net::NetLog::TYPE_REQUEST_ALIVE, request->net_log().source(),
540 net::NetLog::PHASE_BEGIN, request->creation_time(), &callback); 540 net::NetLog::PHASE_BEGIN, request->creation_time(), &callback);
541 NetLog::Entry entry(&entry_data, request->net_log().GetLogLevel()); 541 NetLog::Entry entry(&entry_data, request->net_log().GetLogLevel());
542 observer->OnAddEntry(entry); 542 observer->OnAddEntry(entry);
543 } 543 }
544 } 544 }
545 545
546 } // namespace net 546 } // namespace net
OLDNEW
« net/base/net_info_source_list.h ('K') | « net/base/net_info_source_list.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698