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

Unified Diff: chrome/browser/profile.cc

Issue 3210007: Add support for a "split" incognito behavior for extensions. (Closed)
Patch Set: latest Created 10 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
« no previous file with comments | « chrome/browser/net/chrome_url_request_context.cc ('k') | chrome/browser/profile_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profile.cc
diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc
index 2f1641ed03a7c99d6aa3b73203cff44458b7191d..5c3669cca58b2fd06aabd85c7caafc3aa901eb45 100644
--- a/chrome/browser/profile.cc
+++ b/chrome/browser/profile.cc
@@ -18,6 +18,8 @@
#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/download/download_manager.h"
#include "chrome/browser/file_system/file_system_host_context.h"
+#include "chrome/browser/extensions/extension_message_service.h"
+#include "chrome/browser/extensions/extension_process_manager.h"
#include "chrome/browser/find_bar_state.h"
#include "chrome/browser/in_process_webkit/webkit_context.h"
#include "chrome/browser/net/chrome_url_request_context.h"
@@ -119,6 +121,7 @@ class OffTheRecordProfileImpl : public Profile,
: profile_(real_profile),
start_time_(Time::Now()) {
request_context_ = ChromeURLRequestContextGetter::CreateOffTheRecord(this);
+ extension_process_manager_.reset(ExtensionProcessManager::Create(this));
// Register for browser close notifications so we can detect when the last
// off-the-record window is closed, in which case we can clean our states
@@ -134,6 +137,7 @@ class OffTheRecordProfileImpl : public Profile,
Source<Profile>(this),
NotificationService::NoDetails());
CleanupRequestContext(request_context_);
+ CleanupRequestContext(extensions_request_context_);
// Clean up all DB files/directories
ChromeThread::PostTask(
@@ -220,7 +224,7 @@ class OffTheRecordProfileImpl : public Profile,
}
virtual ExtensionProcessManager* GetExtensionProcessManager() {
- return GetOriginalProfile()->GetExtensionProcessManager();
+ return extension_process_manager_.get();
}
virtual ExtensionMessageService* GetExtensionMessageService() {
@@ -357,7 +361,12 @@ class OffTheRecordProfileImpl : public Profile,
}
URLRequestContextGetter* GetRequestContextForExtensions() {
- return GetOriginalProfile()->GetRequestContextForExtensions();
+ if (!extensions_request_context_) {
+ extensions_request_context_ =
+ ChromeURLRequestContextGetter::CreateOffTheRecordForExtensions(this);
+ }
+
+ return extensions_request_context_;
}
virtual net::SSLConfigService* GetSSLConfigService() {
@@ -543,9 +552,14 @@ class OffTheRecordProfileImpl : public Profile,
// The real underlying profile.
Profile* profile_;
+ scoped_ptr<ExtensionProcessManager> extension_process_manager_;
+
// The context to use for requests made from this OTR session.
scoped_refptr<ChromeURLRequestContextGetter> request_context_;
+ // The context to use for requests made by an extension while in OTR mode.
+ scoped_refptr<ChromeURLRequestContextGetter> extensions_request_context_;
+
// The download manager that only stores downloaded items in memory.
scoped_refptr<DownloadManager> download_manager_;
« no previous file with comments | « chrome/browser/net/chrome_url_request_context.cc ('k') | chrome/browser/profile_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698