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

Unified Diff: net/base/cookie_monster.h

Issue 5430004: Refactored cookies persistent store clean-up on shutdown. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Style fixes. Created 10 years 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.h
diff --git a/net/base/cookie_monster.h b/net/base/cookie_monster.h
index cdb508ee971e0232cd8dd082d088300a809317dc..c32f38ac5dc0fe0f25d0f02d6dbd0572dc25f1b6 100644
--- a/net/base/cookie_monster.h
+++ b/net/base/cookie_monster.h
@@ -206,6 +206,12 @@ class CookieMonster : public CookieStore {
// function must be called before initialization.
void SetExpiryAndKeyScheme(ExpiryAndKeyScheme key_scheme);
+ // Retrieves the persistent store if it exists. This function will return
+ // NULL for incognito mode.
+ PersistentCookieStore* GetPersistentCookieStore() {
+ return store_.get();
jochen (gone - plz use gerrit) 2010/12/02 16:48:44 instead of this, add SetClearLocalStateOnExit() to
Randy Smith (Not in Mondays) 2010/12/02 21:19:26 Seconded; to the extent possible, I'd like to hide
pastarmovj 2010/12/03 16:43:02 Done.
+ }
+
// There are some unknowns about how to correctly handle file:// cookies,
// and our implementation for this is not robust enough. This allows you
// to enable support, but it should only be used for testing. Bug 1157243.
@@ -676,18 +682,22 @@ typedef base::RefCountedThreadSafe<CookieMonster::PersistentCookieStore>
class CookieMonster::PersistentCookieStore
: public RefcountedPersistentCookieStore {
public:
- virtual ~PersistentCookieStore() { }
+ virtual ~PersistentCookieStore() {}
// Initializes the store and retrieves the existing cookies. This will be
// called only once at startup.
- virtual bool Load(std::vector<CookieMonster::CanonicalCookie*>*) = 0;
+ virtual bool Load(std::vector<CookieMonster::CanonicalCookie*>* cookies) = 0;
+
+ virtual void AddCookie(const CanonicalCookie& cc) = 0;
+ virtual void UpdateCookieAccessTime(const CanonicalCookie& cc) = 0;
+ virtual void DeleteCookie(const CanonicalCookie& cc) = 0;
- virtual void AddCookie(const CanonicalCookie&) = 0;
- virtual void UpdateCookieAccessTime(const CanonicalCookie&) = 0;
- virtual void DeleteCookie(const CanonicalCookie&) = 0;
+ // Sets the value of the user preference whether the persistent storage
+ // must be deleted upon destruction.
+ virtual void SetClearLocalStateOnExit(bool clear_local_state) = 0;
protected:
- PersistentCookieStore() { }
+ PersistentCookieStore() {}
private:
DISALLOW_COPY_AND_ASSIGN(PersistentCookieStore);

Powered by Google App Engine
This is Rietveld 408576698