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/base/sdch_manager.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/base/sdch_manager.cc')
-rw-r--r-- | net/base/sdch_manager.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/net/base/sdch_manager.cc b/net/base/sdch_manager.cc index be8ae13..9097f88 100644 --- a/net/base/sdch_manager.cc +++ b/net/base/sdch_manager.cc @@ -172,10 +172,7 @@ bool SdchManager::CanFetchDictionary(const GURL& referring_url, return true; } -void SdchManager::FetchDictionary(const GURL& referring_url, - const GURL& dictionary_url) { - if (!CanFetchDictionary(referring_url, dictionary_url)) - return; +void SdchManager::FetchDictionary(const GURL& dictionary_url) { if (fetcher_.get()) fetcher_->Schedule(dictionary_url); } @@ -379,6 +376,11 @@ bool SdchManager::Dictionary::CanSet(const std::string& domain, 5. If the dictionary has a Port attribute and the referer URL's port was not in the list. */ + + // TODO(jar): Redirects in dictionary fetches might plausibly be problematic, + // and hence the conservative approach is to not allow any redirects (if there + // were any... then don't allow the dictionary to be set). + if (domain.empty()) { SdchErrorRecovery(DICTIONARY_MISSING_DOMAIN_SPECIFIER); return false; // Domain is required. |