OLD | NEW |
---|---|
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/base/net_log_util.h" | 5 #include "net/base/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 15 matching lines...) Expand all Loading... | |
26 #include "net/dns/host_resolver.h" | 26 #include "net/dns/host_resolver.h" |
27 #include "net/http/http_cache.h" | 27 #include "net/http/http_cache.h" |
28 #include "net/http/http_network_session.h" | 28 #include "net/http/http_network_session.h" |
29 #include "net/http/http_server_properties.h" | 29 #include "net/http/http_server_properties.h" |
30 #include "net/http/http_transaction_factory.h" | 30 #include "net/http/http_transaction_factory.h" |
31 #include "net/proxy/proxy_config.h" | 31 #include "net/proxy/proxy_config.h" |
32 #include "net/proxy/proxy_retry_info.h" | 32 #include "net/proxy/proxy_retry_info.h" |
33 #include "net/proxy/proxy_service.h" | 33 #include "net/proxy/proxy_service.h" |
34 #include "net/quic/quic_protocol.h" | 34 #include "net/quic/quic_protocol.h" |
35 #include "net/quic/quic_utils.h" | 35 #include "net/quic/quic_utils.h" |
36 #include "net/socket/ssl_client_socket.h" | |
36 #include "net/url_request/url_request.h" | 37 #include "net/url_request/url_request.h" |
37 #include "net/url_request/url_request_context.h" | 38 #include "net/url_request/url_request_context.h" |
38 | 39 |
39 namespace net { | 40 namespace net { |
40 | 41 |
41 namespace { | 42 namespace { |
42 | 43 |
43 // This should be incremented when significant changes are made that will | 44 // This should be incremented when significant changes are made that will |
44 // invalidate the old loading code. | 45 // invalidate the old loading code. |
45 const int kLogFormatVersion = 1; | 46 const int kLogFormatVersion = 1; |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
440 status_dict->SetBoolean( | 441 status_dict->SetBoolean( |
441 "use_alternate_protocols", | 442 "use_alternate_protocols", |
442 http_network_session->params().use_alternate_protocols); | 443 http_network_session->params().use_alternate_protocols); |
443 status_dict->SetBoolean( | 444 status_dict->SetBoolean( |
444 "force_spdy_over_ssl", | 445 "force_spdy_over_ssl", |
445 http_network_session->params().force_spdy_over_ssl); | 446 http_network_session->params().force_spdy_over_ssl); |
446 status_dict->SetBoolean( | 447 status_dict->SetBoolean( |
447 "force_spdy_always", | 448 "force_spdy_always", |
448 http_network_session->params().force_spdy_always); | 449 http_network_session->params().force_spdy_always); |
449 | 450 |
450 std::vector<std::string> next_protos; | 451 NextProtoVector next_protos; |
451 http_network_session->GetNextProtos(&next_protos); | 452 http_network_session->GetNextProtos(&next_protos); |
452 std::string next_protos_string = JoinString(next_protos, ','); | 453 if (!next_protos.empty()) { |
453 status_dict->SetString("next_protos", next_protos_string); | 454 NextProtoVector::iterator it = next_protos.begin(); |
455 std::string next_protos_string(SSLClientSocket::NextProtoToString(*it)); | |
456 ++it; | |
457 for (; it != next_protos.end(); ++it) { | |
458 next_protos_string.append(","); | |
459 next_protos_string.append(SSLClientSocket::NextProtoToString(*it)); | |
460 } | |
Ryan Hamilton
2014/12/10 20:08:59
How about:
std::string next_protos_string;
for (c
Bence
2014/12/10 22:01:23
Done.
| |
461 status_dict->SetString("next_protos", next_protos_string); | |
Ryan Hamilton
2014/12/10 20:09:00
Alternatively, you could consider using a ListValu
| |
462 } | |
454 | 463 |
455 net_info_dict->Set(NetInfoSourceToString(NET_INFO_SPDY_STATUS), | 464 net_info_dict->Set(NetInfoSourceToString(NET_INFO_SPDY_STATUS), |
456 status_dict); | 465 status_dict); |
457 } | 466 } |
458 | 467 |
459 if (info_sources & NET_INFO_SPDY_ALT_PROTO_MAPPINGS) { | 468 if (info_sources & NET_INFO_SPDY_ALT_PROTO_MAPPINGS) { |
460 base::ListValue* dict_list = new base::ListValue(); | 469 base::ListValue* dict_list = new base::ListValue(); |
461 | 470 |
462 const net::HttpServerProperties& http_server_properties = | 471 const net::HttpServerProperties& http_server_properties = |
463 *context->http_server_properties(); | 472 *context->http_server_properties(); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
548 request->net_log().source(), | 557 request->net_log().source(), |
549 net::NetLog::PHASE_BEGIN, | 558 net::NetLog::PHASE_BEGIN, |
550 request->creation_time(), | 559 request->creation_time(), |
551 &callback); | 560 &callback); |
552 NetLog::Entry entry(&entry_data, request->net_log().GetLogLevel()); | 561 NetLog::Entry entry(&entry_data, request->net_log().GetLogLevel()); |
553 observer->OnAddEntry(entry); | 562 observer->OnAddEntry(entry); |
554 } | 563 } |
555 } | 564 } |
556 | 565 |
557 } // namespace net | 566 } // namespace net |
OLD | NEW |