summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-03 22:14:15 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-03 22:14:15 +0000
commit3460228438564690022243511825894c9c600608 (patch)
treebada6636f1a8656ffb8ac481cad1c1d29bddf9f5 /chrome/browser/chromeos
parente56e96f80ce491b23454a039ae5eba1a1c6ee3f9 (diff)
downloadchromium_src-3460228438564690022243511825894c9c600608.zip
chromium_src-3460228438564690022243511825894c9c600608.tar.gz
chromium_src-3460228438564690022243511825894c9c600608.tar.bz2
Revert 38001 and 38002.
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. 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/564045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38028 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos')
-rw-r--r--chrome/browser/chromeos/external_cookie_handler_unittest.cc35
1 files changed, 2 insertions, 33 deletions
diff --git a/chrome/browser/chromeos/external_cookie_handler_unittest.cc b/chrome/browser/chromeos/external_cookie_handler_unittest.cc
index b01dd9b..ad75af9 100644
--- a/chrome/browser/chromeos/external_cookie_handler_unittest.cc
+++ b/chrome/browser/chromeos/external_cookie_handler_unittest.cc
@@ -31,10 +31,6 @@ class MockCookieStore : public net::CookieStore {
}
virtual ~MockCookieStore() {}
- virtual bool SetCookie(const GURL& url, const std::string& cookie_line) {
- EXPECT_TRUE(false);
- return true;
- }
virtual bool SetCookieWithOptions(const GURL& url,
const std::string& cookie_line,
const net::CookieOptions& options) {
@@ -48,35 +44,6 @@ class MockCookieStore : public net::CookieStore {
return has_cookie;
}
- virtual bool SetCookieWithCreationTime(const GURL& url,
- const std::string& cookie_line,
- const base::Time& creation_time) {
- EXPECT_TRUE(false);
- return true;
- }
- virtual bool SetCookieWithCreationTimeWithOptions(
- const GURL& url,
- const std::string& cookie_line,
- const base::Time& creation_time,
- const net::CookieOptions& options) {
- EXPECT_TRUE(false);
- return true;
- }
-
- virtual void SetCookies(const GURL& url,
- const std::vector<std::string>& cookies) {
- EXPECT_TRUE(false);
- }
- virtual void SetCookiesWithOptions(const GURL& url,
- const std::vector<std::string>& cookies,
- const net::CookieOptions& options) {
- EXPECT_TRUE(false);
- }
-
- virtual std::string GetCookies(const GURL& url) {
- EXPECT_TRUE(false);
- return std::string();
- }
virtual std::string GetCookiesWithOptions(const GURL& url,
const net::CookieOptions& options) {
EXPECT_TRUE(false);
@@ -88,6 +55,8 @@ class MockCookieStore : public net::CookieStore {
EXPECT_TRUE(false);
}
+ virtual net::CookieMonster* GetCookieMonster() { return NULL; }
+
private:
std::set<std::string> cookies_;
const GURL expected_url_;