Clarify semantics/ownership around WebWorkerFetchContext |
||
Issue description(At the time around or after https://chromium-review.googlesource.com/c/chromium/src/+/1193385) Unclear semantics around WebWorkerFetchContext might block off-the-main-thread work. For example: - Some parts of WebWorkerFetchContext subclasses are used as initialization parameters passed from the parent context and consumed/invalidated at InitializeOnWorkerThread(), while other parts remain valid throughout the lifetime of WebWorkerFetchContext. - Some objects are created from the initialization-parameter-ish part of WebWorkerFetchContext, but their ownership is held by multiple classes (e.g. by WebWorkerFetchContext and WorkerOrWorkletGlobalScope). - Some methods of WebWorkerFetchContext has destructive effects and "should be called only once", while the others can be called repeatedly.
,
Nov 9
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/7ede5922f5c054c81b5ea049651775ab0503582c commit 7ede5922f5c054c81b5ea049651775ab0503582c Author: Hiroshige Hayashizaki <hiroshige@chromium.org> Date: Fri Nov 09 14:46:31 2018 Enable multiple WorkerFetchContext per one global scope Currently WorkerFetchContext has the ownership of some objects originated from WebWorkerFetchContext. To create multiple WorkerFetchContexts for one WorkerOrWorkletGlobalScope/WebWorkerFetchContext, this CL moves these ownership outside WorkerFetchContext. Namely, - url_loader_factory_ and script_loader_factory_ from WorkerFetchContext to WebWorketFetchContext subclasses, and - subresource_filter_ from WorkerFetchContext to WorkerOrWorkletGlobalScope. Still |WorkerFetchContext::subresource_filter_| is kept, but it is created in WorkerOrWorkletGlobalScope and passed to WorkerFetchContext. This CL doesn't change the observable behavior. This CL creates WebURLLoaderFactory a little more eagerly, i.e. when WorkerFetchContext is created, while previously it was created when WorkerFetchContext::CreateURLLoader() is called for the first time. Bug: 880027, 903579 Change-Id: I84a8bafee25b7f293201a271d198260e2dfb8e68 Reviewed-on: https://chromium-review.googlesource.com/c/1193385 Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by: Tsuyoshi Horo <horo@chromium.org> Reviewed-by: Kinuko Yasuda <kinuko@chromium.org> Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org> Cr-Commit-Position: refs/heads/master@{#606835} [modify] https://crrev.com/7ede5922f5c054c81b5ea049651775ab0503582c/content/renderer/loader/web_worker_fetch_context_impl.cc [modify] https://crrev.com/7ede5922f5c054c81b5ea049651775ab0503582c/content/renderer/loader/web_worker_fetch_context_impl.h [modify] https://crrev.com/7ede5922f5c054c81b5ea049651775ab0503582c/content/renderer/service_worker/service_worker_fetch_context_impl.cc [modify] https://crrev.com/7ede5922f5c054c81b5ea049651775ab0503582c/content/renderer/service_worker/service_worker_fetch_context_impl.h [modify] https://crrev.com/7ede5922f5c054c81b5ea049651775ab0503582c/third_party/blink/public/platform/web_worker_fetch_context.h [modify] https://crrev.com/7ede5922f5c054c81b5ea049651775ab0503582c/third_party/blink/renderer/core/loader/worker_fetch_context.cc [modify] https://crrev.com/7ede5922f5c054c81b5ea049651775ab0503582c/third_party/blink/renderer/core/loader/worker_fetch_context.h [modify] https://crrev.com/7ede5922f5c054c81b5ea049651775ab0503582c/third_party/blink/renderer/core/workers/worker_or_worklet_global_scope.cc [modify] https://crrev.com/7ede5922f5c054c81b5ea049651775ab0503582c/third_party/blink/renderer/core/workers/worker_or_worklet_global_scope.h
,
Nov 14
|
||
►
Sign in to add a comment |
||
Comment 1 by hirosh...@chromium.org
, Nov 8