diff options
author | jar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-11 21:37:04 +0000 |
---|---|---|
committer | jar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-11 21:37:04 +0000 |
commit | 7234e6cc82609038c3dbb5bd175e73d7ea93fd76 (patch) | |
tree | f9ec71ceb5f9a26d33799df74db6fb0988a20d42 /net/url_request/url_request_http_job.cc | |
parent | 568a0bebd0c3c296e473b2e434c679634e7c68bf (diff) | |
download | chromium_src-7234e6cc82609038c3dbb5bd175e73d7ea93fd76.zip chromium_src-7234e6cc82609038c3dbb5bd175e73d7ea93fd76.tar.gz chromium_src-7234e6cc82609038c3dbb5bd175e73d7ea93fd76.tar.bz2 |
Fetch SDCH dictionary as soon as current URL fetch completes
Rather than just waiting for 15 seconds, this patch fetches the
"suggested dicitionary" as soon as the current download completes.
This avoids stealing bandwidth from the original download, but
works as quickly as possible to get the dictionary, so that the
user can receive compression results asap.
r=wtc
Review URL: http://codereview.chromium.org/20254
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9597 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/url_request/url_request_http_job.cc')
-rw-r--r-- | net/url_request/url_request_http_job.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc index d29b31e..c7fc435 100644 --- a/net/url_request/url_request_http_job.cc +++ b/net/url_request/url_request_http_job.cc @@ -64,6 +64,9 @@ URLRequestHttpJob::URLRequestHttpJob(URLRequest* request) } URLRequestHttpJob::~URLRequestHttpJob() { + if (sdch_dictionary_url_.is_valid()) { + SdchManager::Global()->FetchDictionary(sdch_dictionary_url_); + } } void URLRequestHttpJob::SetUpload(net::UploadData* upload) { @@ -445,7 +448,6 @@ void URLRequestHttpJob::NotifyHeadersComplete() { } } - // Get list of SDCH dictionary requests, and schedule them to be loaded. if (SdchManager::Global() && SdchManager::Global()->IsInSupportedDomain(request_->url())) { static const std::string name = "Get-Dictionary"; @@ -459,7 +461,9 @@ void URLRequestHttpJob::NotifyHeadersComplete() { // 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); - SdchManager::Global()->FetchDictionary(request_->url(), dictionary_url); + if (SdchManager::Global()->CanFetchDictionary(request_->url(), + dictionary_url)) + sdch_dictionary_url_ = dictionary_url; } } |