summaryrefslogtreecommitdiffstats
path: root/net/base/sdch_manager.cc
diff options
context:
space:
mode:
authorericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-08 18:40:05 +0000
committerericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-08 18:40:05 +0000
commit72569645fdd3ab18b27466e5d32149b2d2ed1172 (patch)
tree7d68a44f5e8dff7d30b73f9a6ecea3668c94f9f1 /net/base/sdch_manager.cc
parentddf9d4aea57b36326ace447318cc06beb21ff9d2 (diff)
downloadchromium_src-72569645fdd3ab18b27466e5d32149b2d2ed1172.zip
chromium_src-72569645fdd3ab18b27466e5d32149b2d2ed1172.tar.gz
chromium_src-72569645fdd3ab18b27466e5d32149b2d2ed1172.tar.bz2
Pull in new googleurl@94 which includes GURL::EffectiveIntPort().
Update callers to use this method. Review URL: http://codereview.chromium.org/5641 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3024 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/sdch_manager.cc')
-rw-r--r--net/base/sdch_manager.cc18
1 files changed, 3 insertions, 15 deletions
diff --git a/net/base/sdch_manager.cc b/net/base/sdch_manager.cc
index 6c8bce3..de1e0b0 100644
--- a/net/base/sdch_manager.cc
+++ b/net/base/sdch_manager.cc
@@ -214,18 +214,6 @@ void SdchManager::UrlSafeBase64Encode(const std::string& input,
// Security functions restricting loads and use of dictionaries.
// static
-int SdchManager::Dictionary::GetPortIncludingDefault(const GURL& url) {
- std::string port(url.port());
- if (port.length())
- return StringToInt(port);
- if (url.scheme() == "http")
- return 80; // Default port value.
- // TODO(jar): If sdch supports other schemes, then write a general function
- // or surface functionality hidden in url_cannon_stdurl.cc into url_canon.h.
- return -1;
-}
-
-// static
bool SdchManager::Dictionary::CanSet(const std::string& domain,
const std::string& path,
const std::set<int> ports,
@@ -256,7 +244,7 @@ bool SdchManager::Dictionary::CanSet(const std::string& domain,
// TODO(jar): Enforce item 4 above.
if (!ports.empty()
- && 0 == ports.count(GetPortIncludingDefault(dictionary_url)))
+ && 0 == ports.count(dictionary_url.EffectiveIntPort()))
return false;
return true;
}
@@ -276,7 +264,7 @@ bool SdchManager::Dictionary::CanUse(const GURL referring_url) {
if (!DomainMatch(referring_url, domain_))
return false;
if (!ports_.empty()
- && 0 == ports_.count(GetPortIncludingDefault(referring_url)))
+ && 0 == ports_.count(referring_url.EffectiveIntPort()))
return false;
if (path_.size() && !PathMatch(referring_url.path(), path_))
return false;
@@ -302,7 +290,7 @@ bool SdchManager::Dictionary::CanAdvertise(const GURL& target_url) {
*/
if (!DomainMatch(target_url, domain_))
return false;
- if (!ports_.empty() && 0 == ports_.count(GetPortIncludingDefault(target_url)))
+ if (!ports_.empty() && 0 == ports_.count(target_url.EffectiveIntPort()))
return false;
if (path_.size() && !PathMatch(target_url.path(), path_))
return false;