refactor: Enable network service (Part 1) (#17431)

* Convert InspectableWebContentsImpl::LoadNetworkResource to SimpleURLLoader

https://bugs.chromium.org/p/chromium/issues/detail?id=721408

* Plumb creation of network context with the service
This commit is contained in:
Robo 2019-03-26 06:40:48 +05:30 committed by Cheng Zhao
parent 4ec2f8b67b
commit 6c20c6e668
18 changed files with 469 additions and 172 deletions

View file

@ -40,12 +40,20 @@ class NetExportFileWriter;
// using the actual network service.
class SystemNetworkContextManager {
public:
SystemNetworkContextManager();
~SystemNetworkContextManager();
// Creates the global instance of SystemNetworkContextManager. If an
// instance already exists, this will cause a DCHECK failure.
static SystemNetworkContextManager* CreateInstance(PrefService* pref_service);
// Gets the global SystemNetworkContextManager instance.
static SystemNetworkContextManager* GetInstance();
// Destroys the global SystemNetworkContextManager instance.
static void DeleteInstance();
// Returns default set of parameters for configuring the network service.
static network::mojom::NetworkContextParamsPtr
CreateDefaultNetworkContextParams();
network::mojom::NetworkContextParamsPtr CreateDefaultNetworkContextParams();
// Initializes |network_context_params| as needed to set up a system
// NetworkContext. If the network service is disabled,
@ -85,6 +93,8 @@ class SystemNetworkContextManager {
private:
class URLLoaderFactoryForSystem;
explicit SystemNetworkContextManager(PrefService* pref_service);
// Creates parameters for the NetworkContext. May only be called once, since
// it initializes some class members.
network::mojom::NetworkContextParamsPtr CreateNetworkContextParams();