MacPWAs: Detect when app shims launch but terminate early
Change OpenApplicationWithPath to return the NSRunningApplication instead of just its pid. Use this in LaunchShim to detect when the process terminates, and issue a callback, which lands in AppShimHost::OnShimProcessTerminated. In AppShimHost, treat OnShimProcessTerminated just like a failure in OnShimProcessLaunched -- attempt to recreate the app bundles and launch again, and if that fails, close the app's windows. Ensure that only the first call to AppShimHost::LaunchShim do anything. Handle IsAcceptablyCodeSigned failing by closing the shim process and re-launching. This makes us re-generate app shims when they are not signed by the following sequence - The launch will attempt to launch from the Applications folder - If this is signed, success - If this is not signed (more likely), then it will fall through the same path -- the second AppShimHost::LaunchShim call will do nothing, and the shim process will terminate. - This termination will cause us to launch again, this time re-creating the shim, whereupon it should now be signed. Add tests for this sequence. Bug: 924482 Change-Id: I915c8fb3b9ee9b8fe109e7330d16673a4192e30a Reviewed-on: https://chromium-review.googlesource.com/c/1433442 Commit-Queue: ccameron <ccameron@chromium.org> Reviewed-by:Mark Mentovai <mark@chromium.org> Cr-Commit-Position: refs/heads/master@{#625769}
Showing
Please register or sign in to comment