[webkit-changes] [WebKit/WebKit] cf4c6b: workers/opaque-origin.html WPT is failing in WebKi...

Chris Dumez noreply at github.com
Thu Jun 1 10:12:17 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: cf4c6bcca8bdcea58e4e38f59512f9d6a15c7d48
      https://github.com/WebKit/WebKit/commit/cf4c6bcca8bdcea58e4e38f59512f9d6a15c7d48
  Author: Chris Dumez <cdumez at apple.com>
  Date:   2023-06-01 (Thu, 01 Jun 2023)

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/workers/opaque-origin-expected.txt
    M Source/WebCore/fileapi/BlobURL.cpp
    M Source/WebCore/fileapi/ThreadableBlobRegistry.cpp
    M Source/WebCore/page/SecurityOrigin.cpp

  Log Message:
  -----------
  workers/opaque-origin.html WPT is failing in WebKit only
https://bugs.webkit.org/show_bug.cgi?id=257573

Reviewed by Darin Adler.

ThreadableBlobRegistry was storing Blob URL opaque origins in per thread storage.
As a result, if a context with an opaque origin creates a worker, the worker
and the context won't be able to access each other's blobs. As a matter of fact,
the worker won't even be able to load the blobs it created since we hop to the
main thread to do the loading.

To address the issue, ThreadableBlobRegistry now stores origins in a global map,
that is always accessed on the main thread. Also tweak SecurityOrigin::canRequest()
and another call site so that it doesn't only do a pointer check for cached blob
origins. This is important since the origins get isolated-copied across threads.

* LayoutTests/imported/w3c/web-platform-tests/workers/opaque-origin-expected.txt:
* Source/WebCore/fileapi/ThreadableBlobRegistry.cpp:
(WebCore::WTF_REQUIRES_LOCK):
(WebCore::unregisterBlobURLOriginIfNecessary):
(WebCore::ThreadableBlobRegistry::registerBlobURL):
(WebCore::ThreadableBlobRegistry::registerBlobURLHandle):
(WebCore::ThreadableBlobRegistry::getCachedOrigin):
(WebCore::originMap): Deleted.
(WebCore::blobURLReferencesMap): Deleted.
* Source/WebCore/page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::canRequest const):

Canonical link: https://commits.webkit.org/264799@main




More information about the webkit-changes mailing list