commit | fa4e0b04a6863f51eb542143bb3e15a0056307e2 | [log] [tgz] |
---|---|---|
author | Matt Falkenhagen <falken@chromium.org> | Tue May 21 03:08:23 2019 |
committer | Commit Bot <commit-bot@chromium.org> | Tue May 21 03:08:23 2019 |
tree | 922fd00c17453f9915f584a69dc52686c69e4d71 | |
parent | d59383294490127e39d4ee800068c261b201ed30 [diff] |
service worker: When installed script data can't be read, tell the worker. Before this CL, when ServiceWorkerInstalledScriptsSender failed to read the script data from disk, it would call DeleteVersion() which calls Doom() on the worker, which sends the Stop IPC. However, the service worker thread would still be blocked waiting for the script data so it wouldn't respond to the Stop IPC. Eventually start worker is aborted because of the 5 second stop worker timeout on the browser process, but this is slow and roundabout. It causes ServiceWorkerVersionBrowserTest.ReadResourceFailure* to take over 5 seconds to run. To fix this, break the Mojo connection with the service worker like the other failure cases. This causes the service worker to quickly terminate via: 1. The Internal instance in service_worker_installed_scripts_manager.cc destructs due to Mojo strong binding and sets |are_all_data_added_|. 2. ThreadSafeScriptContainer::WaitOnWorkerThread() detects that the browser failed to send the script. 3. ServiceWorkerInstalledScriptsManager::GetScriptData() returns nullptr. 4. ServiceWorkerGlobalScope::RunInstalledClassicScript() reports failure to load the script and self-terminates with close(). Bug: 964201 Change-Id: I6f2ee8ef0864ba64b0a13827640d6bf2d44cbade Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1621413 Reviewed-by: Makoto Shimazu <shimazu@chromium.org> Commit-Queue: Matt Falkenhagen <falken@chromium.org> Cr-Commit-Position: refs/heads/master@{#661600}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .