Chromium Code Reviews

Unified Diff: android_webview/browser/net/aw_url_request_context_getter.cc

Issue 12546016: Remove the Extensions URLRequestContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: android_webview/browser/net/aw_url_request_context_getter.cc
diff --git a/android_webview/browser/net/aw_url_request_context_getter.cc b/android_webview/browser/net/aw_url_request_context_getter.cc
index eed948f0b17e84f6ad2ebf261ac7bf9486b93985..eb7fdbb7fa1ff471cf864485894fc9b041ade038 100644
--- a/android_webview/browser/net/aw_url_request_context_getter.cc
+++ b/android_webview/browser/net/aw_url_request_context_getter.cc
@@ -18,6 +18,7 @@
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/cookie_store_factory.h"
#include "content/public/common/content_client.h"
+#include "content/public/common/content_constants.h"
#include "content/public/common/url_constants.h"
#include "net/base/cache_type.h"
#include "net/cookies/cookie_store.h"
@@ -54,12 +55,15 @@ AwURLRequestContextGetter::~AwURLRequestContextGetter() {
void AwURLRequestContextGetter::Init() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- cookie_store_ = content::CreatePersistentCookieStore(
- browser_context_->GetPath().Append(FILE_PATH_LITERAL("Cookies")),
- true,
- NULL,
- NULL);
- cookie_store_->GetCookieMonster()->SetPersistSessionCookies(true);
+ // By default session cookies are always restored. An Android application can
+ // control this policy by calling CookieManager.removeSessionCookie() when
+ // Activity.onCreate() is called with savedInstanceState == null.
+ cookie_store_ = content::CreateCookieStore(
+ content::CookieStoreConfig(
+ browser_context_->GetPath().Append(content::kCookieFilename),
+ content::CookieStoreConfig::RESTORED_SESSION_COOKIES,
+ NULL,
+ NULL));
// The CookieMonster must be passed here so it happens synchronously to
// the main thread initialization (to avoid race condition in another

Powered by Google App Engine