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

Unified Diff: chrome/browser/chromeos/login/base_login_display_host.cc

Issue 6870016: Refcount browser process in BaseLoginDisplayHost so message loop does not exit (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Delete LoginDisplayHost in MessageLoop::Run() context in test framework. Created 9 years, 8 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 | « no previous file | chrome/browser/chromeos/login/wizard_in_process_browser_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/base_login_display_host.cc
diff --git a/chrome/browser/chromeos/login/base_login_display_host.cc b/chrome/browser/chromeos/login/base_login_display_host.cc
index ce8a9f7a89edb62716234d2bee970215ee53ff87..90f5a59a07e64925149c1abcb115075239cdcdb7 100644
--- a/chrome/browser/chromeos/login/base_login_display_host.cc
+++ b/chrome/browser/chromeos/login/base_login_display_host.cc
@@ -90,9 +90,19 @@ BaseLoginDisplayHost::BaseLoginDisplayHost(const gfx::Rect& background_bounds)
NotificationService::AllSources());
DCHECK(default_host_ == NULL);
default_host_ = this;
+
+ // Add a reference count so the message loop won't exit when other
+ // message loop clients (e.g. menus) do.
+ g_browser_process->AddRefModule();
}
BaseLoginDisplayHost::~BaseLoginDisplayHost() {
+ // A browser should already exist when destructor is called since
+ // deletion is scheduled with MessageLoop::DeleteSoon() from
+ // OnSessionStart(), so the browser will already have incremented
+ // the reference count.
+ g_browser_process->ReleaseModule();
+
default_host_ = NULL;
}
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/wizard_in_process_browser_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698