Introduce SystemNetworkContextManager

Desktop / Chromium - mmenke [chromium.org] - 13 July 2017 19:27 EDT

The new class provides access to the SystemURLRequestContext via an in-process NetworkService and the NetworkContext Mojo API. Eventually, we should remove IOThread entirely, and have the SystemNetworkContextManager perform all configuration of the SystemRequestContext, and provide access to it as well.

The in-process network service currently just takes a URLRequestContextBuilder from IOThread and uses that to create the URLRequestContext, but this gives us a path to switch over configuration so that it goes through the NetworkService API. It also lets us switch consumers over to using the NetworkContext API without having to create a wrapper that supports both the shiny new Mojo API the legacy one.

When network service is enabled, the SystemNetworkContextManager will use an out-of-process URLRequestContext instead of an in-process one, while the IOThread will continue to use an in-process ones.

BUG=715695

Review-Url: https://codereview.chromium.org/2968293002 Cr-Commit-Position: refs/heads/master@{#486527}

f73a512 Introduce SystemNetworkContextManager.
chrome/browser/BUILD.gn | 3 +
chrome/browser/DEPS | 4 +
chrome/browser/io_thread.cc | 73 +++++++++--------
chrome/browser/io_thread.h | 16 +++-
.../browser/net/system_network_context_manager.cc | 63 +++++++++++++++
.../browser/net/system_network_context_manager.h | 72 +++++++++++++++++
.../system_network_context_manager_browsertest.cc | 91 ++++++++++++++++++++++
.../ui/webui/net_internals/net_internals_ui.cc | 2 +-
chrome/test/BUILD.gn | 1 +
content/BUILD.gn | 3 +-
content/browser/blob_storage/blob_url_unittest.cc | 2 +-
content/browser/loader/DEPS | 12 +--
.../loader/mojo_async_resource_handler_unittest.cc | 2 +-
.../loader/url_loader_factory_impl_unittest.cc | 2 +-
content/browser/storage_partition_impl.cc | 14 +---
content/network/BUILD.gn | 5 +-
content/network/DEPS | 3 +-
content/network/network_context.cc | 16 +++-
content/network/network_context.h | 16 +++-
...{network_service.cc => network_service_impl.cc} | 55 +++++++++----
.../{network_service.h => network_service_impl.h} | 34 +++++---
content/network/network_service_unittest.cc | 4 +-
content/network/url_loader_unittest.cc | 2 +-
content/public/browser/BUILD.gn | 4 +-
content/public/browser/network_service_instance.cc | 30 +++++++
content/public/browser/network_service_instance.h | 23 ++++++
content/public/network/BUILD.gn | 35 +++++++++
content/public/network/DEPS | 5 ++
content/public/network/network_service.h | 50 ++++++++++++
.../test}/test_url_loader_client.cc | 2 +-
.../test}/test_url_loader_client.h | 10 +--
content/test/BUILD.gn | 4 +-
content/utility/utility_service_factory.cc | 4 +-
33 files changed, 552 insertions(+), 110 deletions(-)

Upstream: git.chromium.org


  • Share