summaryrefslogtreecommitdiffstats
path: root/chrome/browser/automation
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-30 21:48:57 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-30 21:48:57 +0000
commitbe6fca6c1f6e90be5a1d513130433a2434fadf64 (patch)
tree4ab379225dd316aeab53291518473d048988cf08 /chrome/browser/automation
parentd406e2e329cc7240e29597b35a7c20433c560a51 (diff)
downloadchromium_src-be6fca6c1f6e90be5a1d513130433a2434fadf64.zip
chromium_src-be6fca6c1f6e90be5a1d513130433a2434fadf64.tar.gz
chromium_src-be6fca6c1f6e90be5a1d513130433a2434fadf64.tar.bz2
If the URLRequestContext has no CookiePolicy, then we should
allow cookies instead of denying them. I broke this yesterday when I made the CookiePolicy be an optional element of the URLRequestContext. See r37624. R=pkasting BUG=none TEST=none Review URL: http://codereview.chromium.org/557073 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37649 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/automation')
-rw-r--r--chrome/browser/automation/url_request_automation_job.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/chrome/browser/automation/url_request_automation_job.cc b/chrome/browser/automation/url_request_automation_job.cc
index 70d1d52..df32cc2 100644
--- a/chrome/browser/automation/url_request_automation_job.cc
+++ b/chrome/browser/automation/url_request_automation_job.cc
@@ -313,9 +313,9 @@ void URLRequestAutomationJob::OnRequestStarted(int tab, int id,
}
if (response_cookies.size()) {
- if (ctx && ctx->cookie_store() && ctx->cookie_policy() &&
+ if (ctx && ctx->cookie_store() && (!ctx->cookie_policy() ||
ctx->cookie_policy()->CanSetCookie(
- url_for_cookies, request_->first_party_for_cookies())) {
+ url_for_cookies, request_->first_party_for_cookies()))) {
net::CookieOptions options;
options.set_include_httponly();
ctx->cookie_store()->SetCookiesWithOptions(url_for_cookies,
@@ -325,10 +325,9 @@ void URLRequestAutomationJob::OnRequestStarted(int tab, int id,
}
}
- if (ctx && ctx->cookie_store() && ctx->cookie_policy() &&
- !response.persistent_cookies.empty() &&
- ctx->cookie_policy()->CanSetCookie(
- url_for_cookies, request_->first_party_for_cookies())) {
+ if (!response.persistent_cookies.empty() && ctx && ctx->cookie_store() &&
+ (!ctx->cookie_policy() || ctx->cookie_policy()->CanSetCookie(
+ url_for_cookies, request_->first_party_for_cookies()))) {
StringTokenizer cookie_parser(response.persistent_cookies, ";");
std::vector<net::CookieMonster::CanonicalCookie> existing_cookies;