PlzDedicatedWorker: Fix origin comparison for a blob url worker
This CL fixes origin comparison on IsSameOriginClientContainerHost() for blob url workers. This fixes WPTs for clients.claim() when PlzDedicatedWorker is enabled. Before this CL, IsSameOriginClientContainerHost() took an origin from ServiceWorkerContainerHost::url() that returns GURL. However, this didn't work when the function returns a blob url (e.g., when the container host is for a blob url worker) because GURL::GetOrigin() cannot retrieve an origin from blob URLs (see https://crbug.com/1144717). After this CL, the function takes the origin from ServiceWorkerContainerHost::GetUrlForScopeMatch(). Even for blob url workers, this returns a non-blob URL inherited from their parent. It should be valid to take the origin from the alternative URL because it's guaranteed that they are in the same origin. This might not align with the spec based on the discussion in the issues, but we implement this to keep compatibilities: - https://github.com/w3c/ServiceWorker/issues/1265 - https://github.com/w3c/ServiceWorker/issues/1554 Bug: 1017034 Change-Id: Ia167c1acaa665ac08e433d37f78d4c5b22383ab2 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2600420 Commit-Queue: Asami Doi <asamidoi@chromium.org> Reviewed-by:Hiroki Nakagawa <nhiroki@chromium.org> Cr-Commit-Position: refs/heads/master@{#842892}
Showing
Please register or sign in to comment