summaryrefslogtreecommitdiffstats
path: root/chrome/browser/net
diff options
context:
space:
mode:
authoridanan@chromium.org <idanan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-15 15:24:46 +0000
committeridanan@chromium.org <idanan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-15 15:24:46 +0000
commit0820ac156d55a3532af12014177dd619cafe216f (patch)
tree7701a3a801e3fc0c50bfe97b9801a7d3af769a9c /chrome/browser/net
parent32b8072a2ac29592417255fb6efafee33e46d70e (diff)
downloadchromium_src-0820ac156d55a3532af12014177dd619cafe216f.zip
chromium_src-0820ac156d55a3532af12014177dd619cafe216f.tar.gz
chromium_src-0820ac156d55a3532af12014177dd619cafe216f.tar.bz2
Privacy option added for all cookies to become session cookies.
BUG=10502 Review URL: http://codereview.chromium.org/87047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16158 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/net')
-rw-r--r--chrome/browser/net/chrome_url_request_context.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/chrome/browser/net/chrome_url_request_context.cc b/chrome/browser/net/chrome_url_request_context.cc
index 1c18ed4..eb3a0d0 100644
--- a/chrome/browser/net/chrome_url_request_context.cc
+++ b/chrome/browser/net/chrome_url_request_context.cc
@@ -142,7 +142,9 @@ ChromeURLRequestContext* ChromeURLRequestContext::CreateOriginal(
context->cookie_db_.reset(new SQLitePersistentCookieStore(
cookie_store_path.ToWStringHack(),
g_browser_process->db_thread()->message_loop()));
- context->cookie_store_ = new net::CookieMonster(context->cookie_db_.get());
+ context->cookie_store_ = new net::CookieMonster(
+ context->cookie_policy_.GetType() ==
+ net::CookiePolicy::SESSION_COOKIES ? NULL : context->cookie_db_.get());
}
return context;
@@ -390,6 +392,11 @@ void ChromeURLRequestContext::OnCookiePolicyChange(
DCHECK(MessageLoop::current() ==
ChromeThread::GetMessageLoop(ChromeThread::IO));
cookie_policy_.SetType(type);
+
+ if (is_off_the_record_ || type == net::CookiePolicy::SESSION_COOKIES)
+ cookie_store_->SetStore(NULL);
+ else
+ cookie_store_->SetStore(cookie_db_.get());
}
void ChromeURLRequestContext::OnNewExtensions(ExtensionPaths* new_paths) {