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

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: Whitespace fix. 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
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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 // "enable_file_scheme_". 199 // "enable_file_scheme_".
200 // If this this method is called, it must be called before first use of 200 // If this this method is called, it must be called before first use of
201 // the instance (i.e. as part of the instance initialization process). 201 // the instance (i.e. as part of the instance initialization process).
202 void SetCookieableSchemes(const char* schemes[], size_t num_schemes); 202 void SetCookieableSchemes(const char* schemes[], size_t num_schemes);
203 203
204 // Overrides the default key and expiry scheme. See comments 204 // Overrides the default key and expiry scheme. See comments
205 // before CookieMap and Garbage collection constants for details. This 205 // before CookieMap and Garbage collection constants for details. This
206 // function must be called before initialization. 206 // function must be called before initialization.
207 void SetExpiryAndKeyScheme(ExpiryAndKeyScheme key_scheme); 207 void SetExpiryAndKeyScheme(ExpiryAndKeyScheme key_scheme);
208 208
209 PersistentCookieStore* GetPersistentCookieStore() {
Mattias Nissler (ping if slow) 2010/12/01 17:23:24 We might want to consider to not provide the gette
210 return store_.get();
211 }
212
213 void DetachPersistentCookieStore() {
214 store_ = NULL;
215 }
216
209 // There are some unknowns about how to correctly handle file:// cookies, 217 // There are some unknowns about how to correctly handle file:// cookies,
210 // and our implementation for this is not robust enough. This allows you 218 // and our implementation for this is not robust enough. This allows you
211 // to enable support, but it should only be used for testing. Bug 1157243. 219 // to enable support, but it should only be used for testing. Bug 1157243.
212 // Must be called before creating a CookieMonster instance. 220 // Must be called before creating a CookieMonster instance.
213 static void EnableFileScheme(); 221 static void EnableFileScheme();
214 static bool enable_file_scheme_; 222 static bool enable_file_scheme_;
215 223
216 private: 224 private:
217 ~CookieMonster(); 225 ~CookieMonster();
218 226
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 virtual ~PersistentCookieStore() { } 687 virtual ~PersistentCookieStore() { }
680 688
681 // Initializes the store and retrieves the existing cookies. This will be 689 // Initializes the store and retrieves the existing cookies. This will be
682 // called only once at startup. 690 // called only once at startup.
683 virtual bool Load(std::vector<CookieMonster::CanonicalCookie*>*) = 0; 691 virtual bool Load(std::vector<CookieMonster::CanonicalCookie*>*) = 0;
684 692
685 virtual void AddCookie(const CanonicalCookie&) = 0; 693 virtual void AddCookie(const CanonicalCookie&) = 0;
686 virtual void UpdateCookieAccessTime(const CanonicalCookie&) = 0; 694 virtual void UpdateCookieAccessTime(const CanonicalCookie&) = 0;
687 virtual void DeleteCookie(const CanonicalCookie&) = 0; 695 virtual void DeleteCookie(const CanonicalCookie&) = 0;
688 696
697 // Deletes the persistent store file(s).
698 virtual void ClearLocalState() = 0;
699
689 protected: 700 protected:
690 PersistentCookieStore() { } 701 PersistentCookieStore() { }
691 702
692 private: 703 private:
693 DISALLOW_COPY_AND_ASSIGN(PersistentCookieStore); 704 DISALLOW_COPY_AND_ASSIGN(PersistentCookieStore);
694 }; 705 };
695 706
696 } // namespace net 707 } // namespace net
697 708
698 #endif // NET_BASE_COOKIE_MONSTER_H_ 709 #endif // NET_BASE_COOKIE_MONSTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698