summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-19 02:11:08 +0000
committerakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-19 02:11:08 +0000
commit1a2337dae4710317edf3ac0f8a476f813219e523 (patch)
treed5b2579b70e2707c5e424a94222735942b84e196 /net
parentcb71709da0aae899a80ab5eda9a54fc499a591ac (diff)
downloadchromium_src-1a2337dae4710317edf3ac0f8a476f813219e523.zip
chromium_src-1a2337dae4710317edf3ac0f8a476f813219e523.tar.gz
chromium_src-1a2337dae4710317edf3ac0f8a476f813219e523.tar.bz2
This prevents crashes due to URLRequestHttpJobs hanging on past IOThread
destruction. BUG=chromium-os:8179,63692 TEST=sync integration tests Review URL: http://codereview.chromium.org/5163004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66722 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/url_request/url_request_http_job.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc
index a3e88ab..f00f490 100644
--- a/net/url_request/url_request_http_job.cc
+++ b/net/url_request/url_request_http_job.cc
@@ -77,7 +77,6 @@ URLRequestJob* URLRequestHttpJob::Factory(URLRequest* request,
URLRequestHttpJob::URLRequestHttpJob(URLRequest* request)
: URLRequestJob(request),
- context_(request->context()),
response_info_(NULL),
response_cookies_save_index_(0),
proxy_auth_state_(net::AUTH_STATE_DONT_NEED_AUTH),
@@ -609,6 +608,7 @@ void URLRequestHttpJob::DestroyTransaction() {
transaction_.reset();
response_info_ = NULL;
+ context_ = NULL;
}
void URLRequestHttpJob::StartTransaction() {
@@ -631,6 +631,9 @@ void URLRequestHttpJob::StartTransaction() {
if (rv == net::OK) {
rv = transaction_->Start(
&request_info_, &start_callback_, request_->net_log());
+ // Make sure the context is alive for the duration of the
+ // transaction.
+ context_ = request_->context();
}
}