diff options
author | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-03 19:58:57 +0000 |
---|---|---|
committer | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-03 19:58:57 +0000 |
commit | a0b0d63b60bbc0675115317a0b08ee4183436787 (patch) | |
tree | be1e255eac2d1e176af658d492bfcf2b28d30ae3 /webkit/glue/webcookie.h | |
parent | b24586704bd0ab21ea365bd75eb6ab0ffc1e00ec (diff) | |
download | chromium_src-a0b0d63b60bbc0675115317a0b08ee4183436787.zip chromium_src-a0b0d63b60bbc0675115317a0b08ee4183436787.tar.gz chromium_src-a0b0d63b60bbc0675115317a0b08ee4183436787.tar.bz2 |
Back out trunk r37998.
Modify CookiePolicy to work asynchronously
This change will enable us to prompt the user before setting a cookie. While we only need to prompt before setting, we actually need to make both CanSetCookie and CanGetCookies asynchronous. This is necessary in order to preserve FIFO ordering since the value returned by GetCookies depends on the changes made to the cookie DB by SetCookie.
This change also includes some simplification of CookieStore. Instead of N virtual functions, I distilled it down to only 4. The remaining functions are instead expressed in terms of those.
While studying all the places where we currently use CookiePolicy, I found that some of them were not appropriate. After discussing with Amit, I decided to remove the policy checks in URLRequestAutomationJob. See the comments in the code regarding this.
I changed the signature of CookieMonster::GetRawCookies to GetAllCookiesForURL to better match GetAllCookies. I also filed a bug about making it even closer in functionality. Related to this change webkit/glue/webcookie.h grows a constructor that takes a CanonicalCookie to help clean up some code.
On the Chrome side, ChromeURLRequestContext now has a ChromeCookiePolicy object. That object is threadsafe ref counted because it is passed between the UI and IO threads. It is responsible for implementing the queuing logic described above. It will also in the future trigger the Chrome UI code to actually show the setcookie prompt.
Please review the state machinery changes in URLRequestHttpJob carefully.
R=eroman
BUG=34331
TEST=no tests yet for prompting.
Review URL: http://codereview.chromium.org/567015
TBR=darin@chromium.org
Review URL: http://codereview.chromium.org/562037
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38002 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webcookie.h')
-rw-r--r-- | webkit/glue/webcookie.h | 40 |
1 files changed, 14 insertions, 26 deletions
diff --git a/webkit/glue/webcookie.h b/webkit/glue/webcookie.h index 2feb800..4966c442 100644 --- a/webkit/glue/webcookie.h +++ b/webkit/glue/webcookie.h @@ -9,7 +9,7 @@ #ifndef WEBKIT_GLUE_WEBCOOKIE_H_ #define WEBKIT_GLUE_WEBCOOKIE_H_ -#include "net/base/cookie_monster.h" +#include <string> namespace webkit_glue { @@ -18,34 +18,22 @@ struct WebCookie { WebCookie(const std::string& name, const std::string& value, const std::string& domain, const std::string& path, double expires, bool http_only, bool secure, bool session) - : name(name), - value(value), - domain(domain), - path(path), - expires(expires), - http_only(http_only), - secure(secure), - session(session) { - } - - WebCookie(const std::string& domain, - const net::CookieMonster::CanonicalCookie& c) - : name(c.Name()), - value(c.Value()), - domain(domain), - path(c.Path()), - expires(c.ExpiryDate().ToDoubleT() * 1000), - http_only(c.IsHttpOnly()), - secure(c.IsSecure()), - session(!c.IsPersistent()) { + : name(name), + value(value), + domain(domain), + path(path), + expires(expires), + http_only(http_only), + secure(secure), + session(session) { } // For default constructions. - WebCookie() - : expires(0), - http_only(false), - secure(false), - session(false) { + WebCookie() : + expires(0), + http_only(false), + secure(false), + session(false) { } // Cookie name. |