• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2012 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 // This class is useful for building a simple URLRequestContext. Most creators
6 // of new URLRequestContexts should use this helper class to construct it. Call
7 // any configuration params, and when done, invoke Build() to construct the
8 // URLRequestContext. This URLRequestContext will own all its own storage.
9 //
10 // URLRequestContextBuilder and its associated params classes are initially
11 // populated with "sane" default values. Read through the comments to figure out
12 // what these are.
13 
14 #ifndef NET_URL_REQUEST_URL_REQUEST_CONTEXT_BUILDER_H_
15 #define NET_URL_REQUEST_URL_REQUEST_CONTEXT_BUILDER_H_
16 
17 #include <stdint.h>
18 
19 #include <map>
20 #include <memory>
21 #include <optional>
22 #include <string>
23 #include <utility>
24 #include <vector>
25 
26 #include "base/files/file_path.h"
27 #include "base/functional/callback.h"
28 #include "base/memory/raw_ptr.h"
29 #include "base/memory/scoped_refptr.h"
30 #include "base/task/task_traits.h"
31 #include "base/types/optional_ref.h"
32 #include "build/build_config.h"
33 #include "build/buildflag.h"
34 #include "net/base/net_export.h"
35 #include "net/base/network_delegate.h"
36 #include "net/base/network_handle.h"
37 #include "net/base/proxy_delegate.h"
38 #include "net/disk_cache/disk_cache.h"
39 #include "net/dns/host_resolver.h"
40 #include "net/http/http_network_session.h"
41 #include "net/net_buildflags.h"
42 #include "net/network_error_logging/network_error_logging_service.h"
43 #include "net/proxy_resolution/proxy_config_service.h"
44 #include "net/proxy_resolution/proxy_resolution_service.h"
45 #include "net/socket/client_socket_factory.h"
46 #include "net/ssl/ssl_config_service.h"
47 #include "net/third_party/quiche/src/quiche/quic/core/quic_packets.h"
48 #include "net/url_request/url_request_job_factory.h"
49 
50 namespace net {
51 
52 class CertVerifier;
53 class ClientSocketFactory;
54 class CookieStore;
55 class HttpAuthHandlerFactory;
56 class HttpTransactionFactory;
57 class HttpUserAgentSettings;
58 class HttpServerProperties;
59 class HostResolverManager;
60 class NetworkQualityEstimator;
61 class ProxyConfigService;
62 class URLRequestContext;
63 
64 #if BUILDFLAG(ENABLE_REPORTING)
65 struct ReportingPolicy;
66 class PersistentReportingAndNelStore;
67 #endif  // BUILDFLAG(ENABLE_REPORTING)
68 
69 #if BUILDFLAG(ENABLE_DEVICE_BOUND_SESSIONS)
70 namespace device_bound_sessions {
71 class SessionService;
72 }
73 #endif  // BUILDFLAG(ENABLE_DEVICE_BOUND_SESSIONS)
74 
75 // A URLRequestContextBuilder creates a single URLRequestContext. It provides
76 // methods to manage various URLRequestContext components which should be called
77 // before creating the Context. Once configuration is complete, calling Build()
78 // will create a URLRequestContext with the specified configuration. Components
79 // that are not explicitly configured will use reasonable in-memory defaults.
80 //
81 // The returned URLRequestContext is self-contained: Deleting it will safely
82 // shut down all of the URLRequests owned by its internal components, and then
83 // tear down those components. The only exception to this are objects not owned
84 // by URLRequestContext. This includes components passed in to the methods that
85 // take raw pointers, and objects that components passed in to the Builder have
86 // raw pointers to.
87 //
88 // A Builder should be destroyed after calling Build, and there is no need to
89 // keep it around for the lifetime of the created URLRequestContext. Each
90 // Builder may be used to create only a single URLRequestContext.
91 class NET_EXPORT URLRequestContextBuilder {
92  public:
93   // Creates an HttpNetworkTransactionFactory given an HttpNetworkSession. Does
94   // not take ownership of the session.
95   using CreateHttpTransactionFactoryCallback =
96       base::OnceCallback<std::unique_ptr<HttpTransactionFactory>(
97           HttpNetworkSession* session)>;
98 
99   struct NET_EXPORT HttpCacheParams {
100     enum Type {
101       // In-memory cache.
102       IN_MEMORY,
103       // Disk cache using "default" backend.
104       DISK,
105       // Disk cache using "blockfile" backend (BackendImpl).
106       DISK_BLOCKFILE,
107       // Disk cache using "simple" backend (SimpleBackendImpl).
108       DISK_SIMPLE,
109     };
110 
111     HttpCacheParams();
112     ~HttpCacheParams();
113 
114     // The type of HTTP cache. Default is IN_MEMORY.
115     Type type = IN_MEMORY;
116 
117     // The max size of the cache in bytes. Default is algorithmically determined
118     // based off available disk space.
119     int max_size = 0;
120 
121     // Whether or not we need to reset the cache due to an experiment change.
122     bool reset_cache = false;
123 
124     // The cache path (when type is DISK).
125     base::FilePath path;
126 
127     // A factory to broker file operations. This is needed for network process
128     // sandboxing in some platforms.
129     scoped_refptr<disk_cache::BackendFileOperationsFactory>
130         file_operations_factory;
131 
132 #if BUILDFLAG(IS_ANDROID)
133     // If this is set, will override the default ApplicationStatusListener. This
134     // is useful if the cache will not be in the main process.
135     disk_cache::ApplicationStatusListenerGetter app_status_listener_getter;
136 #endif
137   };
138 
139   URLRequestContextBuilder();
140 
141   URLRequestContextBuilder(const URLRequestContextBuilder&) = delete;
142   URLRequestContextBuilder& operator=(const URLRequestContextBuilder&) = delete;
143 
144   virtual ~URLRequestContextBuilder();
145 
146   // Sets whether Brotli compression is enabled.  Disabled by default;
set_enable_brotli(bool enable_brotli)147   void set_enable_brotli(bool enable_brotli) { enable_brotli_ = enable_brotli; }
148 
149   // Sets whether Zstd compression is enabled. Disabled by default.
set_enable_zstd(bool enable_zstd)150   void set_enable_zstd(bool enable_zstd) { enable_zstd_ = enable_zstd; }
151 
152   // Sets whether Compression Dictionary is enabled. Disabled by default.
set_enable_shared_dictionary(bool enable_shared_dictionary)153   void set_enable_shared_dictionary(bool enable_shared_dictionary) {
154     enable_shared_dictionary_ = enable_shared_dictionary;
155   }
156 
157   // Sets whether SZSTD of Compression Dictionary is enabled. Disabled by
158   // default.
set_enable_shared_zstd(bool enable_shared_zstd)159   void set_enable_shared_zstd(bool enable_shared_zstd) {
160     enable_shared_zstd_ = enable_shared_zstd;
161   }
162 
163   // Sets the |check_cleartext_permitted| flag, which controls whether to check
164   // system policy before allowing a cleartext http or ws request.
set_check_cleartext_permitted(bool value)165   void set_check_cleartext_permitted(bool value) {
166     check_cleartext_permitted_ = value;
167   }
168 
set_require_network_anonymization_key(bool value)169   void set_require_network_anonymization_key(bool value) {
170     require_network_anonymization_key_ = value;
171   }
172 
173   // Unlike most other setters, the builder does not take ownership of the
174   // NetworkQualityEstimator.
set_network_quality_estimator(NetworkQualityEstimator * network_quality_estimator)175   void set_network_quality_estimator(
176       NetworkQualityEstimator* network_quality_estimator) {
177     network_quality_estimator_ = network_quality_estimator;
178   }
179 
180   // These functions are mutually exclusive.  The ProxyConfigService, if
181   // set, will be used to construct a ConfiguredProxyResolutionService.
set_proxy_config_service(std::unique_ptr<ProxyConfigService> proxy_config_service)182   void set_proxy_config_service(
183       std::unique_ptr<ProxyConfigService> proxy_config_service) {
184     proxy_config_service_ = std::move(proxy_config_service);
185   }
186 
187   // Sets whether quick PAC checks are enabled. Defaults to true. Ignored if
188   // a ConfiguredProxyResolutionService is set directly.
set_pac_quick_check_enabled(bool pac_quick_check_enabled)189   void set_pac_quick_check_enabled(bool pac_quick_check_enabled) {
190     pac_quick_check_enabled_ = pac_quick_check_enabled;
191   }
192 
193   // Sets the proxy service. If one is not provided, by default, uses system
194   // libraries to evaluate PAC scripts, if available (And if not, skips PAC
195   // resolution). Subclasses may override CreateProxyResolutionService for
196   // different default behavior.
set_proxy_resolution_service(std::unique_ptr<ProxyResolutionService> proxy_resolution_service)197   void set_proxy_resolution_service(
198       std::unique_ptr<ProxyResolutionService> proxy_resolution_service) {
199     proxy_resolution_service_ = std::move(proxy_resolution_service);
200   }
201 
set_ssl_config_service(std::unique_ptr<SSLConfigService> ssl_config_service)202   void set_ssl_config_service(
203       std::unique_ptr<SSLConfigService> ssl_config_service) {
204     ssl_config_service_ = std::move(ssl_config_service);
205   }
206 
207   // Call these functions to specify hard-coded Accept-Language
208   // or User-Agent header values for all requests that don't
209   // have the headers already set.
210   void set_accept_language(const std::string& accept_language);
211   void set_user_agent(const std::string& user_agent);
212 
213   // Makes the created URLRequestContext use a particular HttpUserAgentSettings
214   // object. Not compatible with set_accept_language() / set_user_agent().
215   //
216   // The object will be live until the URLRequestContext is destroyed.
217   void set_http_user_agent_settings(
218       std::unique_ptr<HttpUserAgentSettings> http_user_agent_settings);
219 
220   // Sets a valid ProtocolHandler for a scheme.
221   // A ProtocolHandler already exists for |scheme| will be overwritten.
222   void SetProtocolHandler(
223       const std::string& scheme,
224       std::unique_ptr<URLRequestJobFactory::ProtocolHandler> protocol_handler);
225 
226   // Unlike the other setters, the builder does not take ownership of the
227   // NetLog.
228   // TODO(mmenke):  Probably makes sense to get rid of this, and have consumers
229   // set their own NetLog::Observers instead.
set_net_log(NetLog * net_log)230   void set_net_log(NetLog* net_log) { net_log_ = net_log; }
231 
232   // Sets a HostResolver instance to be used instead of default construction.
233   // Should not be used if set_host_resolver_manager(),
234   // set_host_mapping_rules(), or set_host_resolver_factory() are used. On
235   // building the context, will call HostResolver::SetRequestContext, so
236   // |host_resolver| may not already be associated with a context.
237   void set_host_resolver(std::unique_ptr<HostResolver> host_resolver);
238 
239   // If set to non-empty, the mapping rules will be applied to requests to the
240   // created host resolver. See MappedHostResolver for details. Should not be
241   // used if set_host_resolver() is used.
242   void set_host_mapping_rules(std::string host_mapping_rules);
243 
244   // Sets a shared HostResolverManager to be used for created HostResolvers.
245   // Should not be used if set_host_resolver() is used. The consumer must ensure
246   // |manager| outlives the URLRequestContext returned by the builder.
247   void set_host_resolver_manager(HostResolverManager* manager);
248 
249   // Sets the factory used for any HostResolverCreation. By default, a default
250   // implementation will be used. Should not be used if set_host_resolver() is
251   // used.
252   void set_host_resolver_factory(HostResolver::Factory* factory);
253 
254   // Uses NetworkDelegateImpl by default. Note that calling Build will unset
255   // any custom delegate in builder, so this must be called each time before
256   // Build is called.
257   // Returns a raw pointer to the set delegate.
258   template <typename T>
set_network_delegate(std::unique_ptr<T> delegate)259   T* set_network_delegate(std::unique_ptr<T> delegate) {
260     network_delegate_ = std::move(delegate);
261     return static_cast<T*>(network_delegate_.get());
262   }
263 
264   // Sets the ProxyDelegate.
265   void set_proxy_delegate(std::unique_ptr<ProxyDelegate> proxy_delegate);
266 
267   // Sets a specific HttpAuthHandlerFactory to be used by the URLRequestContext
268   // rather than the default |HttpAuthHandlerRegistryFactory|. The builder
269   // takes ownership of the factory and will eventually transfer it to the new
270   // URLRequestContext.
271   void SetHttpAuthHandlerFactory(
272       std::unique_ptr<HttpAuthHandlerFactory> factory);
273 
274   // By default HttpCache is enabled with a default constructed HttpCacheParams.
275   void EnableHttpCache(const HttpCacheParams& params);
276   void DisableHttpCache();
277 
278   // Override default HttpNetworkSessionParams settings.
set_http_network_session_params(const HttpNetworkSessionParams & http_network_session_params)279   void set_http_network_session_params(
280       const HttpNetworkSessionParams& http_network_session_params) {
281     http_network_session_params_ = http_network_session_params;
282   }
283 
set_transport_security_persister_file_path(const base::FilePath & transport_security_persister_file_path)284   void set_transport_security_persister_file_path(
285       const base::FilePath& transport_security_persister_file_path) {
286     transport_security_persister_file_path_ =
287         transport_security_persister_file_path;
288   }
289 
set_hsts_policy_bypass_list(const std::vector<std::string> & hsts_policy_bypass_list)290   void set_hsts_policy_bypass_list(
291       const std::vector<std::string>& hsts_policy_bypass_list) {
292     hsts_policy_bypass_list_ = hsts_policy_bypass_list;
293   }
294 
295   void SetSpdyAndQuicEnabled(bool spdy_enabled, bool quic_enabled);
296 
297   void set_sct_auditing_delegate(
298       std::unique_ptr<SCTAuditingDelegate> sct_auditing_delegate);
299   void set_quic_context(std::unique_ptr<QuicContext> quic_context);
300 
301   void SetCertVerifier(std::unique_ptr<CertVerifier> cert_verifier);
302 
303 #if BUILDFLAG(ENABLE_REPORTING)
304   void set_reporting_service(
305       std::unique_ptr<ReportingService> reporting_service);
306   void set_reporting_policy(std::unique_ptr<ReportingPolicy> reporting_policy);
307 
set_network_error_logging_enabled(bool network_error_logging_enabled)308   void set_network_error_logging_enabled(bool network_error_logging_enabled) {
309     network_error_logging_enabled_ = network_error_logging_enabled;
310   }
311 
312   template <typename T>
SetNetworkErrorLoggingServiceForTesting(std::unique_ptr<T> service)313   T* SetNetworkErrorLoggingServiceForTesting(std::unique_ptr<T> service) {
314     network_error_logging_service_ = std::move(service);
315     return static_cast<T*>(network_error_logging_service_.get());
316   }
317 
318   void set_persistent_reporting_and_nel_store(
319       std::unique_ptr<PersistentReportingAndNelStore>
320           persistent_reporting_and_nel_store);
321 
322   void set_enterprise_reporting_endpoints(
323       const base::flat_map<std::string, GURL>& enterprise_reporting_endpoints);
324 #endif  // BUILDFLAG(ENABLE_REPORTING)
325 
326   // Override the default in-memory cookie store. If |cookie_store| is NULL,
327   // CookieStore will be disabled for this context.
328   void SetCookieStore(std::unique_ptr<CookieStore> cookie_store);
329 
330   // Sets a specific HttpServerProperties for use in the
331   // URLRequestContext rather than creating a default HttpServerPropertiesImpl.
332   void SetHttpServerProperties(
333       std::unique_ptr<HttpServerProperties> http_server_properties);
334 
335   // Sets a callback that will be used to create the
336   // HttpNetworkTransactionFactory. If a cache is enabled, the cache's
337   // HttpTransactionFactory will wrap the one this creates.
338   // TODO(mmenke): Get rid of this. See https://crbug.com/721408
339   void SetCreateHttpTransactionFactoryCallback(
340       CreateHttpTransactionFactoryCallback
341           create_http_network_transaction_factory);
342 
343   template <typename T>
SetHttpTransactionFactoryForTesting(std::unique_ptr<T> factory)344   T* SetHttpTransactionFactoryForTesting(std::unique_ptr<T> factory) {
345     create_http_network_transaction_factory_.Reset();
346     http_transaction_factory_ = std::move(factory);
347     return static_cast<T*>(http_transaction_factory_.get());
348   }
349 
350   // Sets a ClientSocketFactory so a test can mock out sockets. This must
351   // outlive the URLRequestContext that will be built.
set_client_socket_factory_for_testing(ClientSocketFactory * client_socket_factory_for_testing)352   void set_client_socket_factory_for_testing(
353       ClientSocketFactory* client_socket_factory_for_testing) {
354     set_client_socket_factory(client_socket_factory_for_testing);
355   }
356 
357   // Sets a ClientSocketFactory when the network service sandbox is enabled. The
358   // unique_ptr is moved to a URLRequestContext once Build() is called.
set_client_socket_factory(std::unique_ptr<ClientSocketFactory> client_socket_factory)359   void set_client_socket_factory(
360       std::unique_ptr<ClientSocketFactory> client_socket_factory) {
361     set_client_socket_factory(client_socket_factory.get());
362     client_socket_factory_ = std::move(client_socket_factory);
363   }
364 
set_cookie_deprecation_label(const std::string & label)365   void set_cookie_deprecation_label(const std::string& label) {
366     cookie_deprecation_label_ = label;
367   }
368 
369 #if BUILDFLAG(ENABLE_DEVICE_BOUND_SESSIONS)
370   void set_device_bound_session_service(
371       std::unique_ptr<device_bound_sessions::SessionService>
372           device_bound_session_service);
373 #endif  // BUILDFLAG(ENABLE_DEVICE_BOUND_SESSIONS)
374 
set_has_device_bound_session_service(bool enable)375   void set_has_device_bound_session_service(bool enable) {
376 #if BUILDFLAG(ENABLE_DEVICE_BOUND_SESSIONS)
377     has_device_bound_session_service_ = enable;
378 #else
379     NOTREACHED();
380 #endif  // BUILDFLAG(ENABLE_DEVICE_BOUND_SESSIONS)
381   }
382 
set_device_bound_sessions_file_path(const base::FilePath & device_bound_sessions_file_path)383   void set_device_bound_sessions_file_path(
384       const base::FilePath& device_bound_sessions_file_path) {
385 #if BUILDFLAG(ENABLE_DEVICE_BOUND_SESSIONS)
386     device_bound_sessions_file_path_ = device_bound_sessions_file_path;
387 #else
388     NOTREACHED();
389 #endif  // BUILDFLAG(ENABLE_DEVICE_BOUND_SESSIONS)
390   }
391 
392   // Binds the context to `network`. All requests scheduled through the context
393   // built by this builder will be sent using `network`. Requests will fail if
394   // `network` disconnects. `options` allows to specify the ManagerOptions that
395   // will be passed to the special purpose HostResolver created internally.
396   // This also imposes some limitations on the context capabilities:
397   // * By design, QUIC connection migration will be turned off.
398   // Only implemented for Android (API level > 23).
399   void BindToNetwork(
400       handles::NetworkHandle network,
401       std::optional<HostResolver::ManagerOptions> options = std::nullopt);
402 
403   // Creates a mostly self-contained URLRequestContext. May only be called once
404   // per URLRequestContextBuilder. After this is called, the Builder can be
405   // safely destroyed.
406   std::unique_ptr<URLRequestContext> Build();
407 
SuppressSettingSocketPerformanceWatcherFactoryForTesting()408   void SuppressSettingSocketPerformanceWatcherFactoryForTesting() {
409     suppress_setting_socket_performance_watcher_factory_for_testing_ = true;
410   }
411 
412  protected:
413   // Lets subclasses override ProxyResolutionService creation, using a
414   // ProxyResolutionService that uses the URLRequestContext itself to get PAC
415   // scripts. When this method is invoked, the URLRequestContext is not yet
416   // ready to service requests.
417   virtual std::unique_ptr<ProxyResolutionService> CreateProxyResolutionService(
418       std::unique_ptr<ProxyConfigService> proxy_config_service,
419       URLRequestContext* url_request_context,
420       HostResolver* host_resolver,
421       NetworkDelegate* network_delegate,
422       NetLog* net_log,
423       bool pac_quick_check_enabled);
424 
425  private:
426   // Extracts the component pointers required to construct an HttpNetworkSession
427   // and copies them into the HttpNetworkSession::Context used to create the
428   // session. This function should be used to ensure that a context and its
429   // associated HttpNetworkSession are consistent.
430   static void SetHttpNetworkSessionComponents(
431       const URLRequestContext* request_context,
432       HttpNetworkSessionContext* session_context,
433       bool suppress_setting_socket_performance_watcher_factory = false,
434       ClientSocketFactory* client_socket_factory = nullptr);
435 
436   // Factory that will be used to create all client sockets used by the
437   // URLRequestContext that will be built.
438   // `client_socket_factory` must outlive the context.
set_client_socket_factory(ClientSocketFactory * client_socket_factory)439   void set_client_socket_factory(ClientSocketFactory* client_socket_factory) {
440     client_socket_factory_raw_ = client_socket_factory;
441   }
442 
443   bool enable_brotli_ = false;
444   bool enable_zstd_ = false;
445   bool enable_shared_dictionary_ = false;
446   bool enable_shared_zstd_ = false;
447   bool check_cleartext_permitted_ = false;
448   bool require_network_anonymization_key_ = false;
449   raw_ptr<NetworkQualityEstimator> network_quality_estimator_ = nullptr;
450 
451   std::string accept_language_;
452   std::string user_agent_;
453   std::unique_ptr<HttpUserAgentSettings> http_user_agent_settings_;
454 
455   std::optional<std::string> cookie_deprecation_label_;
456 
457   bool http_cache_enabled_ = true;
458   bool cookie_store_set_by_client_ = false;
459   bool suppress_setting_socket_performance_watcher_factory_for_testing_ = false;
460 
461   handles::NetworkHandle bound_network_ = handles::kInvalidNetworkHandle;
462   // Used only if the context is bound to a network to customize the
463   // HostResolver created internally.
464   HostResolver::ManagerOptions manager_options_;
465 
466   HttpCacheParams http_cache_params_;
467   HttpNetworkSessionParams http_network_session_params_;
468   CreateHttpTransactionFactoryCallback create_http_network_transaction_factory_;
469   std::unique_ptr<HttpTransactionFactory> http_transaction_factory_;
470   base::FilePath transport_security_persister_file_path_;
471   std::vector<std::string> hsts_policy_bypass_list_;
472   raw_ptr<NetLog> net_log_ = nullptr;
473   std::unique_ptr<HostResolver> host_resolver_;
474   std::string host_mapping_rules_;
475   raw_ptr<HostResolverManager> host_resolver_manager_ = nullptr;
476   raw_ptr<HostResolver::Factory> host_resolver_factory_ = nullptr;
477   std::unique_ptr<ProxyConfigService> proxy_config_service_;
478   bool pac_quick_check_enabled_ = true;
479   std::unique_ptr<ProxyResolutionService> proxy_resolution_service_;
480   std::unique_ptr<SSLConfigService> ssl_config_service_;
481   std::unique_ptr<NetworkDelegate> network_delegate_;
482   std::unique_ptr<ProxyDelegate> proxy_delegate_;
483   std::unique_ptr<CookieStore> cookie_store_;
484   std::unique_ptr<HttpAuthHandlerFactory> http_auth_handler_factory_;
485   std::unique_ptr<CertVerifier> cert_verifier_;
486   std::unique_ptr<SCTAuditingDelegate> sct_auditing_delegate_;
487   std::unique_ptr<QuicContext> quic_context_;
488   std::unique_ptr<ClientSocketFactory> client_socket_factory_ = nullptr;
489 #if BUILDFLAG(ENABLE_REPORTING)
490   std::unique_ptr<ReportingService> reporting_service_;
491   std::unique_ptr<ReportingPolicy> reporting_policy_;
492   bool network_error_logging_enabled_ = false;
493   std::unique_ptr<NetworkErrorLoggingService> network_error_logging_service_;
494   std::unique_ptr<PersistentReportingAndNelStore>
495       persistent_reporting_and_nel_store_;
496   base::flat_map<std::string, GURL> enterprise_reporting_endpoints_ = {};
497 #endif  // BUILDFLAG(ENABLE_REPORTING)
498   std::unique_ptr<HttpServerProperties> http_server_properties_;
499   std::map<std::string, std::unique_ptr<URLRequestJobFactory::ProtocolHandler>>
500       protocol_handlers_;
501 #if BUILDFLAG(ENABLE_DEVICE_BOUND_SESSIONS)
502   bool has_device_bound_session_service_ = false;
503   std::unique_ptr<device_bound_sessions::SessionService>
504       device_bound_session_service_;
505   base::FilePath device_bound_sessions_file_path_;
506 #endif  // BUILDFLAG(ENABLE_DEVICE_BOUND_SESSIONS)
507 
508   raw_ptr<ClientSocketFactory> client_socket_factory_raw_ = nullptr;
509 };
510 
511 }  // namespace net
512 
513 #endif  // NET_URL_REQUEST_URL_REQUEST_CONTEXT_BUILDER_H_
514