diff options
author | jar@google.com <jar@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-02 01:32:34 +0000 |
---|---|---|
committer | jar@google.com <jar@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-02 01:32:34 +0000 |
commit | 140a1bc66cbf515dfb10347ee10b39d42dbe1ee0 (patch) | |
tree | adfc4252be520d1db852d8f429cc3361d078554c /chrome/browser | |
parent | c949118827afb549daa94fe3171b5e415bb32ea9 (diff) | |
download | chromium_src-140a1bc66cbf515dfb10347ee10b39d42dbe1ee0.zip chromium_src-140a1bc66cbf515dfb10347ee10b39d42dbe1ee0.tar.gz chromium_src-140a1bc66cbf515dfb10347ee10b39d42dbe1ee0.tar.bz2 |
Add instrumentation to and tighten SDCH implementation
r=huanr,kmixter,openvcdiff
Review URL: http://codereview.chromium.org/12699
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6193 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/net/sdch_dictionary_fetcher.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/chrome/browser/net/sdch_dictionary_fetcher.cc b/chrome/browser/net/sdch_dictionary_fetcher.cc index 3a36ff7..5208f37 100644 --- a/chrome/browser/net/sdch_dictionary_fetcher.cc +++ b/chrome/browser/net/sdch_dictionary_fetcher.cc @@ -6,6 +6,14 @@ #include "chrome/browser/profile.h" void SdchDictionaryFetcher::Schedule(const GURL& dictionary_url) { + // Avoid pushing duplicate copy onto queue. We may fetch this url again later + // and get a different dictionary, but there is no reason to have it in the + // queue twice at one time. + if (!fetch_queue_.empty() && fetch_queue_.back() == dictionary_url) { + SdchManager::SdchErrorRecovery( + SdchManager::DICTIONARY_ALREADY_SCHEDULED_TO_DOWNLOAD); + return; + } fetch_queue_.push(dictionary_url); ScheduleDelayedRun(); } |