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

Unified Diff: chrome/browser/io_thread.h

Issue 2972223002: Revert https://codereview.chromium.org/2860033003 (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/io_thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/io_thread.h
diff --git a/chrome/browser/io_thread.h b/chrome/browser/io_thread.h
index 4b83d2bab9355dec9d073ca8fde636439568decc..a1069e3fc04c8ea07c620f8da5dc74739ea3f2bb 100644
--- a/chrome/browser/io_thread.h
+++ b/chrome/browser/io_thread.h
@@ -37,6 +37,7 @@
class PrefProxyConfigTracker;
class PrefService;
class PrefRegistrySimple;
+class SystemURLRequestContextGetter;
#if defined(OS_ANDROID)
namespace chrome {
@@ -54,10 +55,6 @@ namespace certificate_transparency {
class TreeStateTracker;
}
-namespace chrome {
-class TestingIOThreadState;
-}
-
namespace chrome_browser_net {
class DnsProbeService;
}
@@ -77,6 +74,8 @@ class EventRouterForwarder;
namespace net {
class CTPolicyEnforcer;
class CertVerifier;
+class ChannelIDService;
+class CookieStore;
class CTLogVerifier;
class HostMappingRules;
class HostResolver;
@@ -93,7 +92,6 @@ class SSLConfigService;
class TransportSecurityState;
class URLRequestContext;
class URLRequestContextGetter;
-class URLRequestContextStorage;
class URLRequestJobFactory;
namespace ct {
@@ -150,6 +148,8 @@ class IOThread : public content::BrowserThreadDelegate {
std::unique_ptr<net::NetworkDelegate> system_network_delegate;
std::unique_ptr<net::HostResolver> host_resolver;
std::unique_ptr<net::CertVerifier> cert_verifier;
+ // The ChannelIDService must outlive the HttpTransactionFactory.
+ std::unique_ptr<net::ChannelIDService> system_channel_id_service;
// This TransportSecurityState doesn't load or save any state. It's only
// used to enforce pinning for system requests and will only use built-in
// pins.
@@ -175,10 +175,16 @@ class IOThread : public content::BrowserThreadDelegate {
// |proxy_script_fetcher_context| for the second context. It has a direct
// ProxyService, since we always directly connect to fetch the PAC script.
std::unique_ptr<net::URLRequestContext> proxy_script_fetcher_context;
- std::unique_ptr<net::URLRequestContextStorage>
- system_request_context_storage;
+ std::unique_ptr<net::ProxyService> system_proxy_service;
+ std::unique_ptr<net::HttpNetworkSession> system_http_network_session;
+ std::unique_ptr<net::HttpTransactionFactory>
+ system_http_transaction_factory;
+ std::unique_ptr<net::URLRequestJobFactory> system_url_request_job_factory;
std::unique_ptr<net::URLRequestContext> system_request_context;
SystemRequestContextLeakChecker system_request_context_leak_checker;
+ // |system_cookie_store| and |system_channel_id_service| are shared
+ // between |proxy_script_fetcher_context| and |system_request_context|.
+ std::unique_ptr<net::CookieStore> system_cookie_store;
#if BUILDFLAG(ENABLE_EXTENSIONS)
scoped_refptr<extensions::EventRouterForwarder>
extension_event_router_forwarder;
@@ -263,8 +269,11 @@ class IOThread : public content::BrowserThreadDelegate {
bool PacHttpsUrlStrippingEnabled() const;
private:
+ // Provide SystemURLRequestContextGetter with access to
+ // InitSystemRequestContext().
+ friend class SystemURLRequestContextGetter;
+
friend class test::IOThreadPeer;
- friend class chrome::TestingIOThreadState;
// BrowserThreadDelegate implementation, runs on the IO thread.
// This handles initialization and destruction of state that must
@@ -272,6 +281,16 @@ class IOThread : public content::BrowserThreadDelegate {
void Init() override;
void CleanUp() override;
+ // Global state must be initialized on the IO thread, then this
+ // method must be invoked on the UI thread.
+ void InitSystemRequestContext();
+
+ // Lazy initialization of system request context for
+ // SystemURLRequestContextGetter. To be called on IO thread only
+ // after global state has been initialized on the IO thread, and
+ // SystemRequestContext state has been initialized on the UI thread.
+ void InitSystemRequestContextOnIOThread();
+
void CreateDefaultAuthHandlerFactory();
// Returns an SSLConfigService instance.
@@ -293,7 +312,10 @@ class IOThread : public content::BrowserThreadDelegate {
return NULL;
#endif
}
- void ConstructSystemRequestContext();
+ static net::URLRequestContext* ConstructSystemRequestContext(
+ IOThread::Globals* globals,
+ const net::HttpNetworkSession::Params& params,
+ net::NetLog* net_log);
// Parse command line flags and use components/network_session_configurator to
// configure |params|.
« no previous file with comments | « no previous file | chrome/browser/io_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698