Chromium Code Reviews| Index: net/url_request/url_request_context_builder.h |
| diff --git a/net/url_request/url_request_context_builder.h b/net/url_request/url_request_context_builder.h |
| index c37eb21e4f96c7ecfe288eaa9c3faf6d691fa907..96bb2b76590f6e69cd36d327d89bd2801f4430e6 100644 |
| --- a/net/url_request/url_request_context_builder.h |
| +++ b/net/url_request/url_request_context_builder.h |
| @@ -56,6 +56,22 @@ class ProxyConfigService; |
| class URLRequestContext; |
| class URLRequestInterceptor; |
| +// A URLRequestContextBuilder creates a single URLRequestContext. Provides |
|
Randy Smith (Not in Mondays)
2017/06/13 16:28:00
nit, suggestion: "It provides methods .. which sho
mmenke
2017/06/13 16:33:24
Done.
|
| +// methods to manage various URLRequestContext components before creating the |
| +// Context. Once configuration is complete, calling Build() will create a |
| +// URLRequestContext with the specified configuration. Components that are not |
| +// explicitly configured will use reasonable in-memory defaults. |
| +// |
| +// The returned URLRequestContext is self-contained: Deleting it will safely |
| +// shut down all of the URLRequests owned by its internal components, and then |
| +// tear down those components. The only exception to this are objects not owned |
| +// by URLRequestContext. This includes components passed in to the methods that |
| +// take raw pointers, and objects that components passed in to the Builder have |
| +// raw pointers to. |
| +// |
| +// A Builder should be destroyed after calling Build, and there is no need to |
| +// keep it around for the lifetime of the created URLRequestContext. Each |
| +// Builder may be used to create only a single URLRequestContext. |
| class NET_EXPORT URLRequestContextBuilder { |
| public: |
| struct NET_EXPORT HttpCacheParams { |
| @@ -314,6 +330,9 @@ class NET_EXPORT URLRequestContextBuilder { |
| void SetHttpServerProperties( |
| std::unique_ptr<HttpServerProperties> http_server_properties); |
| + // Creates a mostly self-contained URLRequestContext. May only be called once |
| + // per URLRequestContextBuilder. After this is called, the Builder can be |
| + // safely destroyed. |
| std::unique_ptr<URLRequestContext> Build(); |
| protected: |