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

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

Issue 10824020: Move PROFILE_DESTROYED notification to ProfileDestroyer and observe it in ExtensionProcessManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: destroy original profile->destroy incognito EPM Created 8 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
« no previous file with comments | « chrome/browser/profiles/profile.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_destroyer.cc
diff --git a/chrome/browser/profiles/profile_destroyer.cc b/chrome/browser/profiles/profile_destroyer.cc
index fcf5f10790015fd00f7bc65ccb7f9c1885f3f46a..59f7dd5ad7c954d9ded6f902305e5c1e4afac458 100644
--- a/chrome/browser/profiles/profile_destroyer.cc
+++ b/chrome/browser/profiles/profile_destroyer.cc
@@ -24,6 +24,8 @@ std::vector<ProfileDestroyer*>* ProfileDestroyer::pending_destroyers_ = NULL;
// static
void ProfileDestroyer::DestroyProfileWhenAppropriate(Profile* const profile) {
DCHECK(profile);
+ profile->MaybeSendDestroyedNotification();
+
std::vector<content::RenderProcessHost*> hosts;
// Testing profiles can simply be deleted directly. Some tests don't setup
// RenderProcessHost correctly and don't necessary run on the UI thread
@@ -85,7 +87,7 @@ ProfileDestroyer::ProfileDestroyer(
pending_destroyers_->push_back(this);
for (size_t i = 0; i < hosts.size(); ++i) {
registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_TERMINATED,
- content::Source<content::RenderProcessHost>(hosts[i]));
+ content::Source<content::RenderProcessHost>(hosts[i]));
// For each of the notifications, we bump up our reference count.
// It will go back to 0 and free us when all hosts are terminated.
++num_hosts_;
@@ -126,6 +128,8 @@ void ProfileDestroyer::Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
DCHECK(type == content::NOTIFICATION_RENDERER_PROCESS_TERMINATED);
+ registrar_.Remove(this, content::NOTIFICATION_RENDERER_PROCESS_TERMINATED,
+ source);
DCHECK(num_hosts_ > 0);
--num_hosts_;
if (num_hosts_ == 0) {
« no previous file with comments | « chrome/browser/profiles/profile.cc ('k') | chrome/browser/profiles/profile_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698