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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
50 #include "content/public/browser/notification_details.h" | 50 #include "content/public/browser/notification_details.h" |
51 #include "content/public/browser/resource_dispatcher_host.h" | 51 #include "content/public/browser/resource_dispatcher_host.h" |
52 #include "content/public/browser/web_contents.h" | 52 #include "content/public/browser/web_contents.h" |
53 #include "content/public/browser/web_ui.h" | 53 #include "content/public/browser/web_ui.h" |
54 #include "content/public/browser/web_ui_data_source.h" | 54 #include "content/public/browser/web_ui_data_source.h" |
55 #include "content/public/browser/web_ui_message_handler.h" | 55 #include "content/public/browser/web_ui_message_handler.h" |
56 #include "grit/net_internals_resources.h" | 56 #include "grit/net_internals_resources.h" |
57 #include "net/base/net_errors.h" | 57 #include "net/base/net_errors.h" |
58 #include "net/base/net_log_logger.h" | 58 #include "net/base/net_log_logger.h" |
59 #include "net/base/net_util.h" | 59 #include "net/base/net_util.h" |
60 #include "net/base/sdch_manager.h" | |
60 #include "net/disk_cache/disk_cache.h" | 61 #include "net/disk_cache/disk_cache.h" |
61 #include "net/dns/host_cache.h" | 62 #include "net/dns/host_cache.h" |
62 #include "net/dns/host_resolver.h" | 63 #include "net/dns/host_resolver.h" |
63 #include "net/http/http_cache.h" | 64 #include "net/http/http_cache.h" |
64 #include "net/http/http_network_layer.h" | 65 #include "net/http/http_network_layer.h" |
65 #include "net/http/http_network_session.h" | 66 #include "net/http/http_network_session.h" |
66 #include "net/http/http_server_properties.h" | 67 #include "net/http/http_server_properties.h" |
67 #include "net/http/http_stream_factory.h" | 68 #include "net/http/http_stream_factory.h" |
68 #include "net/http/transport_security_state.h" | 69 #include "net/http/transport_security_state.h" |
69 #include "net/proxy/proxy_service.h" | 70 #include "net/proxy/proxy_service.h" |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
397 void OnHSTSDelete(const base::ListValue* list); | 398 void OnHSTSDelete(const base::ListValue* list); |
398 void OnGetHttpCacheInfo(const base::ListValue* list); | 399 void OnGetHttpCacheInfo(const base::ListValue* list); |
399 void OnGetSocketPoolInfo(const base::ListValue* list); | 400 void OnGetSocketPoolInfo(const base::ListValue* list); |
400 void OnGetSessionNetworkStats(const base::ListValue* list); | 401 void OnGetSessionNetworkStats(const base::ListValue* list); |
401 void OnCloseIdleSockets(const base::ListValue* list); | 402 void OnCloseIdleSockets(const base::ListValue* list); |
402 void OnFlushSocketPools(const base::ListValue* list); | 403 void OnFlushSocketPools(const base::ListValue* list); |
403 void OnGetSpdySessionInfo(const base::ListValue* list); | 404 void OnGetSpdySessionInfo(const base::ListValue* list); |
404 void OnGetSpdyStatus(const base::ListValue* list); | 405 void OnGetSpdyStatus(const base::ListValue* list); |
405 void OnGetSpdyAlternateProtocolMappings(const base::ListValue* list); | 406 void OnGetSpdyAlternateProtocolMappings(const base::ListValue* list); |
406 void OnGetQuicInfo(const base::ListValue* list); | 407 void OnGetQuicInfo(const base::ListValue* list); |
408 void OnGetSdchInfo(const base::ListValue* list); | |
407 #if defined(OS_WIN) | 409 #if defined(OS_WIN) |
408 void OnGetServiceProviders(const base::ListValue* list); | 410 void OnGetServiceProviders(const base::ListValue* list); |
409 #endif | 411 #endif |
410 void OnSetLogLevel(const base::ListValue* list); | 412 void OnSetLogLevel(const base::ListValue* list); |
411 | 413 |
412 // ChromeNetLog::ThreadSafeObserver implementation: | 414 // ChromeNetLog::ThreadSafeObserver implementation: |
413 void OnAddEntry(const net::NetLog::Entry& entry) override; | 415 void OnAddEntry(const net::NetLog::Entry& entry) override; |
414 | 416 |
415 // ConnectionTester::Delegate implementation: | 417 // ConnectionTester::Delegate implementation: |
416 void OnStartConnectionTestSuite() override; | 418 void OnStartConnectionTestSuite() override; |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
604 base::Bind(&IOThreadImpl::CallbackHelper, | 606 base::Bind(&IOThreadImpl::CallbackHelper, |
605 &IOThreadImpl::OnGetSpdyStatus, proxy_)); | 607 &IOThreadImpl::OnGetSpdyStatus, proxy_)); |
606 web_ui()->RegisterMessageCallback( | 608 web_ui()->RegisterMessageCallback( |
607 "getSpdyAlternateProtocolMappings", | 609 "getSpdyAlternateProtocolMappings", |
608 base::Bind(&IOThreadImpl::CallbackHelper, | 610 base::Bind(&IOThreadImpl::CallbackHelper, |
609 &IOThreadImpl::OnGetSpdyAlternateProtocolMappings, proxy_)); | 611 &IOThreadImpl::OnGetSpdyAlternateProtocolMappings, proxy_)); |
610 web_ui()->RegisterMessageCallback( | 612 web_ui()->RegisterMessageCallback( |
611 "getQuicInfo", | 613 "getQuicInfo", |
612 base::Bind(&IOThreadImpl::CallbackHelper, | 614 base::Bind(&IOThreadImpl::CallbackHelper, |
613 &IOThreadImpl::OnGetQuicInfo, proxy_)); | 615 &IOThreadImpl::OnGetQuicInfo, proxy_)); |
616 web_ui()->RegisterMessageCallback( | |
617 "getSdchInfo", | |
618 base::Bind( | |
619 &IOThreadImpl::CallbackHelper, &IOThreadImpl::OnGetSdchInfo, proxy_)); | |
mmenke
2014/10/29 22:20:44
Note: I added a new file net/base/net_log_util wi
| |
614 #if defined(OS_WIN) | 620 #if defined(OS_WIN) |
615 web_ui()->RegisterMessageCallback( | 621 web_ui()->RegisterMessageCallback( |
616 "getServiceProviders", | 622 "getServiceProviders", |
617 base::Bind(&IOThreadImpl::CallbackHelper, | 623 base::Bind(&IOThreadImpl::CallbackHelper, |
618 &IOThreadImpl::OnGetServiceProviders, proxy_)); | 624 &IOThreadImpl::OnGetServiceProviders, proxy_)); |
619 #endif | 625 #endif |
620 | 626 |
621 web_ui()->RegisterMessageCallback( | 627 web_ui()->RegisterMessageCallback( |
622 "setLogLevel", | 628 "setLogLevel", |
623 base::Bind(&IOThreadImpl::CallbackHelper, | 629 base::Bind(&IOThreadImpl::CallbackHelper, |
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1345 const base::ListValue* list) { | 1351 const base::ListValue* list) { |
1346 DCHECK(!list); | 1352 DCHECK(!list); |
1347 net::HttpNetworkSession* http_network_session = | 1353 net::HttpNetworkSession* http_network_session = |
1348 GetHttpNetworkSession(GetMainContext()); | 1354 GetHttpNetworkSession(GetMainContext()); |
1349 | 1355 |
1350 base::Value* quic_info = http_network_session ? | 1356 base::Value* quic_info = http_network_session ? |
1351 http_network_session->QuicInfoToValue() : NULL; | 1357 http_network_session->QuicInfoToValue() : NULL; |
1352 SendJavascriptCommand("receivedQuicInfo", quic_info); | 1358 SendJavascriptCommand("receivedQuicInfo", quic_info); |
1353 } | 1359 } |
1354 | 1360 |
1361 void NetInternalsMessageHandler::IOThreadImpl::OnGetSdchInfo( | |
1362 const base::ListValue* list) { | |
1363 DCHECK(!list); | |
1364 net::SdchManager* sdch_manager = GetMainContext()->sdch_manager(); | |
1365 | |
1366 base::Value* sdch_info = | |
1367 sdch_manager ? sdch_manager->SdchInfoToValue() : NULL; | |
1368 SendJavascriptCommand("receivedSdchInfo", sdch_info); | |
1369 } | |
1370 | |
1355 #if defined(OS_WIN) | 1371 #if defined(OS_WIN) |
1356 void NetInternalsMessageHandler::IOThreadImpl::OnGetServiceProviders( | 1372 void NetInternalsMessageHandler::IOThreadImpl::OnGetServiceProviders( |
1357 const base::ListValue* list) { | 1373 const base::ListValue* list) { |
1358 DCHECK(!list); | 1374 DCHECK(!list); |
1359 | 1375 |
1360 base::DictionaryValue* service_providers = new base::DictionaryValue(); | 1376 base::DictionaryValue* service_providers = new base::DictionaryValue(); |
1361 | 1377 |
1362 WinsockLayeredServiceProviderList layered_providers; | 1378 WinsockLayeredServiceProviderList layered_providers; |
1363 GetWinsockLayeredServiceProviders(&layered_providers); | 1379 GetWinsockLayeredServiceProviders(&layered_providers); |
1364 base::ListValue* layered_provider_list = new base::ListValue(); | 1380 base::ListValue* layered_provider_list = new base::ListValue(); |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1724 } | 1740 } |
1725 | 1741 |
1726 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) | 1742 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) |
1727 : WebUIController(web_ui) { | 1743 : WebUIController(web_ui) { |
1728 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); | 1744 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); |
1729 | 1745 |
1730 // Set up the chrome://net-internals/ source. | 1746 // Set up the chrome://net-internals/ source. |
1731 Profile* profile = Profile::FromWebUI(web_ui); | 1747 Profile* profile = Profile::FromWebUI(web_ui); |
1732 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); | 1748 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); |
1733 } | 1749 } |
OLD | NEW |