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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 12546016: Remove the Extensions URLRequestContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: most unittests pass Created 7 years, 5 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: chrome/browser/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index 86e75848aacd888e4bce09577aa450e86be6be31..7191d3adbc9a3b49175762236359de4132bf6b42 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -116,6 +116,8 @@
#include "content/public/browser/child_process_data.h"
#include "content/public/browser/child_process_security_policy.h"
#include "content/public/browser/compositor_util.h"
+#include "content/public/browser/cookie_store_factory.h"
+#include "content/public/browser/cookie_store_map.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/resource_context.h"
@@ -123,6 +125,7 @@
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_view.h"
#include "content/public/common/child_process_host.h"
+#include "content/public/common/content_constants.h"
#include "content/public/common/content_descriptors.h"
#include "extensions/browser/view_type_utils.h"
#include "extensions/common/constants.h"
@@ -133,6 +136,7 @@
#include "net/base/mime_util.h"
#include "net/cookies/canonical_cookie.h"
#include "net/cookies/cookie_options.h"
+#include "net/cookies/cookie_store.h"
#include "net/ssl/ssl_cert_request_info.h"
#include "ppapi/host/ppapi_host.h"
#include "ui/base/l10n/l10n_util.h"
@@ -1695,16 +1699,37 @@ bool ChromeContentBrowserClient::AllowWorkerIndexedDB(
return allow;
}
-net::URLRequestContext*
-ChromeContentBrowserClient::OverrideRequestContextForURL(
- const GURL& url, content::ResourceContext* context) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- if (url.SchemeIs(extensions::kExtensionScheme)) {
- ProfileIOData* io_data = ProfileIOData::FromResourceContext(context);
- return io_data->extensions_request_context();
- }
+void ChromeContentBrowserClient::OverrideCookieStoreMap(
+ content::BrowserContext* browser_context,
+ bool in_memory,
+ const base::FilePath& partition_path,
+ bool is_default,
+ content::CookieStoreMap* cookie_store_map) {
+ using content::CreateCookieStore;
+ using content::CookieStoreConfig;
- return NULL;
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ net::CookieStore* cookie_store = NULL;
+ // This is called for each StoragePartition. Currently Extensions
+ // should only execute on the default partition.
+ if (is_default) {
+ if (in_memory) {
+ cookie_store = CreateCookieStore(CookieStoreConfig::InMemory());
+ } else {
+ base::FilePath cookie_path = partition_path.Append(
+ chrome::kExtensionsCookieFilename);
+ cookie_store = CreateCookieStore(
+ CookieStoreConfig::Persistent(
+ cookie_path,
+ browser_context->GetCookieStoreConfig()
+ .restore_old_session_cookies));
+ }
+
+
+ static const char* schemes[] = { extensions::kExtensionScheme };
+ cookie_store->GetCookieMonster()->SetCookieableSchemes(schemes, 1);
+ cookie_store_map->SetForScheme(extensions::kExtensionScheme, cookie_store);
+ }
}
QuotaPermissionContext*

Powered by Google App Engine
This is Rietveld 408576698