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

Unified Diff: net/url_request/url_request_http_job.cc

Issue 20379: Improve modularity of recent SDCH dictionary load checkin... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 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/base/sdch_manager.cc ('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
===================================================================
--- net/url_request/url_request_http_job.cc (revision 9856)
+++ net/url_request/url_request_http_job.cc (working copy)
@@ -65,7 +65,11 @@
URLRequestHttpJob::~URLRequestHttpJob() {
if (sdch_dictionary_url_.is_valid()) {
- SdchManager::Global()->FetchDictionary(sdch_dictionary_url_);
+ // Prior to reaching the destructor, request_ has been set to a NULL
+ // pointer, so request_->url() is no longer valid in the destructor, and we
+ // use an alternate copy |request_info_.url|.
+ SdchManager::Global()->FetchDictionary(request_info_.url,
+ sdch_dictionary_url_);
}
}
@@ -454,10 +458,11 @@
// Eventually we should wait until a dictionary is requested several times
// before we even download it (so that we don't waste memory or bandwidth).
if (response_info_->headers->EnumerateHeader(&iter, name, &url_text)) {
- GURL dictionary_url = request_->url().Resolve(url_text);
- if (SdchManager::Global()->CanFetchDictionary(request_->url(),
- dictionary_url))
- sdch_dictionary_url_ = dictionary_url;
+ // request_->url() won't be valid in the destructor, so we use an
+ // alternate copy.
+ DCHECK(request_->url() == request_info_.url);
+ // Resolve suggested URL relative to request url.
+ sdch_dictionary_url_ = request_info_.url.Resolve(url_text);
}
}
« no previous file with comments | « net/base/sdch_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698