Chromium Code Reviews| 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/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 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 413 } | 413 } |
| 414 | 414 |
| 415 if (info_sources & NET_INFO_SPDY_STATUS) { | 415 if (info_sources & NET_INFO_SPDY_STATUS) { |
| 416 base::DictionaryValue* status_dict = new base::DictionaryValue(); | 416 base::DictionaryValue* status_dict = new base::DictionaryValue(); |
| 417 | 417 |
| 418 status_dict->SetBoolean("spdy_enabled", HttpStreamFactory::spdy_enabled()); | 418 status_dict->SetBoolean("spdy_enabled", HttpStreamFactory::spdy_enabled()); |
| 419 status_dict->SetBoolean( | 419 status_dict->SetBoolean( |
| 420 "use_alternative_services", | 420 "use_alternative_services", |
| 421 http_network_session->params().use_alternative_services); | 421 http_network_session->params().use_alternative_services); |
| 422 | 422 |
| 423 NextProtoVector next_protos; | 423 NextProtoVector alpn_protos; |
| 424 http_network_session->GetNextProtos(&next_protos); | 424 http_network_session->GetAlpnProtos(&alpn_protos); |
| 425 if (!next_protos.empty()) { | 425 if (!alpn_protos.empty()) { |
| 426 std::string next_protos_string; | 426 std::string next_protos_string; |
| 427 for (const NextProto proto : next_protos) { | 427 for (const NextProto proto : alpn_protos) { |
|
davidben
2015/10/13 20:55:59
Either const NextProto& proto or NextProto. Since
Bence
2015/10/14 14:55:59
Done.
| |
| 428 if (!next_protos_string.empty()) | 428 if (!next_protos_string.empty()) |
| 429 next_protos_string.append(","); | 429 next_protos_string.append(","); |
| 430 next_protos_string.append(SSLClientSocket::NextProtoToString(proto)); | 430 next_protos_string.append(SSLClientSocket::NextProtoToString(proto)); |
| 431 } | 431 } |
| 432 status_dict->SetString("next_protos", next_protos_string); | 432 status_dict->SetString("alpn_protos", next_protos_string); |
| 433 } | |
| 434 | |
| 435 NextProtoVector npn_protos; | |
| 436 http_network_session->GetNpnProtos(&npn_protos); | |
| 437 if (!npn_protos.empty()) { | |
| 438 std::string next_protos_string; | |
| 439 for (const NextProto proto : npn_protos) { | |
|
davidben
2015/10/13 20:55:59
Ditto.
Bence
2015/10/14 14:55:59
Done.
| |
| 440 if (!next_protos_string.empty()) | |
| 441 next_protos_string.append(","); | |
| 442 next_protos_string.append(SSLClientSocket::NextProtoToString(proto)); | |
| 443 } | |
| 444 status_dict->SetString("npn_protos", next_protos_string); | |
| 433 } | 445 } |
| 434 | 446 |
| 435 net_info_dict->Set(NetInfoSourceToString(NET_INFO_SPDY_STATUS), | 447 net_info_dict->Set(NetInfoSourceToString(NET_INFO_SPDY_STATUS), |
| 436 status_dict); | 448 status_dict); |
| 437 } | 449 } |
| 438 | 450 |
| 439 if (info_sources & NET_INFO_SPDY_ALT_SVC_MAPPINGS) { | 451 if (info_sources & NET_INFO_SPDY_ALT_SVC_MAPPINGS) { |
| 440 const HttpServerProperties& http_server_properties = | 452 const HttpServerProperties& http_server_properties = |
| 441 *context->http_server_properties(); | 453 *context->http_server_properties(); |
| 442 net_info_dict->Set( | 454 net_info_dict->Set( |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 511 // fine, since GetRequestStateAsValue() ignores the capture mode. | 523 // fine, since GetRequestStateAsValue() ignores the capture mode. |
| 512 NetLog::EntryData entry_data( | 524 NetLog::EntryData entry_data( |
| 513 NetLog::TYPE_REQUEST_ALIVE, request->net_log().source(), | 525 NetLog::TYPE_REQUEST_ALIVE, request->net_log().source(), |
| 514 NetLog::PHASE_BEGIN, request->creation_time(), &callback); | 526 NetLog::PHASE_BEGIN, request->creation_time(), &callback); |
| 515 NetLog::Entry entry(&entry_data, NetLogCaptureMode::Default()); | 527 NetLog::Entry entry(&entry_data, NetLogCaptureMode::Default()); |
| 516 observer->OnAddEntry(entry); | 528 observer->OnAddEntry(entry); |
| 517 } | 529 } |
| 518 } | 530 } |
| 519 | 531 |
| 520 } // namespace net | 532 } // namespace net |
| OLD | NEW |