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

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

Issue 2968293002: Introduce SystemNetworkContextManager. (Closed)
Patch Set: Response to comments 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.
kinuko 2017/07/11 08:26:41 nit: might be helpful to have a forwarding pointer
mmenke 2017/07/11 18:36:26 Done.
135 std::unique_ptr<content::NetworkService> network_service;
136
130 // Ascribes all data use in Chrome to a source, such as page loads. 137 // Ascribes all data use in Chrome to a source, such as page loads.
131 std::unique_ptr<data_use_measurement::ChromeDataUseAscriber> 138 std::unique_ptr<data_use_measurement::ChromeDataUseAscriber>
132 data_use_ascriber; 139 data_use_ascriber;
133 // Global aggregator of data use. It must outlive the 140 // Global aggregator of data use. It must outlive the
134 // |system_network_delegate|. 141 // |system_network_delegate|.
135 std::unique_ptr<data_usage::DataUseAggregator> data_use_aggregator; 142 std::unique_ptr<data_usage::DataUseAggregator> data_use_aggregator;
136 #if defined(OS_ANDROID) 143 #if defined(OS_ANDROID)
137 // An external observer of data use. 144 // An external observer of data use.
138 std::unique_ptr<chrome::android::ExternalDataUseObserver> 145 std::unique_ptr<chrome::android::ExternalDataUseObserver>
139 external_data_use_observer; 146 external_data_use_observer;
140 #endif // defined(OS_ANDROID) 147 #endif // defined(OS_ANDROID)
141 std::vector<scoped_refptr<const net::CTLogVerifier>> ct_logs; 148 std::vector<scoped_refptr<const net::CTLogVerifier>> ct_logs;
142 std::unique_ptr<net::HttpAuthPreferences> http_auth_preferences; 149 std::unique_ptr<net::HttpAuthPreferences> http_auth_preferences;
143 std::unique_ptr<net::URLRequestContext> system_request_context; 150 std::unique_ptr<content::mojom::NetworkContext> system_network_context;
151 net::URLRequestContext* system_request_context;
144 SystemRequestContextLeakChecker system_request_context_leak_checker; 152 SystemRequestContextLeakChecker system_request_context_leak_checker;
145 #if BUILDFLAG(ENABLE_EXTENSIONS) 153 #if BUILDFLAG(ENABLE_EXTENSIONS)
146 scoped_refptr<extensions::EventRouterForwarder> 154 scoped_refptr<extensions::EventRouterForwarder>
147 extension_event_router_forwarder; 155 extension_event_router_forwarder;
148 #endif 156 #endif
149 std::unique_ptr<net::HostMappingRules> host_mapping_rules; 157 std::unique_ptr<net::HostMappingRules> host_mapping_rules;
150 std::unique_ptr<net::NetworkQualityEstimator> network_quality_estimator; 158 std::unique_ptr<net::NetworkQualityEstimator> network_quality_estimator;
151 std::unique_ptr<net::RTTAndThroughputEstimatesObserver> 159 std::unique_ptr<net::RTTAndThroughputEstimatesObserver>
152 network_quality_observer; 160 network_quality_observer;
153 161
(...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 324 // No PrefMember for the GSSAPI library name, since changing it after startup
317 // requires unloading the existing GSSAPI library, which could cause all sorts 325 // requires unloading the existing GSSAPI library, which could cause all sorts
318 // of problems for, for example, active Negotiate transactions. 326 // of problems for, for example, active Negotiate transactions.
319 std::string gssapi_library_name_; 327 std::string gssapi_library_name_;
320 #endif 328 #endif
321 329
322 #if defined(OS_CHROMEOS) 330 #if defined(OS_CHROMEOS)
323 bool allow_gssapi_library_load_; 331 bool allow_gssapi_library_load_;
324 #endif 332 #endif
325 333
334 // These are set on the IOThread, and then consumed during initialization on
335 // the IOThread.
336 content::mojom::NetworkContextRequest network_context_request_;
337 content::mojom::NetworkContextParamsPtr network_context_params_;
338
326 // This is an instance of the default SSLConfigServiceManager for the current 339 // This is an instance of the default SSLConfigServiceManager for the current
327 // platform and it gets SSL preferences from local_state object. 340 // platform and it gets SSL preferences from local_state object.
328 std::unique_ptr<ssl_config::SSLConfigServiceManager> 341 std::unique_ptr<ssl_config::SSLConfigServiceManager>
329 ssl_config_service_manager_; 342 ssl_config_service_manager_;
330 343
331 // These member variables are initialized by a task posted to the IO thread, 344 // These member variables are initialized by a task posted to the IO thread,
332 // which gets posted by calling certain member functions of IOThread. 345 // which gets posted by calling certain member functions of IOThread.
333 std::unique_ptr<net::ProxyConfigService> system_proxy_config_service_; 346 std::unique_ptr<net::ProxyConfigService> system_proxy_config_service_;
334 347
335 std::unique_ptr<PrefProxyConfigTracker> pref_proxy_config_tracker_; 348 std::unique_ptr<PrefProxyConfigTracker> pref_proxy_config_tracker_;
336 349
337 scoped_refptr<net::URLRequestContextGetter> 350 scoped_refptr<net::URLRequestContextGetter>
338 system_url_request_context_getter_; 351 system_url_request_context_getter_;
339 352
340 // True if QUIC is allowed by policy. 353 // True if QUIC is allowed by policy.
341 bool is_quic_allowed_by_policy_; 354 bool is_quic_allowed_by_policy_;
342 355
343 // True if HTTP/0.9 is allowed on non-default ports by policy. 356 // True if HTTP/0.9 is allowed on non-default ports by policy.
344 bool http_09_on_non_default_ports_enabled_; 357 bool http_09_on_non_default_ports_enabled_;
345 358
346 const base::TimeTicks creation_time_; 359 const base::TimeTicks creation_time_;
347 360
348 base::WeakPtrFactory<IOThread> weak_factory_; 361 base::WeakPtrFactory<IOThread> weak_factory_;
349 362
350 DISALLOW_COPY_AND_ASSIGN(IOThread); 363 DISALLOW_COPY_AND_ASSIGN(IOThread);
351 }; 364 };
352 365
353 #endif // CHROME_BROWSER_IO_THREAD_H_ 366 #endif // CHROME_BROWSER_IO_THREAD_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698