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

Unified Diff: chrome/browser/profiles/profile.cc

Issue 7024056: Handle extension webrequest API on the IO thread. This speeds up blocking event (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 9 years, 6 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_network_delegate.cc ('k') | chrome/browser/profiles/profile_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile.cc
diff --git a/chrome/browser/profiles/profile.cc b/chrome/browser/profiles/profile.cc
index 03f01130783c1a47a25112e4b05a2e8a5225a70f..b61febd8e34485facc1feacbd6ac4094a8a40a4e 100644
--- a/chrome/browser/profiles/profile.cc
+++ b/chrome/browser/profiles/profile.cc
@@ -81,6 +81,18 @@ net::URLRequestContextGetter* Profile::default_request_context_;
namespace {
+void NotifyOTRProfileCreatedOnIOThread(ProfileId original_profile_id,
+ ProfileId otr_profile_id) {
+ ExtensionWebRequestEventRouter::GetInstance()->OnOTRProfileCreated(
+ original_profile_id, otr_profile_id);
+}
+
+void NotifyOTRProfileDestroyedOnIOThread(ProfileId original_profile_id,
+ ProfileId otr_profile_id) {
+ ExtensionWebRequestEventRouter::GetInstance()->OnOTRProfileDestroyed(
+ original_profile_id, otr_profile_id);
+}
+
} // namespace
Profile::Profile()
@@ -231,6 +243,12 @@ class OffTheRecordProfileImpl : public Profile,
// Make the chrome//extension-icon/ resource available.
ExtensionIconSource* icon_source = new ExtensionIconSource(real_profile);
GetChromeURLDataManager()->AddDataSource(icon_source);
+
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
+ NewRunnableFunction(
+ &NotifyOTRProfileCreatedOnIOThread,
+ profile_->GetRuntimeId(), GetRuntimeId()));
}
virtual ~OffTheRecordProfileImpl() {
@@ -240,6 +258,12 @@ class OffTheRecordProfileImpl : public Profile,
ProfileDependencyManager::GetInstance()->DestroyProfileServices(this);
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
+ NewRunnableFunction(
+ &NotifyOTRProfileDestroyedOnIOThread,
+ profile_->GetRuntimeId(), GetRuntimeId()));
+
// Clean up all DB files/directories
if (db_tracker_)
BrowserThread::PostTask(
« no previous file with comments | « chrome/browser/net/chrome_network_delegate.cc ('k') | chrome/browser/profiles/profile_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698