Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1216)

Side by Side Diff: chrome/browser/ui/webui/net_internals/net_internals_ui.cc

Issue 2968293002: Introduce SystemNetworkContextManager. (Closed)
Patch Set: Response to comments Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/net/system_network_context_manager_browsertest.cc ('k') | chrome/test/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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()->system_request_context.get()); 1030 contexts.insert(io_thread_->globals()->system_request_context);
1031 1031
1032 // Add entries for ongoing network objects. 1032 // Add entries for ongoing network objects.
1033 CreateNetLogEntriesForActiveObjects(contexts, this); 1033 CreateNetLogEntriesForActiveObjects(contexts, this);
1034 } 1034 }
1035 1035
1036 void NetInternalsMessageHandler::IOThreadImpl::SendNetInfo(int info_sources) { 1036 void NetInternalsMessageHandler::IOThreadImpl::SendNetInfo(int info_sources) {
1037 DCHECK_CURRENTLY_ON(BrowserThread::IO); 1037 DCHECK_CURRENTLY_ON(BrowserThread::IO);
1038 SendJavascriptCommand("receivedNetInfo", 1038 SendJavascriptCommand("receivedNetInfo",
1039 net::GetNetInfo(GetMainContext(), info_sources)); 1039 net::GetNetInfo(GetMainContext(), info_sources));
1040 } 1040 }
1041 1041
1042 } // namespace 1042 } // namespace
1043 1043
1044 1044
1045 //////////////////////////////////////////////////////////////////////////////// 1045 ////////////////////////////////////////////////////////////////////////////////
1046 // 1046 //
1047 // NetInternalsUI 1047 // NetInternalsUI
1048 // 1048 //
1049 //////////////////////////////////////////////////////////////////////////////// 1049 ////////////////////////////////////////////////////////////////////////////////
1050 1050
1051 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) 1051 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui)
1052 : WebUIController(web_ui) { 1052 : WebUIController(web_ui) {
1053 web_ui->AddMessageHandler(base::MakeUnique<NetInternalsMessageHandler>()); 1053 web_ui->AddMessageHandler(base::MakeUnique<NetInternalsMessageHandler>());
1054 1054
1055 // Set up the chrome://net-internals/ source. 1055 // Set up the chrome://net-internals/ source.
1056 Profile* profile = Profile::FromWebUI(web_ui); 1056 Profile* profile = Profile::FromWebUI(web_ui);
1057 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); 1057 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource());
1058 } 1058 }
OLDNEW
« no previous file with comments | « chrome/browser/net/system_network_context_manager_browsertest.cc ('k') | chrome/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698