summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authormarkusheintz@chromium.org <markusheintz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-30 12:56:25 +0000
committermarkusheintz@chromium.org <markusheintz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-30 12:56:25 +0000
commit0a44c4aaebc2bf82d0925ba4bfa2fd42d30f2d6a (patch)
tree152ffc5dd5d88c72be5994b24a9ce680507118a0 /net
parente86819e44270d53a9c11a50b061fa620042e7035 (diff)
downloadchromium_src-0a44c4aaebc2bf82d0925ba4bfa2fd42d30f2d6a.zip
chromium_src-0a44c4aaebc2bf82d0925ba4bfa2fd42d30f2d6a.tar.gz
chromium_src-0a44c4aaebc2bf82d0925ba4bfa2fd42d30f2d6a.tar.bz2
Remove unused parameter from the method IsDomainMatch of the class CanonicalCookie.
TEST=CanonicalCookie* BUG=163349 Review URL: https://chromiumcodereview.appspot.com/11308270 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170442 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/cookies/canonical_cookie.cc3
-rw-r--r--net/cookies/canonical_cookie.h2
-rw-r--r--net/cookies/canonical_cookie_unittest.cc30
-rw-r--r--net/cookies/cookie_monster.cc6
4 files changed, 19 insertions, 22 deletions
diff --git a/net/cookies/canonical_cookie.cc b/net/cookies/canonical_cookie.cc
index e894359..83e0e60 100644
--- a/net/cookies/canonical_cookie.cc
+++ b/net/cookies/canonical_cookie.cc
@@ -338,8 +338,7 @@ bool CanonicalCookie::IsOnPath(const std::string& url_path) const {
return true;
}
-bool CanonicalCookie::IsDomainMatch(const std::string& scheme,
- const std::string& host) const {
+bool CanonicalCookie::IsDomainMatch(const std::string& host) const {
// Can domain match in two ways; as a domain cookie (where the cookie
// domain begins with ".") or as a host cookie (where it doesn't).
diff --git a/net/cookies/canonical_cookie.h b/net/cookies/canonical_cookie.h
index ff83b87..0612991 100644
--- a/net/cookies/canonical_cookie.h
+++ b/net/cookies/canonical_cookie.h
@@ -111,7 +111,7 @@ class NET_EXPORT CanonicalCookie {
}
bool IsOnPath(const std::string& url_path) const;
- bool IsDomainMatch(const std::string& scheme, const std::string& host) const;
+ bool IsDomainMatch(const std::string& host) const;
std::string DebugString() const;
diff --git a/net/cookies/canonical_cookie_unittest.cc b/net/cookies/canonical_cookie_unittest.cc
index 9951db0..b46a3f2 100644
--- a/net/cookies/canonical_cookie_unittest.cc
+++ b/net/cookies/canonical_cookie_unittest.cc
@@ -201,30 +201,30 @@ TEST(CanonicalCookieTest, IsDomainMatch) {
scoped_ptr<CanonicalCookie> cookie(
CanonicalCookie::Create(url, "A=2", creation_time, options));
EXPECT_TRUE(cookie->IsHostCookie());
- EXPECT_TRUE(cookie->IsDomainMatch("http", "www.example.com"));
- EXPECT_TRUE(cookie->IsDomainMatch("https", "www.example.com"));
- EXPECT_FALSE(cookie->IsDomainMatch("http", "foo.www.example.com"));
- EXPECT_FALSE(cookie->IsDomainMatch("http", "www0.example.com"));
- EXPECT_FALSE(cookie->IsDomainMatch("http", "example.com"));
+ EXPECT_TRUE(cookie->IsDomainMatch("www.example.com"));
+ EXPECT_TRUE(cookie->IsDomainMatch("www.example.com"));
+ EXPECT_FALSE(cookie->IsDomainMatch("foo.www.example.com"));
+ EXPECT_FALSE(cookie->IsDomainMatch("www0.example.com"));
+ EXPECT_FALSE(cookie->IsDomainMatch("example.com"));
cookie.reset(
CanonicalCookie::Create(url, "A=2; Domain=www.example.com", creation_time,
options));
EXPECT_TRUE(cookie->IsDomainCookie());
- EXPECT_TRUE(cookie->IsDomainMatch("http", "www.example.com"));
- EXPECT_TRUE(cookie->IsDomainMatch("https", "www.example.com"));
- EXPECT_TRUE(cookie->IsDomainMatch("http", "foo.www.example.com"));
- EXPECT_FALSE(cookie->IsDomainMatch("http", "www0.example.com"));
- EXPECT_FALSE(cookie->IsDomainMatch("http", "example.com"));
+ EXPECT_TRUE(cookie->IsDomainMatch("www.example.com"));
+ EXPECT_TRUE(cookie->IsDomainMatch("www.example.com"));
+ EXPECT_TRUE(cookie->IsDomainMatch("foo.www.example.com"));
+ EXPECT_FALSE(cookie->IsDomainMatch("www0.example.com"));
+ EXPECT_FALSE(cookie->IsDomainMatch("example.com"));
cookie.reset(
CanonicalCookie::Create(url, "A=2; Domain=.www.example.com",
creation_time, options));
- EXPECT_TRUE(cookie->IsDomainMatch("http", "www.example.com"));
- EXPECT_TRUE(cookie->IsDomainMatch("https", "www.example.com"));
- EXPECT_TRUE(cookie->IsDomainMatch("http", "foo.www.example.com"));
- EXPECT_FALSE(cookie->IsDomainMatch("http", "www0.example.com"));
- EXPECT_FALSE(cookie->IsDomainMatch("http", "example.com"));
+ EXPECT_TRUE(cookie->IsDomainMatch("www.example.com"));
+ EXPECT_TRUE(cookie->IsDomainMatch("www.example.com"));
+ EXPECT_TRUE(cookie->IsDomainMatch("foo.www.example.com"));
+ EXPECT_FALSE(cookie->IsDomainMatch("www0.example.com"));
+ EXPECT_FALSE(cookie->IsDomainMatch("example.com"));
}
TEST(CanonicalCookieTest, IsOnPath) {
diff --git a/net/cookies/cookie_monster.cc b/net/cookies/cookie_monster.cc
index 59f3cf8..3397628 100644
--- a/net/cookies/cookie_monster.cc
+++ b/net/cookies/cookie_monster.cc
@@ -1133,7 +1133,6 @@ int CookieMonster::DeleteAllForHost(const GURL& url) {
if (!HasCookieableScheme(url))
return 0;
- const std::string scheme(url.scheme());
const std::string host(url.host());
// We store host cookies in the store by their canonical host name;
@@ -1148,7 +1147,7 @@ int CookieMonster::DeleteAllForHost(const GURL& url) {
const CanonicalCookie* const cc = curit->second;
// Delete only on a match as a host cookie.
- if (cc->IsHostCookie() && cc->IsDomainMatch(scheme, host)) {
+ if (cc->IsHostCookie() && cc->IsDomainMatch(host)) {
num_deleted++;
InternalDeleteCookie(curit, true, DELETE_COOKIE_EXPLICIT);
@@ -1603,7 +1602,6 @@ void CookieMonster::FindCookiesForKey(
std::vector<CanonicalCookie*>* cookies) {
lock_.AssertAcquired();
- const std::string scheme(url.scheme());
const std::string host(url.host());
bool secure = url.SchemeIsSecure();
@@ -1628,7 +1626,7 @@ void CookieMonster::FindCookiesForKey(
continue;
// Filter out cookies that don't apply to this domain.
- if (!cc->IsDomainMatch(scheme, host))
+ if (!cc->IsDomainMatch(host))
continue;
if (!cc->IsOnPath(url.path()))