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..8b6628b247a5d0fff07154fc8ca5016874eefa85 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. It provides |
+// methods to manage various URLRequestContext components which should be called |
+// 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: |