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

Unified Diff: net/url_request/url_request_context_builder.h

Issue 2939733002: Add some docs to URLRequestContextBuilder. (Closed)
Patch Set: Response to comment Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/url_request/url_request_context_builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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:
« no previous file with comments | « no previous file | net/url_request/url_request_context_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698