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

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: Added a unit-test, not fully working yet 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 309f0fba8e281494b2c214cc74bfa3f5f1254945..2273c139a0384d9a8a23508324988f0a02a0e56b 100644
--- a/net/url_request/url_request_http_job.cc
+++ b/net/url_request/url_request_http_job.cc
@@ -342,11 +342,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();
}
@@ -357,6 +359,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 {
@@ -364,6 +370,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