ServiceWorker: Fix the lifetime of OnFetchEventFinished()
SWFetchDispatcher is destroyed after response is reached. Once the dispatcher is destroyed, SWVersion::FinishRequest() in FetchEventFinished() is never called. A service worker can't be terminated without calling FinishRequest() and it leads to increase the memory usage. This CL makes OnFetchEventFinished() static to enable to call it after SWFetchDispatcher is destructed. The new browser tests introduced in this CL make sure SWVersion::StartRequest() and SWVersion::FinishRequest() are called the same number of times. Without this CL, the tests fail. Bug: 1145551 Change-Id: I3f6ac9d2bdb19e58802f37650288b24e22bb7d54 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2543534 Commit-Queue: Asami Doi <asamidoi@chromium.org> Reviewed-by:Makoto Shimazu <shimazu@chromium.org> Cr-Commit-Position: refs/heads/master@{#834142}
Showing
Please register or sign in to comment