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

Unified Diff: net/url_request/url_request.h

Issue 501163002: Make URLRequest's constructor private, and make URLRequestContext a friend class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge? Created 6 years, 4 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
Index: net/url_request/url_request.h
diff --git a/net/url_request/url_request.h b/net/url_request/url_request.h
index 5e87cdcaeda3bc6921f8916f7230fd5ba7e4209f..23ebdc3182456a1483109dfdb794f4739c02ef19 100644
--- a/net/url_request/url_request.h
+++ b/net/url_request/url_request.h
@@ -11,6 +11,7 @@
#include "base/debug/leak_tracker.h"
#include "base/logging.h"
#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
#include "base/strings/string16.h"
#include "base/supports_user_data.h"
#include "base/threading/non_thread_safe.h"
@@ -273,18 +274,6 @@ class NET_EXPORT URLRequest : NON_EXPORTED_BASE(public base::NonThreadSafe),
virtual ~Delegate() {}
};
- // URLRequests should almost always be created by calling
- // URLRequestContext::CreateRequest.
- //
- // If no cookie store or network delegate are passed in, will use the ones
- // from the URLRequestContext.
- URLRequest(const GURL& url,
- RequestPriority priority,
- Delegate* delegate,
- const URLRequestContext* context,
- CookieStore* cookie_store,
- NetworkDelegate* network_delegate);
-
// If destroyed after Start() has been called but while IO is pending,
// then the request will be effectively canceled and the delegate
// will not have any more of its methods called.
@@ -714,6 +703,19 @@ class NET_EXPORT URLRequest : NON_EXPORTED_BASE(public base::NonThreadSafe),
private:
friend class URLRequestJob;
+ friend class URLRequestContext;
+
+ // URLRequests are always be created by calling
pauljensen 2014/08/28 15:48:39 remove "be"
mmenke 2014/08/28 16:46:00 Done.
+ // URLRequestContext::CreateRequest.
+ //
+ // If no cookie store or network delegate are passed in, will use the ones
+ // from the URLRequestContext.
+ URLRequest(const GURL& url,
+ RequestPriority priority,
+ Delegate* delegate,
+ const URLRequestContext* context,
+ CookieStore* cookie_store,
+ NetworkDelegate* network_delegate);
// Registers or unregisters a network interception class.
static void RegisterRequestInterceptor(Interceptor* interceptor);

Powered by Google App Engine
This is Rietveld 408576698