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

Unified Diff: net/url_request/url_request_http_job.cc

Issue 10911151: URLRequestHttpJob::StartTransaction should honour network delegate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 2 tests split into 6 and only 4 disabled for CF Created 8 years, 3 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_http_job.cc
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc
index 901e3e758104206d81d4087fff4470093156bd85..4bffa9f8c1ea59616cc56925caf37917ed775913 100644
--- a/net/url_request/url_request_http_job.cc
+++ b/net/url_request/url_request_http_job.cc
@@ -329,11 +329,13 @@ void URLRequestHttpJob::StartTransaction() {
request_, notify_before_headers_sent_callback_,
&request_info_.extra_headers);
// If an extension blocks the request, we rely on the callback to
- // StartTransactionInternal().
+ // MaybeStartTransactionInternal().
if (rv == ERR_IO_PENDING) {
SetBlockedOnDelegate();
return;
}
+ MaybeStartTransactionInternal(rv);
+ return;
}
StartTransactionInternal();
}
@@ -344,6 +346,10 @@ void URLRequestHttpJob::NotifyBeforeSendHeadersCallback(int result) {
// Check that there are no callbacks to already canceled requests.
DCHECK_NE(URLRequestStatus::CANCELED, GetStatus().status());
+ MaybeStartTransactionInternal(result);
+}
+
+void URLRequestHttpJob::MaybeStartTransactionInternal(int result) {
if (result == OK) {
StartTransactionInternal();
} else {
@@ -351,6 +357,7 @@ void URLRequestHttpJob::NotifyBeforeSendHeadersCallback(int result) {
request_->net_log().AddEvent(NetLog::TYPE_CANCELLED,
NetLog::StringCallback("source", &source));
NotifyCanceled();
+ NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED, result));
}
}

Powered by Google App Engine
This is Rietveld 408576698