Index: trunk/src/net/cookies/cookie_monster.h |
=================================================================== |
--- trunk/src/net/cookies/cookie_monster.h (revision 219785) |
+++ trunk/src/net/cookies/cookie_monster.h (working copy) |
@@ -37,7 +37,6 @@ |
namespace net { |
-class CookieMonsterDelegate; |
class ParsedCookie; |
// The cookie monster is the system for storing and retrieving cookies. It has |
@@ -66,8 +65,8 @@ |
// - Verify that our domain enforcement and non-dotted handling is correct |
class NET_EXPORT CookieMonster : public CookieStore { |
public: |
+ class Delegate; |
class PersistentCookieStore; |
- typedef CookieMonsterDelegate Delegate; |
// Terminology: |
// * The 'top level domain' (TLD) of an internet domain name is |
@@ -139,11 +138,11 @@ |
// monster's existence. If |store| is NULL, then no backing store will be |
// updated. If |delegate| is non-NULL, it will be notified on |
// creation/deletion of cookies. |
- CookieMonster(PersistentCookieStore* store, CookieMonsterDelegate* delegate); |
+ CookieMonster(PersistentCookieStore* store, Delegate* delegate); |
// Only used during unit testing. |
CookieMonster(PersistentCookieStore* store, |
- CookieMonsterDelegate* delegate, |
+ Delegate* delegate, |
int last_access_threshold_milliseconds); |
// Helper function that adds all cookies from |list| into this instance. |
@@ -225,10 +224,6 @@ |
// Resets the list of cookieable schemes to kDefaultCookieableSchemes with or |
// without 'file' being included. |
- // |
- // 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. |
void SetEnableFileScheme(bool accept); |
// Instructs the cookie monster to not delete expired cookies. This is used |
@@ -239,6 +234,12 @@ |
// Protects session cookies from deletion on shutdown. |
void SetForceKeepSessionState(); |
+ // 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. |
+ // Must be called before creating a CookieMonster instance. |
+ static void EnableFileScheme(); |
+ |
// Flush the backing store (if any) to disk and post the given callback when |
// done. |
// WARNING: THE CALLBACK WILL RUN ON A RANDOM THREAD. IT MUST BE THREAD SAFE. |
@@ -351,8 +352,8 @@ |
// and to provide a public cause for onCookieChange notifications. |
// |
// If you add or remove causes from this list, please be sure to also update |
- // the CookieMonsterDelegate::ChangeCause mapping inside ChangeCauseMapping. |
- // Moreover, these are used as array indexes, so avoid reordering to keep the |
+ // the Delegate::ChangeCause mapping inside ChangeCauseMapping. Moreover, |
+ // these are used as array indexes, so avoid reordering to keep the |
// histogram buckets consistent. New items (if necessary) should be added |
// at the end of the list, just before DELETE_COOKIE_LAST_ENTRY. |
enum DeletionCause { |
@@ -539,8 +540,7 @@ |
const base::Time& current_time); |
// |deletion_cause| argument is used for collecting statistics and choosing |
- // the correct CookieMonsterDelegate::ChangeCause for OnCookieChanged |
- // notifications. |
+ // the correct Delegate::ChangeCause for OnCookieChanged notifications. |
void InternalDeleteCookie(CookieMap::iterator it, bool sync_to_store, |
DeletionCause deletion_cause); |
@@ -662,7 +662,7 @@ |
std::vector<std::string> cookieable_schemes_; |
- scoped_refptr<CookieMonsterDelegate> delegate_; |
+ scoped_refptr<Delegate> delegate_; |
// Lock for thread-safety |
base::Lock lock_; |
@@ -681,8 +681,8 @@ |
DISALLOW_COPY_AND_ASSIGN(CookieMonster); |
}; |
-class NET_EXPORT CookieMonsterDelegate |
- : public base::RefCountedThreadSafe<CookieMonsterDelegate> { |
+class NET_EXPORT CookieMonster::Delegate |
+ : public base::RefCountedThreadSafe<CookieMonster::Delegate> { |
public: |
// The publicly relevant reasons a cookie might be changed. |
enum ChangeCause { |
@@ -714,8 +714,8 @@ |
bool removed, |
ChangeCause cause) = 0; |
protected: |
- friend class base::RefCountedThreadSafe<CookieMonsterDelegate>; |
- virtual ~CookieMonsterDelegate() {} |
+ friend class base::RefCountedThreadSafe<CookieMonster::Delegate>; |
+ virtual ~Delegate() {} |
}; |
typedef base::RefCountedThreadSafe<CookieMonster::PersistentCookieStore> |