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

Unified Diff: net/cookies/cookie_monster.h

Issue 676073003: Add AddCallbackForCookie method to CookieStore. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix PrerenderCookieStore build Created 6 years, 2 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
« no previous file with comments | « net/cookies/canonical_cookie.cc ('k') | net/cookies/cookie_monster.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cookies/cookie_monster.h
diff --git a/net/cookies/cookie_monster.h b/net/cookies/cookie_monster.h
index 741c22e6d080fc4518a299f5be34b917191698db..90acd9da66428247c6e3517f38b8ee98fefbac0a 100644
--- a/net/cookies/cookie_monster.h
+++ b/net/cookies/cookie_monster.h
@@ -18,6 +18,7 @@
#include "base/basictypes.h"
#include "base/callback_forward.h"
#include "base/gtest_prod_util.h"
+#include "base/memory/linked_ptr.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/synchronization/lock.h"
@@ -26,8 +27,7 @@
#include "net/cookies/canonical_cookie.h"
#include "net/cookies/cookie_constants.h"
#include "net/cookies/cookie_store.h"
-
-class GURL;
+#include "url/gurl.h"
namespace base {
class Histogram;
@@ -315,6 +315,11 @@ class NET_EXPORT CookieMonster : public CookieStore {
// See comment on keys before the CookieMap typedef.
std::string GetKey(const std::string& domain) const;
+ virtual scoped_ptr<CookieChangedSubscription> AddCallbackForCookie(
+ const GURL& url,
+ const std::string& name,
+ const CookieChangedCallback& callback) override;
+
bool loaded();
private:
@@ -695,6 +700,12 @@ class NET_EXPORT CookieMonster : public CookieStore {
// instance are reset back to defaults.
static bool default_enable_file_scheme_;
+ typedef std::map<std::pair<GURL, std::string>,
+ linked_ptr<CookieChangedCallbackList>> CookieChangedHookMap;
+ CookieChangedHookMap hook_map_;
+
+ void RunCallbacks(const CanonicalCookie& cookie);
+
DISALLOW_COPY_AND_ASSIGN(CookieMonster);
};
« no previous file with comments | « net/cookies/canonical_cookie.cc ('k') | net/cookies/cookie_monster.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698