New issue
Advanced search Search tips

Issue 759867 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 1
Type: Bug

Blocked on:
issue 762642

Blocking:
issue 714463



Sign in to add a comment

AppShell: Implement proper application lifetime

Project Member Reported by michae...@chromium.org, Aug 28 2017

Issue description

AppShell currently quits when all app windows are closed or when all root windows are closed.

It should stay alive if an app is in the process of reloading. See issue 759811.

We'll use KeepAliveRegistry to generalize these conditions.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Sep 2 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2dbce0d12e269610dad1b6846f2b5278a1d77f59

commit 2dbce0d12e269610dad1b6846f2b5278a1d77f59
Author: Michael Giuffrida <michaelpg@chromium.org>
Date: Sat Sep 02 03:30:59 2017

Componentize KeepAliveRegistry

KeepAliveRegistry in //chrome/browser/lifetime and its associated files
make up a useful component in themselves and will be used in
//extensions/shell.

The Chrome Browser-specific parts of //chrome/browser/lifetime are not
moved.

Bug:  759867 
Change-Id: Ia44e19f3ab3524bfe7b7fe600ef4794cd40f3cf7
Reviewed-on: https://chromium-review.googlesource.com/639716
Commit-Queue: Michael Giuffrida <michaelpg@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#499384}
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/BUILD.gn
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/app_controller_mac.mm
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/apps/app_window_interactive_uitest.cc
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/background/background_mode_manager.cc
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/background/background_mode_manager.h
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/background/background_mode_manager_unittest.cc
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/background/background_mode_optimizer.cc
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/background/background_mode_optimizer.h
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/browser_process_impl.cc
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/browser_process_impl.h
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/browser_process_platform_part_chromeos.cc
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/chromeos/BUILD.gn
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/chromeos/login/ui/login_display_host_impl.cc
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/extensions/api/content_settings/content_settings_apitest.cc
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/extensions/api/preference/preference_apitest.cc
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/lifetime/application_lifetime.cc
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/lifetime/browser_close_manager_browsertest.cc
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/notifications/message_center_notifications_browsertest.cc
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/notifications/platform_notification_service_impl.cc
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/notifications/platform_notification_service_interactive_uitest.cc
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/notifications/profile_notification.cc
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/page_load_metrics/page_load_metrics_browsertest.cc
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/profiles/profile_manager_browsertest.cc
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/push_messaging/push_messaging_browsertest.cc
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/push_messaging/push_messaging_service_impl.cc
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/safe_browsing/BUILD.gn
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_dialog_controller_impl_browsertest_win.cc
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/safe_browsing/chrome_cleaner/reporter_runner_browsertest_win.cc
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/sessions/better_session_restore_browsertest.cc
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/sessions/session_restore.cc
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/sessions/session_restore_browsertest.cc
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/sessions/session_restore_observer_browsertest.cc
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/sessions/tab_restore_browsertest.cc
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/ui/BUILD.gn
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/ui/app_list/profile_loader.cc
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/ui/apps/chrome_app_delegate.cc
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/ui/browser.cc
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/ui/startup/startup_browser_creator_triggered_reset_browsertest_win.cc
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/ui/views/BUILD.gn
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/ui/views/chrome_views_delegate.cc
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/ui/views/chrome_views_delegate_win.cc
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/ui/views/profiles/user_manager_view.cc
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/ui/views/uninstall_view.cc
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/ui/webui/profile_helper.cc
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/browser/ui/window_sizer/window_sizer_ash_uitest.cc
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/test/BUILD.gn
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/chrome/test/base/testing_browser_process.cc
[modify] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/components/BUILD.gn
[add] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/components/keep_alive_registry/BUILD.gn
[add] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/components/keep_alive_registry/DEPS
[rename] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/components/keep_alive_registry/keep_alive_registry.cc
[rename] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/components/keep_alive_registry/keep_alive_registry.h
[rename] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/components/keep_alive_registry/keep_alive_registry_unittest.cc
[rename] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/components/keep_alive_registry/keep_alive_state_observer.h
[rename] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/components/keep_alive_registry/keep_alive_types.cc
[rename] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/components/keep_alive_registry/keep_alive_types.h
[rename] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/components/keep_alive_registry/scoped_keep_alive.cc
[rename] https://crrev.com/2dbce0d12e269610dad1b6846f2b5278a1d77f59/components/keep_alive_registry/scoped_keep_alive.h

Blockedon: 762642
Labels: M-66
Project Member

Comment 4 by bugdroid1@chromium.org, Feb 19 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a324e41a6a868da44090e0f3015eb500a1e5f57d

commit a324e41a6a868da44090e0f3015eb500a1e5f57d
Author: Michael Giuffrida <michaelpg@chromium.org>
Date: Mon Feb 19 17:28:03 2018

AppShell: Create class to juggle keep-alives for apps

When a Chrome app restarts itself, its windows get closed before it is
unloaded. It will then be asynchronously loaded again and sent the
onLaunch event, at which point its background page may create a window.

At each of these steps, we might have no windows open. In AppShell,
closing the last window ends the main RunLoop. (Chrome has similar
behavior, but only when there are no other Chrome windows open and no
apps enabled that keep Chrome open in the background).

Work around this by creating keep-alives spanning from when the app is
unloaded for a reload, to when its first app window is shown. The tricky
part is removing the keep-alive if an app fails to reload, or if it
reloads but decides not to create a window.

This class could be used by Chrome's ExtensionService as well, with some
tweaks. See crbug.com/759811.

Bug:  759867 
Change-Id: I9040306ef18b8948d2f73e57e69de75a8aac997a
Reviewed-on: https://chromium-review.googlesource.com/911733
Reviewed-by: Ben Wells <benwells@chromium.org>
Reviewed-by: Cait Phillips <caitkp@chromium.org>
Commit-Queue: Michael Giuffrida <michaelpg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537671}
[modify] https://crrev.com/a324e41a6a868da44090e0f3015eb500a1e5f57d/extensions/shell/BUILD.gn
[modify] https://crrev.com/a324e41a6a868da44090e0f3015eb500a1e5f57d/extensions/shell/browser/DEPS
[add] https://crrev.com/a324e41a6a868da44090e0f3015eb500a1e5f57d/extensions/shell/browser/shell_keep_alive_requester.cc
[add] https://crrev.com/a324e41a6a868da44090e0f3015eb500a1e5f57d/extensions/shell/browser/shell_keep_alive_requester.h
[add] https://crrev.com/a324e41a6a868da44090e0f3015eb500a1e5f57d/extensions/shell/browser/shell_keep_alive_requester_unittest.cc

Project Member

Comment 5 by bugdroid1@chromium.org, Mar 9 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c176d79e115597bf129d60eab3a0a74024fb1da8

commit c176d79e115597bf129d60eab3a0a74024fb1da8
Author: Michael Giuffrida <michaelpg@chromium.org>
Date: Fri Mar 09 22:43:30 2018

AppShell: Enable chrome.runtime.reload()

Allow apps to reload themselves, and ensure the ShellDesktopControllerAura
keeps app_shell alive long enough for the app to come back up.

Add browser tests for ShellDesktopControllerAura and
chrome.runtime.reload() in AppShell.

Bug:  762642 , 759867 
Change-Id: If09ad83e6d3073461ebf8b53afa69a6c2aab7e15
Reviewed-on: https://chromium-review.googlesource.com/912752
Reviewed-by: James Cook <jamescook@chromium.org>
Commit-Queue: Michael Giuffrida <michaelpg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#542261}
[modify] https://crrev.com/c176d79e115597bf129d60eab3a0a74024fb1da8/extensions/shell/BUILD.gn
[add] https://crrev.com/c176d79e115597bf129d60eab3a0a74024fb1da8/extensions/shell/browser/api/runtime/runtime_apitest.cc
[rename] https://crrev.com/c176d79e115597bf129d60eab3a0a74024fb1da8/extensions/shell/browser/api/runtime/shell_runtime_api_delegate.cc
[rename] https://crrev.com/c176d79e115597bf129d60eab3a0a74024fb1da8/extensions/shell/browser/api/runtime/shell_runtime_api_delegate.h
[modify] https://crrev.com/c176d79e115597bf129d60eab3a0a74024fb1da8/extensions/shell/browser/shell_browsertest.cc
[modify] https://crrev.com/c176d79e115597bf129d60eab3a0a74024fb1da8/extensions/shell/browser/shell_desktop_controller_aura.cc
[modify] https://crrev.com/c176d79e115597bf129d60eab3a0a74024fb1da8/extensions/shell/browser/shell_desktop_controller_aura.h
[add] https://crrev.com/c176d79e115597bf129d60eab3a0a74024fb1da8/extensions/shell/browser/shell_desktop_controller_aura_browsertest.cc
[modify] https://crrev.com/c176d79e115597bf129d60eab3a0a74024fb1da8/extensions/shell/browser/shell_extension_system.cc
[modify] https://crrev.com/c176d79e115597bf129d60eab3a0a74024fb1da8/extensions/shell/browser/shell_extension_system.h
[modify] https://crrev.com/c176d79e115597bf129d60eab3a0a74024fb1da8/extensions/shell/browser/shell_extensions_browser_client.cc

Status: Fixed (was: Started)

Sign in to add a comment