Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Unified Diff: net/base/cookie_monster.cc

Issue 5318002: Also register read cookies in the content settings delegate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/base/cookie_monster.cc
diff --git a/net/base/cookie_monster.cc b/net/base/cookie_monster.cc
index caf98a3ee1159a6b4f10c53b1e2fcd3482ce7bd9..d41d2eef6fd1bc12b16b5a0d7d95734c56bb44c0 100644
--- a/net/base/cookie_monster.cc
+++ b/net/base/cookie_monster.cc
@@ -409,7 +409,7 @@ void CookieMonster::SetExpiryAndKeyScheme(ExpiryAndKeyScheme key_scheme) {
// The system resolution is not high enough, so we can have multiple
// set cookies that result in the same system time. When this happens, we
// increment by one Time unit. Let's hope computers don't get too fast.
-Time CookieMonster::CurrentTime() {
+Time CookieMonster::StrictlyIncreasingTime() {
return std::max(Time::Now(),
Time::FromInternalValue(last_time_seen_.ToInternalValue() + 1));
}
@@ -770,7 +770,7 @@ bool CookieMonster::SetCookieWithCreationTimeAndOptions(
Time creation_time = creation_time_or_null;
if (creation_time.is_null()) {
- creation_time = CurrentTime();
+ creation_time = StrictlyIncreasingTime();
last_time_seen_ = creation_time;
}
@@ -836,7 +836,7 @@ bool CookieMonster::SetCookieWithDetails(
InitIfNecessary();
- Time creation_time = CurrentTime();
+ Time creation_time = StrictlyIncreasingTime();
last_time_seen_ = creation_time;
scoped_ptr<CanonicalCookie> cc;
@@ -1351,13 +1351,12 @@ CookieMonster::CookieList CookieMonster::GetAllCookies() {
return cookie_list;
}
-CookieMonster::CookieList CookieMonster::GetAllCookiesForURL(const GURL& url) {
+CookieMonster::CookieList CookieMonster::GetAllCookiesForURLWithOptions(
+ const GURL& url,
+ const CookieOptions& options) {
AutoLock autolock(lock_);
InitIfNecessary();
- CookieOptions options;
- options.set_include_httponly();
-
std::vector<CanonicalCookie*> cookie_ptrs;
FindCookiesForHostAndDomain(url, options, false, &cookie_ptrs);
std::sort(cookie_ptrs.begin(), cookie_ptrs.end(), CookieSorter);
@@ -1370,6 +1369,13 @@ CookieMonster::CookieList CookieMonster::GetAllCookiesForURL(const GURL& url) {
return cookies;
}
+CookieMonster::CookieList CookieMonster::GetAllCookiesForURL(const GURL& url) {
+ CookieOptions options;
+ options.set_include_httponly();
+
+ return GetAllCookiesForURLWithOptions(url, options);
+}
+
void CookieMonster::FindCookiesForHostAndDomain(
const GURL& url,
const CookieOptions& options,
@@ -1377,7 +1383,7 @@ void CookieMonster::FindCookiesForHostAndDomain(
std::vector<CanonicalCookie*>* cookies) {
lock_.AssertAcquired();
- const Time current_time(CurrentTime());
+ const Time current_time(StrictlyIncreasingTime());
// Probe to save statistics relatively frequently. We do it here rather
// than in the set path as many websites won't set cookies, and we

Powered by Google App Engine
This is Rietveld 408576698