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

Unified Diff: chrome/browser/browsing_data/browsing_data_cookie_helper.h

Issue 454623003: Store in memory cookies in a hash set instead of a list. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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: chrome/browser/browsing_data/browsing_data_cookie_helper.h
diff --git a/chrome/browser/browsing_data/browsing_data_cookie_helper.h b/chrome/browser/browsing_data/browsing_data_cookie_helper.h
index 7d9315b020fbb21d307346d12692640a77ed94b1..b29701a7e127be8425f139b3a64afdf3b1a730df 100644
--- a/chrome/browser/browsing_data/browsing_data_cookie_helper.h
+++ b/chrome/browser/browsing_data/browsing_data_cookie_helper.h
@@ -12,6 +12,7 @@
#include "base/callback.h"
#include "base/memory/ref_counted.h"
#include "net/cookies/cookie_monster.h"
+#include "url/gurl.h"
class GURL;
Avi (use Gerrit) 2014/08/07 23:50:37 If you include the header you shouldn't need to fo
erikchen 2014/08/08 00:35:28 Removed.
@@ -90,7 +91,7 @@ class BrowsingDataCookieHelper
// cookies.
class CannedBrowsingDataCookieHelper : public BrowsingDataCookieHelper {
public:
- typedef std::map<GURL, net::CookieList*> OriginCookieListMap;
+ typedef std::map<GURL, net::CookieHashSet*> OriginCookieListMap;
Avi (use Gerrit) 2014/08/07 23:50:38 OriginCookieSetMap? Or is the current name generic
erikchen 2014/08/08 00:35:28 I changed the name, as well as the names of the va
explicit CannedBrowsingDataCookieHelper(
net::URLRequestContextGetter* request_context);
@@ -147,12 +148,12 @@ class CannedBrowsingDataCookieHelper : public BrowsingDataCookieHelper {
// domain, and path as the newly created cookie. Delete the old cookie
// if does.
bool DeleteMatchingCookie(const net::CanonicalCookie& add_cookie,
- net::CookieList* cookie_list);
+ net::CookieHashSet* cookie_list);
virtual ~CannedBrowsingDataCookieHelper();
// Returns the |CookieList| for the given |origin|.
- net::CookieList* GetCookiesFor(const GURL& origin);
+ net::CookieHashSet* GetCookiesFor(const GURL& origin);
// Adds the |cookie| to the cookie list for the given |frame_url|.
void AddCookie(const GURL& frame_url,
@@ -161,6 +162,9 @@ class CannedBrowsingDataCookieHelper : public BrowsingDataCookieHelper {
// Map that contains the cookie lists for all frame origins.
OriginCookieListMap origin_cookie_list_map_;
+ // A cache of the url for the global cookie list.
+ GURL origin_cookie_url_;
Avi (use Gerrit) 2014/08/07 23:50:38 Huh? Why do this? This is used in one place; sugge
erikchen 2014/08/08 00:35:27 Done.
+
DISALLOW_COPY_AND_ASSIGN(CannedBrowsingDataCookieHelper);
};

Powered by Google App Engine
This is Rietveld 408576698