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 "chrome/browser/ui/webui/net_internals/net_internals_ui.h" | 5 #include "chrome/browser/ui/webui/net_internals/net_internals_ui.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <list> | 8 #include <list> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 1344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1355 base::Value* spdy_info = http_network_session ? | 1355 base::Value* spdy_info = http_network_session ? |
1356 http_network_session->SpdySessionPoolInfoToValue() : NULL; | 1356 http_network_session->SpdySessionPoolInfoToValue() : NULL; |
1357 SendJavascriptCommand("receivedSpdySessionInfo", spdy_info); | 1357 SendJavascriptCommand("receivedSpdySessionInfo", spdy_info); |
1358 } | 1358 } |
1359 | 1359 |
1360 void NetInternalsMessageHandler::IOThreadImpl::OnGetSpdyStatus( | 1360 void NetInternalsMessageHandler::IOThreadImpl::OnGetSpdyStatus( |
1361 const base::ListValue* list) { | 1361 const base::ListValue* list) { |
1362 DCHECK(!list); | 1362 DCHECK(!list); |
1363 base::DictionaryValue* status_dict = new base::DictionaryValue(); | 1363 base::DictionaryValue* status_dict = new base::DictionaryValue(); |
1364 | 1364 |
| 1365 net::HttpNetworkSession* http_network_session = |
| 1366 GetHttpNetworkSession(GetMainContext()); |
| 1367 |
1365 status_dict->Set("spdy_enabled", | 1368 status_dict->Set("spdy_enabled", |
1366 base::Value::CreateBooleanValue( | 1369 base::Value::CreateBooleanValue( |
1367 net::HttpStreamFactory::spdy_enabled())); | 1370 net::HttpStreamFactory::spdy_enabled())); |
1368 status_dict->Set("use_alternate_protocols", | 1371 status_dict->Set("use_alternate_protocols", |
1369 base::Value::CreateBooleanValue( | 1372 base::Value::CreateBooleanValue( |
1370 net::HttpStreamFactory::use_alternate_protocols())); | 1373 http_network_session->params().use_alternate_protocols)); |
1371 status_dict->Set("force_spdy_over_ssl", | 1374 status_dict->Set("force_spdy_over_ssl", |
1372 base::Value::CreateBooleanValue( | 1375 base::Value::CreateBooleanValue( |
1373 net::HttpStreamFactory::force_spdy_over_ssl())); | 1376 http_network_session->params().force_spdy_over_ssl)); |
1374 status_dict->Set("force_spdy_always", | 1377 status_dict->Set("force_spdy_always", |
1375 base::Value::CreateBooleanValue( | 1378 base::Value::CreateBooleanValue( |
1376 net::HttpStreamFactory::force_spdy_always())); | 1379 http_network_session->params().force_spdy_always)); |
1377 | 1380 |
1378 // The next_protos may not be specified for certain configurations of SPDY. | 1381 std::vector<std::string> next_protos; |
1379 std::string next_protos_string; | 1382 http_network_session->GetNextProtos(&next_protos); |
1380 if (net::HttpStreamFactory::has_next_protos()) { | 1383 std::string next_protos_string = JoinString(next_protos, ','); |
1381 next_protos_string = JoinString(net::HttpStreamFactory::next_protos(), ','); | |
1382 } | |
1383 status_dict->SetString("next_protos", next_protos_string); | 1384 status_dict->SetString("next_protos", next_protos_string); |
1384 | 1385 |
1385 SendJavascriptCommand("receivedSpdyStatus", status_dict); | 1386 SendJavascriptCommand("receivedSpdyStatus", status_dict); |
1386 } | 1387 } |
1387 | 1388 |
1388 void | 1389 void |
1389 NetInternalsMessageHandler::IOThreadImpl::OnGetSpdyAlternateProtocolMappings( | 1390 NetInternalsMessageHandler::IOThreadImpl::OnGetSpdyAlternateProtocolMappings( |
1390 const base::ListValue* list) { | 1391 const base::ListValue* list) { |
1391 DCHECK(!list); | 1392 DCHECK(!list); |
1392 base::ListValue* dict_list = new base::ListValue(); | 1393 base::ListValue* dict_list = new base::ListValue(); |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1834 } | 1835 } |
1835 | 1836 |
1836 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) | 1837 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) |
1837 : WebUIController(web_ui) { | 1838 : WebUIController(web_ui) { |
1838 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); | 1839 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); |
1839 | 1840 |
1840 // Set up the chrome://net-internals/ source. | 1841 // Set up the chrome://net-internals/ source. |
1841 Profile* profile = Profile::FromWebUI(web_ui); | 1842 Profile* profile = Profile::FromWebUI(web_ui); |
1842 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); | 1843 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); |
1843 } | 1844 } |
OLD | NEW |