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

Unified Diff: net/url_request/url_request.h

Issue 1523433002: Remove support for a URLRequest having a NULL Delegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge, remove if in file_writer_delegate Created 5 years 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 | « ios/web/net/request_tracker_impl_unittest.mm ('k') | net/url_request/url_request.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request.h
diff --git a/net/url_request/url_request.h b/net/url_request/url_request.h
index f1d90edb558fe1f40a5b2c61c2be0c9f7576dc36..e4085fc92ed8794d234df6451617af4cd2f33ab8 100644
--- a/net/url_request/url_request.h
+++ b/net/url_request/url_request.h
@@ -303,8 +303,9 @@ class NET_EXPORT URLRequest : NON_EXPORTED_BASE(public base::NonThreadSafe),
ReferrerPolicy referrer_policy() const { return referrer_policy_; }
void set_referrer_policy(ReferrerPolicy referrer_policy);
- // Sets the delegate of the request. This value may be changed at any time,
- // and it is permissible for it to be null.
+ // Sets the delegate of the request. This is only to allow creating a request
+ // before creating its delegate. |delegate| must be non-NULL and the request
+ // must not yet have a Delegate set.
void set_delegate(Delegate* delegate);
// Indicates that the request body should be sent using chunked transfer
@@ -523,7 +524,8 @@ class NET_EXPORT URLRequest : NON_EXPORTED_BASE(public base::NonThreadSafe),
uint64 identifier() const { return identifier_; }
// This method is called to start the request. The delegate will receive
- // a OnResponseStarted callback when the request is started.
+ // a OnResponseStarted callback when the request is started. The request
+ // must have a delegate set before this method is called.
void Start();
// This method may be called at any time after Start() has been called to
@@ -621,9 +623,6 @@ class NET_EXPORT URLRequest : NON_EXPORTED_BASE(public base::NonThreadSafe),
// due to HSTS. If so, |redirect_url| is rewritten to the new HTTPS URL.
bool GetHSTSRedirect(GURL* redirect_url) const;
- // TODO(willchan): Undo this. Only temporarily public.
- bool has_delegate() const { return delegate_ != NULL; }
-
// NOTE(willchan): This is just temporary for debugging
// http://crbug.com/90971.
// Allows to setting debug info into the URLRequest.
@@ -726,9 +725,8 @@ class NET_EXPORT URLRequest : NON_EXPORTED_BASE(public base::NonThreadSafe),
// occurs.
void NotifyResponseStarted();
- // These functions delegate to |delegate_| and may only be used if
- // |delegate_| is not NULL. See URLRequest::Delegate for the meaning
- // of these functions.
+ // These functions delegate to |delegate_|. See URLRequest::Delegate for the
+ // meaning of these functions.
void NotifyAuthRequired(AuthChallengeInfo* auth_info);
void NotifyAuthRequiredComplete(NetworkDelegate::AuthRequiredResponse result);
void NotifyCertificateRequested(SSLCertRequestInfo* cert_request_info);
« no previous file with comments | « ios/web/net/request_tracker_impl_unittest.mm ('k') | net/url_request/url_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698