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

Unified Diff: net/cookies/cookie_monster.h

Issue 233353003: Only commit cookie changes in prerenders after a prerender is shown (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Add browser tests, fix a bug in what was changed yesterday. Created 6 years, 7 months 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 side-by-side diff with in-line comments
Download patch
Index: net/cookies/cookie_monster.h
===================================================================
--- net/cookies/cookie_monster.h (revision 265252)
+++ net/cookies/cookie_monster.h (working copy)
@@ -307,6 +307,19 @@
static const char* kDefaultCookieableSchemes[];
static const int kDefaultCookieableSchemesCount;
+ // Copies all keys for the given |key| to another cookie monster |other|.
+ // Both |other| and |this| must be loaded for this operation to succeed.
+ // Furthermore, there may not be any cookies stored in |other| for |key|.
+ // Returns false if any of these conditions is not met.
+ bool CopyCookiesForKeyToOtherCookieMonster(std::string key,
+ CookieMonster* other);
+
+ // Find the key (for lookup in cookies_) based on the given domain.
+ // See comment on keys before the CookieMap typedef.
+ std::string GetKey(const std::string& domain) const;
+
+ bool loaded();
+
private:
// For queueing the cookie monster calls.
class CookieMonsterTask;
@@ -455,6 +468,7 @@
InitStore();
} else {
loaded_ = true;
+ ReportLoaded();
}
initialized_ = true;
}
@@ -464,6 +478,9 @@
// Should only be called by InitIfNecessary().
void InitStore();
+ // Reports to the delegate that the cookie monster was loaded.
+ void ReportLoaded();
+
// Stores cookies loaded from the backing store and invokes any deferred
// calls. |beginning_time| should be the moment PersistentCookieStore::Load
// was invoked and is used for reporting histogram_time_blocked_on_load_.
@@ -576,10 +593,6 @@
CookieItVector::iterator cookie_its_begin,
CookieItVector::iterator cookie_its_end);
- // Find the key (for lookup in cookies_) based on the given domain.
- // See comment on keys before the CookieMap typedef.
- std::string GetKey(const std::string& domain) const;
-
bool HasCookieableScheme(const GURL& url);
// Statistics support
@@ -720,6 +733,9 @@
virtual void OnCookieChanged(const CanonicalCookie& cookie,
bool removed,
ChangeCause cause) = 0;
+ // Indicates that the cookie store has fully loaded.
+ virtual void OnLoaded() = 0;
+
protected:
friend class base::RefCountedThreadSafe<CookieMonsterDelegate>;
virtual ~CookieMonsterDelegate() {}

Powered by Google App Engine
This is Rietveld 408576698