Chromium Code Reviews| 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( |