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

Unified Diff: net/cookies/cookie_store.h

Issue 683113005: Update from chromium https://crrev.com/302282 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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/cookie_monster_unittest.cc ('k') | net/disk_cache/backend_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cookies/cookie_store.h
diff --git a/net/cookies/cookie_store.h b/net/cookies/cookie_store.h
index e6e48203fe1ebed8ba15c938daf2d5a807877ad4..9f5e1f191be96728cecf33ac2ed89abf2f329d48 100644
--- a/net/cookies/cookie_store.h
+++ b/net/cookies/cookie_store.h
@@ -34,8 +34,10 @@ class NET_EXPORT CookieStore : public base::RefCountedThreadSafe<CookieStore> {
typedef base::Callback<void(const std::string& cookie)> GetCookiesCallback;
typedef base::Callback<void(bool success)> SetCookiesCallback;
typedef base::Callback<void(int num_deleted)> DeleteCallback;
- typedef base::Closure CookieChangedCallback;
- typedef base::CallbackList<void(void)> CookieChangedCallbackList;
+ typedef base::Callback<void(const CanonicalCookie& cookie, bool removed)>
+ CookieChangedCallback;
+ typedef base::CallbackList<void(const CanonicalCookie& cookie, bool removed)>
+ CookieChangedCallbackList;
typedef CookieChangedCallbackList::Subscription CookieChangedSubscription;
// Sets a single cookie. Expects a cookie line, like "a=1; domain=b.com".
@@ -99,6 +101,13 @@ class NET_EXPORT CookieStore : public base::RefCountedThreadSafe<CookieStore> {
// would be sent for a request to |url| changes. The returned handle is
// guaranteed not to hold a hard reference to the CookieStore object.
//
+ // |callback| will be called when a cookie is added or removed. |callback| is
+ // passed the respective |cookie| which was added to or removed from the
+ // cookies and a boolean indicating if the cookies was removed or not.
+ //
+ // Note that |callback| is called twice when a cookie is updated: once for
+ // the removal of the existing cookie and once for the adding the new cookie.
+ //
// Note that this method consumes memory and CPU per (url, name) pair ever
// registered that are still consumed even after all subscriptions for that
// (url, name) pair are removed. If this method ever needs to support an
« no previous file with comments | « net/cookies/cookie_monster_unittest.cc ('k') | net/disk_cache/backend_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698