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

Unified Diff: net/url_request/url_request.cc

Issue 11364057: Set blocked_on_delegate_ when a URLRequest is blocked during redirects (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Fix comment Created 8 years, 1 month 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 | « net/base/net_log_event_type_list.h ('k') | net/url_request/url_request_http_job.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request.cc
===================================================================
--- net/url_request/url_request.cc (revision 167555)
+++ net/url_request/url_request.cc (working copy)
@@ -326,7 +326,8 @@
}
LoadStateWithParam URLRequest::GetLoadState() const {
- if (blocked_on_delegate_) {
+ // Only return LOAD_STATE_WAITING_FOR_DELEGATE if there's a load state param.
+ if (blocked_on_delegate_ && !load_state_param_.empty()) {
return LoadStateWithParam(LOAD_STATE_WAITING_FOR_DELEGATE,
load_state_param_);
}
@@ -651,6 +652,7 @@
RestartWithJob(job);
} else if (delegate_) {
delegate_->OnReceivedRedirect(this, location, defer_redirect);
+ // |this| may be have been destroyed here.
}
}
@@ -964,7 +966,12 @@
void URLRequest::SetBlockedOnDelegate() {
blocked_on_delegate_ = true;
- net_log_.BeginEvent(NetLog::TYPE_URL_REQUEST_BLOCKED_ON_DELEGATE);
+ if (!load_state_param_.empty()) {
+ net_log_.BeginEvent(NetLog::TYPE_URL_REQUEST_BLOCKED_ON_DELEGATE,
+ NetLog::StringCallback("delegate", &load_state_param_));
+ } else {
+ net_log_.BeginEvent(NetLog::TYPE_URL_REQUEST_BLOCKED_ON_DELEGATE);
+ }
}
void URLRequest::SetUnblockedOnDelegate() {
« no previous file with comments | « net/base/net_log_event_type_list.h ('k') | net/url_request/url_request_http_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698