| 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 <memory> | 10 #include <memory> |
| (...skipping 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1020 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 1020 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 1021 if (pending_entries_) | 1021 if (pending_entries_) |
| 1022 SendJavascriptCommand("receivedLogEntries", std::move(pending_entries_)); | 1022 SendJavascriptCommand("receivedLogEntries", std::move(pending_entries_)); |
| 1023 } | 1023 } |
| 1024 | 1024 |
| 1025 void NetInternalsMessageHandler::IOThreadImpl::PrePopulateEventList() { | 1025 void NetInternalsMessageHandler::IOThreadImpl::PrePopulateEventList() { |
| 1026 // Using a set removes any duplicates. | 1026 // Using a set removes any duplicates. |
| 1027 std::set<net::URLRequestContext*> contexts; | 1027 std::set<net::URLRequestContext*> contexts; |
| 1028 for (const auto& getter : context_getters_) | 1028 for (const auto& getter : context_getters_) |
| 1029 contexts.insert(getter->GetURLRequestContext()); | 1029 contexts.insert(getter->GetURLRequestContext()); |
| 1030 contexts.insert(io_thread_->globals()->proxy_script_fetcher_context.get()); | |
| 1031 contexts.insert(io_thread_->globals()->system_request_context.get()); | 1030 contexts.insert(io_thread_->globals()->system_request_context.get()); |
| 1032 | 1031 |
| 1033 // Add entries for ongoing network objects. | 1032 // Add entries for ongoing network objects. |
| 1034 CreateNetLogEntriesForActiveObjects(contexts, this); | 1033 CreateNetLogEntriesForActiveObjects(contexts, this); |
| 1035 } | 1034 } |
| 1036 | 1035 |
| 1037 void NetInternalsMessageHandler::IOThreadImpl::SendNetInfo(int info_sources) { | 1036 void NetInternalsMessageHandler::IOThreadImpl::SendNetInfo(int info_sources) { |
| 1038 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 1037 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 1039 SendJavascriptCommand("receivedNetInfo", | 1038 SendJavascriptCommand("receivedNetInfo", |
| 1040 net::GetNetInfo(GetMainContext(), info_sources)); | 1039 net::GetNetInfo(GetMainContext(), info_sources)); |
| 1041 } | 1040 } |
| 1042 | 1041 |
| 1043 } // namespace | 1042 } // namespace |
| 1044 | 1043 |
| 1045 | 1044 |
| 1046 //////////////////////////////////////////////////////////////////////////////// | 1045 //////////////////////////////////////////////////////////////////////////////// |
| 1047 // | 1046 // |
| 1048 // NetInternalsUI | 1047 // NetInternalsUI |
| 1049 // | 1048 // |
| 1050 //////////////////////////////////////////////////////////////////////////////// | 1049 //////////////////////////////////////////////////////////////////////////////// |
| 1051 | 1050 |
| 1052 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) | 1051 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) |
| 1053 : WebUIController(web_ui) { | 1052 : WebUIController(web_ui) { |
| 1054 web_ui->AddMessageHandler(base::MakeUnique<NetInternalsMessageHandler>()); | 1053 web_ui->AddMessageHandler(base::MakeUnique<NetInternalsMessageHandler>()); |
| 1055 | 1054 |
| 1056 // Set up the chrome://net-internals/ source. | 1055 // Set up the chrome://net-internals/ source. |
| 1057 Profile* profile = Profile::FromWebUI(web_ui); | 1056 Profile* profile = Profile::FromWebUI(web_ui); |
| 1058 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); | 1057 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); |
| 1059 } | 1058 } |
| OLD | NEW |