Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1631)

Unified Diff: android_webview/browser/aw_browser_context.cc

Issue 12546016: Remove the Extensions URLRequestContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: android webview init fix merged in. Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: android_webview/browser/aw_browser_context.cc
diff --git a/android_webview/browser/aw_browser_context.cc b/android_webview/browser/aw_browser_context.cc
index 9700645683e3a551ed056b8cae2a4e66a8bee5a0..20b739130dc7a917a1470a67e9d15399812217ca 100644
--- a/android_webview/browser/aw_browser_context.cc
+++ b/android_webview/browser/aw_browser_context.cc
@@ -21,6 +21,9 @@
#include "content/public/browser/resource_context.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/browser/web_contents.h"
+#include "content/public/common/content_constants.h"
+#include "content/public/common/url_constants.h"
+#include "net/cookies/cookie_monster.h"
#include "net/url_request/url_request_context.h"
namespace android_webview {
@@ -95,16 +98,11 @@ AwBrowserContext* AwBrowserContext::FromWebContents(
}
void AwBrowserContext::PreMainMessageLoopRun() {
- cookie_store_ = content::CreatePersistentCookieStore(
- GetPath().Append(FILE_PATH_LITERAL("Cookies")),
- true,
- NULL,
- NULL);
- cookie_store_->GetCookieMonster()->SetPersistSessionCookies(true);
- url_request_context_getter_ =
- new AwURLRequestContextGetter(GetPath(), cookie_store_.get());
+ url_request_context_getter_ = new AwURLRequestContextGetter(GetPath());
- DidCreateCookieMonster(cookie_store_->GetCookieMonster());
+ DidCreateCookieMonster(
+ GetDefaultStoragePartition(this)->GetCookieStoreForScheme(
+ chrome::kHttpScheme)->GetCookieMonster());
visitedlink_master_.reset(
new visitedlink::VisitedLinkMaster(this, this, false));
@@ -182,6 +180,22 @@ base::FilePath AwBrowserContext::GetPath() const {
return context_storage_path_;
}
+void AwBrowserContext::OverrideCookieStoreConfigs(
+ const base::FilePath& partition_path,
+ bool in_memory_partition,
+ bool is_default_partition,
+ CookieSchemeMap* configs) {
+ using content::CookieStoreConfig;
+ configs->clear();
+ // 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.
+ (*configs)[content::BrowserContext::kDefaultCookieScheme] =
+ CookieStoreConfig(partition_path.Append(content::kCookieFilename),
+ CookieStoreConfig::RESTORED_SESSION_COOKIES,
+ NULL, NULL);
+}
+
bool AwBrowserContext::IsOffTheRecord() const {
// Android WebView does not support off the record profile yet.
return false;
« no previous file with comments | « android_webview/browser/aw_browser_context.h ('k') | android_webview/browser/net/aw_url_request_context_getter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698