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

Side by Side 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. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | net/base/cookie_monster.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Brought to you by the letter D and the number 2. 5 // Brought to you by the letter D and the number 2.
6 6
7 #ifndef NET_BASE_COOKIE_MONSTER_H_ 7 #ifndef NET_BASE_COOKIE_MONSTER_H_
8 #define NET_BASE_COOKIE_MONSTER_H_ 8 #define NET_BASE_COOKIE_MONSTER_H_
9 #pragma once 9 #pragma once
10 10
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 // "enable_file_scheme_". 200 // "enable_file_scheme_".
201 // If this this method is called, it must be called before first use of 201 // If this this method is called, it must be called before first use of
202 // the instance (i.e. as part of the instance initialization process). 202 // the instance (i.e. as part of the instance initialization process).
203 void SetCookieableSchemes(const char* schemes[], size_t num_schemes); 203 void SetCookieableSchemes(const char* schemes[], size_t num_schemes);
204 204
205 // Overrides the default key and expiry scheme. See comments 205 // Overrides the default key and expiry scheme. See comments
206 // before CookieMap and Garbage collection constants for details. This 206 // before CookieMap and Garbage collection constants for details. This
207 // function must be called before initialization. 207 // function must be called before initialization.
208 void SetExpiryAndKeyScheme(ExpiryAndKeyScheme key_scheme); 208 void SetExpiryAndKeyScheme(ExpiryAndKeyScheme key_scheme);
209 209
210 // Delegates the call to set the |clear_local_store_on_exit_| flag of the
211 // PersistentStore if it exists.
212 void SetClearPersistentStoreOnExit(bool clear_local_store);
213
210 // There are some unknowns about how to correctly handle file:// cookies, 214 // There are some unknowns about how to correctly handle file:// cookies,
211 // and our implementation for this is not robust enough. This allows you 215 // and our implementation for this is not robust enough. This allows you
212 // to enable support, but it should only be used for testing. Bug 1157243. 216 // to enable support, but it should only be used for testing. Bug 1157243.
213 // Must be called before creating a CookieMonster instance. 217 // Must be called before creating a CookieMonster instance.
214 static void EnableFileScheme(); 218 static void EnableFileScheme();
215 static bool enable_file_scheme_; 219 static bool enable_file_scheme_;
216 220
217 private: 221 private:
218 ~CookieMonster(); 222 ~CookieMonster();
219 223
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 674
671 DISALLOW_COPY_AND_ASSIGN(ParsedCookie); 675 DISALLOW_COPY_AND_ASSIGN(ParsedCookie);
672 }; 676 };
673 677
674 typedef base::RefCountedThreadSafe<CookieMonster::PersistentCookieStore> 678 typedef base::RefCountedThreadSafe<CookieMonster::PersistentCookieStore>
675 RefcountedPersistentCookieStore; 679 RefcountedPersistentCookieStore;
676 680
677 class CookieMonster::PersistentCookieStore 681 class CookieMonster::PersistentCookieStore
678 : public RefcountedPersistentCookieStore { 682 : public RefcountedPersistentCookieStore {
679 public: 683 public:
680 virtual ~PersistentCookieStore() { } 684 virtual ~PersistentCookieStore() {}
681 685
682 // Initializes the store and retrieves the existing cookies. This will be 686 // Initializes the store and retrieves the existing cookies. This will be
683 // called only once at startup. 687 // called only once at startup.
684 virtual bool Load(std::vector<CookieMonster::CanonicalCookie*>*) = 0; 688 virtual bool Load(std::vector<CookieMonster::CanonicalCookie*>* cookies) = 0;
685 689
686 virtual void AddCookie(const CanonicalCookie&) = 0; 690 virtual void AddCookie(const CanonicalCookie& cc) = 0;
687 virtual void UpdateCookieAccessTime(const CanonicalCookie&) = 0; 691 virtual void UpdateCookieAccessTime(const CanonicalCookie& cc) = 0;
688 virtual void DeleteCookie(const CanonicalCookie&) = 0; 692 virtual void DeleteCookie(const CanonicalCookie& cc) = 0;
693
694 // Sets the value of the user preference whether the persistent storage
695 // must be deleted upon destruction.
696 virtual void SetClearLocalStateOnExit(bool clear_local_state) = 0;
689 697
690 protected: 698 protected:
691 PersistentCookieStore() { } 699 PersistentCookieStore() {}
692 700
693 private: 701 private:
694 DISALLOW_COPY_AND_ASSIGN(PersistentCookieStore); 702 DISALLOW_COPY_AND_ASSIGN(PersistentCookieStore);
695 }; 703 };
696 704
697 class CookieList : public std::vector<CookieMonster::CanonicalCookie> { 705 class CookieList : public std::vector<CookieMonster::CanonicalCookie> {
698 }; 706 };
699 707
700 } // namespace net 708 } // namespace net
701 709
702 #endif // NET_BASE_COOKIE_MONSTER_H_ 710 #endif // NET_BASE_COOKIE_MONSTER_H_
OLDNEW
« 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
This is Rietveld 408576698