summaryrefslogtreecommitdiffstats
path: root/chrome/browser/net
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/net')
-rw-r--r--chrome/browser/net/sdch_dictionary_fetcher.cc2
-rw-r--r--chrome/browser/net/sdch_dictionary_fetcher.h10
2 files changed, 7 insertions, 5 deletions
diff --git a/chrome/browser/net/sdch_dictionary_fetcher.cc b/chrome/browser/net/sdch_dictionary_fetcher.cc
index 5208f37..9bce5f3 100644
--- a/chrome/browser/net/sdch_dictionary_fetcher.cc
+++ b/chrome/browser/net/sdch_dictionary_fetcher.cc
@@ -18,8 +18,6 @@ void SdchDictionaryFetcher::Schedule(const GURL& dictionary_url) {
ScheduleDelayedRun();
}
-// TODO(jar): If QOS low priority is supported, switch to using that instead of
-// just waiting to do the fetch.
void SdchDictionaryFetcher::ScheduleDelayedRun() {
if (fetch_queue_.empty() || current_fetch_.get() || task_is_pending_)
return;
diff --git a/chrome/browser/net/sdch_dictionary_fetcher.h b/chrome/browser/net/sdch_dictionary_fetcher.h
index b943a24..a0a9e2f 100644
--- a/chrome/browser/net/sdch_dictionary_fetcher.h
+++ b/chrome/browser/net/sdch_dictionary_fetcher.h
@@ -13,6 +13,7 @@
#include <string>
#include "base/compiler_specific.h"
+#include "base/scoped_ptr.h"
#include "base/task.h"
#include "chrome/browser/net/url_fetcher.h"
#include "net/base/sdch_manager.h"
@@ -20,7 +21,7 @@
class SdchDictionaryFetcher : public URLFetcher::Delegate,
public SdchFetcher {
public:
- SdchDictionaryFetcher() :
+ SdchDictionaryFetcher() :
ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)),
task_is_pending_(false) {}
virtual ~SdchDictionaryFetcher() {}
@@ -31,8 +32,11 @@ class SdchDictionaryFetcher : public URLFetcher::Delegate,
virtual void Schedule(const GURL& dictionary_url);
private:
- // Delay between Schedule and actual download.
- static const int kMsDelayFromRequestTillDownload = 15000;
+ // Delay in ms between Schedule and actual download.
+ // This leaves the URL in a queue, which is de-duped, so that there is less
+ // chance we'll try to load the same URL multiple times when a pile of
+ // page subresources (or tabs opened in parallel) all suggest the dictionary.
+ static const int kMsDelayFromRequestTillDownload = 100;
// Ensure the download after the above delay.
void ScheduleDelayedRun();