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

Unified Diff: net/url_request/url_request_http_job.cc

Issue 810883007: Add debug information for crbug.com/289715 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.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') | 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 8531dd32ad350be963fbfa40c329545c2086ce12..45fdbd87a9bb482943752726743812f0fc59a5d5 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,6 +208,8 @@ URLRequestHttpJob::URLRequestHttpJob(
base::Unretained(this))),
awaiting_callback_(false),
http_user_agent_settings_(http_user_agent_settings),
+ destructor_was_called_(false),
+ transaction_state_(TRANSACTION_WAS_NOT_INITIALIZED),
weak_factory_(this) {
URLRequestThrottlerManager* manager = request->context()->throttler_manager();
if (manager)
@@ -218,6 +221,8 @@ URLRequestHttpJob::URLRequestHttpJob(
URLRequestHttpJob::~URLRequestHttpJob() {
CHECK(!awaiting_callback_);
+ destructor_was_called_ = true;
+
DCHECK(!sdch_test_control_ || !sdch_test_activated_);
if (!is_cached_content_) {
if (sdch_test_control_)
@@ -407,6 +412,7 @@ void URLRequestHttpJob::DestroyTransaction() {
DoneWithRequest(ABORTED);
transaction_.reset();
+ transaction_state_ = TRANSACTION_WAS_DESTROYED;
response_info_ = NULL;
receive_headers_end_ = base::TimeTicks();
}
@@ -468,6 +474,9 @@ 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(
@@ -674,7 +683,13 @@ void URLRequestHttpJob::SaveCookiesAndNotifyHeadersComplete(int result) {
return;
}
- DCHECK(transaction_.get());
+ // TODO(battre) crbug.com/289715
+ // Remove check for destructor_was_called_ and make CHECK(transaction_.get())
+ // a DCHECK again.
+ TransactionState state = transaction_state_;
+ base::debug::Alias(&state);
+ CHECK(!destructor_was_called_);
mmenke 2015/01/09 16:11:57 If the destructor was already called, what are the
battre 2015/01/09 16:46:14 Done.
+ CHECK(transaction_.get());
const HttpResponseInfo* response_info = transaction_->GetResponseInfo();
DCHECK(response_info);
« no previous file with comments | « net/url_request/url_request_http_job.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698