Chromium Code Reviews

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: Lock protected the clear on exit flag. Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | net/base/cookie_monster.cc » ('j') | no next file with comments »
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 44bd51080fdeba6db669a0462f053678b2d90fd6..0b111301cb0c81eb759a9b666e5f76c17b092539 100644
--- a/net/base/cookie_monster.h
+++ b/net/base/cookie_monster.h
@@ -207,6 +207,10 @@ class CookieMonster : public CookieStore {
// function must be called before initialization.
void SetExpiryAndKeyScheme(ExpiryAndKeyScheme key_scheme);
+ // Delegates the call to set the |clear_local_store_on_exit_| flag of the
+ // PersistentStore if it exists.
+ void SetClearPersistentStoreOnExit(bool clear_local_store);
+
// 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.
@@ -677,18 +681,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);
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | net/base/cookie_monster.cc » ('j') | no next file with comments »

Powered by Google App Engine