summaryrefslogtreecommitdiffstats
path: root/net/base
diff options
context:
space:
mode:
Diffstat (limited to 'net/base')
-rw-r--r--net/base/sdch_manager.cc10
-rw-r--r--net/base/sdch_manager.h8
2 files changed, 10 insertions, 8 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.
diff --git a/net/base/sdch_manager.h b/net/base/sdch_manager.h
index 0f7cdeb..2a4e5b5 100644
--- a/net/base/sdch_manager.h
+++ b/net/base/sdch_manager.h
@@ -243,13 +243,13 @@ class SdchManager {
// by 1 the number of times it will be reported as blacklisted.
const bool IsInSupportedDomain(const GURL& url);
- // Schedule the URL fetching to load a dictionary. This will generally return
- // long before the dictionary is actually loaded and added.
+ // Schedule the URL fetching to load a dictionary. This will always return
+ // before the dictionary is actually loaded and added.
// After the implied task does completes, the dictionary will have been
// cached in memory.
- void FetchDictionary(const GURL& referring_url, const GURL& dictionary_url);
+ void FetchDictionary(const GURL& dictionary_url);
- // Security test function used before initiating a fetch.
+ // Security test function used before initiating a FetchDictionary.
// Return true if fetch is legal.
bool CanFetchDictionary(const GURL& referring_url,
const GURL& dictionary_url) const;