AppShell: Implement proper application lifetime |
||||
Issue descriptionAppShell 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.
,
Sep 6 2017
,
Jan 27 2018
,
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
,
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
,
Mar 10 2018
|
||||
►
Sign in to add a comment |
||||
Comment 1 by bugdroid1@chromium.org
, Sep 2 2017