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

Side by Side Diff: chrome/browser/io_thread.h

Issue 2968293002: Introduce SystemNetworkContextManager. (Closed)
Patch Set: Merge 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
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 #ifndef CHROME_BROWSER_IO_THREAD_H_ 5 #ifndef CHROME_BROWSER_IO_THREAD_H_
6 #define CHROME_BROWSER_IO_THREAD_H_ 6 #define CHROME_BROWSER_IO_THREAD_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
11 #include <map> 11 #include <map>
12 #include <memory> 12 #include <memory>
13 #include <set> 13 #include <set>
14 #include <string> 14 #include <string>
15 #include <unordered_set> 15 #include <unordered_set>
16 #include <vector> 16 #include <vector>
17 17
18 #include "base/compiler_specific.h" 18 #include "base/compiler_specific.h"
19 #include "base/macros.h" 19 #include "base/macros.h"
20 #include "base/memory/ref_counted.h" 20 #include "base/memory/ref_counted.h"
21 #include "base/memory/weak_ptr.h" 21 #include "base/memory/weak_ptr.h"
22 #include "base/strings/string_piece.h" 22 #include "base/strings/string_piece.h"
23 #include "base/time/time.h" 23 #include "base/time/time.h"
24 #include "build/build_config.h" 24 #include "build/build_config.h"
25 #include "chrome/browser/net/chrome_network_delegate.h" 25 #include "chrome/browser/net/chrome_network_delegate.h"
26 #include "chrome/browser/net/system_network_context_manager.h"
26 #include "chrome/common/features.h" 27 #include "chrome/common/features.h"
27 #include "components/metrics/data_use_tracker.h" 28 #include "components/metrics/data_use_tracker.h"
28 #include "components/prefs/pref_member.h" 29 #include "components/prefs/pref_member.h"
29 #include "components/ssl_config/ssl_config_service_manager.h" 30 #include "components/ssl_config/ssl_config_service_manager.h"
30 #include "content/public/browser/browser_thread.h" 31 #include "content/public/browser/browser_thread.h"
31 #include "content/public/browser/browser_thread_delegate.h" 32 #include "content/public/browser/browser_thread_delegate.h"
33 #include "content/public/common/network_service.mojom.h"
34 #include "content/public/network/network_service.h"
32 #include "extensions/features/features.h" 35 #include "extensions/features/features.h"
33 #include "net/base/network_change_notifier.h" 36 #include "net/base/network_change_notifier.h"
34 #include "net/http/http_network_session.h" 37 #include "net/http/http_network_session.h"
35 #include "net/nqe/network_quality_estimator.h" 38 #include "net/nqe/network_quality_estimator.h"
36 39
37 class PrefProxyConfigTracker; 40 class PrefProxyConfigTracker;
38 class PrefService; 41 class PrefService;
39 class PrefRegistrySimple; 42 class PrefRegistrySimple;
40 43
41 #if defined(OS_ANDROID) 44 #if defined(OS_ANDROID)
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 explicit SystemRequestContextLeakChecker(Globals* globals); 123 explicit SystemRequestContextLeakChecker(Globals* globals);
121 ~SystemRequestContextLeakChecker(); 124 ~SystemRequestContextLeakChecker();
122 125
123 private: 126 private:
124 Globals* const globals_; 127 Globals* const globals_;
125 }; 128 };
126 129
127 Globals(); 130 Globals();
128 ~Globals(); 131 ~Globals();
129 132
133 // In-process NetworkService for use in URLRequestContext configuration when
134 // the actual network service is disabled. See SystemNetworkContextManager's
asanka 2017/07/13 01:52:29 s/actual/out-of-process/ ?
mmenke 2017/07/13 16:15:18 Except it's not necessarily out of process, as Joh
135 // header comment for more details
136 std::unique_ptr<content::NetworkService> network_service;
137
130 // Ascribes all data use in Chrome to a source, such as page loads. 138 // Ascribes all data use in Chrome to a source, such as page loads.
131 std::unique_ptr<data_use_measurement::ChromeDataUseAscriber> 139 std::unique_ptr<data_use_measurement::ChromeDataUseAscriber>
132 data_use_ascriber; 140 data_use_ascriber;
133 // Global aggregator of data use. It must outlive the 141 // Global aggregator of data use. It must outlive the
134 // |system_network_delegate|. 142 // |system_network_delegate|.
135 std::unique_ptr<data_usage::DataUseAggregator> data_use_aggregator; 143 std::unique_ptr<data_usage::DataUseAggregator> data_use_aggregator;
136 #if defined(OS_ANDROID) 144 #if defined(OS_ANDROID)
137 // An external observer of data use. 145 // An external observer of data use.
138 std::unique_ptr<chrome::android::ExternalDataUseObserver> 146 std::unique_ptr<chrome::android::ExternalDataUseObserver>
139 external_data_use_observer; 147 external_data_use_observer;
140 #endif // defined(OS_ANDROID) 148 #endif // defined(OS_ANDROID)
141 std::vector<scoped_refptr<const net::CTLogVerifier>> ct_logs; 149 std::vector<scoped_refptr<const net::CTLogVerifier>> ct_logs;
142 std::unique_ptr<net::HttpAuthPreferences> http_auth_preferences; 150 std::unique_ptr<net::HttpAuthPreferences> http_auth_preferences;
143 std::unique_ptr<net::URLRequestContext> system_request_context; 151 std::unique_ptr<content::mojom::NetworkContext> system_network_context;
152 net::URLRequestContext* system_request_context;
144 SystemRequestContextLeakChecker system_request_context_leak_checker; 153 SystemRequestContextLeakChecker system_request_context_leak_checker;
145 #if BUILDFLAG(ENABLE_EXTENSIONS) 154 #if BUILDFLAG(ENABLE_EXTENSIONS)
146 scoped_refptr<extensions::EventRouterForwarder> 155 scoped_refptr<extensions::EventRouterForwarder>
147 extension_event_router_forwarder; 156 extension_event_router_forwarder;
148 #endif 157 #endif
149 std::unique_ptr<net::HostMappingRules> host_mapping_rules; 158 std::unique_ptr<net::HostMappingRules> host_mapping_rules;
150 std::unique_ptr<net::NetworkQualityEstimator> network_quality_estimator; 159 std::unique_ptr<net::NetworkQualityEstimator> network_quality_estimator;
151 std::unique_ptr<net::RTTAndThroughputEstimatesObserver> 160 std::unique_ptr<net::RTTAndThroughputEstimatesObserver>
152 network_quality_observer; 161 network_quality_observer;
153 162
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 // No PrefMember for the GSSAPI library name, since changing it after startup 325 // No PrefMember for the GSSAPI library name, since changing it after startup
317 // requires unloading the existing GSSAPI library, which could cause all sorts 326 // requires unloading the existing GSSAPI library, which could cause all sorts
318 // of problems for, for example, active Negotiate transactions. 327 // of problems for, for example, active Negotiate transactions.
319 std::string gssapi_library_name_; 328 std::string gssapi_library_name_;
320 #endif 329 #endif
321 330
322 #if defined(OS_CHROMEOS) 331 #if defined(OS_CHROMEOS)
323 bool allow_gssapi_library_load_; 332 bool allow_gssapi_library_load_;
324 #endif 333 #endif
325 334
335 // These are set on the IOThread, and then consumed during initialization on
asanka 2017/07/13 01:52:29 ... are set on the UI thread, and then ... on the
mmenke 2017/07/13 16:15:18 Done.
336 // the IOThread.
337 content::mojom::NetworkContextRequest network_context_request_;
338 content::mojom::NetworkContextParamsPtr network_context_params_;
339
326 // This is an instance of the default SSLConfigServiceManager for the current 340 // This is an instance of the default SSLConfigServiceManager for the current
327 // platform and it gets SSL preferences from local_state object. 341 // platform and it gets SSL preferences from local_state object.
328 std::unique_ptr<ssl_config::SSLConfigServiceManager> 342 std::unique_ptr<ssl_config::SSLConfigServiceManager>
329 ssl_config_service_manager_; 343 ssl_config_service_manager_;
330 344
331 // These member variables are initialized by a task posted to the IO thread, 345 // These member variables are initialized by a task posted to the IO thread,
332 // which gets posted by calling certain member functions of IOThread. 346 // which gets posted by calling certain member functions of IOThread.
333 std::unique_ptr<net::ProxyConfigService> system_proxy_config_service_; 347 std::unique_ptr<net::ProxyConfigService> system_proxy_config_service_;
334 348
335 std::unique_ptr<PrefProxyConfigTracker> pref_proxy_config_tracker_; 349 std::unique_ptr<PrefProxyConfigTracker> pref_proxy_config_tracker_;
336 350
337 scoped_refptr<net::URLRequestContextGetter> 351 scoped_refptr<net::URLRequestContextGetter>
338 system_url_request_context_getter_; 352 system_url_request_context_getter_;
339 353
340 // True if QUIC is allowed by policy. 354 // True if QUIC is allowed by policy.
341 bool is_quic_allowed_by_policy_; 355 bool is_quic_allowed_by_policy_;
342 356
343 // True if HTTP/0.9 is allowed on non-default ports by policy. 357 // True if HTTP/0.9 is allowed on non-default ports by policy.
344 bool http_09_on_non_default_ports_enabled_; 358 bool http_09_on_non_default_ports_enabled_;
345 359
346 const base::TimeTicks creation_time_; 360 const base::TimeTicks creation_time_;
347 361
348 base::WeakPtrFactory<IOThread> weak_factory_; 362 base::WeakPtrFactory<IOThread> weak_factory_;
349 363
350 DISALLOW_COPY_AND_ASSIGN(IOThread); 364 DISALLOW_COPY_AND_ASSIGN(IOThread);
351 }; 365 };
352 366
353 #endif // CHROME_BROWSER_IO_THREAD_H_ 367 #endif // CHROME_BROWSER_IO_THREAD_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698