Commit 82e6f94c authored by Istiaque Ahmed's avatar Istiaque Ahmed Committed by Commit Bot

[ESW] Ignore ExtensionFunctions appearing after worker has stopped.

ExtensionFunction can appear after a worker has already stopped. Trying
to execute the ExtensionFunction results in EFD::CheckPermissions failure.

As the worker is stopped, we can safely ignore this extension function.

Subsequent CL will add tests for this once crbug/999027 is completely
fixed.

  related patches.

Bug: 999027
Test: Locally trying UpdatePackedExtension test few thousand time with
Change-Id: I6e8d8716d4bec349034502233782ada8674d1325
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1832465
Commit-Queue: Istiaque Ahmed <lazyboy@chromium.org>
Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#706036}
parent 40fe2b90
......@@ -296,6 +296,13 @@ void ExtensionFunctionDispatcher::Dispatch(
if (!rph)
return;
WorkerId worker_id{params.extension_id, render_process_id,
params.service_worker_version_id,
params.worker_thread_id};
// Ignore if the worker has already stopped.
if (!ProcessManager::Get(browser_context_)->HasServiceWorker(worker_id))
return;
WorkerResponseCallbackMapKey key(render_process_id,
params.service_worker_version_id);
UIThreadWorkerResponseCallbackWrapperMap::const_iterator iter =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment