| 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 1411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1422 | 1422 |
| 1423 void | 1423 void |
| 1424 NetInternalsMessageHandler::IOThreadImpl::OnGetSpdyAlternateProtocolMappings( | 1424 NetInternalsMessageHandler::IOThreadImpl::OnGetSpdyAlternateProtocolMappings( |
| 1425 const base::ListValue* list) { | 1425 const base::ListValue* list) { |
| 1426 DCHECK(!list); | 1426 DCHECK(!list); |
| 1427 base::ListValue* dict_list = new base::ListValue(); | 1427 base::ListValue* dict_list = new base::ListValue(); |
| 1428 | 1428 |
| 1429 const net::HttpServerProperties& http_server_properties = | 1429 const net::HttpServerProperties& http_server_properties = |
| 1430 *GetMainContext()->http_server_properties(); | 1430 *GetMainContext()->http_server_properties(); |
| 1431 | 1431 |
| 1432 const net::AlternateProtocolMap& map = | 1432 // TODO(rtenneti): This call is slow. |
| 1433 http_server_properties.alternate_protocol_map(); | 1433 const net::AlternateProtocolMap map = |
| 1434 http_server_properties.GetAlternateProtocolMap(); |
| 1434 | 1435 |
| 1435 for (net::AlternateProtocolMap::const_iterator it = map.begin(); | 1436 for (net::AlternateProtocolMap::const_iterator it = map.begin(); |
| 1436 it != map.end(); ++it) { | 1437 it != map.end(); ++it) { |
| 1437 base::DictionaryValue* dict = new base::DictionaryValue(); | 1438 base::DictionaryValue* dict = new base::DictionaryValue(); |
| 1438 dict->SetString("host_port_pair", it->first.ToString()); | 1439 dict->SetString("host_port_pair", it->first.ToString()); |
| 1439 dict->SetString("alternate_protocol", it->second.ToString()); | 1440 dict->SetString("alternate_protocol", it->second.ToString()); |
| 1440 dict_list->Append(dict); | 1441 dict_list->Append(dict); |
| 1441 } | 1442 } |
| 1442 | 1443 |
| 1443 SendJavascriptCommand("receivedSpdyAlternateProtocolMappings", dict_list); | 1444 SendJavascriptCommand("receivedSpdyAlternateProtocolMappings", dict_list); |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1869 } | 1870 } |
| 1870 | 1871 |
| 1871 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) | 1872 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) |
| 1872 : WebUIController(web_ui) { | 1873 : WebUIController(web_ui) { |
| 1873 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); | 1874 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); |
| 1874 | 1875 |
| 1875 // Set up the chrome://net-internals/ source. | 1876 // Set up the chrome://net-internals/ source. |
| 1876 Profile* profile = Profile::FromWebUI(web_ui); | 1877 Profile* profile = Profile::FromWebUI(web_ui); |
| 1877 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); | 1878 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); |
| 1878 } | 1879 } |
| OLD | NEW |