Index: net/cookies/cookie_monster.cc |
diff --git a/net/cookies/cookie_monster.cc b/net/cookies/cookie_monster.cc |
index f24637735fd44a3be289b58bec803081a1e25739..5eda0e6415f1ac3a5e98020be93f46d136abfe91 100644 |
--- a/net/cookies/cookie_monster.cc |
+++ b/net/cookies/cookie_monster.cc |
@@ -256,38 +256,38 @@ CookieMonster::CookieItVector::iterator LowerBoundAccessDate( |
LowerBoundAccessDateComparator); |
} |
-// Mapping between DeletionCause and Delegate::ChangeCause; the mapping also |
-// provides a boolean that specifies whether or not an OnCookieChanged |
-// notification ought to be generated. |
+// Mapping between DeletionCause and CookieMonsterDelegate::ChangeCause; the |
+// mapping also provides a boolean that specifies whether or not an |
+// OnCookieChanged notification ought to be generated. |
typedef struct ChangeCausePair_struct { |
- CookieMonster::Delegate::ChangeCause cause; |
+ CookieMonsterDelegate::ChangeCause cause; |
bool notify; |
} ChangeCausePair; |
ChangeCausePair ChangeCauseMapping[] = { |
// DELETE_COOKIE_EXPLICIT |
- { CookieMonster::Delegate::CHANGE_COOKIE_EXPLICIT, true }, |
+ { CookieMonsterDelegate::CHANGE_COOKIE_EXPLICIT, true }, |
// DELETE_COOKIE_OVERWRITE |
- { CookieMonster::Delegate::CHANGE_COOKIE_OVERWRITE, true }, |
+ { CookieMonsterDelegate::CHANGE_COOKIE_OVERWRITE, true }, |
// DELETE_COOKIE_EXPIRED |
- { CookieMonster::Delegate::CHANGE_COOKIE_EXPIRED, true }, |
+ { CookieMonsterDelegate::CHANGE_COOKIE_EXPIRED, true }, |
// DELETE_COOKIE_EVICTED |
- { CookieMonster::Delegate::CHANGE_COOKIE_EVICTED, true }, |
+ { CookieMonsterDelegate::CHANGE_COOKIE_EVICTED, true }, |
// DELETE_COOKIE_DUPLICATE_IN_BACKING_STORE |
- { CookieMonster::Delegate::CHANGE_COOKIE_EXPLICIT, false }, |
+ { CookieMonsterDelegate::CHANGE_COOKIE_EXPLICIT, false }, |
// DELETE_COOKIE_DONT_RECORD |
- { CookieMonster::Delegate::CHANGE_COOKIE_EXPLICIT, false }, |
+ { CookieMonsterDelegate::CHANGE_COOKIE_EXPLICIT, false }, |
// DELETE_COOKIE_EVICTED_DOMAIN |
- { CookieMonster::Delegate::CHANGE_COOKIE_EVICTED, true }, |
+ { CookieMonsterDelegate::CHANGE_COOKIE_EVICTED, true }, |
// DELETE_COOKIE_EVICTED_GLOBAL |
- { CookieMonster::Delegate::CHANGE_COOKIE_EVICTED, true }, |
+ { CookieMonsterDelegate::CHANGE_COOKIE_EVICTED, true }, |
// DELETE_COOKIE_EVICTED_DOMAIN_PRE_SAFE |
- { CookieMonster::Delegate::CHANGE_COOKIE_EVICTED, true }, |
+ { CookieMonsterDelegate::CHANGE_COOKIE_EVICTED, true }, |
// DELETE_COOKIE_EVICTED_DOMAIN_POST_SAFE |
- { CookieMonster::Delegate::CHANGE_COOKIE_EVICTED, true }, |
+ { CookieMonsterDelegate::CHANGE_COOKIE_EVICTED, true }, |
// DELETE_COOKIE_EXPIRED_OVERWRITE |
- { CookieMonster::Delegate::CHANGE_COOKIE_EXPIRED_OVERWRITE, true }, |
+ { CookieMonsterDelegate::CHANGE_COOKIE_EXPIRED_OVERWRITE, true }, |
// DELETE_COOKIE_LAST_ENTRY |
- { CookieMonster::Delegate::CHANGE_COOKIE_EXPLICIT, false } |
+ { CookieMonsterDelegate::CHANGE_COOKIE_EXPLICIT, false } |
}; |
std::string BuildCookieLine(const CanonicalCookieVector& cookies) { |
@@ -308,10 +308,8 @@ std::string BuildCookieLine(const CanonicalCookieVector& cookies) { |
} // namespace |
-// static |
-bool CookieMonster::default_enable_file_scheme_ = false; |
- |
-CookieMonster::CookieMonster(PersistentCookieStore* store, Delegate* delegate) |
+CookieMonster::CookieMonster(PersistentCookieStore* store, |
+ CookieMonsterDelegate* delegate) |
: initialized_(false), |
loaded_(false), |
store_(store), |
@@ -327,7 +325,7 @@ CookieMonster::CookieMonster(PersistentCookieStore* store, Delegate* delegate) |
} |
CookieMonster::CookieMonster(PersistentCookieStore* store, |
- Delegate* delegate, |
+ CookieMonsterDelegate* delegate, |
int last_access_threshold_milliseconds) |
: initialized_(false), |
loaded_(false), |
@@ -1279,11 +1277,6 @@ void CookieMonster::SetKeepExpiredCookies() { |
keep_expired_cookies_ = true; |
} |
-// static |
-void CookieMonster::EnableFileScheme() { |
- default_enable_file_scheme_ = true; |
-} |
- |
void CookieMonster::FlushStore(const base::Closure& callback) { |
base::AutoLock autolock(lock_); |
if (initialized_ && store_.get()) |
@@ -1642,9 +1635,9 @@ const int CookieMonster::kDefaultCookieableSchemesCount = |
arraysize(CookieMonster::kDefaultCookieableSchemes); |
void CookieMonster::SetDefaultCookieableSchemes() { |
- int num_schemes = default_enable_file_scheme_ ? |
- kDefaultCookieableSchemesCount : kDefaultCookieableSchemesCount - 1; |
- SetCookieableSchemes(kDefaultCookieableSchemes, num_schemes); |
+ // Always disable file scheme unless SetEnableFileScheme(true) is called. |
+ SetCookieableSchemes(kDefaultCookieableSchemes, |
+ kDefaultCookieableSchemesCount - 1); |
} |
void CookieMonster::FindCookiesForHostAndDomain( |
@@ -1744,7 +1737,7 @@ void CookieMonster::InternalInsertCookie(const std::string& key, |
cookies_.insert(CookieMap::value_type(key, cc)); |
if (delegate_.get()) { |
delegate_->OnCookieChanged( |
- *cc, false, CookieMonster::Delegate::CHANGE_COOKIE_EXPLICIT); |
+ *cc, false, CookieMonsterDelegate::CHANGE_COOKIE_EXPLICIT); |
} |
} |