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

Unified Diff: net/url_request/url_request_http_job.cc

Issue 133663003: Fix crash due to use of null transaction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@defer_1_net
Patch Set: Created 6 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e77a03b1c5347986c7e1189ae8ca12316617c3be..d483f0c82cd8a085331f06365d200f0ccc90cccb 100644
--- a/net/url_request/url_request_http_job.cc
+++ b/net/url_request/url_request_http_job.cc
@@ -414,9 +414,6 @@ void URLRequestHttpJob::StartTransactionInternal() {
rv = request_->context()->http_transaction_factory()->CreateTransaction(
priority_, &transaction_);
- transaction_->SetBeforeNetworkStartCallback(base::Bind(
- &URLRequestHttpJob::NotifyBeforeNetworkStart, base::Unretained(this)));
-
if (rv == OK && request_info_.url.SchemeIsWSOrWSS()) {
// TODO(ricea): Implement WebSocket throttling semantics as defined in
// RFC6455 Section 4.1.
@@ -431,6 +428,10 @@ void URLRequestHttpJob::StartTransactionInternal() {
}
if (rv == OK) {
+ transaction_->SetBeforeNetworkStartCallback(
+ base::Bind(&URLRequestHttpJob::NotifyBeforeNetworkStart,
+ base::Unretained(this)));
+
if (!throttling_entry_.get() ||
!throttling_entry_->ShouldRejectRequest(*request_)) {
rv = transaction_->Start(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698