summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorrsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-28 04:50:10 +0000
committerrsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-28 04:50:10 +0000
commitdedec0b98955617acca49f50627a6d18d1f7958e (patch)
tree159fa18bbe7e89598ce3d07025a43802c17e7050 /net
parentd2a2ca70268d37cc4958ece3ef02c7345a7dd54d (diff)
downloadchromium_src-dedec0b98955617acca49f50627a6d18d1f7958e.zip
chromium_src-dedec0b98955617acca49f50627a6d18d1f7958e.tar.gz
chromium_src-dedec0b98955617acca49f50627a6d18d1f7958e.tar.bz2
Remove the last traces of experimental support for MAC cookies
Support for MAC cookies was mostly removed in r126928. However, changes to the cookie store were not fully reverted, and new callsites were introduced due to the interface changes. This fully removes the interfaces introduced for MAC cookies, including the CookieMonster::CookieInfo class. BUG=none TBR=willchan Review URL: https://chromiumcodereview.appspot.com/12326056 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@185160 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/cookies/canonical_cookie.cc21
-rw-r--r--net/cookies/canonical_cookie.h9
-rw-r--r--net/cookies/canonical_cookie_unittest.cc68
-rw-r--r--net/cookies/cookie_monster.cc188
-rw-r--r--net/cookies/cookie_monster.h13
-rw-r--r--net/cookies/cookie_monster_perftest.cc45
-rw-r--r--net/cookies/cookie_monster_store_test.cc7
-rw-r--r--net/cookies/cookie_monster_unittest.cc42
-rw-r--r--net/cookies/cookie_store.cc4
-rw-r--r--net/cookies/cookie_store.h32
-rw-r--r--net/cookies/cookie_store_test_callbacks.cc5
-rw-r--r--net/cookies/cookie_store_test_callbacks.h24
-rw-r--r--net/cookies/cookie_store_test_helpers.cc45
-rw-r--r--net/cookies/cookie_store_test_helpers.h19
-rw-r--r--net/cookies/cookie_store_unittest.h127
-rw-r--r--net/cookies/parsed_cookie.cc22
-rw-r--r--net/cookies/parsed_cookie.h10
-rw-r--r--net/cookies/parsed_cookie_unittest.cc47
-rw-r--r--net/url_request/url_request_http_job.cc6
-rw-r--r--net/url_request/url_request_http_job.h4
-rw-r--r--net/websockets/websocket_job_spdy2_unittest.cc7
-rw-r--r--net/websockets/websocket_job_spdy3_unittest.cc7
22 files changed, 128 insertions, 624 deletions
diff --git a/net/cookies/canonical_cookie.cc b/net/cookies/canonical_cookie.cc
index 4b864db..a24f2f2 100644
--- a/net/cookies/canonical_cookie.cc
+++ b/net/cookies/canonical_cookie.cc
@@ -112,7 +112,6 @@ CanonicalCookie::CanonicalCookie()
CanonicalCookie::CanonicalCookie(
const GURL& url, const std::string& name, const std::string& value,
const std::string& domain, const std::string& path,
- const std::string& mac_key, const std::string& mac_algorithm,
const base::Time& creation, const base::Time& expiration,
const base::Time& last_access, bool secure, bool httponly)
: source_(GetCookieSourceFromURL(url)),
@@ -120,8 +119,6 @@ CanonicalCookie::CanonicalCookie(
value_(value),
domain_(domain),
path_(path),
- mac_key_(mac_key),
- mac_algorithm_(mac_algorithm),
creation_date_(creation),
expiry_date_(expiration),
last_access_date_(last_access),
@@ -134,8 +131,6 @@ CanonicalCookie::CanonicalCookie(const GURL& url, const ParsedCookie& pc)
name_(pc.Name()),
value_(pc.Value()),
path_(CanonPath(url, pc)),
- mac_key_(pc.MACKey()),
- mac_algorithm_(pc.MACAlgorithm()),
creation_date_(Time::Now()),
last_access_date_(Time()),
secure_(pc.IsSecure()),
@@ -230,12 +225,6 @@ CanonicalCookie* CanonicalCookie::Create(const GURL& url,
}
std::string cookie_path = CanonicalCookie::CanonPath(url, parsed_cookie);
- std::string mac_key;
- if (parsed_cookie.HasMACKey())
- mac_key = parsed_cookie.MACKey();
- std::string mac_algorithm;
- if (parsed_cookie.HasMACAlgorithm())
- mac_algorithm = parsed_cookie.MACAlgorithm();
Time server_time(creation_time);
if (options.has_server_time())
server_time = options.server_time();
@@ -245,8 +234,8 @@ CanonicalCookie* CanonicalCookie::Create(const GURL& url,
server_time);
return new CanonicalCookie(url, parsed_cookie.Name(), parsed_cookie.Value(),
- cookie_domain, cookie_path, mac_key, mac_algorithm,
- creation_time, cookie_expires, creation_time,
+ cookie_domain, cookie_path, creation_time,
+ cookie_expires, creation_time,
parsed_cookie.IsSecure(),
parsed_cookie.IsHttpOnly());
}
@@ -256,8 +245,6 @@ CanonicalCookie* CanonicalCookie::Create(const GURL& url,
const std::string& value,
const std::string& domain,
const std::string& path,
- const std::string& mac_key,
- const std::string& mac_algorithm,
const base::Time& creation,
const base::Time& expiration,
bool secure,
@@ -298,8 +285,8 @@ CanonicalCookie* CanonicalCookie::Create(const GURL& url,
canon_path_component.len);
return new CanonicalCookie(url, parsed_name, parsed_value, cookie_domain,
- cookie_path, mac_key, mac_algorithm, creation,
- expiration, creation, secure, http_only);
+ cookie_path, creation, expiration, creation,
+ secure, http_only);
}
bool CanonicalCookie::IsOnPath(const std::string& url_path) const {
diff --git a/net/cookies/canonical_cookie.h b/net/cookies/canonical_cookie.h
index 614b8e9..88bc788 100644
--- a/net/cookies/canonical_cookie.h
+++ b/net/cookies/canonical_cookie.h
@@ -31,8 +31,6 @@ class NET_EXPORT CanonicalCookie {
const std::string& value,
const std::string& domain,
const std::string& path,
- const std::string& mac_key,
- const std::string& mac_algorithm,
const base::Time& creation,
const base::Time& expiration,
const base::Time& last_access,
@@ -64,8 +62,6 @@ class NET_EXPORT CanonicalCookie {
const std::string& value,
const std::string& domain,
const std::string& path,
- const std::string& mac_key,
- const std::string& mac_algorithm,
const base::Time& creation,
const base::Time& expiration,
bool secure,
@@ -76,8 +72,6 @@ class NET_EXPORT CanonicalCookie {
const std::string& Value() const { return value_; }
const std::string& Domain() const { return domain_; }
const std::string& Path() const { return path_; }
- const std::string& MACKey() const { return mac_key_; }
- const std::string& MACAlgorithm() const { return mac_algorithm_; }
const base::Time& CreationDate() const { return creation_date_; }
const base::Time& LastAccessDate() const { return last_access_date_; }
bool IsPersistent() const { return !expiry_date_.is_null(); }
@@ -144,14 +138,11 @@ class NET_EXPORT CanonicalCookie {
// this field will be null. CanonicalCookie consumers should not rely on
// this field unless they guarantee that the creator of those
// CanonicalCookies properly initialized the field.
- // TODO(abarth): We might need to make this field persistent for MAC cookies.
std::string source_;
std::string name_;
std::string value_;
std::string domain_;
std::string path_;
- std::string mac_key_; // TODO(abarth): Persist to disk.
- std::string mac_algorithm_; // TODO(abarth): Persist to disk.
base::Time creation_date_;
base::Time expiry_date_;
base::Time last_access_date_;
diff --git a/net/cookies/canonical_cookie_unittest.cc b/net/cookies/canonical_cookie_unittest.cc
index 3c31316..2a2b353 100644
--- a/net/cookies/canonical_cookie_unittest.cc
+++ b/net/cookies/canonical_cookie_unittest.cc
@@ -45,7 +45,7 @@ TEST(CanonicalCookieTest, Constructor) {
GURL url("http://www.example.com/test");
base::Time current_time = base::Time::Now();
- CanonicalCookie cookie(url, "A", "2", "www.example.com", "/test", "", "",
+ CanonicalCookie cookie(url, "A", "2", "www.example.com", "/test",
current_time, base::Time(), current_time, false,
false);
EXPECT_EQ(url.GetOrigin().spec(), cookie.Source());
@@ -55,8 +55,8 @@ TEST(CanonicalCookieTest, Constructor) {
EXPECT_EQ("/test", cookie.Path());
EXPECT_FALSE(cookie.IsSecure());
- CanonicalCookie cookie2(url, "A", "2", "", "", "", "", current_time,
- base::Time(), current_time, false, false);
+ CanonicalCookie cookie2(url, "A", "2", "", "", current_time, base::Time(),
+ current_time, false, false);
EXPECT_EQ(url.GetOrigin().spec(), cookie.Source());
EXPECT_EQ("A", cookie2.Name());
EXPECT_EQ("2", cookie2.Value());
@@ -111,8 +111,8 @@ TEST(CanonicalCookieTest, Create) {
// Test the creating cookies using specific parameter instead of a cookie
// string.
cookie.reset(CanonicalCookie::Create(
- url, "A", "2", "www.example.com", "/test", "", "", creation_time,
- base::Time(), false, false));
+ url, "A", "2", "www.example.com", "/test", creation_time, base::Time(),
+ false, false));
EXPECT_EQ(url.GetOrigin().spec(), cookie->Source());
EXPECT_EQ("A", cookie->Name());
EXPECT_EQ("2", cookie->Value());
@@ -121,8 +121,8 @@ TEST(CanonicalCookieTest, Create) {
EXPECT_FALSE(cookie->IsSecure());
cookie.reset(CanonicalCookie::Create(
- url, "A", "2", ".www.example.com", "/test", "", "", creation_time,
- base::Time(), false, false));
+ url, "A", "2", ".www.example.com", "/test", creation_time, base::Time(),
+ false, false));
EXPECT_EQ(url.GetOrigin().spec(), cookie->Source());
EXPECT_EQ("A", cookie->Name());
EXPECT_EQ("2", cookie->Value());
@@ -137,8 +137,6 @@ TEST(CanonicalCookieTest, IsEquivalent) {
std::string cookie_value = "2EDA-EF";
std::string cookie_domain = ".www.example.com";
std::string cookie_path = "/";
- std::string mac_key;
- std::string mac_algorithm;
base::Time creation_time = base::Time::Now();
base::Time last_access_time = creation_time;
base::Time expiration_time = creation_time + base::TimeDelta::FromDays(2);
@@ -148,69 +146,65 @@ TEST(CanonicalCookieTest, IsEquivalent) {
// Test that a cookie is equivalent to itself.
scoped_ptr<CanonicalCookie> cookie(
new CanonicalCookie(url, cookie_name, cookie_value, cookie_domain,
- cookie_path, mac_key, mac_algorithm, creation_time,
- expiration_time, last_access_time, secure, httponly));
+ cookie_path, creation_time, expiration_time,
+ last_access_time, secure, httponly));
EXPECT_TRUE(cookie->IsEquivalent(*cookie));
// Test that two identical cookies are equivalent.
scoped_ptr<CanonicalCookie> other_cookie(
new CanonicalCookie(url, cookie_name, cookie_value, cookie_domain,
- cookie_path, mac_key, mac_algorithm, creation_time,
- expiration_time, last_access_time, secure, httponly));
+ cookie_path, creation_time, expiration_time,
+ last_access_time, secure, httponly));
EXPECT_TRUE(cookie->IsEquivalent(*other_cookie));
// Tests that use different variations of attribute values that
// DON'T affect cookie equivalence.
other_cookie.reset(new CanonicalCookie(url, cookie_name, "2", cookie_domain,
- cookie_path, mac_key, mac_algorithm,
- creation_time, expiration_time,
- last_access_time, secure, httponly));
+ cookie_path, creation_time,
+ expiration_time, last_access_time,
+ secure, httponly));
EXPECT_TRUE(cookie->IsEquivalent(*other_cookie));
base::Time other_creation_time =
creation_time + base::TimeDelta::FromMinutes(2);
other_cookie.reset(new CanonicalCookie(url, cookie_name, "2", cookie_domain,
- cookie_path, mac_key, mac_algorithm,
- other_creation_time, expiration_time,
- last_access_time, secure, httponly));
+ cookie_path, other_creation_time,
+ expiration_time, last_access_time,
+ secure, httponly));
EXPECT_TRUE(cookie->IsEquivalent(*other_cookie));
other_cookie.reset(new CanonicalCookie(url, cookie_name, cookie_name,
- cookie_domain, cookie_path, mac_key,
- mac_algorithm, creation_time,
- expiration_time, last_access_time,
- true, httponly));
+ cookie_domain, cookie_path,
+ creation_time, expiration_time,
+ last_access_time, true, httponly));
EXPECT_TRUE(cookie->IsEquivalent(*other_cookie));
// Tests that use different variations of attribute values that
// DO affect cookie equivalence.
other_cookie.reset(new CanonicalCookie(url, "B", cookie_value, cookie_domain,
- cookie_path, mac_key, mac_algorithm,
- creation_time, expiration_time,
- last_access_time, secure, httponly));
+ cookie_path, creation_time,
+ expiration_time, last_access_time,
+ secure, httponly));
EXPECT_FALSE(cookie->IsEquivalent(*other_cookie));
other_cookie.reset(new CanonicalCookie(url, cookie_name, cookie_value,
"www.example.com", cookie_path,
- mac_key, mac_algorithm, creation_time,
- expiration_time, last_access_time,
- secure, httponly));
+ creation_time, expiration_time,
+ last_access_time, secure, httponly));
EXPECT_TRUE(cookie->IsDomainCookie());
EXPECT_FALSE(other_cookie->IsDomainCookie());
EXPECT_FALSE(cookie->IsEquivalent(*other_cookie));
other_cookie.reset(new CanonicalCookie(url, cookie_name, cookie_value,
- ".example.com", cookie_path, mac_key,
- mac_algorithm, creation_time,
- expiration_time, last_access_time,
- secure, httponly));
+ ".example.com", cookie_path,
+ creation_time, expiration_time,
+ last_access_time, secure, httponly));
EXPECT_FALSE(cookie->IsEquivalent(*other_cookie));
other_cookie.reset(new CanonicalCookie(url, cookie_name, cookie_value,
- cookie_domain, "/test/0", mac_key,
- mac_algorithm, creation_time,
- expiration_time, last_access_time,
- secure, httponly));
+ cookie_domain, "/test/0",
+ creation_time, expiration_time,
+ last_access_time, secure, httponly));
EXPECT_FALSE(cookie->IsEquivalent(*other_cookie));
}
diff --git a/net/cookies/cookie_monster.cc b/net/cookies/cookie_monster.cc
index 0285a55..83e99cb 100644
--- a/net/cookies/cookie_monster.cc
+++ b/net/cookies/cookie_monster.cc
@@ -154,11 +154,11 @@ bool LRUCookieSorter(const CookieMonster::CookieMap::iterator& it1,
// name, and path.
struct CookieSignature {
public:
- CookieSignature(const std::string& name, const std::string& domain,
+ CookieSignature(const std::string& name,
+ const std::string& domain,
const std::string& path)
- : name(name),
- domain(domain),
- path(path) {}
+ : name(name), domain(domain), path(path) {
+ }
// To be a key for a map this class needs to be assignable, copyable,
// and have an operator<. The default assignment operator
@@ -274,22 +274,6 @@ std::string BuildCookieLine(const CanonicalCookieVector& cookies) {
return cookie_line;
}
-void BuildCookieInfoList(const CanonicalCookieVector& cookies,
- std::vector<CookieStore::CookieInfo>* cookie_infos) {
- for (CanonicalCookieVector::const_iterator it = cookies.begin();
- it != cookies.end(); ++it) {
- const CanonicalCookie* cookie = *it;
- CookieStore::CookieInfo cookie_info;
-
- cookie_info.name = cookie->Name();
- cookie_info.creation_date = cookie->CreationDate();
- cookie_info.mac_key = cookie->MACKey();
- cookie_info.mac_algorithm = cookie->MACAlgorithm();
-
- cookie_infos->push_back(cookie_info);
- }
-}
-
} // namespace
// static
@@ -389,12 +373,16 @@ void CookieMonster::CookieMonsterTask::InvokeCallback(base::Closure callback) {
class CookieMonster::SetCookieWithDetailsTask
: public CookieMonster::CookieMonsterTask {
public:
- SetCookieWithDetailsTask(
- CookieMonster* cookie_monster,
- const GURL& url, const std::string& name, const std::string& value,
- const std::string& domain, const std::string& path,
- const base::Time& expiration_time, bool secure, bool http_only,
- const CookieMonster::SetCookiesCallback& callback)
+ SetCookieWithDetailsTask(CookieMonster* cookie_monster,
+ const GURL& url,
+ const std::string& name,
+ const std::string& value,
+ const std::string& domain,
+ const std::string& path,
+ const base::Time& expiration_time,
+ bool secure,
+ bool http_only,
+ const CookieMonster::SetCookiesCallback& callback)
: CookieMonsterTask(cookie_monster),
url_(url),
name_(name),
@@ -538,11 +526,10 @@ void CookieMonster::DeleteAllTask::Run() {
class CookieMonster::DeleteAllCreatedBetweenTask
: public CookieMonster::CookieMonsterTask {
public:
- DeleteAllCreatedBetweenTask(
- CookieMonster* cookie_monster,
- const Time& delete_begin,
- const Time& delete_end,
- const CookieMonster::DeleteCallback& callback)
+ DeleteAllCreatedBetweenTask(CookieMonster* cookie_monster,
+ const Time& delete_begin,
+ const Time& delete_end,
+ const CookieMonster::DeleteCallback& callback)
: CookieMonsterTask(cookie_monster),
delete_begin_(delete_begin),
delete_end_(delete_end),
@@ -609,10 +596,9 @@ void CookieMonster::DeleteAllForHostTask::Run() {
class CookieMonster::DeleteCanonicalCookieTask
: public CookieMonster::CookieMonsterTask {
public:
- DeleteCanonicalCookieTask(
- CookieMonster* cookie_monster,
- const CanonicalCookie& cookie,
- const CookieMonster::DeleteCookieCallback& callback)
+ DeleteCanonicalCookieTask(CookieMonster* cookie_monster,
+ const CanonicalCookie& cookie,
+ const CookieMonster::DeleteCookieCallback& callback)
: CookieMonsterTask(cookie_monster),
cookie_(cookie),
callback_(callback) {
@@ -716,45 +702,6 @@ void CookieMonster::GetCookiesWithOptionsTask::Run() {
}
}
-// Task class for GetCookiesWithInfo call.
-class CookieMonster::GetCookiesWithInfoTask
- : public CookieMonster::CookieMonsterTask {
- public:
- GetCookiesWithInfoTask(CookieMonster* cookie_monster,
- const GURL& url,
- const CookieOptions& options,
- const CookieMonster::GetCookieInfoCallback& callback)
- : CookieMonsterTask(cookie_monster),
- url_(url),
- options_(options),
- callback_(callback) { }
-
- // CookieMonster::CookieMonsterTask:
- virtual void Run() OVERRIDE;
-
- protected:
- virtual ~GetCookiesWithInfoTask() {}
-
- private:
- GURL url_;
- CookieOptions options_;
- CookieMonster::GetCookieInfoCallback callback_;
-
- DISALLOW_COPY_AND_ASSIGN(GetCookiesWithInfoTask);
-};
-
-void CookieMonster::GetCookiesWithInfoTask::Run() {
- if (!callback_.is_null()) {
- std::string cookie_line;
- std::vector<CookieMonster::CookieInfo> cookie_infos;
- this->cookie_monster()->
- GetCookiesWithInfo(url_, options_, &cookie_line, &cookie_infos);
- this->InvokeCallback(base::Bind(&CookieMonster::GetCookieInfoCallback::Run,
- base::Unretained(&callback_),
- cookie_line, cookie_infos));
- }
-}
-
// Task class for DeleteCookie call.
class CookieMonster::DeleteCookieTask
: public CookieMonster::CookieMonsterTask {
@@ -793,11 +740,9 @@ void CookieMonster::DeleteCookieTask::Run() {
class CookieMonster::DeleteSessionCookiesTask
: public CookieMonster::CookieMonsterTask {
public:
- DeleteSessionCookiesTask(
- CookieMonster* cookie_monster,
- const CookieMonster::DeleteCallback& callback)
- : CookieMonsterTask(cookie_monster),
- callback_(callback) {
+ DeleteSessionCookiesTask(CookieMonster* cookie_monster,
+ const CookieMonster::DeleteCallback& callback)
+ : CookieMonsterTask(cookie_monster), callback_(callback) {
}
// CookieMonster::CookieMonsterTask:
@@ -823,9 +768,14 @@ void CookieMonster::DeleteSessionCookiesTask::Run() {
// Asynchronous CookieMonster API
void CookieMonster::SetCookieWithDetailsAsync(
- const GURL& url, const std::string& name, const std::string& value,
- const std::string& domain, const std::string& path,
- const base::Time& expiration_time, bool secure, bool http_only,
+ const GURL& url,
+ const std::string& name,
+ const std::string& value,
+ const std::string& domain,
+ const std::string& path,
+ const base::Time& expiration_time,
+ bool secure,
+ bool http_only,
const SetCookiesCallback& callback) {
scoped_refptr<SetCookieWithDetailsTask> task =
new SetCookieWithDetailsTask(this, url, name, value, domain, path,
@@ -918,16 +868,6 @@ void CookieMonster::GetCookiesWithOptionsAsync(
DoCookieTaskForURL(task, url);
}
-void CookieMonster::GetCookiesWithInfoAsync(
- const GURL& url,
- const CookieOptions& options,
- const GetCookieInfoCallback& callback) {
- scoped_refptr<GetCookiesWithInfoTask> task =
- new GetCookiesWithInfoTask(this, url, options, callback);
-
- DoCookieTaskForURL(task, url);
-}
-
void CookieMonster::DeleteCookieAsync(const GURL& url,
const std::string& cookie_name,
const base::Closure& callback) {
@@ -988,10 +928,14 @@ void CookieMonster::DoCookieTaskForURL(
task_item->Run();
}
-bool CookieMonster::SetCookieWithDetails(
- const GURL& url, const std::string& name, const std::string& value,
- const std::string& domain, const std::string& path,
- const base::Time& expiration_time, bool secure, bool http_only) {
+bool CookieMonster::SetCookieWithDetails(const GURL& url,
+ const std::string& name,
+ const std::string& value,
+ const std::string& domain,
+ const std::string& path,
+ const base::Time& expiration_time,
+ bool secure,
+ bool http_only) {
base::AutoLock autolock(lock_);
if (!HasCookieableScheme(url))
@@ -1000,14 +944,9 @@ bool CookieMonster::SetCookieWithDetails(
Time creation_time = CurrentTime();
last_time_seen_ = creation_time;
- // TODO(abarth): Take these values as parameters.
- std::string mac_key;
- std::string mac_algorithm;
-
scoped_ptr<CanonicalCookie> cc;
cc.reset(CanonicalCookie::Create(
url, name, value, domain, path,
- mac_key, mac_algorithm,
creation_time, expiration_time,
secure, http_only));
@@ -1170,8 +1109,8 @@ bool CookieMonster::DeleteCanonicalCookie(const CanonicalCookie& cookie) {
return false;
}
-void CookieMonster::SetCookieableSchemes(
- const char* schemes[], size_t num_schemes) {
+void CookieMonster::SetCookieableSchemes(const char* schemes[],
+ size_t num_schemes) {
base::AutoLock autolock(lock_);
// Cookieable Schemes must be set before first use of function.
@@ -1241,32 +1180,6 @@ std::string CookieMonster::GetCookiesWithOptions(const GURL& url,
return cookie_line;
}
-void CookieMonster::GetCookiesWithInfo(const GURL& url,
- const CookieOptions& options,
- std::string* cookie_line,
- std::vector<CookieInfo>* cookie_infos) {
- DCHECK(cookie_line->empty());
- DCHECK(cookie_infos->empty());
-
- base::AutoLock autolock(lock_);
-
- if (!HasCookieableScheme(url))
- return;
-
- TimeTicks start_time(TimeTicks::Now());
-
- std::vector<CanonicalCookie*> cookies;
- FindCookiesForHostAndDomain(url, options, true, &cookies);
- std::sort(cookies.begin(), cookies.end(), CookieSorter);
- *cookie_line = BuildCookieLine(cookies);
-
- histogram_time_get_->AddTime(TimeTicks::Now() - start_time);
-
- TimeTicks mac_start_time = TimeTicks::Now();
- BuildCookieInfoList(cookies, cookie_infos);
- histogram_time_mac_->AddTime(TimeTicks::Now() - mac_start_time);
-}
-
void CookieMonster::DeleteCookie(const GURL& url,
const std::string& cookie_name) {
base::AutoLock autolock(lock_);
@@ -1572,7 +1485,6 @@ void CookieMonster::SetDefaultCookieableSchemes() {
SetCookieableSchemes(kDefaultCookieableSchemes, num_schemes);
}
-
void CookieMonster::FindCookiesForHostAndDomain(
const GURL& url,
const CookieOptions& options,
@@ -1593,13 +1505,12 @@ void CookieMonster::FindCookiesForHostAndDomain(
update_access_time, cookies);
}
-void CookieMonster::FindCookiesForKey(
- const std::string& key,
- const GURL& url,
- const CookieOptions& options,
- const Time& current,
- bool update_access_time,
- std::vector<CanonicalCookie*>* cookies) {
+void CookieMonster::FindCookiesForKey(const std::string& key,
+ const GURL& url,
+ const CookieOptions& options,
+ const Time& current,
+ bool update_access_time,
+ std::vector<CanonicalCookie*>* cookies) {
lock_.AssertAcquired();
for (CookieMapItPair its = cookies_.equal_range(key);
@@ -2089,9 +2000,6 @@ void CookieMonster::InitializeHistograms() {
histogram_time_get_ = base::Histogram::FactoryTimeGet("Cookie.TimeGet",
base::TimeDelta::FromMilliseconds(1), base::TimeDelta::FromMinutes(1),
50, base::Histogram::kUmaTargetedHistogramFlag);
- histogram_time_mac_ = base::Histogram::FactoryTimeGet("Cookie.TimeGetMac",
- base::TimeDelta::FromMilliseconds(1), base::TimeDelta::FromMinutes(1),
- 50, base::Histogram::kUmaTargetedHistogramFlag);
histogram_time_blocked_on_load_ = base::Histogram::FactoryTimeGet(
"Cookie.TimeBlockedOnLoad",
base::TimeDelta::FromMilliseconds(1), base::TimeDelta::FromMinutes(1),
diff --git a/net/cookies/cookie_monster.h b/net/cookies/cookie_monster.h
index 8a400c2..e39cfe1 100644
--- a/net/cookies/cookie_monster.h
+++ b/net/cookies/cookie_monster.h
@@ -225,11 +225,6 @@ class NET_EXPORT CookieMonster : public CookieStore {
const CookieOptions& options,
const GetCookiesCallback& callback) OVERRIDE;
- virtual void GetCookiesWithInfoAsync(
- const GURL& url,
- const CookieOptions& options,
- const GetCookieInfoCallback& callback) OVERRIDE;
-
// Deletes all cookies with that might apply to |url| that has |cookie_name|.
virtual void DeleteCookieAsync(
const GURL& url, const std::string& cookie_name,
@@ -278,7 +273,6 @@ class NET_EXPORT CookieMonster : public CookieStore {
class GetAllCookiesForURLWithOptionsTask;
class GetAllCookiesTask;
class GetCookiesWithOptionsTask;
- class GetCookiesWithInfoTask;
class SetCookieWithDetailsTask;
class SetCookieWithOptionsTask;
class DeleteSessionCookiesTask;
@@ -402,11 +396,6 @@ class NET_EXPORT CookieMonster : public CookieStore {
std::string GetCookiesWithOptions(const GURL& url,
const CookieOptions& options);
- void GetCookiesWithInfo(const GURL& url,
- const CookieOptions& options,
- std::string* cookie_line,
- std::vector<CookieInfo>* cookie_infos);
-
void DeleteCookie(const GURL& url, const std::string& cookie_name);
bool SetCookieWithCreationTime(const GURL& url,
@@ -714,7 +703,7 @@ class CookieMonster::PersistentCookieStore
// already returned, plus all cookies that are chain-loaded and not yet
// returned to CookieMonster.
virtual void LoadCookiesForKey(const std::string& key,
- const LoadedCallback& loaded_callback) = 0;
+ const LoadedCallback& loaded_callback) = 0;
virtual void AddCookie(const CanonicalCookie& cc) = 0;
virtual void UpdateCookieAccessTime(const CanonicalCookie& cc) = 0;
diff --git a/net/cookies/cookie_monster_perftest.cc b/net/cookies/cookie_monster_perftest.cc
index 63bd5ac..a765716 100644
--- a/net/cookies/cookie_monster_perftest.cc
+++ b/net/cookies/cookie_monster_perftest.cc
@@ -93,27 +93,6 @@ class GetCookiesCallback : public BaseCallback {
net::CookieOptions options_;
};
-class GetCookiesWithInfoCallback : public BaseCallback {
- public:
- const std::string& GetCookiesWithInfo(CookieMonster* cm, const GURL& gurl) {
- cm->GetCookiesWithInfoAsync(gurl, options_, base::Bind(
- &GetCookiesWithInfoCallback::Run,
- base::Unretained(this)));
- WaitForCallback();
- return cookies_;
- }
-
- private:
- void Run(const std::string& cookie_line,
- const std::vector<CookieStore::CookieInfo>& cookie_infos) {
- cookies_ = cookie_line;
- BaseCallback::Run();
- }
-
- std::string cookies_;
- net::CookieOptions options_;
-};
-
} // namespace
TEST(ParsedCookieTest, TestParseCookies) {
@@ -203,30 +182,6 @@ TEST_F(CookieMonsterTest, TestAddCookieOnManyHosts) {
timer3.Done();
}
-TEST_F(CookieMonsterTest, TestGetCookiesWithInfo) {
- scoped_refptr<CookieMonster> cm(new CookieMonster(NULL, NULL));
-
- std::vector<GURL> gurls;
- for (int i = 0; i < kNumCookies; ++i)
- gurls.push_back(GURL(base::StringPrintf("https://a%04d.izzle", i)));
-
- SetCookieCallback setCookieCallback;
-
- for (std::vector<GURL>::const_iterator it = gurls.begin();
- it != gurls.end(); ++it) {
- setCookieCallback.SetCookie(cm, *it, kCookieLine);
- }
-
- GetCookiesWithInfoCallback getCookiesCallback;
-
- PerfTimeLogger timer("Cookie_monster_get_cookie_info");
- for (std::vector<GURL>::const_iterator it = gurls.begin();
- it != gurls.end(); ++it) {
- getCookiesCallback.GetCookiesWithInfo(cm, *it);
- }
- timer.Done();
-}
-
TEST_F(CookieMonsterTest, TestDomainTree) {
scoped_refptr<CookieMonster> cm(new CookieMonster(NULL, NULL));
GetCookiesCallback getCookiesCallback;
diff --git a/net/cookies/cookie_monster_store_test.cc b/net/cookies/cookie_monster_store_test.cc
index 6e0965d..58fb690 100644
--- a/net/cookies/cookie_monster_store_test.cc
+++ b/net/cookies/cookie_monster_store_test.cc
@@ -115,7 +115,6 @@ CanonicalCookie BuildCanonicalCookie(const std::string& key,
return CanonicalCookie(
GURL(), pc.Name(), pc.Value(), key, cookie_path,
- pc.MACKey(), pc.MACAlgorithm(),
creation_time, cookie_expires, creation_time,
pc.IsSecure(), pc.IsHttpOnly());
}
@@ -208,13 +207,9 @@ CookieMonster* CreateMonsterFromStoreForGC(
(i < num_old_cookies) ? current - base::TimeDelta::FromDays(days_old) :
current;
- std::string mac_key;
- std::string mac_algorithm;
-
CanonicalCookie cc(
GURL(), "a", "1", base::StringPrintf("h%05d.izzle", i), "/path",
- mac_key, mac_algorithm, creation_time, expiration_time,
- last_access_time, false, false);
+ creation_time, expiration_time, last_access_time, false, false);
store->AddCookie(cc);
}
diff --git a/net/cookies/cookie_monster_unittest.cc b/net/cookies/cookie_monster_unittest.cc
index 8be6923..1e8d83a 100644
--- a/net/cookies/cookie_monster_unittest.cc
+++ b/net/cookies/cookie_monster_unittest.cc
@@ -379,15 +379,6 @@ class MockGetCookiesCallback
MOCK_METHOD1(Invoke, void(const std::string& cookies));
};
-class MockGetCookieInfoCallback
- : public MockCookieCallback<MockGetCookieInfoCallback,
- CookieStore::GetCookieInfoCallback> {
- public:
- MOCK_METHOD2(Invoke,
- void(const std::string& cookies,
- const std::vector<CookieStore::CookieInfo>& cookie_infos));
-};
-
class MockSetCookiesCallback
: public MockCookieCallback<MockSetCookiesCallback,
CookieStore::SetCookiesCallback> {
@@ -435,10 +426,6 @@ ACTION_P3(GetCookiesAction, cookie_monster, url, callback) {
cookie_monster->GetCookiesWithOptionsAsync(
url, CookieOptions(), callback->AsCallback());
}
-ACTION_P3(GetCookiesWithInfoAction, cookie_monster, url, callback) {
- cookie_monster->GetCookiesWithInfoAsync(
- url, CookieOptions(), callback->AsCallback());
-}
ACTION_P4(SetCookieAction, cookie_monster, url, cookie_line, callback) {
cookie_monster->SetCookieWithOptionsAsync(
url, cookie_line, CookieOptions(), callback->AsCallback());
@@ -620,27 +607,6 @@ TEST_F(DeferredCookieTaskTest, DeferredGetCookies) {
CompleteLoadingAndWait();
}
-TEST_F(DeferredCookieTaskTest, DeferredGetCookiesWithInfo) {
- DeclareLoadedCookie("www.google.izzle",
- "X=1; path=/; expires=Mon, 18-Apr-22 22:50:14 GMT",
- Time::Now() + TimeDelta::FromDays(3));
-
- MockGetCookieInfoCallback get_cookie_info_callback;
-
- BeginWithForDomainKey("google.izzle", GetCookiesWithInfoAction(
- &cookie_monster(), url_google_, &get_cookie_info_callback));
-
- WaitForLoadCall();
-
- EXPECT_CALL(get_cookie_info_callback, Invoke("X=1", testing::_)).WillOnce(
- GetCookiesWithInfoAction(
- &cookie_monster(), url_google_, &get_cookie_info_callback));
- EXPECT_CALL(get_cookie_info_callback, Invoke("X=1", testing::_)).WillOnce(
- QuitCurrentMessageLoop());
-
- CompleteLoadingAndWait();
-}
-
TEST_F(DeferredCookieTaskTest, DeferredSetCookie) {
MockSetCookiesCallback set_cookies_callback;
@@ -855,7 +821,7 @@ TEST_F(DeferredCookieTaskTest, DeferredTaskOrder) {
MockGetCookiesCallback get_cookies_callback;
MockSetCookiesCallback set_cookies_callback;
MockClosure delete_cookie_callback;
- MockGetCookieInfoCallback get_cookie_info_callback;
+ MockGetCookiesCallback get_cookies_callback_deferred;
EXPECT_CALL(*this, Begin()).WillOnce(testing::DoAll(
GetCookiesAction(
@@ -870,9 +836,9 @@ TEST_F(DeferredCookieTaskTest, DeferredTaskOrder) {
WaitForLoadCall();
EXPECT_CALL(get_cookies_callback, Invoke("X=1")).WillOnce(
- GetCookiesWithInfoAction(
- &cookie_monster(), url_google_, &get_cookie_info_callback));
- EXPECT_CALL(get_cookie_info_callback, Invoke("X=1", testing::_)).WillOnce(
+ GetCookiesAction(
+ &cookie_monster(), url_google_, &get_cookies_callback_deferred));
+ EXPECT_CALL(get_cookies_callback_deferred, Invoke("X=1")).WillOnce(
QuitCurrentMessageLoop());
EXPECT_CALL(set_cookies_callback, Invoke(true));
EXPECT_CALL(delete_cookie_callback, Invoke());
diff --git a/net/cookies/cookie_store.cc b/net/cookies/cookie_store.cc
index 25060904..e1b2e09 100644
--- a/net/cookies/cookie_store.cc
+++ b/net/cookies/cookie_store.cc
@@ -12,8 +12,4 @@ CookieStore::CookieStore() {}
CookieStore::~CookieStore() {}
-CookieStore::CookieInfo::CookieInfo() {}
-
-CookieStore::CookieInfo::~CookieInfo() {}
-
} // namespace net
diff --git a/net/cookies/cookie_store.h b/net/cookies/cookie_store.h
index 042884c..27a9f1e 100644
--- a/net/cookies/cookie_store.h
+++ b/net/cookies/cookie_store.h
@@ -27,29 +27,7 @@ class CookieMonster;
// be thread safe as its methods can be accessed from IO as well as UI threads.
class NET_EXPORT CookieStore : public base::RefCountedThreadSafe<CookieStore> {
public:
- // This struct contains additional consumer-specific information that might
- // be stored with cookies; currently just MAC information, see:
- // http://tools.ietf.org/html/draft-ietf-oauth-v2-http-mac
- struct NET_EXPORT CookieInfo {
- CookieInfo();
- ~CookieInfo();
-
- // The name of the cookie.
- std::string name;
- // TODO(abarth): Add value if any clients need it.
-
- // The time at which the cookie was created.
- base::Time creation_date;
-
- // The value of the MAC-Key and MAC-Algorithm attributes, if present.
- std::string mac_key;
- std::string mac_algorithm;
- };
-
// Callback definitions.
- typedef base::Callback <void(
- const std::string& cookie_line,
- const std::vector<CookieInfo>& cookie_infos)> GetCookieInfoCallback;
typedef base::Callback<void(const std::string& cookie)>
GetCookiesCallback;
typedef base::Callback<void(bool success)> SetCookiesCallback;
@@ -74,17 +52,9 @@ class NET_EXPORT CookieStore : public base::RefCountedThreadSafe<CookieStore> {
// Simple interface, gets a cookie string "a=b; c=d" for the given URL.
// Use options to access httponly cookies.
virtual void GetCookiesWithOptionsAsync(
- const GURL& url, const CookieOptions& options,
- const GetCookiesCallback& callback) = 0;
-
- // This function is similar to GetCookiesWithOptions same functionality as
- // GetCookiesWithOptions except that it additionally provides detailed
- // information about the cookie contained in the cookie line. See |struct
- // CookieInfo| above for details.
- virtual void GetCookiesWithInfoAsync(
const GURL& url,
const CookieOptions& options,
- const GetCookieInfoCallback& callback) = 0;
+ const GetCookiesCallback& callback) = 0;
// Deletes the passed in cookie for the specified URL.
virtual void DeleteCookieAsync(const GURL& url,
diff --git a/net/cookies/cookie_store_test_callbacks.cc b/net/cookies/cookie_store_test_callbacks.cc
index 0d4cb5c..c0bc6cc 100644
--- a/net/cookies/cookie_store_test_callbacks.cc
+++ b/net/cookies/cookie_store_test_callbacks.cc
@@ -48,11 +48,6 @@ GetCookieStringCallback::GetCookieStringCallback() {}
GetCookieStringCallback::GetCookieStringCallback(base::Thread* run_in_thread)
: CookieCallback(run_in_thread) {}
-GetCookiesWithInfoCallback::GetCookiesWithInfoCallback() {}
-GetCookiesWithInfoCallback::GetCookiesWithInfoCallback(
- base::Thread* run_in_thread) : CookieCallback(run_in_thread) {}
-GetCookiesWithInfoCallback::~GetCookiesWithInfoCallback() {}
-
DeleteCallback::DeleteCallback() : num_deleted_(0) {}
DeleteCallback::DeleteCallback(base::Thread* run_in_thread)
: CookieCallback(run_in_thread),
diff --git a/net/cookies/cookie_store_test_callbacks.h b/net/cookies/cookie_store_test_callbacks.h
index 86e11f8..0d74b58 100644
--- a/net/cookies/cookie_store_test_callbacks.h
+++ b/net/cookies/cookie_store_test_callbacks.h
@@ -81,30 +81,6 @@ class GetCookieStringCallback : public CookieCallback {
std::string cookie_;
};
-class GetCookiesWithInfoCallback : public CookieCallback {
- public:
- GetCookiesWithInfoCallback();
- explicit GetCookiesWithInfoCallback(base::Thread* run_in_thread);
- ~GetCookiesWithInfoCallback();
-
- void Run(
- const std::string& cookie_line,
- const std::vector<CookieStore::CookieInfo>& cookie_info) {
- cookie_line_ = cookie_line;
- cookie_info_ = cookie_info;
- CallbackEpilogue();
- }
-
- const std::string& cookie_line() { return cookie_line_; }
- const std::vector<CookieStore::CookieInfo>& cookie_info() {
- return cookie_info_;
- }
-
- private:
- std::string cookie_line_;
- std::vector<CookieStore::CookieInfo> cookie_info_;
-};
-
class DeleteCallback : public CookieCallback {
public:
DeleteCallback();
diff --git a/net/cookies/cookie_store_test_helpers.cc b/net/cookies/cookie_store_test_helpers.cc
index 3f19d8d..e499538 100644
--- a/net/cookies/cookie_store_test_helpers.cc
+++ b/net/cookies/cookie_store_test_helpers.cc
@@ -20,14 +20,6 @@ DelayedCookieMonster::DelayedCookieMonster()
DelayedCookieMonster::~DelayedCookieMonster() {
}
-void DelayedCookieMonster::GetCookiesInternalCallback(
- const std::string& cookie_line,
- const std::vector<CookieStore::CookieInfo>& cookie_info) {
- cookie_line_ = cookie_line;
- cookie_info_ = cookie_info;
- did_run_ = true;
-}
-
void DelayedCookieMonster::SetCookiesInternalCallback(bool result) {
result_ = result;
did_run_ = true;
@@ -39,25 +31,9 @@ void DelayedCookieMonster::GetCookiesWithOptionsInternalCallback(
did_run_ = true;
}
-void DelayedCookieMonster::GetCookiesWithInfoAsync(
- const GURL& url,
- const CookieOptions& options,
- const CookieMonster::GetCookieInfoCallback& callback) {
- did_run_ = false;
- cookie_monster_->GetCookiesWithInfoAsync(
- url, options,
- base::Bind(&DelayedCookieMonster::GetCookiesInternalCallback,
- base::Unretained(this)));
- DCHECK_EQ(did_run_, true);
- MessageLoop::current()->PostDelayedTask(
- FROM_HERE,
- base::Bind(&DelayedCookieMonster::InvokeGetCookiesCallback,
- base::Unretained(this), callback),
- base::TimeDelta::FromMilliseconds(kDelayedTime));
-}
-
void DelayedCookieMonster::SetCookieWithOptionsAsync(
- const GURL& url, const std::string& cookie_line,
+ const GURL& url,
+ const std::string& cookie_line,
const CookieOptions& options,
const CookieMonster::SetCookiesCallback& callback) {
did_run_ = false;
@@ -74,7 +50,8 @@ void DelayedCookieMonster::SetCookieWithOptionsAsync(
}
void DelayedCookieMonster::GetCookiesWithOptionsAsync(
- const GURL& url, const CookieOptions& options,
+ const GURL& url,
+ const CookieOptions& options,
const CookieMonster::GetCookiesCallback& callback) {
did_run_ = false;
cookie_monster_->GetCookiesWithOptionsAsync(
@@ -89,12 +66,6 @@ void DelayedCookieMonster::GetCookiesWithOptionsAsync(
base::TimeDelta::FromMilliseconds(kDelayedTime));
}
-void DelayedCookieMonster::InvokeGetCookiesCallback(
- const CookieMonster::GetCookieInfoCallback& callback) {
- if (!callback.is_null())
- callback.Run(cookie_line_, cookie_info_);
-}
-
void DelayedCookieMonster::InvokeSetCookiesCallback(
const CookieMonster::SetCookiesCallback& callback) {
if (!callback.is_null())
@@ -122,14 +93,6 @@ std::string DelayedCookieMonster::GetCookiesWithOptions(
return "";
}
-void DelayedCookieMonster::GetCookiesWithInfo(
- const GURL& url,
- const CookieOptions& options,
- std::string* cookie_line,
- std::vector<CookieInfo>* cookie_infos) {
- ADD_FAILURE();
-}
-
void DelayedCookieMonster::DeleteCookie(const GURL& url,
const std::string& cookie_name) {
ADD_FAILURE();
diff --git a/net/cookies/cookie_store_test_helpers.h b/net/cookies/cookie_store_test_helpers.h
index 7501fc53..86b572a 100644
--- a/net/cookies/cookie_store_test_helpers.h
+++ b/net/cookies/cookie_store_test_helpers.h
@@ -30,13 +30,9 @@ class DelayedCookieMonster : public CookieStore {
const CookieMonster::SetCookiesCallback& callback) OVERRIDE;
virtual void GetCookiesWithOptionsAsync(
- const GURL& url, const CookieOptions& options,
- const CookieMonster::GetCookiesCallback& callback) OVERRIDE;
-
- virtual void GetCookiesWithInfoAsync(
const GURL& url,
const CookieOptions& options,
- const CookieMonster::GetCookieInfoCallback& callback) OVERRIDE;
+ const CookieMonster::GetCookiesCallback& callback) OVERRIDE;
virtual bool SetCookieWithOptions(const GURL& url,
const std::string& cookie_line,
@@ -45,11 +41,6 @@ class DelayedCookieMonster : public CookieStore {
virtual std::string GetCookiesWithOptions(const GURL& url,
const CookieOptions& options);
- virtual void GetCookiesWithInfo(const GURL& url,
- const CookieOptions& options,
- std::string* cookie_line,
- std::vector<CookieInfo>* cookie_infos);
-
virtual void DeleteCookie(const GURL& url,
const std::string& cookie_name);
@@ -70,19 +61,12 @@ class DelayedCookieMonster : public CookieStore {
// Be called immediately from CookieMonster.
- void GetCookiesInternalCallback(
- const std::string& cookie_line,
- const std::vector<CookieStore::CookieInfo>& cookie_info);
-
void SetCookiesInternalCallback(bool result);
void GetCookiesWithOptionsInternalCallback(const std::string& cookie);
// Invoke the original callbacks.
- void InvokeGetCookiesCallback(
- const CookieMonster::GetCookieInfoCallback& callback);
-
void InvokeSetCookiesCallback(
const CookieMonster::SetCookiesCallback& callback);
@@ -98,7 +82,6 @@ class DelayedCookieMonster : public CookieStore {
bool result_;
std::string cookie_;
std::string cookie_line_;
- std::vector<CookieStore::CookieInfo> cookie_info_;
};
} // namespace net
diff --git a/net/cookies/cookie_store_unittest.h b/net/cookies/cookie_store_unittest.h
index 0b742b3..eed8b00 100644
--- a/net/cookies/cookie_store_unittest.h
+++ b/net/cookies/cookie_store_unittest.h
@@ -45,9 +45,6 @@ const char kValidDomainCookieLine[] = "A=B; path=/; domain=google.izzle";
// // The cookie store supports cookies with the exclude_httponly() option.
// static const bool supports_http_only;
//
-// // The cookie store supports the GetCookiesWithInfoAsync() method.
-// static const bool supports_cookies_with_info;
-//
// // The cookie store is able to make the difference between the ".com"
// // and the "com" domains.
// static const bool supports_non_dotted_domains;
@@ -115,24 +112,6 @@ class CookieStoreTest : public testing::Test {
return callback.cookie();
}
- void GetCookiesWithInfo(CookieStore* cs,
- const GURL& url,
- const CookieOptions& options,
- std::string* cookie_line,
- std::vector<CookieStore::CookieInfo>* cookie_info) {
- DCHECK(cs);
- DCHECK(cookie_line);
- DCHECK(cookie_info);
- GetCookiesWithInfoCallback callback;
- cs->GetCookiesWithInfoAsync(
- url, options, base::Bind(&GetCookiesWithInfoCallback::Run,
- base::Unretained(&callback)));
- RunFor(kTimeout);
- EXPECT_TRUE(callback.did_run());
- *cookie_line = callback.cookie_line();
- *cookie_info = callback.cookie_info();
- }
-
bool SetCookieWithOptions(CookieStore* cs,
const GURL& url,
const std::string& cookie_line,
@@ -632,40 +611,6 @@ TYPED_TEST_P(CookieStoreTest, HttpOnlyTest) {
this->MatchCookieLines("A=C", this->GetCookies(cs, this->url_google_));
}
-TYPED_TEST_P(CookieStoreTest, TestGetCookiesWithInfo) {
- if (!TypeParam::supports_cookies_with_info)
- return;
-
- scoped_refptr<CookieStore> cs(this->GetCookieStore());
- CookieOptions options;
-
- EXPECT_TRUE(this->SetCookieWithOptions(cs, this->url_google_, "A=B",
- options));
- EXPECT_TRUE(this->SetCookieWithOptions(cs, this->url_google_,
- "C=D; Mac-Key=390jfn0awf3; Mac-Algorithm=hmac-sha-1", options));
-
- this->MatchCookieLines("A=B; C=D",
- this->GetCookiesWithOptions(cs, this->url_google_, options));
-
- std::string cookie_line;
- std::vector<CookieStore::CookieInfo> cookie_infos;
-
- this->GetCookiesWithInfo(cs, this->url_google_, options, &cookie_line,
- &cookie_infos);
-
- EXPECT_EQ("A=B; C=D", cookie_line);
-
- EXPECT_EQ(2U, cookie_infos.size());
-
- EXPECT_EQ("A", cookie_infos[0].name);
- EXPECT_EQ("", cookie_infos[0].mac_key);
- EXPECT_EQ("", cookie_infos[0].mac_algorithm);
-
- EXPECT_EQ("C", cookie_infos[1].name);
- EXPECT_EQ("390jfn0awf3", cookie_infos[1].mac_key);
- EXPECT_EQ("hmac-sha-1", cookie_infos[1].mac_algorithm);
-}
-
TYPED_TEST_P(CookieStoreTest, TestCookieDeletion) {
scoped_refptr<CookieStore> cs(this->GetCookieStore());
@@ -904,12 +849,26 @@ TYPED_TEST_P(CookieStoreTest, CookieOrdering) {
}
REGISTER_TYPED_TEST_CASE_P(CookieStoreTest,
- TypeTest, DomainTest, DomainWithTrailingDotTest, ValidSubdomainTest,
- InvalidDomainTest, DomainWithoutLeadingDotTest, CaseInsensitiveDomainTest,
- TestIpAddress, TestNonDottedAndTLD, TestHostEndsWithDot, InvalidScheme,
- InvalidScheme_Read, PathTest, HttpOnlyTest, TestGetCookiesWithInfo,
- TestCookieDeletion, TestDeleteAllCreatedBetween, TestSecure,
- NetUtilCookieTest, OverwritePersistentCookie, CookieOrdering);
+ TypeTest,
+ DomainTest,
+ DomainWithTrailingDotTest,
+ ValidSubdomainTest,
+ InvalidDomainTest,
+ DomainWithoutLeadingDotTest,
+ CaseInsensitiveDomainTest,
+ TestIpAddress,
+ TestNonDottedAndTLD,
+ TestHostEndsWithDot,
+ InvalidScheme,
+ InvalidScheme_Read,
+ PathTest,
+ HttpOnlyTest,
+ TestCookieDeletion,
+ TestDeleteAllCreatedBetween,
+ TestSecure,
+ NetUtilCookieTest,
+ OverwritePersistentCookie,
+ CookieOrdering);
template<class CookieStoreTestTraits>
class MultiThreadedCookieStoreTest :
@@ -940,16 +899,6 @@ class MultiThreadedCookieStoreTest :
base::Bind(&GetCookieStringCallback::Run, base::Unretained(callback)));
}
- void GetCookiesWithInfoTask(CookieStore* cs,
- const GURL& url,
- const CookieOptions& options,
- GetCookiesWithInfoCallback* callback) {
- cs->GetCookiesWithInfoAsync(
- url, options,
- base::Bind(&GetCookiesWithInfoCallback::Run,
- base::Unretained(callback)));
- }
-
void SetCookieWithOptionsTask(CookieStore* cs,
const GURL& url,
const std::string& cookie_line,
@@ -1022,34 +971,6 @@ TYPED_TEST_P(MultiThreadedCookieStoreTest, ThreadCheckGetCookiesWithOptions) {
EXPECT_EQ("A=B", callback.cookie());
}
-TYPED_TEST_P(MultiThreadedCookieStoreTest, ThreadCheckGetCookiesWithInfo) {
- if (!TypeParam::supports_cookies_with_info)
- return;
- scoped_refptr<CookieStore> cs(this->GetCookieStore());
- CookieOptions options;
- std::string cookie_line;
- std::vector<CookieStore::CookieInfo> cookie_infos;
- EXPECT_TRUE(this->SetCookie(cs, this->url_google_, "A=B"));
- this->GetCookiesWithInfo(cs, this->url_google_, options, &cookie_line,
- &cookie_infos);
- this->MatchCookieLines("A=B", cookie_line);
- EXPECT_EQ(1U, cookie_infos.size());
- EXPECT_EQ("A", cookie_infos[0].name);
- EXPECT_EQ("", cookie_infos[0].mac_key);
- EXPECT_EQ("", cookie_infos[0].mac_algorithm);
- GetCookiesWithInfoCallback callback(&this->other_thread_);
- base::Closure task = base::Bind(
- &net::MultiThreadedCookieStoreTest<TypeParam>::GetCookiesWithInfoTask,
- base::Unretained(this), cs, this->url_google_, options, &callback);
- this->RunOnOtherThread(task);
- EXPECT_TRUE(callback.did_run());
- this->MatchCookieLines("A=B", callback.cookie_line());
- EXPECT_EQ(1U, callback.cookie_info().size());
- EXPECT_EQ("A", callback.cookie_info()[0].name);
- EXPECT_EQ("", callback.cookie_info()[0].mac_key);
- EXPECT_EQ("", callback.cookie_info()[0].mac_algorithm);
-}
-
TYPED_TEST_P(MultiThreadedCookieStoreTest, ThreadCheckSetCookieWithOptions) {
scoped_refptr<CookieStore> cs(this->GetCookieStore());
CookieOptions options;
@@ -1110,9 +1031,11 @@ TYPED_TEST_P(MultiThreadedCookieStoreTest, ThreadCheckDeleteSessionCookies) {
}
REGISTER_TYPED_TEST_CASE_P(MultiThreadedCookieStoreTest,
- ThreadCheckGetCookies, ThreadCheckGetCookiesWithOptions,
- ThreadCheckGetCookiesWithInfo, ThreadCheckSetCookieWithOptions,
- ThreadCheckDeleteCookie, ThreadCheckDeleteSessionCookies);
+ ThreadCheckGetCookies,
+ ThreadCheckGetCookiesWithOptions,
+ ThreadCheckSetCookieWithOptions,
+ ThreadCheckDeleteCookie,
+ ThreadCheckDeleteSessionCookies);
} // namespace net
diff --git a/net/cookies/parsed_cookie.cc b/net/cookies/parsed_cookie.cc
index 704de04..5cd542d 100644
--- a/net/cookies/parsed_cookie.cc
+++ b/net/cookies/parsed_cookie.cc
@@ -51,8 +51,6 @@ namespace {
const char kPathTokenName[] = "path";
const char kDomainTokenName[] = "domain";
-const char kMACKeyTokenName[] = "mac-key";
-const char kMACAlgorithmTokenName[] = "mac-algorithm";
const char kExpiresTokenName[] = "expires";
const char kMaxAgeTokenName[] = "max-age";
const char kSecureTokenName[] = "secure";
@@ -154,8 +152,6 @@ namespace net {
ParsedCookie::ParsedCookie(const std::string& cookie_line)
: path_index_(0),
domain_index_(0),
- mac_key_index_(0),
- mac_algorithm_index_(0),
expires_index_(0),
maxage_index_(0),
secure_index_(0),
@@ -204,15 +200,6 @@ bool ParsedCookie::SetDomain(const std::string& domain) {
return SetString(&domain_index_, kDomainTokenName, domain);
}
-bool ParsedCookie::SetMACKey(const std::string& mac_key) {
- return SetString(&mac_key_index_, kMACKeyTokenName, mac_key);
-}
-
-bool ParsedCookie::SetMACAlgorithm(const std::string& mac_algorithm) {
- return SetString(&mac_algorithm_index_, kMACAlgorithmTokenName,
- mac_algorithm);
-}
-
bool ParsedCookie::SetExpires(const std::string& expires) {
return SetString(&expires_index_, kExpiresTokenName, expires);
}
@@ -405,10 +392,6 @@ void ParsedCookie::SetupAttributes() {
path_index_ = i;
} else if (pairs_[i].first == kDomainTokenName) {
domain_index_ = i;
- } else if (pairs_[i].first == kMACKeyTokenName) {
- mac_key_index_ = i;
- } else if (pairs_[i].first == kMACAlgorithmTokenName) {
- mac_algorithm_index_ = i;
} else if (pairs_[i].first == kExpiresTokenName) {
expires_index_ = i;
} else if (pairs_[i].first == kMaxAgeTokenName) {
@@ -468,9 +451,8 @@ void ParsedCookie::ClearAttributePair(size_t index) {
if (index == 0)
return;
- size_t* indexes[] = {&path_index_, &domain_index_, &mac_key_index_,
- &mac_algorithm_index_, &expires_index_, &maxage_index_, &secure_index_,
- &httponly_index_};
+ size_t* indexes[] = { &path_index_, &domain_index_, &expires_index_,
+ &maxage_index_, &secure_index_, &httponly_index_ };
for (size_t i = 0; i < arraysize(indexes); ++i) {
if (*indexes[i] == index)
*indexes[i] = 0;
diff --git a/net/cookies/parsed_cookie.h b/net/cookies/parsed_cookie.h
index 694d724..43afa4b 100644
--- a/net/cookies/parsed_cookie.h
+++ b/net/cookies/parsed_cookie.h
@@ -39,12 +39,6 @@ class NET_EXPORT ParsedCookie {
const std::string& Path() const { return pairs_[path_index_].second; }
bool HasDomain() const { return domain_index_ != 0; }
const std::string& Domain() const { return pairs_[domain_index_].second; }
- bool HasMACKey() const { return mac_key_index_ != 0; }
- const std::string& MACKey() const { return pairs_[mac_key_index_].second; }
- bool HasMACAlgorithm() const { return mac_algorithm_index_ != 0; }
- const std::string& MACAlgorithm() const {
- return pairs_[mac_algorithm_index_].second;
- }
bool HasExpires() const { return expires_index_ != 0; }
const std::string& Expires() const { return pairs_[expires_index_].second; }
bool HasMaxAge() const { return maxage_index_ != 0; }
@@ -65,8 +59,6 @@ class NET_EXPORT ParsedCookie {
bool SetValue(const std::string& value);
bool SetPath(const std::string& path);
bool SetDomain(const std::string& domain);
- bool SetMACKey(const std::string& mac_key);
- bool SetMACAlgorithm(const std::string& mac_algorithm);
bool SetExpires(const std::string& expires);
bool SetMaxAge(const std::string& maxage);
bool SetIsSecure(bool is_secure);
@@ -138,8 +130,6 @@ class NET_EXPORT ParsedCookie {
// could fit these into 3 bits each if we're worried about size...
size_t path_index_;
size_t domain_index_;
- size_t mac_key_index_;
- size_t mac_algorithm_index_;
size_t expires_index_;
size_t maxage_index_;
size_t secure_index_;
diff --git a/net/cookies/parsed_cookie_unittest.cc b/net/cookies/parsed_cookie_unittest.cc
index 68ead27..3729650 100644
--- a/net/cookies/parsed_cookie_unittest.cc
+++ b/net/cookies/parsed_cookie_unittest.cc
@@ -150,35 +150,6 @@ TEST(ParsedCookieTest, MultipleEquals) {
EXPECT_EQ(4U, pc.NumberOfAttributes());
}
-TEST(ParsedCookieTest, MACKey) {
- ParsedCookie pc("foo=bar; MAC-Key=3900ac9anw9incvw9f");
- EXPECT_TRUE(pc.IsValid());
- EXPECT_EQ("foo", pc.Name());
- EXPECT_EQ("bar", pc.Value());
- EXPECT_EQ("3900ac9anw9incvw9f", pc.MACKey());
- EXPECT_EQ(1U, pc.NumberOfAttributes());
-}
-
-TEST(ParsedCookieTest, MACAlgorithm) {
- ParsedCookie pc("foo=bar; MAC-Algorithm=hmac-sha-1");
- EXPECT_TRUE(pc.IsValid());
- EXPECT_EQ("foo", pc.Name());
- EXPECT_EQ("bar", pc.Value());
- EXPECT_EQ("hmac-sha-1", pc.MACAlgorithm());
- EXPECT_EQ(1U, pc.NumberOfAttributes());
-}
-
-TEST(ParsedCookieTest, MACKeyAndMACAlgorithm) {
- ParsedCookie pc(
- "foo=bar; MAC-Key=voiae-09fj0302nfqf; MAC-Algorithm=hmac-sha-256");
- EXPECT_TRUE(pc.IsValid());
- EXPECT_EQ("foo", pc.Name());
- EXPECT_EQ("bar", pc.Value());
- EXPECT_EQ("voiae-09fj0302nfqf", pc.MACKey());
- EXPECT_EQ("hmac-sha-256", pc.MACAlgorithm());
- EXPECT_EQ(2U, pc.NumberOfAttributes());
-}
-
TEST(ParsedCookieTest, QuotedTrailingWhitespace) {
ParsedCookie pc("ANCUUID=\"zohNumRKgI0oxyhSsV3Z7D\" ; "
"expires=Sun, 18-Apr-2027 21:06:29 GMT ; "
@@ -356,37 +327,29 @@ TEST(ParsedCookieTest, SetAttributes) {
// Set all other attributes and check that they are appended in order.
EXPECT_TRUE(pc.SetDomain("domain.com"));
EXPECT_TRUE(pc.SetPath("/"));
- EXPECT_TRUE(pc.SetMACKey("mackey"));
- EXPECT_TRUE(pc.SetMACAlgorithm("\"macalgorithm\""));
EXPECT_TRUE(pc.SetExpires("Sun, 18-Apr-2027 21:06:29 GMT"));
EXPECT_TRUE(pc.SetMaxAge("12345"));
EXPECT_TRUE(pc.SetIsSecure(true));
EXPECT_TRUE(pc.SetIsHttpOnly(true));
- EXPECT_EQ("name=value; domain=domain.com; path=/; mac-key=mackey; "
- "mac-algorithm=\"macalgorithm\"; "
+ EXPECT_EQ("name=value; domain=domain.com; path=/; "
"expires=Sun, 18-Apr-2027 21:06:29 GMT; max-age=12345; secure; "
"httponly",
pc.ToCookieLine());
EXPECT_TRUE(pc.HasDomain());
EXPECT_TRUE(pc.HasPath());
- EXPECT_TRUE(pc.HasMACKey());
- EXPECT_TRUE(pc.HasMACAlgorithm());
EXPECT_TRUE(pc.HasExpires());
EXPECT_TRUE(pc.HasMaxAge());
EXPECT_TRUE(pc.IsSecure());
EXPECT_TRUE(pc.IsHttpOnly());
// Clear one attribute from the middle.
- EXPECT_TRUE(pc.SetMACAlgorithm(""));
+ EXPECT_TRUE(pc.SetPath("/foo"));
EXPECT_TRUE(pc.HasDomain());
EXPECT_TRUE(pc.HasPath());
- EXPECT_TRUE(pc.HasMACKey());
- EXPECT_FALSE(pc.HasMACAlgorithm());
EXPECT_TRUE(pc.HasExpires());
- EXPECT_TRUE(pc.HasMaxAge());
EXPECT_TRUE(pc.IsSecure());
EXPECT_TRUE(pc.IsHttpOnly());
- EXPECT_EQ("name=value; domain=domain.com; path=/; mac-key=mackey; "
+ EXPECT_EQ("name=value; domain=domain.com; path=/foo; "
"expires=Sun, 18-Apr-2027 21:06:29 GMT; max-age=12345; secure; "
"httponly",
pc.ToCookieLine());
@@ -394,8 +357,6 @@ TEST(ParsedCookieTest, SetAttributes) {
// Clear the rest and change the name and value.
EXPECT_TRUE(pc.SetDomain(""));
EXPECT_TRUE(pc.SetPath(""));
- EXPECT_TRUE(pc.SetMACKey(""));
- EXPECT_TRUE(pc.SetMACAlgorithm(""));
EXPECT_TRUE(pc.SetExpires(""));
EXPECT_TRUE(pc.SetMaxAge(""));
EXPECT_TRUE(pc.SetIsSecure(false));
@@ -404,8 +365,6 @@ TEST(ParsedCookieTest, SetAttributes) {
EXPECT_TRUE(pc.SetValue("value2"));
EXPECT_FALSE(pc.HasDomain());
EXPECT_FALSE(pc.HasPath());
- EXPECT_FALSE(pc.HasMACKey());
- EXPECT_FALSE(pc.HasMACAlgorithm());
EXPECT_FALSE(pc.HasExpires());
EXPECT_FALSE(pc.HasMaxAge());
EXPECT_FALSE(pc.IsSecure());
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc
index b26812d..8dc1507 100644
--- a/net/url_request/url_request_http_job.cc
+++ b/net/url_request/url_request_http_job.cc
@@ -528,7 +528,7 @@ void URLRequestHttpJob::AddCookieHeaderAndStart() {
void URLRequestHttpJob::DoLoadCookies() {
CookieOptions options;
options.set_include_httponly();
- request_->context()->cookie_store()->GetCookiesWithInfoAsync(
+ request_->context()->cookie_store()->GetCookiesWithOptionsAsync(
request_->url(), options,
base::Bind(&URLRequestHttpJob::OnCookiesLoaded,
weak_factory_.GetWeakPtr()));
@@ -542,9 +542,7 @@ void URLRequestHttpJob::CheckCookiePolicyAndLoad(
DoStartTransaction();
}
-void URLRequestHttpJob::OnCookiesLoaded(
- const std::string& cookie_line,
- const std::vector<net::CookieStore::CookieInfo>& cookie_infos) {
+void URLRequestHttpJob::OnCookiesLoaded(const std::string& cookie_line) {
if (!cookie_line.empty()) {
request_info_.extra_headers.SetHeader(
HttpRequestHeaders::kCookie, cookie_line);
diff --git a/net/url_request/url_request_http_job.h b/net/url_request/url_request_http_job.h
index a303dff..8020625 100644
--- a/net/url_request/url_request_http_job.h
+++ b/net/url_request/url_request_http_job.h
@@ -176,9 +176,7 @@ class URLRequestHttpJob : public URLRequestJob {
// Callback functions for Cookie Monster
void DoLoadCookies();
void CheckCookiePolicyAndLoad(const CookieList& cookie_list);
- void OnCookiesLoaded(
- const std::string& cookie_line,
- const std::vector<CookieStore::CookieInfo>& cookie_infos);
+ void OnCookiesLoaded(const std::string& cookie_line);
void DoStartTransaction();
// See the implementation for a description of save_next_cookie_running and
diff --git a/net/websockets/websocket_job_spdy2_unittest.cc b/net/websockets/websocket_job_spdy2_unittest.cc
index 4154be4..ee7c6fd 100644
--- a/net/websockets/websocket_job_spdy2_unittest.cc
+++ b/net/websockets/websocket_job_spdy2_unittest.cc
@@ -203,13 +203,6 @@ class MockCookieStore : public net::CookieStore {
callback.Run(GetCookiesWithOptions(url, options));
}
- virtual void GetCookiesWithInfoAsync(
- const GURL& url,
- const net::CookieOptions& options,
- const GetCookieInfoCallback& callback) OVERRIDE {
- ADD_FAILURE();
- }
-
virtual void DeleteCookieAsync(const GURL& url,
const std::string& cookie_name,
const base::Closure& callback) OVERRIDE {
diff --git a/net/websockets/websocket_job_spdy3_unittest.cc b/net/websockets/websocket_job_spdy3_unittest.cc
index 3777c5b..b4f0e55 100644
--- a/net/websockets/websocket_job_spdy3_unittest.cc
+++ b/net/websockets/websocket_job_spdy3_unittest.cc
@@ -207,13 +207,6 @@ class MockCookieStore : public net::CookieStore {
callback.Run(GetCookiesWithOptions(url, options));
}
- virtual void GetCookiesWithInfoAsync(
- const GURL& url,
- const net::CookieOptions& options,
- const GetCookieInfoCallback& callback) OVERRIDE {
- ADD_FAILURE();
- }
-
virtual void DeleteCookieAsync(const GURL& url,
const std::string& cookie_name,
const base::Closure& callback) OVERRIDE {