OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_NET_PROFILE_NETWORK_CONTEXT_SERVICE_H_ | |
6 #define CHROME_BROWSER_NET_PROFILE_NETWORK_CONTEXT_SERVICE_H_ | |
7 | |
8 #include "base/macros.h" | |
9 #include "components/keyed_service/core/keyed_service.h" | |
10 #include "content/public/common/network_service.mojom.h" | |
11 | |
12 class Profile; | |
13 | |
14 // KeyedService that initializes and provides access to the NetworkContexts for | |
15 // a Profile. This will eventually replace ProfileIOData. | |
16 class ProfileNetworkContextService : public KeyedService { | |
17 public: | |
18 explicit ProfileNetworkContextService(Profile* profile); | |
19 ~ProfileNetworkContextService() override; | |
20 | |
21 // Initializes |network_context_params| as needed to set up the | |
22 // ProfileIOData's main URLRequestContext (Which the caller will need to send | |
23 // to the IOThread's in-process NetworkService). If the network service is | |
24 // disabled, this will be the NetworkContext returned by the MainContext() | |
25 // method, and used by all the requests associated with a profile. If the | |
26 // network service is enabled, this method is still used, but only legacy | |
27 // requests going through the URLRequestContext interface instead of the | |
28 // NetworkContext interface will use the ProfileIOData's URLRequestContext, | |
29 // and the ProfileIOData's main URLRequestContext will be configured not to | |
30 // use on-disk storage, as the network service will be using those files | |
31 // instead. | |
Randy Smith (Not in Mondays)
2017/07/20 17:38:34
Ok, I do find this clearer. It's still somewhat h
mmenke
2017/07/20 18:31:30
Thanks so much for the detailed text - I think it'
| |
32 // | |
33 // Must be called before the system NetworkContext is first used. | |
34 void SetUpProfileIODataMainContext( | |
35 content::mojom::NetworkContextRequest* network_context_request, | |
36 content::mojom::NetworkContextParamsPtr* network_context_params); | |
37 | |
38 // Returns the main NetworkContext for the BrowserContext. | |
Randy Smith (Not in Mondays)
2017/07/20 17:38:34
suggestion: Add "If the network service is disable
mmenke
2017/07/20 18:31:30
Done.
| |
39 content::mojom::NetworkContext* MainContext(); | |
40 | |
41 // Creates the main NetworkContext for the BrowserContext. May only be called | |
Randy Smith (Not in Mondays)
2017/07/20 17:38:34
Suggest adding to first sentence ", by requesting
mmenke
2017/07/20 18:31:30
Done (Added "using the network service", "requesti
| |
42 // when the network service is enabled. Must only be called once for a | |
43 // profile, from the ChromeContentBrowserClient. | |
44 content::mojom::NetworkContextPtr CreateMainNetworkContext(); | |
45 | |
46 private: | |
47 Profile* const profile_; | |
48 | |
49 // This is a NetworkContext that wraps ProfileIOData's main URLRequestContext. | |
50 // Always initialized in SetUpProfileIODataMainContext, but it's only returned | |
51 // by Context() when the network service is disabled. | |
52 content::mojom::NetworkContextPtr profile_io_data_main_network_context_; | |
53 | |
54 DISALLOW_COPY_AND_ASSIGN(ProfileNetworkContextService); | |
55 }; | |
56 | |
57 #endif // CHROME_BROWSER_NET_PROFILE_NETWORK_CONTEXT_SERVICE_H_ | |
OLD | NEW |