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

Unified Diff: chrome/browser/net/chrome_cookie_policy.h

Issue 6749044: Remove async functionality from net::CookiePolicy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge Created 9 years, 8 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 | « no previous file | chrome/browser/net/chrome_cookie_policy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/chrome_cookie_policy.h
diff --git a/chrome/browser/net/chrome_cookie_policy.h b/chrome/browser/net/chrome_cookie_policy.h
index 9e925e025afeb62cf64794c2af44a9d194444db2..e050d4b7c909ae44b7f1a26ef20d5f811d59c71a 100644
--- a/chrome/browser/net/chrome_cookie_policy.h
+++ b/chrome/browser/net/chrome_cookie_policy.h
@@ -16,60 +16,23 @@
class HostContentSettingsMap;
-// Implements CookiePolicy that may delay queries to ask the user to decide.
-//
-// We will only prompt the user before setting a cookie. We do not prompt the
-// user before getting a cookie. However, if we are in the process of
-// prompting the user, then any requests to get cookies will be deferred.
-// This is done so that cookie requests remain FIFO.
-//
-class ChromeCookiePolicy
- : public base::RefCountedThreadSafe<ChromeCookiePolicy>,
- public net::CookiePolicy {
+// Implements CookiePolicy that uses HostContentSettingsMap and
+// net::StaticCookiePolicy to decide if the cookie should be blocked.
+class ChromeCookiePolicy : public net::CookiePolicy {
public:
explicit ChromeCookiePolicy(HostContentSettingsMap* map);
virtual ~ChromeCookiePolicy();
// CookiePolicy methods:
- virtual int CanGetCookies(const GURL& url, const GURL& first_party,
- net::CompletionCallback* callback);
- virtual int CanSetCookie(const GURL& url, const GURL& first_party,
- const std::string& cookie_line,
- net::CompletionCallback* callback);
+ virtual int CanGetCookies(const GURL& url, const GURL& first_party) const;
+ virtual int CanSetCookie(const GURL& url,
+ const GURL& first_party,
+ const std::string& cookie_line) const;
private:
- class Completion {
- public:
- static Completion ForSetCookie(net::CompletionCallback* callback) {
- return Completion(true, callback);
- }
-
- static Completion ForGetCookies(net::CompletionCallback* callback) {
- return Completion(false, callback);
- }
-
- bool is_set_cookie_request() const { return is_set_cookie_request_; }
- net::CompletionCallback* callback() const { return callback_; }
-
- private:
- Completion(bool is_set_cookie_request, net::CompletionCallback* callback)
- : is_set_cookie_request_(is_set_cookie_request),
- callback_(callback) {
- }
-
- bool is_set_cookie_request_;
- net::CompletionCallback* callback_;
- };
- typedef std::vector<Completion> Completions;
- typedef std::map<std::string, Completions> HostCompletionsMap;
-
int CheckPolicy(const GURL& url) const;
- // A map from hostname to callbacks awaiting a cookie policy response.
- // This map is only accessed on the IO thread.
- HostCompletionsMap host_completions_map_;
-
- scoped_refptr<HostContentSettingsMap> host_content_settings_map_;
+ const scoped_refptr<HostContentSettingsMap> host_content_settings_map_;
// True if blocking third-party cookies also applies to reading them.
bool strict_third_party_blocking_;
« no previous file with comments | « no previous file | chrome/browser/net/chrome_cookie_policy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698