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

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: fix broken test 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
Index: chrome/browser/profiles/profile.cc
diff --git a/chrome/browser/profiles/profile.cc b/chrome/browser/profiles/profile.cc
index ad93f4667d8acaa270008f3502d3562714f111ed..57712bf582c1ed0470686f40360a2ec1e438531b 100644
--- a/chrome/browser/profiles/profile.cc
+++ b/chrome/browser/profiles/profile.cc
@@ -81,6 +81,18 @@ net::URLRequestContextGetter* Profile::default_request_context_;
namespace {
+static void NotifyOTRProfileCreatedOnIOThread(ProfileId original_profile_id,
Mihai Parparita -not on Chrome 2011/06/08 01:11:59 I thought that using an anonymous namespace was eq
Matt Perry 2011/06/08 20:47:00 Done. (There's a slight difference, but it doesn'
+ ProfileId otr_profile_id) {
+ ExtensionWebRequestEventRouter::GetInstance()->OnOTRProfileCreated(
+ original_profile_id, otr_profile_id);
+}
+
+static void NotifyOTRProfileDestroyedOnIOThread(ProfileId original_profile_id,
+ ProfileId otr_profile_id) {
+ ExtensionWebRequestEventRouter::GetInstance()->OnOTRProfileDestroyed(
+ original_profile_id, otr_profile_id);
+}
+
} // namespace
Profile::Profile()
@@ -223,6 +235,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(), reinterpret_cast<ProfileId>(this)));
Mihai Parparita -not on Chrome 2011/06/08 01:11:59 Use GetRuntimeId instead of the cast? I think that
Matt Perry 2011/06/08 20:47:00 Done.
}
virtual ~OffTheRecordProfileImpl() {
@@ -232,6 +250,12 @@ class OffTheRecordProfileImpl : public Profile,
ProfileDependencyManager::GetInstance()->DestroyProfileServices(this);
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
+ NewRunnableFunction(
+ &NotifyOTRProfileDestroyedOnIOThread,
+ profile_->GetRuntimeId(), reinterpret_cast<ProfileId>(this)));
Mihai Parparita -not on Chrome 2011/06/08 01:11:59 Ditto.
Matt Perry 2011/06/08 20:47:00 Done.
+
// Clean up all DB files/directories
if (db_tracker_)
BrowserThread::PostTask(

Powered by Google App Engine
This is Rietveld 408576698