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

Issue 6870016: Refcount browser process in BaseLoginDisplayHost so message loop does not exit (Closed)

Created:
9 years, 8 months ago by rhashimoto
Modified:
9 years, 7 months ago
CC:
chromium-reviews, oshima, Emmanuel Saint-loubert-BiƩ
Visibility:
Public.

Description

Refcount browser process in BaseLoginDisplayHost so message loop does not exit When no browser is present - e.g. on the ChromeOS login screen - BrowserProcessImpl::module_ref_count was 0. New message loop clients (such as menus) could acquire and release this ref count, which would cause the message loop and the process to exit. Some login screen object should hold a reference on the message loop. This CL gives that responsibility to BaseLoginDisplayHost. Email discussion follows: On Fri, Apr 15, 2011 at 11:55 AM, Nikita Kostylev <nkostylev@google.com>; wrote: > How about incrementing it in BaseLoginDisplayHost ctor, decrementing in > destructor? > chrome/browser/chromeos/login/base_login_display_host.cc > BaseLoginDisplayHost instance is created when Chrome OS is booted > (see base_login_display_host.cc::200) and exists till user signs in or > starts Guest session. > base_login_display_host.cc::101 > void BaseLoginDisplayHost::OnSessionStart() { > MessageLoop::current()->DeleteSoon(FROM_HERE, this); > } > Since it's DeleteSoon, Browser will already exist when BaseLoginDisplayHost > destructor is called. > On Fri, Apr 15, 2011 at 10:34 PM, Mitsuru Oshima <oshima@google.com>; wrote: >> >> +anton who may also know this. >> >> On Fri, Apr 15, 2011 at 11:33 AM, Roy Hashimoto <rhashimoto@google.com>; >> wrote: >>> >>> Any feedback on whether and how the ChromeOS login screen should hold >>> a reference count on the message loop? >>> >>> Thanks, >>> Roy >>> >>> On Thu, Apr 14, 2011 at 3:06 PM, Roy Hashimoto <rhashimoto@google.com>; >>> wrote: >>> > Hi Dave - >>> > >>> > Oshima-san suggested that you might have an answer to an issue I'm >>> > having with menus. In order to keep the message loop running even if >>> > the browser exits, the MenuController class calls a ref/unref on >>> > ViewsDelegate which calls AddRefModule/ReleaseRefModule on >>> > g_browser_process. The problem is that when no browser is present - >>> > e.g. on the ChromeOS login screen - that reference count is 0, so >>> > using this menu class increments the count to 1 and decrements it to 0 >>> > and that exits the message loop and ends the process. >>> > >>> > It seems like some login screen class should be calling >>> > AddRefModule/ReleaseRefModule since it is using the message loop. >>> > Would you agree, and if you do, where should those calls be made? >>> > It's a little tricky because we have to be sure that the transition >>> > from login screen to browser adjusts the count in the proper order. BUG=none TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=82327

Patch Set 1 #

Patch Set 2 : Delete LoginDisplayHost in MessageLoop::Run() context in test framework. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+11 lines, -1 line) Patch
M chrome/browser/chromeos/login/base_login_display_host.cc View 1 chunk +10 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/login/wizard_in_process_browser_test.cc View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 6 (0 generated)
rhashimoto
Whoops, should have run the trybot before adding a reviewer. Will resolve failures and update. ...
9 years, 8 months ago (2011-04-16 03:51:05 UTC) #1
Nikita (slow)
On 2011/04/16 03:51:05, rhashimoto wrote: > Whoops, should have run the trybot before adding a ...
9 years, 8 months ago (2011-04-16 11:20:26 UTC) #2
rhashimoto
On 2011/04/16 11:20:26, Nikita Kostylev wrote: > On 2011/04/16 03:51:05, rhashimoto wrote: > > Whoops, ...
9 years, 8 months ago (2011-04-18 20:25:45 UTC) #3
Nikita (slow)
LGTM
9 years, 8 months ago (2011-04-19 12:53:36 UTC) #4
commit-bot: I haz the power
Try job failure for 6870016-3001 on mac: http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=mac&number=23321
9 years, 8 months ago (2011-04-20 16:35:41 UTC) #5
commit-bot: I haz the power
9 years, 8 months ago (2011-04-20 18:07:40 UTC) #6

Powered by Google App Engine
This is Rietveld 408576698