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

Unified Diff: net/base/cookie_monster.h

Issue 3070001: Fixes targeting the unique creation times invariant in the CookieMonster: (Closed)
Patch Set: Made creation times in perftest unique. Created 10 years, 5 months 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
« no previous file with comments | « no previous file | net/base/cookie_monster.cc » ('j') | net/base/cookie_monster.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/cookie_monster.h
diff --git a/net/base/cookie_monster.h b/net/base/cookie_monster.h
index 9e88bb28bd8e4fb1eb9f2be99a438e51acbe4bdd..884eb221ea0ad2815338868efc5e961c0abe5a55 100644
--- a/net/base/cookie_monster.h
+++ b/net/base/cookie_monster.h
@@ -19,6 +19,7 @@
#include "base/scoped_ptr.h"
#include "base/time.h"
#include "net/base/cookie_store.h"
+#include "testing/gtest/include/gtest/gtest_prod.h"
class GURL;
@@ -106,18 +107,6 @@ class CookieMonster : public CookieStore {
const base::Time& expiration_time,
bool secure, bool http_only);
- // Exposed for unit testing.
- bool SetCookieWithCreationTimeAndOptions(const GURL& url,
- const std::string& cookie_line,
- const base::Time& creation_time,
- const CookieOptions& options);
- bool SetCookieWithCreationTime(const GURL& url,
- const std::string& cookie_line,
- const base::Time& creation_time) {
- return SetCookieWithCreationTimeAndOptions(url, cookie_line, creation_time,
- CookieOptions());
- }
-
// Returns all the cookies, for use in management UI, etc. This does not mark
// the cookies as having been accessed.
CookieList GetAllCookies();
@@ -166,6 +155,14 @@ class CookieMonster : public CookieStore {
private:
~CookieMonster();
+ // Testing support.
+ friend class CookieMonsterTest;
+ FRIEND_TEST(CookieMonsterTest, TestCookieDeleteAllCreatedAfterTimestamp);
+ FRIEND_TEST(CookieMonsterTest, TestCookieDeleteAllCreatedBetweenTimestamps);
+ bool SetCookieWithCreationTime(const GURL& url,
+ const std::string& cookie_line,
+ const base::Time& creation_time);
+
// Called by all non-static functions to ensure that the cookies store has
// been initialized. This is not done during creating so it doesn't block
// the window showing.
@@ -219,6 +216,15 @@ class CookieMonster : public CookieStore {
CanonicalCookie* cc,
bool sync_to_store);
+ // Helper function that sets cookies with more control.
+ // Not exposed as we don't want callers to have the ability
+ // to specify (potentially duplicate) creation times.
+ bool SetCookieWithCreationTimeAndOptions(const GURL& url,
+ const std::string& cookie_line,
+ const base::Time& creation_time,
+ const CookieOptions& options);
+
+
// Helper function that sets a canonical cookie, deleting equivalents and
// performing garbage collection.
bool SetCanonicalCookie(scoped_ptr<CanonicalCookie>* cc,
« no previous file with comments | « no previous file | net/base/cookie_monster.cc » ('j') | net/base/cookie_monster.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698