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

Unified Diff: net/url_request/url_request_http_job.cc

Issue 851503003: Update from https://crrev.com/311076 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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 | « net/url_request/url_request_http_job.h ('k') | net/url_request/url_request_job_manager.h » ('j') | 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 8531dd32ad350be963fbfa40c329545c2086ce12..68858c147586fc902d58c50f946829c46bf543e1 100644
--- a/net/url_request/url_request_http_job.cc
+++ b/net/url_request/url_request_http_job.cc
@@ -9,6 +9,7 @@
#include "base/bind_helpers.h"
#include "base/command_line.h"
#include "base/compiler_specific.h"
+#include "base/debug/alias.h"
#include "base/file_version_info.h"
#include "base/message_loop/message_loop.h"
#include "base/metrics/field_trial.h"
@@ -207,11 +208,18 @@ URLRequestHttpJob::URLRequestHttpJob(
base::Unretained(this))),
awaiting_callback_(false),
http_user_agent_settings_(http_user_agent_settings),
+ transaction_state_(TRANSACTION_WAS_NOT_INITIALIZED),
weak_factory_(this) {
URLRequestThrottlerManager* manager = request->context()->throttler_manager();
if (manager)
throttling_entry_ = manager->RegisterRequestUrl(request->url());
+ // TODO(battre) Remove this overriding once crbug.com/289715 has been
+ // resolved.
+ on_headers_received_callback_ =
+ base::Bind(&URLRequestHttpJob::OnHeadersReceivedCallbackForDebugging,
+ weak_factory_.GetWeakPtr());
+
ResetTimer();
}
@@ -407,6 +415,7 @@ void URLRequestHttpJob::DestroyTransaction() {
DoneWithRequest(ABORTED);
transaction_.reset();
+ transaction_state_ = TRANSACTION_WAS_DESTROYED;
response_info_ = NULL;
receive_headers_end_ = base::TimeTicks();
}
@@ -468,6 +477,8 @@ void URLRequestHttpJob::StartTransactionInternal() {
rv = request_->context()->http_transaction_factory()->CreateTransaction(
priority_, &transaction_);
+ if (rv == OK)
+ transaction_state_ = TRANSACTION_WAS_INITIALIZED;
if (rv == OK && request_info_.url.SchemeIsWSOrWSS()) {
base::SupportsUserData::Data* data = request_->GetUserData(
@@ -933,6 +944,19 @@ void URLRequestHttpJob::OnStartCompleted(int result) {
}
}
+// TODO(battre) Use URLRequestHttpJob::OnHeadersReceivedCallback again, once
+// crbug.com/289715 has been resolved.
+// static
+void URLRequestHttpJob::OnHeadersReceivedCallbackForDebugging(
+ base::WeakPtr<net::URLRequestHttpJob> job,
+ int result) {
+ CHECK(job.get());
+ net::URLRequestHttpJob::TransactionState state = job->transaction_state_;
+ base::debug::Alias(&state);
+ CHECK(job->transaction_.get());
+ job->OnHeadersReceivedCallback(result);
+}
+
void URLRequestHttpJob::OnHeadersReceivedCallback(int result) {
awaiting_callback_ = false;
« no previous file with comments | « net/url_request/url_request_http_job.h ('k') | net/url_request/url_request_job_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698