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
parent e86819e4
...@@ -338,8 +338,7 @@ bool CanonicalCookie::IsOnPath(const std::string& url_path) const { ...@@ -338,8 +338,7 @@ bool CanonicalCookie::IsOnPath(const std::string& url_path) const {
return true; return true;
} }
bool CanonicalCookie::IsDomainMatch(const std::string& scheme, bool CanonicalCookie::IsDomainMatch(const std::string& host) const {
const std::string& host) const {
// Can domain match in two ways; as a domain cookie (where the cookie // 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). // domain begins with ".") or as a host cookie (where it doesn't).
......
...@@ -111,7 +111,7 @@ class NET_EXPORT CanonicalCookie { ...@@ -111,7 +111,7 @@ class NET_EXPORT CanonicalCookie {
} }
bool IsOnPath(const std::string& url_path) const; 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; std::string DebugString() const;
......
...@@ -201,30 +201,30 @@ TEST(CanonicalCookieTest, IsDomainMatch) { ...@@ -201,30 +201,30 @@ TEST(CanonicalCookieTest, IsDomainMatch) {
scoped_ptr<CanonicalCookie> cookie( scoped_ptr<CanonicalCookie> cookie(
CanonicalCookie::Create(url, "A=2", creation_time, options)); CanonicalCookie::Create(url, "A=2", creation_time, options));
EXPECT_TRUE(cookie->IsHostCookie()); EXPECT_TRUE(cookie->IsHostCookie());
EXPECT_TRUE(cookie->IsDomainMatch("http", "www.example.com")); EXPECT_TRUE(cookie->IsDomainMatch("www.example.com"));
EXPECT_TRUE(cookie->IsDomainMatch("https", "www.example.com")); EXPECT_TRUE(cookie->IsDomainMatch("www.example.com"));
EXPECT_FALSE(cookie->IsDomainMatch("http", "foo.www.example.com")); EXPECT_FALSE(cookie->IsDomainMatch("foo.www.example.com"));
EXPECT_FALSE(cookie->IsDomainMatch("http", "www0.example.com")); EXPECT_FALSE(cookie->IsDomainMatch("www0.example.com"));
EXPECT_FALSE(cookie->IsDomainMatch("http", "example.com")); EXPECT_FALSE(cookie->IsDomainMatch("example.com"));
cookie.reset( cookie.reset(
CanonicalCookie::Create(url, "A=2; Domain=www.example.com", creation_time, CanonicalCookie::Create(url, "A=2; Domain=www.example.com", creation_time,
options)); options));
EXPECT_TRUE(cookie->IsDomainCookie()); EXPECT_TRUE(cookie->IsDomainCookie());
EXPECT_TRUE(cookie->IsDomainMatch("http", "www.example.com")); EXPECT_TRUE(cookie->IsDomainMatch("www.example.com"));
EXPECT_TRUE(cookie->IsDomainMatch("https", "www.example.com")); EXPECT_TRUE(cookie->IsDomainMatch("www.example.com"));
EXPECT_TRUE(cookie->IsDomainMatch("http", "foo.www.example.com")); EXPECT_TRUE(cookie->IsDomainMatch("foo.www.example.com"));
EXPECT_FALSE(cookie->IsDomainMatch("http", "www0.example.com")); EXPECT_FALSE(cookie->IsDomainMatch("www0.example.com"));
EXPECT_FALSE(cookie->IsDomainMatch("http", "example.com")); EXPECT_FALSE(cookie->IsDomainMatch("example.com"));
cookie.reset( cookie.reset(
CanonicalCookie::Create(url, "A=2; Domain=.www.example.com", CanonicalCookie::Create(url, "A=2; Domain=.www.example.com",
creation_time, options)); creation_time, options));
EXPECT_TRUE(cookie->IsDomainMatch("http", "www.example.com")); EXPECT_TRUE(cookie->IsDomainMatch("www.example.com"));
EXPECT_TRUE(cookie->IsDomainMatch("https", "www.example.com")); EXPECT_TRUE(cookie->IsDomainMatch("www.example.com"));
EXPECT_TRUE(cookie->IsDomainMatch("http", "foo.www.example.com")); EXPECT_TRUE(cookie->IsDomainMatch("foo.www.example.com"));
EXPECT_FALSE(cookie->IsDomainMatch("http", "www0.example.com")); EXPECT_FALSE(cookie->IsDomainMatch("www0.example.com"));
EXPECT_FALSE(cookie->IsDomainMatch("http", "example.com")); EXPECT_FALSE(cookie->IsDomainMatch("example.com"));
} }
TEST(CanonicalCookieTest, IsOnPath) { TEST(CanonicalCookieTest, IsOnPath) {
......
...@@ -1133,7 +1133,6 @@ int CookieMonster::DeleteAllForHost(const GURL& url) { ...@@ -1133,7 +1133,6 @@ int CookieMonster::DeleteAllForHost(const GURL& url) {
if (!HasCookieableScheme(url)) if (!HasCookieableScheme(url))
return 0; return 0;
const std::string scheme(url.scheme());
const std::string host(url.host()); const std::string host(url.host());
// We store host cookies in the store by their canonical host name; // We store host cookies in the store by their canonical host name;
...@@ -1148,7 +1147,7 @@ int CookieMonster::DeleteAllForHost(const GURL& url) { ...@@ -1148,7 +1147,7 @@ int CookieMonster::DeleteAllForHost(const GURL& url) {
const CanonicalCookie* const cc = curit->second; const CanonicalCookie* const cc = curit->second;
// Delete only on a match as a host cookie. // Delete only on a match as a host cookie.
if (cc->IsHostCookie() && cc->IsDomainMatch(scheme, host)) { if (cc->IsHostCookie() && cc->IsDomainMatch(host)) {
num_deleted++; num_deleted++;
InternalDeleteCookie(curit, true, DELETE_COOKIE_EXPLICIT); InternalDeleteCookie(curit, true, DELETE_COOKIE_EXPLICIT);
...@@ -1603,7 +1602,6 @@ void CookieMonster::FindCookiesForKey( ...@@ -1603,7 +1602,6 @@ void CookieMonster::FindCookiesForKey(
std::vector<CanonicalCookie*>* cookies) { std::vector<CanonicalCookie*>* cookies) {
lock_.AssertAcquired(); lock_.AssertAcquired();
const std::string scheme(url.scheme());
const std::string host(url.host()); const std::string host(url.host());
bool secure = url.SchemeIsSecure(); bool secure = url.SchemeIsSecure();
...@@ -1628,7 +1626,7 @@ void CookieMonster::FindCookiesForKey( ...@@ -1628,7 +1626,7 @@ void CookieMonster::FindCookiesForKey(
continue; continue;
// Filter out cookies that don't apply to this domain. // Filter out cookies that don't apply to this domain.
if (!cc->IsDomainMatch(scheme, host)) if (!cc->IsDomainMatch(host))
continue; continue;
if (!cc->IsOnPath(url.path())) if (!cc->IsOnPath(url.path()))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment