Chromium Code Reviews| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <list> | 10 #include <list> |
| (...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 860 GetMainContext()->transport_security_state(); | 860 GetMainContext()->transport_security_state(); |
| 861 if (!transport_security_state) | 861 if (!transport_security_state) |
| 862 return; | 862 return; |
| 863 | 863 |
| 864 transport_security_state->DeleteDynamicDataForHost(domain); | 864 transport_security_state->DeleteDynamicDataForHost(domain); |
| 865 } | 865 } |
| 866 | 866 |
| 867 void NetInternalsMessageHandler::IOThreadImpl::OnGetSessionNetworkStats( | 867 void NetInternalsMessageHandler::IOThreadImpl::OnGetSessionNetworkStats( |
| 868 const base::ListValue* list) { | 868 const base::ListValue* list) { |
| 869 DCHECK(!list); | 869 DCHECK(!list); |
| 870 net::URLRequestContext* context = | |
| 871 main_context_getter_->GetURLRequestContext(); | |
| 870 net::HttpNetworkSession* http_network_session = | 872 net::HttpNetworkSession* http_network_session = |
| 871 GetHttpNetworkSession(main_context_getter_->GetURLRequestContext()); | 873 GetHttpNetworkSession(context); |
| 872 | 874 |
| 873 base::Value* network_info = NULL; | 875 base::Value* network_info = NULL; |
| 874 if (http_network_session) { | 876 if (http_network_session) { |
| 877 // TODO(mmenke): This cast is ugly. Can we get rid of it, or, better, | |
| 878 // remove DRP data this from net-internals entirely? | |
|
eroman
2016/03/18 17:21:25
phrasing?
mmenke
2016/03/18 17:24:00
Done.
| |
| 875 data_reduction_proxy::DataReductionProxyNetworkDelegate* net_delegate = | 879 data_reduction_proxy::DataReductionProxyNetworkDelegate* net_delegate = |
| 876 static_cast<data_reduction_proxy::DataReductionProxyNetworkDelegate*>( | 880 static_cast<data_reduction_proxy::DataReductionProxyNetworkDelegate*>( |
| 877 http_network_session->network_delegate()); | 881 context->network_delegate()); |
| 878 if (net_delegate) { | 882 if (net_delegate) { |
| 879 network_info = net_delegate->SessionNetworkStatsInfoToValue(); | 883 network_info = net_delegate->SessionNetworkStatsInfoToValue(); |
| 880 } | 884 } |
| 881 } | 885 } |
| 882 SendJavascriptCommand("receivedSessionNetworkStats", network_info); | 886 SendJavascriptCommand("receivedSessionNetworkStats", network_info); |
| 883 } | 887 } |
| 884 | 888 |
| 885 void NetInternalsMessageHandler::IOThreadImpl::OnFlushSocketPools( | 889 void NetInternalsMessageHandler::IOThreadImpl::OnFlushSocketPools( |
| 886 const base::ListValue* list) { | 890 const base::ListValue* list) { |
| 887 DCHECK(!list); | 891 DCHECK(!list); |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1173 //////////////////////////////////////////////////////////////////////////////// | 1177 //////////////////////////////////////////////////////////////////////////////// |
| 1174 | 1178 |
| 1175 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) | 1179 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) |
| 1176 : WebUIController(web_ui) { | 1180 : WebUIController(web_ui) { |
| 1177 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); | 1181 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); |
| 1178 | 1182 |
| 1179 // Set up the chrome://net-internals/ source. | 1183 // Set up the chrome://net-internals/ source. |
| 1180 Profile* profile = Profile::FromWebUI(web_ui); | 1184 Profile* profile = Profile::FromWebUI(web_ui); |
| 1181 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); | 1185 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); |
| 1182 } | 1186 } |
| OLD | NEW |