Index: net/base/cookie_monster.h |
=================================================================== |
--- net/base/cookie_monster.h (revision 100935) |
+++ net/base/cookie_monster.h (working copy) |
@@ -10,6 +10,7 @@ |
#include <map> |
#include <queue> |
+#include <set> |
#include <string> |
#include <utility> |
#include <vector> |
@@ -453,6 +454,12 @@ |
void OnLoaded(base::TimeTicks beginning_time, |
const std::vector<CanonicalCookie*>& cookies); |
+ // Stores cookies loaded from the backing store and invokes deferred callback. |
+ // Called when all cookies for the domain key(eTLD+1) has been loaded from DB. |
erikwright (departed)
2011/09/15 20:56:27
Add a note that cookies contains a superset of the
erikwright (departed)
2011/09/15 21:01:56
In fact, it should say that it "normally" contains
guohui
2011/09/16 18:21:09
Done.
|
+ void CookieMonster::OnKeyLoaded( |
+ const base::Closure& request_task, const std::string& key, |
+ const std::vector<CanonicalCookie*>& cookies); |
+ |
// Stores the loaded cookies. |
void StoreLoadedCookies(const std::vector<CanonicalCookie*>& cookies); |
@@ -572,6 +579,10 @@ |
// to task queue. |
void DoCookieTask(const scoped_refptr<CookieMonsterTask>& task_item); |
+ // Run the cookie request task for a specific URL |
erikwright (departed)
2011/09/15 20:56:27
Correct to:
Runs the task if, or defers the task
guohui
2011/09/16 18:21:09
Done.
|
+ void DoCookieTask(const scoped_refptr<CookieMonsterTask>& task_item, |
+ const GURL& url); |
+ |
// Histogram variables; see CookieMonster::InitializeHistograms() in |
// cookie_monster.cc for details. |
base::Histogram* histogram_expiration_duration_minutes_; |
@@ -597,6 +608,9 @@ |
// calls may be immediately processed. |
bool loaded_; |
+ // List of domain keys that have been loaded from DB |
+ std::set<std::string> keys_loaded_; |
+ |
// Queues calls to CookieMonster until loading from the backend store is |
// completed. |
std::queue<scoped_refptr<CookieMonsterTask> > queue_; |
@@ -922,6 +936,10 @@ |
// called only once at startup. |
virtual bool Load(const LoadedCallback& loaded_callback) = 0; |
erikwright (departed)
2011/09/15 20:56:27
Make these two methods void and declare that they
guohui
2011/09/16 18:21:09
Done.
|
+ // Load all cookies for a domain key(eTLD+1) |
+ virtual bool LoadCookiesForKey(const std::string& key, |
+ const LoadedCallback& loaded_callback) = 0; |
+ |
virtual void AddCookie(const CanonicalCookie& cc) = 0; |
virtual void UpdateCookieAccessTime(const CanonicalCookie& cc) = 0; |
virtual void DeleteCookie(const CanonicalCookie& cc) = 0; |