haikuwebkit/Source/WTF/ChangeLog

7326 lines
285 KiB
Plaintext
Raw Permalink Normal View History

overwriteCodePoint() in createAndFillGlyphPage() is wrong https://bugs.webkit.org/show_bug.cgi?id=215643 <rdar://problem/67430461> Reviewed by Alan Bujtas. Source/WebCore: The CSS spec says that certain characters have to be invisible. Previously, we were doing this by just treating these characters as if they were the zero width space character. However, this is wrong for 2 reasons: 1. If the primary font supports the desired character but doesn't support the zero width space character, we'll fallback past it and trigger a download for secondary fonts until we find one that supports the ZWS character (which the page didn't even ask for!) 2. Shaping is Turing-complete, and expects that the correct glyphIDs are fed into the shaper. We can't just arbitrarily swap out glyphIDs before shaping just because we feel like it. Instead, the solution is to handle these invisible characters after font fallback, and after shaping. This patch does it just like we handle adding letter-spacing, word-spacing, and justification after shaping - by iterating over the glyphs output by the shaper and seeing if any need to be adjusted. This patch also includes a fix for the situation where the glyph buffer might be left in an inconsistent state, where the array of glyphs is shorter than the array of characters - this new codepath added in this patch revealed this existing problem, and fixes it here too. Test: fast/text/zwj-ligature.html * platform/graphics/Font.cpp: (WebCore::createAndFillGlyphPage): (WebCore::overrideControlCharacters): Deleted. * platform/graphics/GlyphBuffer.h: (WebCore::GlyphBuffer::glyphAt const): (WebCore::GlyphBuffer::deleteGlyphWithoutAffectingSize): * platform/graphics/WidthIterator.cpp: (WebCore::WidthIterator::applyCSSVisibilityRules): (WebCore::WidthIterator::advance): * platform/graphics/WidthIterator.h: Source/WTF: * wtf/unicode/CharacterNames.h: LayoutTests: * fast/text/resources/Ahem-GSUB-ligatures.ttf: Added. * fast/text/zwj-ligature-expected.html: Added. * fast/text/zwj-ligature.html: Added. * platform/mac/fast/text/format-control-expected.txt: Progression! A new ligature is formed that wasn't formed before. Also, this ligature is formed in both Chrome and Firefox, so we match them now. * platform/win/TestExpectations: Canonical link: https://commits.webkit.org/240804@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281389 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-08-22 05:41:27 +00:00
2021-08-21 Myles C. Maxfield <mmaxfield@apple.com>
overwriteCodePoint() in createAndFillGlyphPage() is wrong
https://bugs.webkit.org/show_bug.cgi?id=215643
<rdar://problem/67430461>
Reviewed by Alan Bujtas.
* wtf/unicode/CharacterNames.h:
2021-08-21 Sihui Liu <sihui_liu@apple.com>
IndexedDB: crash when triggering IDBOpenRequest completion back on a worker thread
https://bugs.webkit.org/show_bug.cgi?id=229375
Protect callee in CrossThreadTask if it inherits from ThreadSafeRefCounted<T>.
Reviewed by Brady Eidson.
* wtf/CrossThreadTask.h:
2021-08-20 Mark Lam <mark.lam@apple.com>
Make ptrTagName and tagForPtr WTF_EXPORT_PRIVATE.
https://bugs.webkit.org/show_bug.cgi?id=229328
Reviewed by Yusuke Suzuki.
If ptrTagName and tagForPtr are defined, make them WTF_EXPORT_PRIVATE instead of
static functions. This allows us to call them from the debugger during
interactive debugging sessions.
* wtf/PtrTag.cpp:
(WTF::tagForPtr):
(WTF::ptrTagName):
* wtf/PtrTag.h:
2021-08-20 Mark Lam <mark.lam@apple.com>
Remove assertIsTagged and assertIsNullOrTagged.
https://bugs.webkit.org/show_bug.cgi?id=229329
rdar://82162851
Reviewed by Yusuke Suzuki.
These assertion utility functions rely on tagged pointers always having non-zero
PAC bits. This is an incorrect assumption. A tagged pointer can have PAC bits
that are completely zero. Hence, these assert functions cannot be made to work
reliably. We should remove them to prevent them from being used, and potentially
resulting in flaky assertion failures that will be hard to debug later.
Note: assertIsNotTagged is fine to keep. It asserts that PAC bits of a pointer
are all 0. As a result, this assertion can have false positives where it may think
a tagged pointer is an untagged pointer. However, this is rare because it is not
common to have 0 PAC bits in tagged pointers. False positives on this assertion
won't result in flaky test failures that will waste our time later. Hence,
keeping the assertion will do more good (it will tend to help us find bugs) than
bad (it will rarely let false positives thru). As a result, I'm opting to not
remove it.
* wtf/PtrTag.h:
(WTF::assertIsTagged): Deleted.
(WTF::assertIsNullOrTagged): Deleted.
[:has() pseudo-class] Basic support https://bugs.webkit.org/show_bug.cgi?id=228894 Reviewed by Simon Fraser. LayoutTests/imported/w3c: * web-platform-tests/css/selectors/has-basic-expected.txt: * web-platform-tests/css/selectors/has-relative-argument-expected.txt: * web-platform-tests/css/selectors/parsing/parse-has-expected.txt: * web-platform-tests/dom/nodes/Element-closest-expected.txt: Source/WebCore: This patch adds basic support for :has() pseudo-class, https://drafts.csswg.org/selectors/#has-pseudo. The initial implementation is very inefficient. There is no support for invalidation yet. The feature is disabled by default. * css/CSSSelector.cpp: (WebCore::CSSSelector::selectorText const): Serialization. * css/CSSSelector.h: * css/SelectorChecker.cpp: (WebCore::SelectorChecker::checkOne const): Selector matching using nested SelectorChecker. * css/SelectorPseudoClassAndCompatibilityElementMap.in: * css/parser/CSSParserContext.cpp: (WebCore::operator==): (WebCore::add): * css/parser/CSSParserContext.h: * css/parser/CSSParserSelector.h: (WebCore::CSSParserSelector::setPseudoClassType): * css/parser/CSSSelectorParser.cpp: (WebCore::CSSSelectorParser::consumeForgivingSelectorList): Add a template version of the forgiving parsing function. (WebCore::CSSSelectorParser::consumeForgivingComplexSelectorList): Use it for complex selector lists. (WebCore::CSSSelectorParser::consumeForgivingRelativeSelectorList): And the new relative selector lists. (WebCore::CSSSelectorParser::consumeRelativeSelector): Parse relative selectors like "> foo". (WebCore::CSSSelectorParser::consumePseudo): (WebCore::CSSSelectorParser::consumeComplexForgivingSelectorList): Deleted. * css/parser/CSSSelectorParser.h: * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::addPseudoClassType): No compiler support yet. Source/WTF: * Scripts/Preferences/WebPreferencesExperimental.yaml: Add off-by-default HasPseudoClassEnabled preference value. Canonical link: https://commits.webkit.org/240719@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281295 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-08-20 05:15:47 +00:00
2021-08-19 Antti Koivisto <antti@apple.com>
[:has() pseudo-class] Basic support
https://bugs.webkit.org/show_bug.cgi?id=228894
Reviewed by Simon Fraser.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
Add off-by-default HasPseudoClassEnabled preference value.
2021-08-19 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] Stop treating the system font as a non-variable font
https://bugs.webkit.org/show_bug.cgi?id=228176
Reviewed by Sam Weinig.
* wtf/PlatformUse.h:
2021-08-19 Aditya Keerthi <akeerthi@apple.com>
Remove __has_include guard for _UIDatePickerOverlayPresentation
https://bugs.webkit.org/show_bug.cgi?id=227298
rdar://79970171
Reviewed by Tim Horton.
* wtf/PlatformHave.h:
2021-08-19 David Kilzer <ddkilzer@apple.com>
[WTF] Fix static analyzer warnings for clang tidy bugprone-move-forwarding-reference checker
<https://webkit.org/b/229114>
Reviewed by Darin Adler.
* wtf/Deque.h:
(WTF::inlineCapacity>::appendAndBubble):
* wtf/Scope.h:
(WTF::ScopeExit::ScopeExit):
* wtf/ScopedLambda.h:
(WTF::scopedLambda):
* wtf/SharedTask.h:
(WTF::createSharedTask):
- Replace WTFMove() with std::forward<>().
2021-08-19 Alex Christensen <achristensen@webkit.org>
Remove more non-inclusive language from Source
https://bugs.webkit.org/show_bug.cgi?id=229230
Reviewed by Myles C. Maxfield.
* icu/unicode/uspoof.h:
This comment change comes from upstream ICU.
* wtf/URL.h:
2021-08-18 Ryosuke Niwa <rniwa@webkit.org>
[ iOS Debug ] 12 TestWebKitAPI.WebKitLegacy. tests are crashing
https://bugs.webkit.org/show_bug.cgi?id=229250
Reviewed by Wenson Hsieh.
Disable the assertion when Web Thread is enabled for now.
* wtf/CheckedRef.h:
(WTF::SingleThreadIntegralWrapper::assertThread const):
2021-08-18 Megan Gardner <megan_gardner@apple.com>
Remove unneeded UIKitSPI declarations
https://bugs.webkit.org/show_bug.cgi?id=210075
Reviewed by Wenson Hsieh.
Remove unneeded feature define.
* wtf/PlatformHave.h:
2021-08-18 Xabier Rodriguez Calvar <calvaris@igalia.com>
[GStreamer][EME] Try to parse XML init datas that could possibly come from MPD manifests
https://bugs.webkit.org/show_bug.cgi?id=229145
Reviewed by Alicia Boya Garcia.
* wtf/glib/GUniquePtr.h: Added deleter for GMarkupParseContext.
2021-08-16 Alex Christensen <achristensen@webkit.org>
Enable PerformanceNavigationAPI by default
https://bugs.webkit.org/show_bug.cgi?id=227336
Reviewed by Chris Dumez.
It passes WPT tests except the following:
navigation-timing/nav2_test_redirect_chain_xserver_partial_opt_in.html and navigation-timing/nav2_test_redirect_xserver.html pass when run from wpt.live,
and other browsers also don't pass when run from our local hosting infrastructure, which doesn't have a good cross-domain redirect.
nav2_test_attributes_values.html fails in Chrome and Firefox. There's something wrong with the port detection in the test.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
2021-08-16 Ryosuke Niwa <rniwa@webkit.org>
Add thread safe version of CanMakeCheckedPtr
https://bugs.webkit.org/show_bug.cgi?id=229018
Reviewed by Geoffrey Garen.
Introduce CanMakeThreadSafeCheckedPtr which is a thread safe version of CanMakeCheckedPtr.
* wtf/CheckedRef.h:
(WTF::CanMakeCheckedPtrBase): Extracted from CanMakeCheckedPtr.
(WTF::CanMakeCheckedPtrBase::~CanMakeCheckedPtrBase):
(WTF::CanMakeCheckedPtrBase::ptrCount const):
(WTF::SingleThreadIntegralWrapper): Added.
(WTF::SingleThreadIntegralWrapper::SingleThreadIntegralWrapper):
(WTF::SingleThreadIntegralWrapper::operator IntegralType const):
(WTF::SingleThreadIntegralWrapper::operator! const):
(WTF::SingleThreadIntegralWrapper::operator++):
(WTF::SingleThreadIntegralWrapper::operator--):
(WTF::SingleThreadIntegralWrapper::assertThread const):
(WTF::CanMakeCheckedPtr): Redefined using CanMakeCheckedPtrBase and SimpleNonAtomicType.
(WTF::CanMakeThreadSafeCheckedPtr): Added.
2021-08-16 David Kilzer <ddkilzer@apple.com>
ThreadSanitizer: ignore uninteresting data races for reference counting of static WTF::StringImpl objects
<https://webkit.org/b/229113>
Reviewed by Chris Dumez.
* wtf/text/StringImpl.h:
(WTF::StringImpl::isStatic const):
- Add SUPPRESS_TSAN attribute since the 0x1 bit is set at
construction and refcounting occurs in increments of 0x2, so
the static bit never changes.
(WTF::StringImpl::ref):
(WTF::StringImpl::deref):
- Return early for static WTF::StringImpl objects to prevent
TSan from reporting data races for m_refCount.
[GTK][WPE] Add API to pass WebKitMemoryPressureHandler parameters to the network processes https://bugs.webkit.org/show_bug.cgi?id=228227 Reviewed by Carlos Garcia Campos. Source/WebKit: Added webkit_website_data_manager_set_memory_pressure_settings() API function to pass a WebKitMemoryPressureSettings instance as the settings to use by all the network processes. * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/soup/NetworkProcessSoup.cpp: (WebKit::NetworkProcess::platformInitializeNetworkProcess): * UIProcess/API/glib/WebKitMemoryPressureSettings.cpp: * UIProcess/API/glib/WebKitWebsiteDataManager.cpp: (webkit_website_data_manager_set_memory_pressure_settings): * UIProcess/API/gtk/WebKitWebsiteDataManager.h: * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: * UIProcess/API/wpe/WebKitWebsiteDataManager.h: * UIProcess/API/wpe/docs/wpe-1.0-sections.txt: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::didExceedMemoryLimit): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.messages.in: * UIProcess/WebProcessPool.h: * UIProcess/soup/WebProcessPoolSoup.cpp: (WebKit::memoryPressureMonitorDisabled): (WebKit::WebProcessPool::platformInitializeNetworkProcess): Source/WTF: Added a new method to MemoryPressureHandler to set the configuration by copying the parameter instead of moving it. * wtf/MemoryPressureHandler.h: (WTF::MemoryPressureHandler::setConfiguration): Tools: Added an API test for webkit_website_data_manager_set_memory_pressure_settings(). * TestWebKitAPI/Tests/WebKitGLib/TestWebsiteData.cpp: (MemoryPressureTest::setup): (MemoryPressureTest::teardown): (MemoryPressureTest::loadFailedCallback): (MemoryPressureTest::waitUntilLoadFailed): (testMemoryPressureSettings): (beforeAll): Canonical link: https://commits.webkit.org/240531@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281070 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-08-16 06:55:58 +00:00
2021-08-15 Miguel Gomez <magomez@igalia.com>
[GTK][WPE] Add API to pass WebKitMemoryPressureHandler parameters to the network processes
https://bugs.webkit.org/show_bug.cgi?id=228227
Reviewed by Carlos Garcia Campos.
Added a new method to MemoryPressureHandler to set the configuration by copying the parameter
instead of moving it.
* wtf/MemoryPressureHandler.h:
(WTF::MemoryPressureHandler::setConfiguration):
Add initial support for Cross-Origin-Embedder-Policy (COEP) https://bugs.webkit.org/show_bug.cgi?id=228754 Reviewed by Alex Christensen. LayoutTests/imported/w3c: Rebaseline COEP WPT tests now that we are passing more checks. * web-platform-tests/html/cross-origin-embedder-policy/blob.https-expected.txt: * web-platform-tests/html/cross-origin-embedder-policy/coep-frame-javascript.https-expected.txt: * web-platform-tests/html/cross-origin-embedder-policy/coep-on-response-from-service-worker.https-expected.txt: * web-platform-tests/html/cross-origin-embedder-policy/credentialless/iframe-coep-require-corp.tentative.https-expected.txt: * web-platform-tests/html/cross-origin-embedder-policy/cross-origin-isolated-permission.https-expected.txt: * web-platform-tests/html/cross-origin-embedder-policy/data.https-expected.txt: * web-platform-tests/html/cross-origin-embedder-policy/dedicated-worker-cache-storage.https-expected.txt: * web-platform-tests/html/cross-origin-embedder-policy/dedicated-worker.https-expected.txt: * web-platform-tests/html/cross-origin-embedder-policy/header-parsing.https-expected.txt: * web-platform-tests/html/cross-origin-embedder-policy/javascript.https-expected.txt: * web-platform-tests/html/cross-origin-embedder-policy/multi-globals/workers-coep-report.https-expected.txt: * web-platform-tests/html/cross-origin-embedder-policy/no-secure-context-expected.txt: * web-platform-tests/html/cross-origin-embedder-policy/none-sw-from-require-corp.https-expected.txt: * web-platform-tests/html/cross-origin-embedder-policy/none.https-expected.txt: * web-platform-tests/html/cross-origin-embedder-policy/reporting-to-endpoint.https-expected.txt: * web-platform-tests/html/cross-origin-embedder-policy/require-corp-about-blank-expected.txt: Removed. * web-platform-tests/html/cross-origin-embedder-policy/require-corp-about-blank.https-expected.txt: * web-platform-tests/html/cross-origin-embedder-policy/require-corp-about-srcdoc-expected.txt: Removed. * web-platform-tests/html/cross-origin-embedder-policy/require-corp-about-srcdoc.https-expected.txt: * web-platform-tests/html/cross-origin-embedder-policy/require-corp-load-from-cache-storage.https-expected.txt: * web-platform-tests/html/cross-origin-embedder-policy/require-corp-sw-from-none.https-expected.txt: * web-platform-tests/html/cross-origin-embedder-policy/require-corp-sw-from-require-corp.https-expected.txt: * web-platform-tests/html/cross-origin-embedder-policy/require-corp-sw.https-expected.txt: * web-platform-tests/html/cross-origin-embedder-policy/require-corp.https-expected.txt: * web-platform-tests/html/cross-origin-embedder-policy/sandbox.https-expected.txt: * web-platform-tests/html/cross-origin-embedder-policy/service-worker-cache-storage.https-expected.txt: * web-platform-tests/html/cross-origin-embedder-policy/srcdoc.https-expected.txt: Source/WebCore: Add initial support for Cross-Origin-Embedder-Policy (COEP) behind a runtime feature flag, off by default: - https://html.spec.whatwg.org/multipage/origin.html#coep The COEP header has the following impacts: - When a document with `Cross-Origin-Embedder-Policy: require-corp` loads an iframe or a worker script, if the network response for that iframe doesn't also contain `Cross-Origin-Embedder-Policy: require-corp`, then we fail the load. - When a document with `Cross-Origin-Embedder-Policy: require-corp` loads cross-origin subresources, then either CORS must be used or the resource response must be allowed by Cross-Origin-Resource-Policy (CORP) header. Support is only for WK2 and checks are done in the network process for better security. Support for workers and service workers (including cache storage) is included. Most of the Web-Platform-Tests for COEP are passing with this patch. The exceptions are: - Some tests relying on Blob are failing. Similarly to COOP, Blobs need to inherit COEP from their creator. This is currently unimplemented as the change will likely be non-trivial. I will follow-up to fix Blob support for both COOP and COEP. - Tests in the credentialless/ folder are failing because we do not support `Cross-Origin-Embedder-Policy: credentialless`. This seems to be a fairly recent extension proposed by Google and it is not part of the HTML specification yet. - Some tests expect violation reporting and they are failing and we do not implement reporting yet. Note that `self.crossOriginIsolated` still returns false, even if the pages opts into both COOP & COEP, and APIs such as SharedArrayBuffer still are not permitted to use. In order to support this, we will have to actually implement process swapping so that we know a process is not actually shared by several origins. Test: http/wpt/html/cross-origin-embedder-policy/require-corp.https.html * Modules/cache/DOMCache.cpp: (WebCore::DOMCache::queryCache): * Modules/cache/DOMCacheEngine.cpp: (WebCore::DOMCacheEngine::convertToException): * Modules/cache/DOMCacheEngine.h: * Modules/cache/RetrieveRecordsOptions.h: (WebCore::RetrieveRecordsOptions::isolatedCopy const): (WebCore::RetrieveRecordsOptions::encode const): (WebCore::RetrieveRecordsOptions::decode): * dom/Document.cpp: (WebCore::Document::initSecurityContext): * dom/SecurityContext.h: (WebCore::SecurityContext::crossOriginEmbedderPolicy const): (WebCore::SecurityContext::setCrossOriginEmbedderPolicy): * loader/CrossOriginAccessControl.cpp: (WebCore::shouldCrossOriginResourcePolicyCancelLoad): (WebCore::validateCrossOriginResourcePolicy): * loader/CrossOriginAccessControl.h: * loader/CrossOriginEmbedderPolicy.cpp: (WebCore::obtainCrossOriginEmbedderPolicy): (WebCore::CrossOriginEmbedderPolicy::isolatedCopy const): * loader/CrossOriginEmbedderPolicy.h: (WebCore::CrossOriginEmbedderPolicy::encode const): (WebCore::CrossOriginEmbedderPolicy::decode): * loader/CrossOriginOpenerPolicy.cpp: (WebCore::obtainCrossOriginOpenerPolicy): * loader/DocumentThreadableLoader.cpp: (WebCore::DocumentThreadableLoader::loadResourceSynchronously): (WebCore::DocumentThreadableLoader::create): (WebCore::DocumentThreadableLoader::DocumentThreadableLoader): (WebCore::DocumentThreadableLoader::crossOriginEmbedderPolicy const): * loader/DocumentThreadableLoader.h: * loader/DocumentWriter.cpp: (WebCore::DocumentWriter::begin): * loader/FrameLoader.cpp: (WebCore::FrameLoader::didBeginDocument): * loader/ResourceLoaderOptions.h: * loader/WorkerThreadableLoader.cpp: (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge): * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::requestResource): * page/SecurityOrigin.h: * platform/network/HTTPParsers.cpp: (WebCore::parseCrossOriginResourcePolicyHeader): * platform/network/HTTPParsers.h: * workers/Worker.cpp: (WebCore::Worker::notifyFinished): * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::WorkerGlobalScope): * workers/WorkerGlobalScopeProxy.h: * workers/WorkerMessagingProxy.cpp: (WebCore::WorkerMessagingProxy::startWorkerGlobalScope): * workers/WorkerMessagingProxy.h: * workers/WorkerScriptLoader.cpp: (WebCore::WorkerScriptLoader::loadSynchronously): (WebCore::WorkerScriptLoader::loadAsynchronously): (WebCore::WorkerScriptLoader::didReceiveResponse): * workers/WorkerScriptLoader.h: (WebCore::WorkerScriptLoader::crossOriginEmbedderPolicy const): * workers/WorkerThread.cpp: (WebCore::WorkerParameters::isolatedCopy const): * workers/WorkerThread.h: * workers/service/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript): * workers/service/ServiceWorkerContainer.h: * workers/service/ServiceWorkerContextData.cpp: (WebCore::ServiceWorkerContextData::isolatedCopy const): * workers/service/ServiceWorkerContextData.h: (WebCore::ServiceWorkerContextData::encode const): (WebCore::ServiceWorkerContextData::decode): * workers/service/ServiceWorkerFetchResult.h: (WebCore::ServiceWorkerFetchResult::isolatedCopy const): (WebCore::serviceWorkerFetchError): (WebCore::ServiceWorkerFetchResult::encode const): (WebCore::ServiceWorkerFetchResult::decode): * workers/service/ServiceWorkerJob.cpp: (WebCore::ServiceWorkerJob::notifyFinished): * workers/service/ServiceWorkerJobClient.h: * workers/service/context/ServiceWorkerThread.cpp: (WebCore::ServiceWorkerThread::ServiceWorkerThread): * workers/service/server/RegistrationDatabase.cpp: (WebCore::RegistrationDatabase::doPushChanges): (WebCore::RegistrationDatabase::importRecords): * workers/service/server/SWServer.cpp: (WebCore::SWServer::addRegistrationFromStore): (WebCore::SWServer::updateWorker): (WebCore::SWServer::installContextData): * workers/service/server/SWServer.h: * workers/service/server/SWServerJobQueue.cpp: (WebCore::SWServerJobQueue::scriptFetchFinished): * workers/service/server/SWServerWorker.cpp: (WebCore::SWServerWorker::SWServerWorker): (WebCore::SWServerWorker::contextData const): * workers/service/server/SWServerWorker.h: Source/WebKit: As mentioned in the WebCore changelog, we do all the COEP checks in the network process instead of WebCore for added security. As a result, we need to pass more information to the network process when doing loads in order to do those checks. The checks are done in NetworkResourceLoader for navigations & worker script loads (similarly to CSP, X-FrameOptions) and in NetworkLoadChecker for CORP checks of subresource loads (similarly to CORS checks). * NetworkProcess/NetworkLoadChecker.cpp: (WebKit::NetworkLoadChecker::NetworkLoadChecker): (WebKit::NetworkLoadChecker::validateResponse): * NetworkProcess/NetworkLoadChecker.h: (WebKit::NetworkLoadChecker::setParentCrossOriginEmbedderPolicy): (WebKit::NetworkLoadChecker::setCrossOriginEmbedderPolicy): * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::parentOrigin const): (WebKit::NetworkResourceLoadParameters::encode const): (WebKit::NetworkResourceLoadParameters::decode): * NetworkProcess/NetworkResourceLoadParameters.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::shouldInterruptLoadForCSPFrameAncestorsOrXFrameOptions): (WebKit::NetworkResourceLoader::shouldInterruptNavigationForCrossOriginEmbedderPolicy): (WebKit::NetworkResourceLoader::shouldInterruptWorkerLoadForCrossOriginEmbedderPolicy): (WebKit::NetworkResourceLoader::didReceiveResponse): (WebKit::NetworkResourceLoader::willSendRedirectedRequest): * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::PingLoad): (WebKit::PingLoad::initialize): * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: (WebKit::ServiceWorkerFetchTask::didReceiveResponse): * NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.cpp: (WebKit::ServiceWorkerSoftUpdateLoader::processResponse): (WebKit::ServiceWorkerSoftUpdateLoader::didFinishLoading): * NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.h: * NetworkProcess/cache/CacheStorageEngineCache.cpp: (WebKit::CacheStorage::Cache::retrieveRecords): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::addParametersShared): (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): Source/WTF: Add experimental feature flag for Cross-Origin-Embedder-Policy (COEP), off by default. * Scripts/Preferences/WebPreferencesExperimental.yaml: LayoutTests: Update test expectations now that we support COEP on WK2. * TestExpectations: * http/wpt/html/cross-origin-embedder-policy/require-corp.https-expected.txt: Added. * http/wpt/html/cross-origin-embedder-policy/require-corp.https.html: Added. * http/wpt/html/cross-origin-embedder-policy/require-corp.https.html.headers: Added. * platform/mac-wk1/TestExpectations: * platform/win/TestExpectations: Canonical link: https://commits.webkit.org/240459@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280953 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-08-12 02:43:53 +00:00
2021-08-11 Chris Dumez <cdumez@apple.com>
Add initial support for Cross-Origin-Embedder-Policy (COEP)
https://bugs.webkit.org/show_bug.cgi?id=228754
Reviewed by Alex Christensen.
Add experimental feature flag for Cross-Origin-Embedder-Policy (COEP), off by default.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
2021-08-11 Darin Adler <darin@apple.com>
Add deduction guide to RetainPtr, use constexpr a bit more, and streamline the implementation
https://bugs.webkit.org/show_bug.cgi?id=228852
Reviewed by Sam Weinig.
* wtf/RetainPtr.h: Sort includes. Made many functions constexpr including the move
constructors and adoptCF. Use using instead of typedef in most places. Use
remove_pointer_t, conditional_t, is_convertible_v, is_same_v, and other such templates
to simplify expressions. Initialize the m_ptr data member and use the default constructor.
Removed unneeded StorageType synonym for CFTypeRef. Move some inline function bodies out
of the class template definition. Use if constexpr to get rid of the need for the overloaded
autoreleaseHelper function. Added a deduction guide so we can use expressions with the
type RetainPtr on the left side, and an Objective-C pointer or CFTypeRef on the right side,
and have the appropriate RetainPtr type deduced.
Suspend WorkQueue of ResourceLoadStatistics and LocalStorage sooner https://bugs.webkit.org/show_bug.cgi?id=228748 <rdar://problem/81626714> Reviewed by Chris Dumez. Source/WebKit: When suspending ResourceLoadStatistics and LocalStorage, we dispatched a suspend task, which waits on a condition, to their WorkQueue. That means the queue will be suspended after completing all tasks scheduled before the suspend task. These tasks may take a long time to complete and assertion may be timed out. When network process receives PrepareToSuspend message, we want the queues to suspend as soon as possible. To achieve that, now we check if the queue needs to be suspended before each task, which ensures the queue execute as most one task after suspend(). * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore): * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h: * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp: (WebKit::ResourceLoadStatisticsMemoryStore::ResourceLoadStatisticsMemoryStore): * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h: * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp: (WebKit::ResourceLoadStatisticsStore::ResourceLoadStatisticsStore): * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h: (WebKit::ResourceLoadStatisticsStore::workQueue): * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: (WebKit::sharedStatisticsQueue): (WebKit::WebResourceLoadStatisticsStore::suspend): (WebKit::WebResourceLoadStatisticsStore::resume): (WebKit::WTF_GUARDED_BY_LOCK): Deleted. * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: * NetworkProcess/WebStorage/LocalStorageDatabase.cpp: (WebKit::LocalStorageDatabase::create): (WebKit::LocalStorageDatabase::LocalStorageDatabase): * NetworkProcess/WebStorage/LocalStorageDatabase.h: * NetworkProcess/WebStorage/LocalStorageNamespace.cpp: (WebKit::LocalStorageNamespace::getOrCreateStorageArea): * NetworkProcess/WebStorage/LocalStorageNamespace.h: * NetworkProcess/WebStorage/SessionStorageNamespace.cpp: (WebKit::SessionStorageNamespace::getOrCreateStorageArea): * NetworkProcess/WebStorage/SessionStorageNamespace.h: * NetworkProcess/WebStorage/StorageArea.cpp: (WebKit::StorageArea::StorageArea): * NetworkProcess/WebStorage/StorageArea.h: * NetworkProcess/WebStorage/StorageManager.cpp: (WebKit::StorageManager::createLocalStorageArea): (WebKit::StorageManager::createTransientLocalStorageArea): (WebKit::StorageManager::createSessionStorageArea): * NetworkProcess/WebStorage/StorageManager.h: * NetworkProcess/WebStorage/StorageManagerSet.cpp: (WebKit::StorageManagerSet::StorageManagerSet): (WebKit::StorageManagerSet::suspend): (WebKit::StorageManagerSet::resume): * NetworkProcess/WebStorage/StorageManagerSet.h: (WebKit::StorageManagerSet::WTF_GUARDED_BY_LOCK): Deleted. * NetworkProcess/WebStorage/TransientLocalStorageNamespace.cpp: (WebKit::TransientLocalStorageNamespace::getOrCreateStorageArea): * NetworkProcess/WebStorage/TransientLocalStorageNamespace.h: Source/WTF: Add SuspendableWorkQueue that would perform suspend check before each task. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/Forward.h: * wtf/SuspendableWorkQueue.cpp: Added. (WTF::SuspendableWorkQueue::create): (WTF::SuspendableWorkQueue::SuspendableWorkQueue): (WTF::SuspendableWorkQueue::suspend): (WTF::SuspendableWorkQueue::resume): (WTF::SuspendableWorkQueue::dispatch): (WTF::SuspendableWorkQueue::dispatchAfter): (WTF::SuspendableWorkQueue::dispatchSync): (WTF::SuspendableWorkQueue::invokeAllSuspensionCompletionHandlers): (WTF::SuspendableWorkQueue::suspendIfNeeded): * wtf/SuspendableWorkQueue.h: Added. * wtf/WorkQueue.h: (): Deleted. Canonical link: https://commits.webkit.org/240451@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280934 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-08-11 22:25:56 +00:00
2021-08-11 Sihui Liu <sihui_liu@apple.com>
Suspend WorkQueue of ResourceLoadStatistics and LocalStorage sooner
https://bugs.webkit.org/show_bug.cgi?id=228748
<rdar://problem/81626714>
Reviewed by Chris Dumez.
Add SuspendableWorkQueue that would perform suspend check before each task.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/Forward.h:
* wtf/SuspendableWorkQueue.cpp: Added.
(WTF::SuspendableWorkQueue::create):
(WTF::SuspendableWorkQueue::SuspendableWorkQueue):
(WTF::SuspendableWorkQueue::suspend):
(WTF::SuspendableWorkQueue::resume):
(WTF::SuspendableWorkQueue::dispatch):
(WTF::SuspendableWorkQueue::dispatchAfter):
(WTF::SuspendableWorkQueue::dispatchSync):
(WTF::SuspendableWorkQueue::invokeAllSuspensionCompletionHandlers):
(WTF::SuspendableWorkQueue::suspendIfNeeded):
* wtf/SuspendableWorkQueue.h: Added.
* wtf/WorkQueue.h:
(): Deleted.
2021-08-11 Youenn Fablet <youenn@apple.com>
Enable WebRTC relay by default
https://bugs.webkit.org/show_bug.cgi?id=229000
<rdar://78767922>
Reviewed by Eric Carlson.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
2021-08-10 Peng Liu <peng.liu6@apple.com>
Disable SYSTEM_FEATURE_FLAGS on iOS 14
https://bugs.webkit.org/show_bug.cgi?id=228979
<rdar://problem/81764452>
Reviewed by Tim Horton.
Stop using feature flags mechanism on iOS 14 to avoid some issues on iOS simulators.
* wtf/PlatformHave.h:
2021-08-10 Stephan Szabo <stephan.szabo@sony.com>
[WTF][PlayStation] REGRESSION(r280795) error: undefined symbol: WTF::logLevelString()
https://bugs.webkit.org/show_bug.cgi?id=228959
Reviewed by Fujii Hironori.
As per followup win fix, for declspec platforms, LoggingUnix needs
to include LogInitialization to get the export declaration.
* wtf/unix/LoggingUnix.cpp:
2021-08-10 Keith Miller <keith_miller@apple.com>
CallFrame::returnPC should untag the return address before passing it to ReturnAddressPtr
https://bugs.webkit.org/show_bug.cgi?id=228931
Reviewed by Mark Lam.
Add a new helper to untag the return pc from a stack frame.
* wtf/PtrTag.h:
(WTF::untagReturnPC):
2021-08-09 Fujii Hironori <Hironori.Fujii@sony.com>
[GTK][WPE] REGRESSION(r280795): MemoryPressureHandlerUnix.cpp:45:28: error: LogMemoryPressure was not declared in this scope
https://bugs.webkit.org/show_bug.cgi?id=228938
Unreviewed build fix.
* wtf/unix/MemoryPressureHandlerUnix.cpp:
2021-08-09 Fujii Hironori <Hironori.Fujii@sony.com>
[WTF][Win] REGRESSION(r280795) error LNK2019: unresolved external symbol "class WTF::String __cdecl WTF::logLevelString(void)"
https://bugs.webkit.org/show_bug.cgi?id=228937
<rdar://problem/81722757>
Unresolved build fix.
The previous attempt (r280819) didn't actually fix the build
error. LoggingWin.cpp has to include LogInitialization.h.
* wtf/win/LoggingWin.cpp:
2021-08-09 Fujii Hironori <Hironori.Fujii@sony.com>
[WTF][Win] REGRESSION(r280795) error LNK2019: unresolved external symbol "class WTF::String __cdecl WTF::logLevelString(void)"
https://bugs.webkit.org/show_bug.cgi?id=228937
Unreviewed build fix.
> error LNK2019: unresolved external symbol "class WTF::String __cdecl WTF::logLevelString(void)" (?logLevelString@WTF@@YA?AVString@1@XZ)
> referenced in function "private: void __cdecl WebKit::GPUProcessProxy::platformInitializeGPUProcessParameters(struct WebKit::GPUProcessCreationParameters &)"
> (?platformInitializeGPUProcessParameters@GPUProcessProxy@WebKit@@AEAAXAEAUGPUProcessCreationParameters@2@@Z)
> bin64\WebKit2.dll : fatal error LNK1120: 1 unresolved externals
* wtf/LogInitialization.h: Added WTF_EXPORT_PRIVATE for logLevelString.
Create a Language log channel https://bugs.webkit.org/show_bug.cgi?id=228764 Reviewed by Simon Fraser. Source/WebKit: * Platform/Logging.h: * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm: (WebKit::setAppleLanguagesPreference): * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::ProcessLauncher::launchProcess): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::setOverrideLanguages): (WebKit::WebProcessPool::initializeNewWebProcess): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::getLaunchOptions): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): (WebKit::WebProcess::userPreferredLanguagesChanged const): Source/WTF: There have been a variety of bug reports over the past months/years about the procedure by which we determine navigator.language. It's actually somewhat convoluted, so this patch adds a (debug) log channel for it so we can follow what it's doing easily. To enable all the logging, run these commands: % defaults write com.apple.WebKit.WebContent.Development WTFLogging Language % defaults write com.apple.WebKit.WebContent.Development WebKit2Logging Language % defaults write com.apple.WebKit.WebContent WTFLogging Language % defaults write com.apple.WebKit.WebContent WebKit2Logging Language % defaults write -g WTFLogging Language % defaults write -g WebKit2Logging Language % defaults write /Users/$USER/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari.plist WTFLogging Language % defaults write /Users/$USER/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari.plist WebKit2Logging Language * wtf/Language.cpp: (WTF::defaultLanguage): (WTF::overrideUserPreferredLanguages): (WTF::userPreferredLanguages): * wtf/Logging.cpp: * wtf/Logging.h: * wtf/cf/LanguageCF.cpp: (WTF::platformUserPreferredLanguages): * wtf/cocoa/LanguageCocoa.mm: (WTF::minimizedLanguagesFromLanguages): Canonical link: https://commits.webkit.org/240381@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280811 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-08-10 00:07:45 +00:00
2021-08-09 Myles C. Maxfield <mmaxfield@apple.com>
Create a Language log channel
https://bugs.webkit.org/show_bug.cgi?id=228764
Reviewed by Simon Fraser.
There have been a variety of bug reports over the past months/years about the procedure
by which we determine navigator.language. It's actually somewhat convoluted, so this
patch adds a (debug) log channel for it so we can follow what it's doing easily.
To enable all the logging, run these commands:
% defaults write com.apple.WebKit.WebContent.Development WTFLogging Language
% defaults write com.apple.WebKit.WebContent.Development WebKit2Logging Language
% defaults write com.apple.WebKit.WebContent WTFLogging Language
% defaults write com.apple.WebKit.WebContent WebKit2Logging Language
% defaults write -g WTFLogging Language
% defaults write -g WebKit2Logging Language
% defaults write /Users/$USER/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari.plist WTFLogging Language
% defaults write /Users/$USER/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari.plist WebKit2Logging Language
* wtf/Language.cpp:
(WTF::defaultLanguage):
(WTF::overrideUserPreferredLanguages):
(WTF::userPreferredLanguages):
* wtf/Logging.cpp:
* wtf/Logging.h:
* wtf/cf/LanguageCF.cpp:
(WTF::platformUserPreferredLanguages):
* wtf/cocoa/LanguageCocoa.mm:
(WTF::minimizedLanguagesFromLanguages):
Support WTF logging channels https://bugs.webkit.org/show_bug.cgi?id=228768 Source/WebKit: Reviewed by Fujii Hironori. No new tests because there is no behavior change. * GPUProcess/GPUProcess.cpp: (WebKit::GPUProcess::initializeGPUProcess): * GPUProcess/GPUProcessCreationParameters.cpp: (WebKit::GPUProcessCreationParameters::encode const): (WebKit::GPUProcessCreationParameters::decode): * GPUProcess/GPUProcessCreationParameters.h: * Shared/AuxiliaryProcess.cpp: (WebKit::AuxiliaryProcess::initialize): * Shared/WebKit2Initialize.cpp: (WebKit::InitializeWebKit2): * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/Cocoa/GPUProcessProxyCocoa.mm: (WebKit::GPUProcessProxy::platformInitializeGPUProcessParameters): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * UIProcess/GPU/GPUProcessProxy.cpp: (WebKit::GPUProcessProxy::platformInitializeGPUProcessParameters): * UIProcess/WebProcessPool.cpp: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): Source/WebKitLegacy/mac: Reviewed by Fujii Hironori. * WebView/WebView.mm: (-[WebView _commonInitializationWithFrameName:groupName:]): Source/WTF: This patch builds on top of https://bugs.webkit.org/show_bug.cgi?id=228809, which added shared infrastructure for logging. This patch simply triggers that shared infrastructure for WTF. There is no change in behavior - the existing WTF logging channels currently are all implemented independently in custom ways, so this patch just migrates them over to use the shared infrastructure. Reviewed by Fujii Hironori. * WTF.xcodeproj/project.pbxproj: * wtf/Assertions.h: * wtf/CMakeLists.txt: * wtf/LogInitialization.cpp: Added. (WTF::logChannels): * wtf/LogInitialization.h: Added. * wtf/Logging.cpp: Added. * wtf/Logging.h: Added. * wtf/MemoryPressureHandler.cpp: (WTF::MemoryPressureHandler::singleton): * wtf/MemoryPressureHandler.h: * wtf/PlatformFTW.cmake: * wtf/PlatformGTK.cmake: * wtf/PlatformJSCOnly.cmake: * wtf/PlatformMac.cmake: * wtf/PlatformPlayStation.cmake: * wtf/PlatformWPE.cmake: * wtf/PlatformWin.cmake: * wtf/RefCountedLeakCounter.cpp: * wtf/cocoa/LoggingCocoa.mm: Copied from Source/WebKit/UIProcess/Cocoa/GPUProcessProxyCocoa.mm. (WTF::logLevelString): * wtf/cocoa/MachSendRight.cpp: * wtf/cocoa/MainThreadCocoa.mm: * wtf/cocoa/MemoryPressureHandlerCocoa.mm: * wtf/unix/LoggingUnix.cpp: Added. (WTF::logLevelString): * wtf/win/LoggingWin.cpp: Added. (WTF::logLevelString): Canonical link: https://commits.webkit.org/240373@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280795 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-08-09 21:14:53 +00:00
2021-08-09 Myles C. Maxfield <mmaxfield@apple.com>
Support WTF logging channels
https://bugs.webkit.org/show_bug.cgi?id=228768
This patch builds on top of https://bugs.webkit.org/show_bug.cgi?id=228809, which added shared infrastructure
for logging. This patch simply triggers that shared infrastructure for WTF. There is no change in behavior -
the existing WTF logging channels currently are all implemented independently in custom ways, so this patch
just migrates them over to use the shared infrastructure.
Reviewed by Fujii Hironori.
* WTF.xcodeproj/project.pbxproj:
* wtf/Assertions.h:
* wtf/CMakeLists.txt:
* wtf/LogInitialization.cpp: Added.
(WTF::logChannels):
* wtf/LogInitialization.h: Added.
* wtf/Logging.cpp: Added.
* wtf/Logging.h: Added.
* wtf/MemoryPressureHandler.cpp:
(WTF::MemoryPressureHandler::singleton):
* wtf/MemoryPressureHandler.h:
* wtf/PlatformFTW.cmake:
* wtf/PlatformGTK.cmake:
* wtf/PlatformJSCOnly.cmake:
* wtf/PlatformMac.cmake:
* wtf/PlatformPlayStation.cmake:
* wtf/PlatformWPE.cmake:
* wtf/PlatformWin.cmake:
* wtf/RefCountedLeakCounter.cpp:
* wtf/cocoa/LoggingCocoa.mm: Copied from Source/WebKit/UIProcess/Cocoa/GPUProcessProxyCocoa.mm.
(WTF::logLevelString):
* wtf/cocoa/MachSendRight.cpp:
* wtf/cocoa/MainThreadCocoa.mm:
* wtf/cocoa/MemoryPressureHandlerCocoa.mm:
* wtf/unix/LoggingUnix.cpp: Added.
(WTF::logLevelString):
* wtf/win/LoggingWin.cpp: Added.
(WTF::logLevelString):
Deduplicate logging channel algorithms https://bugs.webkit.org/show_bug.cgi?id=228809 Reviewed by Fujii Hironori. Source/WebCore: No new tests because there is no behavior change. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * accessibility/AXLogger.cpp: * inspector/agents/page/PageConsoleAgent.cpp: * page/Page.cpp: * platform/LogInitialization.cpp: Copied from Source/WebCore/platform/LogInitialization.h. (WebCore::logChannels): (WebCore::getLogChannel): * platform/LogInitialization.h: * platform/Logging.cpp: (WebCore::isLogChannelEnabled): Deleted. (WebCore::setLogChannelToAccumulate): Deleted. (WebCore::clearAllLogChannelsToAccumulate): Deleted. (WebCore::initializeLogChannelsIfNecessary): Deleted. (WebCore::getLogChannel): Deleted. * platform/Logging.h: * testing/js/WebCoreTestSupport.cpp: (WebCoreTestSupport::setLogChannelToAccumulate): (WebCoreTestSupport::clearAllLogChannelsToAccumulate): (WebCoreTestSupport::initializeLogChannelsIfNecessary): Source/WebKit: * GPUProcess/GPUConnectionToWebProcess.cpp: * GPUProcess/GPUProcess.cpp: (WebKit::GPUProcess::initializeGPUProcess): * Platform/LogInitialization.cpp: Copied from Source/WebKit/Shared/WebKit2Initialize.cpp. (WebKit::logChannels): (WebKit::getLogChannel): * Platform/LogInitialization.h: * Platform/Logging.cpp: (WebKit::initializeLogChannelsIfNecessary): Deleted. (WebKit::getLogChannel): Deleted. * Platform/Logging.h: * Shared/AuxiliaryProcess.cpp: (WebKit::AuxiliaryProcess::initialize): * Shared/WebKit2Initialize.cpp: (WebKit::InitializeWebKit2): * Sources.txt: * UIProcess/WebPageProxy.cpp: * UIProcess/WebProcessPool.cpp: * WebKit.xcodeproj/project.pbxproj: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): Source/WebKitLegacy: * WebKitLegacy.xcodeproj/project.pbxproj: Source/WebKitLegacy/mac: * Misc/WebKitLogInitialization.h: Copied from Source/WebKit/Platform/LogInitialization.h. * Misc/WebKitLogInitialization.mm: Copied from Source/WebKitLegacy/mac/Misc/WebKitLogging.m. (WebKit::logChannels): (ReportDiscardedDelegateException): * Misc/WebKitLogging.h: * Misc/WebKitLogging.m: (ReportDiscardedDelegateException): Deleted. * WebCoreSupport/WebDragClient.mm: * WebView/WebDelegateImplementationCaching.mm: * WebView/WebView.mm: (-[WebView _commonInitializationWithFrameName:groupName:]): Source/WTF: The current infrastructure (before this patch) had the following duplicated for each framework: - A .cpp file declared the list of logging channels for that framework - The .cpp file also had algorithms to search, modify, and initialize these logging channels Each framework's .cpp file had duplicate algorithms. (The initialization algorithm was even duplicated 3 times!) Because the algorithms directly name their specific list of logging channels, a naive deduplication would have had to add new parameters to these algorithms to pass in the appropriate framework's list. That's fine, but this is exactly the sort of thing classes were designed for - classes are an association of algorithms and data. The algorithms are shared but the data isn't, which really just means we should have 3 instances of a shared class - one for the 3 sets of data. So, this patch creates the LogChannels class which contains the deduplicated algorithms, and each framework has a NeverDestroyed singleton instance of that class. There is a single virtual method in the class, so the appropriate "default write" variable can be queried for each framework. The instances cannot be declared in the Logging.h files in the frameworks, because certain WebKit2 files want to initialize all 3 instances of LogChannels, but you can't #include multiple Logging.h files at the same time because their LOG_CHANNEL_PREFIX #defines will collide with each other. Luckily, LogInitialization.h files exist exactly to solve this purpose, so that's where the LogChannels instances are declared in. After this change, the Logging.h files are just for the declarations of the logging channels themselves, and the LogInitialization.h files are for the LogChannels instances which contain the searching/modifying/initializing algorithms on the list of logging channels. If you just want to LOG(...) something, #include the relevant Logging.h file, and if you want to search/modify/initialize across the entire list of channels, then #include the relevant LogInitialization.h file. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/LogChannels.cpp: Copied from Source/WebCore/platform/Logging.cpp. (WTF::LogChannels::isLogChannelEnabled): (WTF::LogChannels::setLogChannelToAccumulate): (WTF::LogChannels::clearAllLogChannelsToAccumulate): (WTF::LogChannels::initializeLogChannelsIfNecessary): (WTF::LogChannels::getLogChannel): * wtf/LogChannels.h: Copied from Source/WebCore/platform/LogInitialization.h. Canonical link: https://commits.webkit.org/240343@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280758 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-08-07 18:50:12 +00:00
2021-08-07 Myles C. Maxfield <mmaxfield@apple.com>
Deduplicate logging channel algorithms
https://bugs.webkit.org/show_bug.cgi?id=228809
Reviewed by Fujii Hironori.
The current infrastructure (before this patch) had the following duplicated for each framework:
- A .cpp file declared the list of logging channels for that framework
- The .cpp file also had algorithms to search, modify, and initialize these logging channels
Each framework's .cpp file had duplicate algorithms. (The initialization algorithm was even
duplicated 3 times!)
Because the algorithms directly name their specific list of logging channels, a naive deduplication
would have had to add new parameters to these algorithms to pass in the appropriate framework's
list. That's fine, but this is exactly the sort of thing classes were designed for - classes are
an association of algorithms and data. The algorithms are shared but the data isn't, which really
just means we should have 3 instances of a shared class - one for the 3 sets of data.
So, this patch creates the LogChannels class which contains the deduplicated algorithms, and each
framework has a NeverDestroyed singleton instance of that class. There is a single virtual method
in the class, so the appropriate "default write" variable can be queried for each framework.
The instances cannot be declared in the Logging.h files in the frameworks, because certain WebKit2
files want to initialize all 3 instances of LogChannels, but you can't #include multiple Logging.h
files at the same time because their LOG_CHANNEL_PREFIX #defines will collide with each other.
Luckily, LogInitialization.h files exist exactly to solve this purpose, so that's where the
LogChannels instances are declared in. After this change, the Logging.h files are just for the
declarations of the logging channels themselves, and the LogInitialization.h files are for the
LogChannels instances which contain the searching/modifying/initializing algorithms on the list of
logging channels. If you just want to LOG(...) something, #include the relevant Logging.h file, and
if you want to search/modify/initialize across the entire list of channels, then #include the
relevant LogInitialization.h file.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/LogChannels.cpp: Copied from Source/WebCore/platform/Logging.cpp.
(WTF::LogChannels::isLogChannelEnabled):
(WTF::LogChannels::setLogChannelToAccumulate):
(WTF::LogChannels::clearAllLogChannelsToAccumulate):
(WTF::LogChannels::initializeLogChannelsIfNecessary):
(WTF::LogChannels::getLogChannel):
* wtf/LogChannels.h: Copied from Source/WebCore/platform/LogInitialization.h.
2021-08-07 Commit Queue <commit-queue@webkit.org>
Unreviewed, reverting r280756.
https://bugs.webkit.org/show_bug.cgi?id=228897
Broke gtk build
Reverted changeset:
"Deduplicate logging channel algorithms"
https://bugs.webkit.org/show_bug.cgi?id=228809
https://commits.webkit.org/r280756
Deduplicate logging channel algorithms https://bugs.webkit.org/show_bug.cgi?id=228809 Reviewed by Fujii Hironori. Source/WebCore: No new tests because there is no behavior change. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * accessibility/AXLogger.cpp: * inspector/agents/page/PageConsoleAgent.cpp: * page/Page.cpp: * platform/LogInitialization.cpp: Copied from Source/WebCore/platform/LogInitialization.h. (WebCore::logChannels): (WebCore::getLogChannel): * platform/LogInitialization.h: * platform/Logging.cpp: (WebCore::isLogChannelEnabled): Deleted. (WebCore::setLogChannelToAccumulate): Deleted. (WebCore::clearAllLogChannelsToAccumulate): Deleted. (WebCore::initializeLogChannelsIfNecessary): Deleted. (WebCore::getLogChannel): Deleted. * platform/Logging.h: * testing/js/WebCoreTestSupport.cpp: (WebCoreTestSupport::setLogChannelToAccumulate): (WebCoreTestSupport::clearAllLogChannelsToAccumulate): (WebCoreTestSupport::initializeLogChannelsIfNecessary): Source/WebKit: * GPUProcess/GPUConnectionToWebProcess.cpp: * GPUProcess/GPUProcess.cpp: (WebKit::GPUProcess::initializeGPUProcess): * Platform/LogInitialization.cpp: Copied from Source/WebKit/Shared/WebKit2Initialize.cpp. (WebKit::logChannels): (WebKit::getLogChannel): * Platform/LogInitialization.h: * Platform/Logging.cpp: (WebKit::initializeLogChannelsIfNecessary): Deleted. (WebKit::getLogChannel): Deleted. * Platform/Logging.h: * Shared/AuxiliaryProcess.cpp: (WebKit::AuxiliaryProcess::initialize): * Shared/WebKit2Initialize.cpp: (WebKit::InitializeWebKit2): * Sources.txt: * UIProcess/WebPageProxy.cpp: * UIProcess/WebProcessPool.cpp: * WebKit.xcodeproj/project.pbxproj: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): Source/WebKitLegacy: * WebKitLegacy.xcodeproj/project.pbxproj: Source/WebKitLegacy/mac: * Misc/WebKitLogInitialization.h: Copied from Source/WebKit/Platform/LogInitialization.h. * Misc/WebKitLogInitialization.mm: Copied from Source/WebKitLegacy/mac/Misc/WebKitLogging.m. (WebKit::logChannels): (ReportDiscardedDelegateException): * Misc/WebKitLogging.h: * Misc/WebKitLogging.m: (ReportDiscardedDelegateException): Deleted. * WebCoreSupport/WebDragClient.mm: * WebView/WebDelegateImplementationCaching.mm: * WebView/WebView.mm: (-[WebView _commonInitializationWithFrameName:groupName:]): Source/WTF: The current infrastructure (before this patch) had the following duplicated for each framework: - A .cpp file declared the list of logging channels for that framework - The .cpp file also had algorithms to search, modify, and initialize these logging channels Each framework's .cpp file had duplicate algorithms. (The initialization algorithm was even duplicated 3 times!) Because the algorithms directly name their specific list of logging channels, a naive deduplication would have had to add new parameters to these algorithms to pass in the appropriate framework's list. That's fine, but this is exactly the sort of thing classes were designed for - classes are an association of algorithms and data. The algorithms are shared but the data isn't, which really just means we should have 3 instances of a shared class - one for the 3 sets of data. So, this patch creates the LogChannels class which contains the deduplicated algorithms, and each framework has a NeverDestroyed singleton instance of that class. There is a single virtual method in the class, so the appropriate "default write" variable can be queried for each framework. The instances cannot be declared in the Logging.h files in the frameworks, because certain WebKit2 files want to initialize all 3 instances of LogChannels, but you can't #include multiple Logging.h files at the same time because their LOG_CHANNEL_PREFIX #defines will collide with each other. Luckily, LogInitialization.h files exist exactly to solve this purpose, so that's where the LogChannels instances are declared in. After this change, the Logging.h files are just for the declarations of the logging channels themselves, and the LogInitialization.h files are for the LogChannels instances which contain the searching/modifying/initializing algorithms on the list of logging channels. If you just want to LOG(...) something, #include the relevant Logging.h file, and if you want to search/modify/initialize across the entire list of channels, then #include the relevant LogInitialization.h file. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/LogChannels.cpp: Copied from Source/WebCore/platform/Logging.cpp. (WTF::LogChannels::isLogChannelEnabled): (WTF::LogChannels::setLogChannelToAccumulate): (WTF::LogChannels::clearAllLogChannelsToAccumulate): (WTF::LogChannels::initializeLogChannelsIfNecessary): (WTF::LogChannels::getLogChannel): * wtf/LogChannels.h: Copied from Source/WebCore/platform/LogInitialization.h. Canonical link: https://commits.webkit.org/240341@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280756 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-08-07 07:54:50 +00:00
2021-08-07 Myles C. Maxfield <mmaxfield@apple.com>
Deduplicate logging channel algorithms
https://bugs.webkit.org/show_bug.cgi?id=228809
Reviewed by Fujii Hironori.
The current infrastructure (before this patch) had the following duplicated for each framework:
- A .cpp file declared the list of logging channels for that framework
- The .cpp file also had algorithms to search, modify, and initialize these logging channels
Each framework's .cpp file had duplicate algorithms. (The initialization algorithm was even
duplicated 3 times!)
Because the algorithms directly name their specific list of logging channels, a naive deduplication
would have had to add new parameters to these algorithms to pass in the appropriate framework's
list. That's fine, but this is exactly the sort of thing classes were designed for - classes are
an association of algorithms and data. The algorithms are shared but the data isn't, which really
just means we should have 3 instances of a shared class - one for the 3 sets of data.
So, this patch creates the LogChannels class which contains the deduplicated algorithms, and each
framework has a NeverDestroyed singleton instance of that class. There is a single virtual method
in the class, so the appropriate "default write" variable can be queried for each framework.
The instances cannot be declared in the Logging.h files in the frameworks, because certain WebKit2
files want to initialize all 3 instances of LogChannels, but you can't #include multiple Logging.h
files at the same time because their LOG_CHANNEL_PREFIX #defines will collide with each other.
Luckily, LogInitialization.h files exist exactly to solve this purpose, so that's where the
LogChannels instances are declared in. After this change, the Logging.h files are just for the
declarations of the logging channels themselves, and the LogInitialization.h files are for the
LogChannels instances which contain the searching/modifying/initializing algorithms on the list of
logging channels. If you just want to LOG(...) something, #include the relevant Logging.h file, and
if you want to search/modify/initialize across the entire list of channels, then #include the
relevant LogInitialization.h file.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/LogChannels.cpp: Copied from Source/WebCore/platform/Logging.cpp.
(WTF::LogChannels::isLogChannelEnabled):
(WTF::LogChannels::setLogChannelToAccumulate):
(WTF::LogChannels::clearAllLogChannelsToAccumulate):
(WTF::LogChannels::initializeLogChannelsIfNecessary):
(WTF::LogChannels::getLogChannel):
* wtf/LogChannels.h: Copied from Source/WebCore/platform/LogInitialization.h.
GCC 11 builds should use -Wno-array-bounds, -Wno-nonnull https://bugs.webkit.org/show_bug.cgi?id=228601 Patch by Michael Catanzaro <mcatanzaro@gnome.org> on 2021-08-05 Reviewed by Carlos Garcia Campos. .: Prior to GCC 11, these were good warnings that could catch serious errors. But GCC 11 has just become too sensitive and it's flagging what appear to be harmless cases, and not providing enough feedback to know why. This has resulted in me littering our code with pragmas to suppress GCC's false positives, and I think it's reached the point where it's nicer to just turn off the warnings until such time that GCC gets this under control, and rely on Clang instead in the meantime. The GCC developers have indicated that these warnings will *always* produce false positives in some circumstances, but with GCC 11 it's just too become too much IMO. * Source/cmake/WebKitCompilerFlags.cmake: Source/JavaScriptCore: * b3/air/AirAllocateRegistersByGraphColoring.cpp: * jit/JITCall.cpp: (JSC::JIT::compileOpCall): Source/WebCore: * css/CSSValue.h: (WebCore::CSSValue::deref): * css/StyleRule.h: (WebCore::StyleRuleBase::deref const): * dom/Node.h: (WebCore::Node::deref const): Source/WebKit: * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::Stream::~Stream): Source/WTF: * wtf/Bitmap.h: (WTF::WordType>::clear): * wtf/Compiler.h: * wtf/Packed.h: (WTF::PackedAlignedPtr::get const): * wtf/RefPtr.h: (WTF::DefaultRefDerefTraits::derefIfNotNull): Canonical link: https://commits.webkit.org/240291@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280689 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-08-05 15:27:03 +00:00
2021-08-05 Michael Catanzaro <mcatanzaro@gnome.org>
GCC 11 builds should use -Wno-array-bounds, -Wno-nonnull
https://bugs.webkit.org/show_bug.cgi?id=228601
Reviewed by Carlos Garcia Campos.
* wtf/Bitmap.h:
(WTF::WordType>::clear):
* wtf/Compiler.h:
* wtf/Packed.h:
(WTF::PackedAlignedPtr::get const):
* wtf/RefPtr.h:
(WTF::DefaultRefDerefTraits::derefIfNotNull):
2021-08-05 Zan Dobersek <zdobersek@igalia.com>
Avoid reinterpret_cast alignment increase warnings with GCC on CPU(RISCV64)
https://bugs.webkit.org/show_bug.cgi?id=228818
Reviewed by Adrian Perez de Castro.
* wtf/StdLibExtras.h: As with 32-bit ARM and MIPS targets, RISC-V 64-bit
builds with GCC also spawn warnings when the use of reinterpret_cast
causes an increase in alignment. Workaround via reinterpret_cast_ptr is
thus required for CPU(RISCV64).
2021-08-03 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] Tweak the formatting for passing NSArrays to TextStreams
https://bugs.webkit.org/show_bug.cgi?id=228766
Reviewed by Simon Fraser.
Instead of using -[NSArray description], which puts its output on multiple lines,
instead use the same formatting as WTF::Vector, which puts its output on a single line.
We can also use this opportunity to tweak the implementation of operator<<(id) to
allow it to be called with Core Foundation types in raw C++ code.
* wtf/text/TextStream.h:
* wtf/text/cocoa/TextStreamCocoa.mm:
(WTF::TextStream::operator<<):
2021-08-03 Risul Islam <risul_islam@apple.com>
Add functions for parsing URL query string
https://bugs.webkit.org/show_bug.cgi?id=228122
Reviewed by Darin Adler.
Added parsing of URL query strings.
* wtf/KeyValuePair.h:
(WTF::operator== const):
* wtf/URL.cpp:
(WTF::URL::differingQueryParameters):
(WTF::lengthOfURLIgnoringQueryAndFragments):
(WTF::URL::isEqualIgnoringQueryAndFragments):
(WTF::URL::removeQueryParameters):
* wtf/URL.h:
2021-08-03 Youenn Fablet <youenn@apple.com>
RealtimeMediaSource::audioSamplesAvailable is calling malloc as part of locking in audio thread
https://bugs.webkit.org/show_bug.cgi?id=228688
Reviewed by Eric Carlson.
Allow allocations in lockSlow since allocations might happen in rare case and not for each lockSlow call.
* wtf/Lock.cpp:
(WTF::Lock::lockSlow):
(WTF::Lock::unlockSlow):
(WTF::Lock::unlockFairlySlow):
Add CheckedRef https://bugs.webkit.org/show_bug.cgi?id=227164 Reviewed by Geoffrey Garen. Source/WTF: Like r278344, this patch introduces a new type of smart pointer, CheckedRef, which lets each object keep track of pointers pointing to the object. As with CheckedPtr, the purpose of the internal counter for CheckedRef is to release assert that there is no outstanding pointer at the time of destruction instead of keeping the object alive when there is one. This patch also removes makeCheckedPtr in favor of using CheckedPtr with template argument deduction in C++17. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/CheckedPtr.h: (WTF::CheckedPtr::CheckedPtr): Added variants which take CheckedRef as arguments. (WTF::makeCheckedPtr): Deleted. (WTF::CanMakeCheckedPtr): Moved to CheckedRef.h * wtf/CheckedRef.h: Added. (WTF::CheckedRef::~CheckedRef): Added. (WTF::CheckedRef::CheckedRef): Added. (WTF::CheckedRef::isHashTableDeletedValue const): Added. (WTF::CheckedRef::isHashTableEmptyValue const): Added. (WTF::CheckedRef::hashTableEmptyValue): Added. (WTF::CheckedRef::ptrAllowingHashTableEmptyValue const): Added. (WTF::CheckedRef::ptrAllowingHashTableEmptyValue): Added. (WTF::CheckedRef::ptr const): Added. (WTF::CheckedRef::ptr): Added. (WTF::CheckedRef::get const): Added. (WTF::CheckedRef::get): Added. (WTF::CheckedRef::operator-> const): Added. (WTF::CheckedRef::operator->): Added. (WTF::CheckedRef::operator const T& const): Added. (WTF::CheckedRef::operator T&): Added. (WTF::CheckedRef::operator! const): Added. (WTF::CheckedRef::operator=): Added. (WTF::CheckedRef::releasePtr): Added. Returns m_ptr without calling decrementPtrCount. This is equivalent of leakPtr in Ref but we don't call this that since CheckedRef or CheckedPtr is generally not used to manage the object lifetime. (WTF::CheckedRef::poison): Added. (WTF::CheckedRef::unpoison): Added. (WTF::is): Added. (WTF::CheckedRefHashTraits): Added. (WTF::CheckedRefHashTraits::emptyValue): Added. (WTF::CheckedRefHashTraits::constructEmptyValue): Added. (WTF::CheckedRefHashTraits::isEmptyValue): Added. (WTF::CheckedRefHashTraits::peek): Added. (WTF::CheckedRefHashTraits::take): Added. (WTF::CanMakeCheckedPtr): Moved from CheckedPtr.h * wtf/Forward.h: Tools: Added some unit tests for CheckedRef and updated the unit tests for CheckedPtr per the removal of makeCheckedPtr. * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/CheckedPtr.cpp: (WTF_CheckedPtr.CheckedRef): Added * TestWebKitAPI/Tests/WTF/CheckedRef.cpp: Added. (TestWebKitAPI..CheckedObject): Added. (TestWebKitAPI..DerivedCheckedObject): Added. (WTF_CheckedRef.Basic): Added. (WTF_CheckedRef.DerivedClass): Added. (WTF_CheckedRef.HashSet): Added. Canonical link: https://commits.webkit.org/240183@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280559 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-08-02 21:46:29 +00:00
2021-08-02 Ryosuke Niwa <rniwa@webkit.org>
Add CheckedRef
https://bugs.webkit.org/show_bug.cgi?id=227164
Reviewed by Geoffrey Garen.
Like r278344, this patch introduces a new type of smart pointer, CheckedRef,
which lets each object keep track of pointers pointing to the object.
As with CheckedPtr, the purpose of the internal counter for CheckedRef is
to release assert that there is no outstanding pointer at the time of destruction
instead of keeping the object alive when there is one.
This patch also removes makeCheckedPtr in favor of using CheckedPtr with
template argument deduction in C++17.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/CheckedPtr.h:
(WTF::CheckedPtr::CheckedPtr): Added variants which take CheckedRef as arguments.
(WTF::makeCheckedPtr): Deleted.
(WTF::CanMakeCheckedPtr): Moved to CheckedRef.h
* wtf/CheckedRef.h: Added.
(WTF::CheckedRef::~CheckedRef): Added.
(WTF::CheckedRef::CheckedRef): Added.
(WTF::CheckedRef::isHashTableDeletedValue const): Added.
(WTF::CheckedRef::isHashTableEmptyValue const): Added.
(WTF::CheckedRef::hashTableEmptyValue): Added.
(WTF::CheckedRef::ptrAllowingHashTableEmptyValue const): Added.
(WTF::CheckedRef::ptrAllowingHashTableEmptyValue): Added.
(WTF::CheckedRef::ptr const): Added.
(WTF::CheckedRef::ptr): Added.
(WTF::CheckedRef::get const): Added.
(WTF::CheckedRef::get): Added.
(WTF::CheckedRef::operator-> const): Added.
(WTF::CheckedRef::operator->): Added.
(WTF::CheckedRef::operator const T& const): Added.
(WTF::CheckedRef::operator T&): Added.
(WTF::CheckedRef::operator! const): Added.
(WTF::CheckedRef::operator=): Added.
(WTF::CheckedRef::releasePtr): Added. Returns m_ptr without calling decrementPtrCount.
This is equivalent of leakPtr in Ref but we don't call this that since CheckedRef or
CheckedPtr is generally not used to manage the object lifetime.
(WTF::CheckedRef::poison): Added.
(WTF::CheckedRef::unpoison): Added.
(WTF::is): Added.
(WTF::CheckedRefHashTraits): Added.
(WTF::CheckedRefHashTraits::emptyValue): Added.
(WTF::CheckedRefHashTraits::constructEmptyValue): Added.
(WTF::CheckedRefHashTraits::isEmptyValue): Added.
(WTF::CheckedRefHashTraits::peek): Added.
(WTF::CheckedRefHashTraits::take): Added.
(WTF::CanMakeCheckedPtr): Moved from CheckedPtr.h
* wtf/Forward.h:
2021-08-02 Devin Rousso <drousso@apple.com>
[Live Text] SPI for machine readable codes is only available on iOS
https://bugs.webkit.org/show_bug.cgi?id=228711
Reviewed by Tim Horton.
* wtf/PlatformEnableCocoa.h:
* wtf/PlatformHave.h:
2021-08-02 Youenn Fablet <youenn@apple.com>
Enable WebRTCPlatformUDPSocketsEnabled experimental feature by default
https://bugs.webkit.org/show_bug.cgi?id=228689
<rdar://problem/81383711>
Reviewed by Eric Carlson.
Enable WebRTCPlatformUDPSocketsEnabled experimental feature by default, WebRTC proxying being off by default for now.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
2021-08-02 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Yarr should use Bitmap instead of ByteVector for BoyerMoore search
https://bugs.webkit.org/show_bug.cgi?id=228676
Reviewed by Saam Barati.
* wtf/Bitmap.h:
2021-08-01 Youenn Fablet <youenn@apple.com>
Introduce an experimental feature to toggle WebRTC socket proxying
https://bugs.webkit.org/show_bug.cgi?id=228681
Reviewed by Eric Carlson.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
2021-07-31 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Move JIT_UNICODE_EXPRESSIONS to ENABLE(YARR_JIT_UNICODE_EXPRESSIONS) in PlatformEnable.h
https://bugs.webkit.org/show_bug.cgi?id=228669
Reviewed by Alexey Shvayka.
* wtf/PlatformEnable.h:
[css-overflow] Implement clip value for overflow https://bugs.webkit.org/show_bug.cgi?id=198230 Patch by Rob Buis <rbuis@igalia.com> on 2021-07-30 Reviewed by Simon Fraser. LayoutTests/imported/w3c: * web-platform-tests/css/css-overflow/overflow-clip-hit-testing-expected.txt: Added. * web-platform-tests/css/css-overflow/overflow-clip-scroll-size-expected.txt: Added. * web-platform-tests/css/css-overflow/parsing/overflow-computed-expected.txt: * web-platform-tests/css/css-overflow/parsing/overflow-valid-expected.txt: Source/WebCore: Implement overflow: clip. Parsing is like the other overflow values but special logic is added to handle the case where only one of overflow-x/overflow-y uses 'clip' [1]. Also adjusts code that computes layout and visual overflow to take overflow: clip into account. This matches Chrome and Firefox. [1] https://drafts.csswg.org/css-overflow/#propdef-overflow-x * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator Overflow const): * css/CSSProperties.json: * css/parser/CSSParserContext.cpp: (WebCore::operator==): (WebCore::add): * css/parser/CSSParserContext.h: * css/parser/CSSParserFastPaths.cpp: (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue): * page/FrameView.cpp: handle scrollbars on viewport element same as overflow: hidden. (WebCore::FrameView::applyOverflowToViewport): * rendering/RenderBox.cpp: (WebCore::RenderBox::updateFromStyle): (WebCore::RenderBox::scrollWidth const): overflow clip forbids all scrolling. (WebCore::RenderBox::scrollHeight const): Ditto. (WebCore::RenderBox::setScrollLeft): Ditto. (WebCore::RenderBox::setScrollTop): Ditto. (WebCore::RenderBox::setScrollPosition): Ditto. (WebCore::RenderBox::requiresLayerWithScrollableArea const): do not create layer with scrollable area for overflow: clip. (WebCore::RenderBox::canBeProgramaticallyScrolled const): overflow clip forbids all scrolling. (WebCore::RenderBox::scrollPosition const): overflow clip forbids all scrolling. (WebCore::RenderBox::overflowClipRect const): only clip the rect horizontally for overflow-x: clip and only vertically for overflow-y: clip. (WebCore::RenderBox::createsNewFormattingContext const): do not create formatting context for overflow: clip. (WebCore::RenderBox::addOverflowFromChild): (WebCore::RenderBox::addLayoutOverflow): (WebCore::RenderBox::layoutOverflowRectForPropagation const): * rendering/RenderObject.cpp: (WebCore::RenderObject::enclosingScrollableContainerForSnapping const): * rendering/RenderObject.h: Add helper method that excludes overflow-x/y: clip. (WebCore::RenderObject::hasPotentiallyScrollableOverflow const): * rendering/style/RenderStyleConstants.cpp: (WebCore::operator<<): * rendering/style/RenderStyleConstants.h: * style/StyleAdjuster.cpp: Add special logic is to handle the case where only one of overflow-x/overflow-y uses 'clip'. (WebCore::Style::Adjuster::adjust const): Source/WTF: Add preference for overflow: clip support. * Scripts/Preferences/WebPreferencesExperimental.yaml: LayoutTests: * TestExpectations: Canonical link: https://commits.webkit.org/240141@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280509 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-31 06:07:09 +00:00
2021-07-30 Rob Buis <rbuis@igalia.com>
[css-overflow] Implement clip value for overflow
https://bugs.webkit.org/show_bug.cgi?id=198230
Reviewed by Simon Fraser.
Add preference for overflow: clip support.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
Add initial support for 'Cross-Origin-Opener-Policy' HTTP header https://bugs.webkit.org/show_bug.cgi?id=192193 <rdar://problem/42013525> Reviewed by Geoff Garen. LayoutTests/imported/w3c: Rebaseline WPT tests now that most tests are passing. * web-platform-tests/IndexedDB/serialize-sharedarraybuffer-throws.https-expected.txt: * web-platform-tests/html/cross-origin-embedder-policy/cross-origin-isolated-permission.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/blob-popup.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/coep-blob-popup.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/coep-navigate-popup.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/coep-redirect.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/coep.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/coop-coep-sandbox.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/coop-csp-sandbox-navigate.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/coop-csp-sandbox.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/coop-navigated-history-popup.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/coop-navigated-popup.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/coop-sandbox.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/header-parsing.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/historical/coep-navigate-popup-unsafe-inherit.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/historical/popup-same-origin-unsafe-allow-outgoing-with-cross-origin.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/historical/popup-same-origin-unsafe-allow-outgoing-with-same-origin.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/historical/popup-same-origin-unsafe-allow-outgoing-with-same-site.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/historical/popup-same-site-unsafe-allow-outgoing-with-cross-origin.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/historical/popup-same-site-unsafe-allow-outgoing-with-same-origin.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/historical/popup-same-site-unsafe-allow-outgoing-with-same-site.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/historical/popup-same-site-with-cross-origin.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/historical/popup-same-site-with-same-origin.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/historical/popup-same-site-with-same-site.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/iframe-popup-same-origin-allow-popups-to-same-origin-allow-popups.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/iframe-popup-same-origin-allow-popups-to-same-origin.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/iframe-popup-same-origin-to-same-origin.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/iframe-popup-same-origin-to-unsafe-none.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/iframe-popup-unsafe-none-to-same-origin.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/javascript-url.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/navigate-to-aboutblank.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/no-https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/popup-coop-by-sw-from-coop.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/popup-coop-by-sw.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/popup-redirect-cache.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/popup-redirect-same-origin-allow-popups.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/popup-same-origin-allow-popups-with-cross-origin.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/popup-same-origin-allow-popups-with-same-origin.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/popup-same-origin-allow-popups-with-same-site.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/popup-same-origin-with-cross-origin.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/popup-same-origin-with-same-origin.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/popup-same-origin-with-same-site.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/popup-unsafe-none-with-cross-origin.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/popup-unsafe-none-with-same-origin.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/popup-unsafe-none-with-same-site.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/popup-unspecified-with-cross-origin.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/popup-unspecified-with-same-origin.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/popup-unspecified-with-same-site.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/popup-with-structured-header.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/resource-popup.https-expected.txt: * web-platform-tests/html/cross-origin-opener-policy/resources/resource-popup.html: * web-platform-tests/html/dom/idlharness.worker-expected.txt: Source/WebCore: Add initial support for 'Cross-Origin-Opener-Policy' HTTP header: - https://html.spec.whatwg.org/multipage/origin.html#cross-origin-opener-policy-value Support is complete enough to pass most WPT tests with the exception of: - The ones involving blob. Support for Blob does not seem trivial so I will address separately (https://github.com/whatwg/html/issues/5198). - The ones that requires reporting COOP enforcement as this is not supported yet. This is a fairly large task so I'll handle separately. - The ones that involve Cross-Origin-Embedder-Policy (COEP) and this is not yet supported. I tried to stay as close as possible to the HTML specification as possible in terms of structuring and naming. I also have code comments to link to the relevant HTML spec sections. Note that as it stands, we do not currently swap process based on COOP header. We merely do isolation of the new browsing context at JS level for now. At some point, we'll want to actually process-swap, once we support COEP and we want to re-enable some Web APIs such as SharedArrayBuffer. No new tests, covered by web-plaform-tests/html/cross-origin-opener-policy. * Headers.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: * dom/Document.cpp: (WebCore::Document::initSecurityContext): (WebCore::Document::shouldForceNoOpenerBasedOnCOOP const): (WebCore::Document::crossOriginOpenerPolicy const): (WebCore::Document::setCrossOriginOpenerPolicy): * dom/Document.h: (WebCore::Document::isSameOriginAsTopDocument const): * dom/SecurityContext.cpp: (WebCore::SecurityContext::enforceSandboxFlags): * dom/SecurityContext.h: (WebCore::SecurityContext::creationSandboxFlags const): * inspector/InspectorFrontendClientLocal.cpp: (WebCore::InspectorFrontendClientLocal::openURLExternally): * loader/CrossOriginEmbedderPolicy.cpp: Copied from Source/WebCore/page/AbstractFrame.cpp. (WebCore::obtainCrossOriginEmbedderPolicy): * loader/CrossOriginEmbedderPolicy.h: Copied from Source/WebCore/page/AbstractFrame.cpp. * loader/CrossOriginOpenerPolicy.cpp: Added. (WebCore::obtainCrossOriginOpenerPolicy): * loader/CrossOriginOpenerPolicy.h: Copied from Source/WebCore/page/AbstractFrame.h. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::willSendRequest): (WebCore::checkIfCOOPValuesRequireBrowsingContextGroupSwitch): (WebCore::computeResponseOriginAndCOOP): (WebCore::DocumentLoader::doCrossOriginOpenerHandlingOfResponse): (WebCore::DocumentLoader::enforceResponseCrossOriginOpenerPolicy): (WebCore::DocumentLoader::responseReceived): (WebCore::DocumentLoader::maybeLoadEmpty): * loader/DocumentLoader.h: (WebCore::DocumentLoader::crossOriginOpenerPolicy const): * loader/DocumentWriter.cpp: (WebCore::DocumentWriter::begin): * loader/FrameLoader.cpp: (WebCore::FrameLoader::didBeginDocument): (WebCore::FrameLoader::setOpener): (WebCore::FrameLoader::loadURL): (WebCore::FrameLoader::loadPostRequest): (WebCore::createWindow): (WebCore::FrameLoader::switchBrowsingContextsGroup): * loader/FrameLoader.h: * loader/NavigationAction.cpp: * loader/NavigationAction.h: (WebCore::NavigationAction::Requester::securityOrigin const): (WebCore::NavigationAction::Requester::topOrigin const): (WebCore::NavigationAction::Requester::crossOriginOpenerPolicy const): * page/AbstractFrame.cpp: (WebCore::AbstractFrame::resetWindowProxy): * page/AbstractFrame.h: * page/DOMWindow.cpp: (WebCore::DOMWindow::crossOriginIsolated const): (WebCore::DOMWindow::createWindow): * page/DOMWindow.h: * page/Frame.cpp: (WebCore::Frame::resetScript): * page/Frame.h: * page/Page.h: (WebCore::Page::setOpenedByDOMWithOpener): * page/WindowOrWorkerGlobalScope.idl: * page/csp/ContentSecurityPolicy.cpp: (WebCore::ContentSecurityPolicy::applyPolicyToScriptExecutionContext): * platform/network/HTTPHeaderNames.in: * platform/network/HTTPParsers.cpp: (WebCore::parseStructuredFieldValue): * platform/network/HTTPParsers.h: * platform/network/ResourceResponseBase.cpp: (WebCore::isSafeRedirectionResponseHeader): * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::crossOriginIsolated const): * workers/WorkerGlobalScope.h: Source/WTF: Add experimental feature flag for 'Cross-Origin-Opener-Policy' HTTP header support. * Scripts/Preferences/WebPreferencesExperimental.yaml: LayoutTests: Update test expectations. * TestExpectations: * platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt: * platform/mac-wk1/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt: * platform/mac-wk2/TestExpectations: * platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt: * platform/mac/TestExpectations: Canonical link: https://commits.webkit.org/240136@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280504 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-31 00:07:37 +00:00
2021-07-30 Chris Dumez <cdumez@apple.com>
Add initial support for 'Cross-Origin-Opener-Policy' HTTP header
https://bugs.webkit.org/show_bug.cgi?id=192193
<rdar://problem/42013525>
Reviewed by Geoff Garen.
Add experimental feature flag for 'Cross-Origin-Opener-Policy' HTTP header
support.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
Stop building WebGPU and the WHLSL compiler to decrease binary size https://bugs.webkit.org/show_bug.cgi?id=228179 Reviewed by Dean Jackson, Robin Morisset, and Devin Rousso. .: * Source/cmake/OptionsFTW.cmake: * Source/cmake/OptionsMac.cmake: * Source/cmake/OptionsWinCairo.cmake: * Source/cmake/WebKitFeatures.cmake: * Source/cmake/tools/vsprops/FeatureDefines.props: * Source/cmake/tools/vsprops/FeatureDefinesCairo.props: Source/JavaScriptCore: This patch deletes the existing implementation just to reduce binary size in releases of WebKit which don't enable WebGPU by default. It doesn't represent a change in direction or policy or anything regarding WebGPU. It's a (somewhat temporary) pragmatic change. Our current implementation of WebGPU: 1. Is off by default on all platforms 2. Is extremely outdated 3. Has no notion of the GPU Process, and therefore needs to be redesigned and largely rewritten 4. Only implements a fraction of what is in the spec Removing the code from the tree doesn't delete it from existence; it's still in source control. The benefit of reducing binary size seems to outweigh having this code in the tree. * inspector/protocol/Canvas.json: * inspector/scripts/codegen/generator.py: Source/WebCore: No new tests because there is no behavior change. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webgpu/GPUBindGroupLayoutBinding.h: Removed. * Modules/webgpu/GPUBindGroupLayoutBinding.idl: Removed. * Modules/webgpu/GPUBindGroupLayoutDescriptor.h: Removed. * Modules/webgpu/GPUBindGroupLayoutDescriptor.idl: Removed. * Modules/webgpu/GPUBlendDescriptor.idl: Removed. * Modules/webgpu/GPUBufferDescriptor.idl: Removed. * Modules/webgpu/GPUBufferUsage.idl: Removed. * Modules/webgpu/GPUCanvasContext.cpp: Removed. * Modules/webgpu/GPUCanvasContext.h: Removed. * Modules/webgpu/GPUCanvasContext.idl: Removed. * Modules/webgpu/GPUColor.idl: Removed. * Modules/webgpu/GPUColorStateDescriptor.idl: Removed. * Modules/webgpu/GPUColorWrite.idl: Removed. * Modules/webgpu/GPUCompareFunction.idl: Removed. * Modules/webgpu/GPUDepthStencilStateDescriptor.idl: Removed. * Modules/webgpu/GPUErrorFilter.idl: Removed. * Modules/webgpu/GPUExtent3D.idl: Removed. * Modules/webgpu/GPULoadOp.idl: Removed. * Modules/webgpu/GPUOrigin3D.h: Removed. * Modules/webgpu/GPUOrigin3D.idl: Removed. * Modules/webgpu/GPUOutOfMemoryError.idl: Removed. * Modules/webgpu/GPURequestAdapterOptions.idl: Removed. * Modules/webgpu/GPUSamplerDescriptor.idl: Removed. * Modules/webgpu/GPUShaderStage.h: Removed. * Modules/webgpu/GPUShaderStage.idl: Removed. * Modules/webgpu/GPUStoreOp.idl: Removed. * Modules/webgpu/GPUTextureDescriptor.idl: Removed. * Modules/webgpu/GPUTextureFormat.idl: Removed. * Modules/webgpu/GPUTextureUsage.idl: Removed. * Modules/webgpu/GPUUncapturedErrorEvent.cpp: Removed. * Modules/webgpu/GPUUncapturedErrorEvent.h: Removed. * Modules/webgpu/GPUUncapturedErrorEvent.idl: Removed. * Modules/webgpu/GPUValidationError.idl: Removed. * Modules/webgpu/GPUVertexAttributeDescriptor.idl: Removed. * Modules/webgpu/GPUVertexBufferDescriptor.idl: Removed. * Modules/webgpu/GPUVertexInputDescriptor.idl: Removed. * Modules/webgpu/Navigator+GPU.idl: Removed. * Modules/webgpu/NavigatorGPU.cpp: Removed. * Modules/webgpu/NavigatorGPU.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLAST.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLAddressEscapeMode.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLAddressSpace.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLArrayType.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLAssignmentExpression.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLBaseFunctionAttribute.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLBlock.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLBooleanLiteral.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLBreak.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.cpp: Removed. * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLCallExpression.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLCommaExpression.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLConstantExpression.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLContinue.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLDefaultDelete.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLDereferenceExpression.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLDoWhileLoop.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLDotExpression.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLEffectfulExpressionStatement.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLEntryPointType.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLEnumerationDefinition.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMember.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMemberLiteral.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLExpression.cpp: Removed. * Modules/webgpu/WHLSL/AST/WHLSLExpression.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLFallthrough.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteral.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.cpp: Removed. * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLForLoop.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLFunctionAttribute.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLFunctionDefinition.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLGlobalVariableReference.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLIfStatement.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.cpp: Removed. * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp: Removed. * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLLogicalExpression.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLLogicalNotExpression.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLMakeArrayReferenceExpression.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLMakePointerExpression.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLNameSpace.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLNamedType.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLNativeFunctionDeclaration.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLNativeTypeDeclaration.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLNumThreadsFunctionAttribute.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLPointerType.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLPropertyAccessExpression.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLQualifier.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLReplaceWith.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLResolvableType.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp: Removed. * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLReturn.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLSemantic.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp: Removed. * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp: Removed. * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLStatement.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLStructureDefinition.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLStructureElement.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLSwitchCase.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLSwitchStatement.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLTernaryExpression.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLType.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLTypeArgument.cpp: Removed. * Modules/webgpu/WHLSL/AST/WHLSLTypeArgument.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLTypeDefinition.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.cpp: Removed. * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.cpp: Removed. * Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLUnnamedTypeHash.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.cpp: Removed. * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp: Removed. * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclarationsStatement.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLVariableReference.h: Removed. * Modules/webgpu/WHLSL/AST/WHLSLWhileLoop.h: Removed. * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp: Removed. * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.h: Removed. * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp: Removed. * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.h: Removed. * Modules/webgpu/WHLSL/Metal/WHLSLMangledNames.h: Removed. * Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.cpp: Removed. * Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.h: Removed. * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp: Removed. * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.h: Removed. * Modules/webgpu/WHLSL/Metal/WHLSLNativeTypeWriter.cpp: Removed. * Modules/webgpu/WHLSL/Metal/WHLSLNativeTypeWriter.h: Removed. * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp: Removed. * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.h: Removed. * Modules/webgpu/WHLSL/Metal/WHLSLVertexBufferIndexCalculator.cpp: Removed. * Modules/webgpu/WHLSL/Metal/WHLSLVertexBufferIndexCalculator.h: Removed. * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp: Removed. * Modules/webgpu/WHLSL/WHLSLASTDumper.h: Removed. * Modules/webgpu/WHLSL/WHLSLBuildStandardLibraryFunctionMap.py: Removed. * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp: Removed. * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.h: Removed. * Modules/webgpu/WHLSL/WHLSLCheckReferenceTypes.cpp: Removed. * Modules/webgpu/WHLSL/WHLSLCheckReferenceTypes.h: Removed. * Modules/webgpu/WHLSL/WHLSLCheckTextureReferences.cpp: Removed. * Modules/webgpu/WHLSL/WHLSLCheckTextureReferences.h: Removed. * Modules/webgpu/WHLSL/WHLSLChecker.cpp: Removed. * Modules/webgpu/WHLSL/WHLSLChecker.h: Removed. * Modules/webgpu/WHLSL/WHLSLCodeLocation.h: Removed. * Modules/webgpu/WHLSL/WHLSLComputeDimensions.cpp: Removed. * Modules/webgpu/WHLSL/WHLSLComputeDimensions.h: Removed. * Modules/webgpu/WHLSL/WHLSLError.h: Removed. * Modules/webgpu/WHLSL/WHLSLFunctionStageChecker.cpp: Removed. * Modules/webgpu/WHLSL/WHLSLFunctionStageChecker.h: Removed. * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp: Removed. * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.h: Removed. * Modules/webgpu/WHLSL/WHLSLHighZombieFinder.cpp: Removed. * Modules/webgpu/WHLSL/WHLSLHighZombieFinder.h: Removed. * Modules/webgpu/WHLSL/WHLSLInferTypes.cpp: Removed. * Modules/webgpu/WHLSL/WHLSLInferTypes.h: Removed. * Modules/webgpu/WHLSL/WHLSLIntrinsics.cpp: Removed. * Modules/webgpu/WHLSL/WHLSLIntrinsics.h: Removed. * Modules/webgpu/WHLSL/WHLSLLexer.cpp: Removed. * Modules/webgpu/WHLSL/WHLSLLexer.h: Removed. * Modules/webgpu/WHLSL/WHLSLLiteralTypeChecker.cpp: Removed. * Modules/webgpu/WHLSL/WHLSLLiteralTypeChecker.h: Removed. * Modules/webgpu/WHLSL/WHLSLNameContext.cpp: Removed. * Modules/webgpu/WHLSL/WHLSLNameContext.h: Removed. * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp: Removed. * Modules/webgpu/WHLSL/WHLSLNameResolver.h: Removed. * Modules/webgpu/WHLSL/WHLSLParser.cpp: Removed. * Modules/webgpu/WHLSL/WHLSLParser.h: Removed. * Modules/webgpu/WHLSL/WHLSLParsingMode.h: Removed. * Modules/webgpu/WHLSL/WHLSLPipelineDescriptor.h: Removed. * Modules/webgpu/WHLSL/WHLSLPrepare.cpp: Removed. * Modules/webgpu/WHLSL/WHLSLPrepare.h: Removed. * Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp: Removed. * Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.h: Removed. * Modules/webgpu/WHLSL/WHLSLProgram.h: Removed. * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp: Removed. * Modules/webgpu/WHLSL/WHLSLPropertyResolver.h: Removed. * Modules/webgpu/WHLSL/WHLSLPruneUnreachableStandardLibraryFunctions.cpp: Removed. * Modules/webgpu/WHLSL/WHLSLPruneUnreachableStandardLibraryFunctions.h: Removed. * Modules/webgpu/WHLSL/WHLSLRecursionChecker.cpp: Removed. * Modules/webgpu/WHLSL/WHLSLRecursionChecker.h: Removed. * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp: Removed. * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.h: Removed. * Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.cpp: Removed. * Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.h: Removed. * Modules/webgpu/WHLSL/WHLSLResolvingType.h: Removed. * Modules/webgpu/WHLSL/WHLSLScopedSetAdder.h: Removed. * Modules/webgpu/WHLSL/WHLSLSemanticMatcher.cpp: Removed. * Modules/webgpu/WHLSL/WHLSLSemanticMatcher.h: Removed. * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt: Removed. * Modules/webgpu/WHLSL/WHLSLStandardLibraryFunctionMap.h: Removed. * Modules/webgpu/WHLSL/WHLSLStandardLibraryUtilities.cpp: Removed. * Modules/webgpu/WHLSL/WHLSLStandardLibraryUtilities.h: Removed. * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.cpp: Removed. * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.h: Removed. * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp: Removed. * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.h: Removed. * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp: Removed. * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.h: Removed. * Modules/webgpu/WHLSL/WHLSLVisitor.cpp: Removed. * Modules/webgpu/WHLSL/WHLSLVisitor.h: Removed. * Modules/webgpu/WebGPU.cpp: Removed. * Modules/webgpu/WebGPU.h: Removed. * Modules/webgpu/WebGPU.idl: Removed. * Modules/webgpu/WebGPUAdapter.cpp: Removed. * Modules/webgpu/WebGPUAdapter.h: Removed. * Modules/webgpu/WebGPUAdapter.idl: Removed. * Modules/webgpu/WebGPUBindGroup.cpp: Removed. * Modules/webgpu/WebGPUBindGroup.h: Removed. * Modules/webgpu/WebGPUBindGroup.idl: Removed. * Modules/webgpu/WebGPUBindGroupBinding.h: Removed. * Modules/webgpu/WebGPUBindGroupBinding.idl: Removed. * Modules/webgpu/WebGPUBindGroupDescriptor.cpp: Removed. * Modules/webgpu/WebGPUBindGroupDescriptor.h: Removed. * Modules/webgpu/WebGPUBindGroupDescriptor.idl: Removed. * Modules/webgpu/WebGPUBindGroupLayout.cpp: Removed. * Modules/webgpu/WebGPUBindGroupLayout.h: Removed. * Modules/webgpu/WebGPUBindGroupLayout.idl: Removed. * Modules/webgpu/WebGPUBuffer.cpp: Removed. * Modules/webgpu/WebGPUBuffer.h: Removed. * Modules/webgpu/WebGPUBuffer.idl: Removed. * Modules/webgpu/WebGPUBufferBinding.h: Removed. * Modules/webgpu/WebGPUBufferBinding.idl: Removed. * Modules/webgpu/WebGPUCommandBuffer.cpp: Removed. * Modules/webgpu/WebGPUCommandBuffer.h: Removed. * Modules/webgpu/WebGPUCommandBuffer.idl: Removed. * Modules/webgpu/WebGPUCommandEncoder.cpp: Removed. * Modules/webgpu/WebGPUCommandEncoder.h: Removed. * Modules/webgpu/WebGPUCommandEncoder.idl: Removed. * Modules/webgpu/WebGPUComputePassEncoder.cpp: Removed. * Modules/webgpu/WebGPUComputePassEncoder.h: Removed. * Modules/webgpu/WebGPUComputePassEncoder.idl: Removed. * Modules/webgpu/WebGPUComputePipeline.cpp: Removed. * Modules/webgpu/WebGPUComputePipeline.h: Removed. * Modules/webgpu/WebGPUComputePipeline.idl: Removed. * Modules/webgpu/WebGPUComputePipelineDescriptor.cpp: Removed. * Modules/webgpu/WebGPUComputePipelineDescriptor.h: Removed. * Modules/webgpu/WebGPUComputePipelineDescriptor.idl: Removed. * Modules/webgpu/WebGPUDevice.cpp: Removed. * Modules/webgpu/WebGPUDevice.h: Removed. * Modules/webgpu/WebGPUDevice.idl: Removed. * Modules/webgpu/WebGPUDeviceErrorScopes.cpp: Removed. * Modules/webgpu/WebGPUDeviceErrorScopes.h: Removed. * Modules/webgpu/WebGPUDeviceErrorScopes.idl: Removed. * Modules/webgpu/WebGPUDeviceEventHandler.idl: Removed. * Modules/webgpu/WebGPUPipeline.cpp: Removed. * Modules/webgpu/WebGPUPipeline.h: Removed. * Modules/webgpu/WebGPUPipelineDescriptorBase.h: Removed. * Modules/webgpu/WebGPUPipelineDescriptorBase.idl: Removed. * Modules/webgpu/WebGPUPipelineLayout.cpp: Removed. * Modules/webgpu/WebGPUPipelineLayout.h: Removed. * Modules/webgpu/WebGPUPipelineLayout.idl: Removed. * Modules/webgpu/WebGPUPipelineLayoutDescriptor.cpp: Removed. * Modules/webgpu/WebGPUPipelineLayoutDescriptor.h: Removed. * Modules/webgpu/WebGPUPipelineLayoutDescriptor.idl: Removed. * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp: Removed. * Modules/webgpu/WebGPUProgrammablePassEncoder.h: Removed. * Modules/webgpu/WebGPUProgrammablePassEncoder.idl: Removed. * Modules/webgpu/WebGPUProgrammableStageDescriptor.cpp: Removed. * Modules/webgpu/WebGPUProgrammableStageDescriptor.h: Removed. * Modules/webgpu/WebGPUProgrammableStageDescriptor.idl: Removed. * Modules/webgpu/WebGPUQueue.cpp: Removed. * Modules/webgpu/WebGPUQueue.h: Removed. * Modules/webgpu/WebGPUQueue.idl: Removed. * Modules/webgpu/WebGPURenderPassDescriptor.cpp: Removed. * Modules/webgpu/WebGPURenderPassDescriptor.h: Removed. * Modules/webgpu/WebGPURenderPassDescriptor.idl: Removed. * Modules/webgpu/WebGPURenderPassEncoder.cpp: Removed. * Modules/webgpu/WebGPURenderPassEncoder.h: Removed. * Modules/webgpu/WebGPURenderPassEncoder.idl: Removed. * Modules/webgpu/WebGPURenderPipeline.cpp: Removed. * Modules/webgpu/WebGPURenderPipeline.h: Removed. * Modules/webgpu/WebGPURenderPipeline.idl: Removed. * Modules/webgpu/WebGPURenderPipelineDescriptor.cpp: Removed. * Modules/webgpu/WebGPURenderPipelineDescriptor.h: Removed. * Modules/webgpu/WebGPURenderPipelineDescriptor.idl: Removed. * Modules/webgpu/WebGPUSampler.cpp: Removed. * Modules/webgpu/WebGPUSampler.h: Removed. * Modules/webgpu/WebGPUSampler.idl: Removed. * Modules/webgpu/WebGPUShaderModule.cpp: Removed. * Modules/webgpu/WebGPUShaderModule.h: Removed. * Modules/webgpu/WebGPUShaderModule.idl: Removed. * Modules/webgpu/WebGPUShaderModuleDescriptor.h: Removed. * Modules/webgpu/WebGPUShaderModuleDescriptor.idl: Removed. * Modules/webgpu/WebGPUSwapChain.cpp: Removed. * Modules/webgpu/WebGPUSwapChain.h: Removed. * Modules/webgpu/WebGPUSwapChain.idl: Removed. * Modules/webgpu/WebGPUSwapChainDescriptor.cpp: Removed. * Modules/webgpu/WebGPUSwapChainDescriptor.h: Removed. * Modules/webgpu/WebGPUTexture.cpp: Removed. * Modules/webgpu/WebGPUTexture.h: Removed. * Modules/webgpu/WebGPUTexture.idl: Removed. * Modules/webgpu/WebGPUTextureView.cpp: Removed. * Modules/webgpu/WebGPUTextureView.h: Removed. * Modules/webgpu/WebGPUTextureView.idl: Removed. * Modules/webgpu/WorkerNavigator+GPU.idl: Removed. * Modules/webgpu/WorkerNavigatorGPU.cpp: Removed. * Modules/webgpu/WorkerNavigatorGPU.h: Removed. * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: * dom/Document.cpp: (WebCore::Document::getCSSCanvasContext): * dom/Document.h: * dom/Document.idl: * dom/EventNames.in: * dom/EventTargetFactory.in: * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::getContext): (WebCore::HTMLCanvasElement::isWebGPUType): Deleted. (WebCore::HTMLCanvasElement::createContextWebGPU): Deleted. (WebCore::HTMLCanvasElement::getContextWebGPU): Deleted. * html/HTMLCanvasElement.h: * html/HTMLCanvasElement.idl: * html/canvas/CanvasRenderingContext.h: (WebCore::CanvasRenderingContext::isWebGL const): (WebCore::CanvasRenderingContext::isWebGPU const): Deleted. * inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::InspectorCanvas): (WebCore::InspectorCanvas::canvasElement const): (WebCore::InspectorCanvas::scriptExecutionContext const): (WebCore::InspectorCanvas::resolveContext const): (WebCore:: const): (WebCore::InspectorCanvas::resetRecordingData): (WebCore::InspectorCanvas::recordAction): (WebCore::InspectorCanvas::buildObjectForCanvas): (WebCore::InspectorCanvas::releaseObjectForRecording): (WebCore::InspectorCanvas::buildInitialState): (WebCore::canvasIfContextMatchesDevice): Deleted. (WebCore::InspectorCanvas::deviceContext const): Deleted. (WebCore::InspectorCanvas::isDeviceForCanvasContext const): Deleted. * inspector/InspectorCanvas.h: * inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::didCreateWebGPUDeviceImpl): Deleted. (WebCore::InspectorInstrumentation::willDestroyWebGPUDeviceImpl): Deleted. (WebCore::InspectorInstrumentation::willConfigureSwapChainImpl): Deleted. (WebCore::InspectorInstrumentation::didCreateWebGPUPipelineImpl): Deleted. (WebCore::InspectorInstrumentation::willDestroyWebGPUPipelineImpl): Deleted. * inspector/InspectorInstrumentation.h: (WebCore::InspectorInstrumentation::didCreateWebGPUDevice): Deleted. (WebCore::InspectorInstrumentation::willDestroyWebGPUDevice): Deleted. (WebCore::InspectorInstrumentation::willConfigureSwapChain): Deleted. (WebCore::InspectorInstrumentation::didCreateWebGPUPipeline): Deleted. (WebCore::InspectorInstrumentation::willDestroyWebGPUPipeline): Deleted. * inspector/InspectorShaderProgram.cpp: (WebCore::InspectorShaderProgram::requestShaderSource): (WebCore::InspectorShaderProgram::updateShader): (WebCore::InspectorShaderProgram::buildObjectForShaderProgram): (WebCore::InspectorShaderProgram::pipeline const): Deleted. * inspector/InspectorShaderProgram.h: * inspector/agents/InspectorCanvasAgent.cpp: (WebCore::InspectorCanvasAgent::InspectorCanvasAgent): (WebCore::InspectorCanvasAgent::enable): (WebCore::InspectorCanvasAgent::startRecording): (WebCore::InspectorCanvasAgent::stopRecording): (WebCore::InspectorCanvasAgent::didChangeCanvasMemory): (WebCore::InspectorCanvasAgent::recordAction): (WebCore::InspectorCanvasAgent::reset): (WebCore::InspectorCanvasAgent::didCreateWebGPUDevice): Deleted. (WebCore::InspectorCanvasAgent::willDestroyWebGPUDevice): Deleted. (WebCore::InspectorCanvasAgent::willConfigureSwapChain): Deleted. (WebCore::InspectorCanvasAgent::didCreateWebGPUPipeline): Deleted. (WebCore::InspectorCanvasAgent::willDestroyWebGPUPipeline): Deleted. * inspector/agents/InspectorCanvasAgent.h: * page/ProcessWarming.cpp: (WebCore::ProcessWarming::prewarmGlobally): * platform/Logging.h: * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: (WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer): (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa): * platform/graphics/cocoa/WebGPULayer.h: Removed. * platform/graphics/cocoa/WebGPULayer.mm: Removed. * platform/graphics/gpu/GPUBindGroup.h: Removed. * platform/graphics/gpu/GPUBindGroupAllocator.h: Removed. * platform/graphics/gpu/GPUBindGroupBinding.h: Removed. * platform/graphics/gpu/GPUBindGroupDescriptor.h: Removed. * platform/graphics/gpu/GPUBindGroupLayout.h: Removed. * platform/graphics/gpu/GPUBlendDescriptor.h: Removed. * platform/graphics/gpu/GPUBuffer.cpp: Removed. * platform/graphics/gpu/GPUBuffer.h: Removed. * platform/graphics/gpu/GPUBufferBinding.h: Removed. * platform/graphics/gpu/GPUBufferDescriptor.h: Removed. * platform/graphics/gpu/GPUBufferUsage.h: Removed. * platform/graphics/gpu/GPUColor.h: Removed. * platform/graphics/gpu/GPUColorStateDescriptor.h: Removed. * platform/graphics/gpu/GPUColorWrite.h: Removed. * platform/graphics/gpu/GPUCommandBuffer.h: Removed. * platform/graphics/gpu/GPUCompareFunction.h: Removed. * platform/graphics/gpu/GPUComputePassEncoder.h: Removed. * platform/graphics/gpu/GPUComputePipeline.h: Removed. * platform/graphics/gpu/GPUComputePipelineDescriptor.h: Removed. * platform/graphics/gpu/GPUDepthStencilStateDescriptor.h: Removed. * platform/graphics/gpu/GPUDevice.cpp: Removed. * platform/graphics/gpu/GPUDevice.h: (WebCore::GPUDevice::platformDevice const): Deleted. (WebCore::GPUDevice::swapChain const): Deleted. (WebCore::GPUDevice::setErrorScopes): Deleted. * platform/graphics/gpu/GPUError.cpp: Removed. * platform/graphics/gpu/GPUError.h: Removed. * platform/graphics/gpu/GPUErrorFilter.h: Removed. * platform/graphics/gpu/GPUErrorScopes.cpp: Removed. * platform/graphics/gpu/GPUErrorScopes.h: Removed. * platform/graphics/gpu/GPUExtent3D.h: Removed. * platform/graphics/gpu/GPULimits.h: Removed. * platform/graphics/gpu/GPULoadOp.h: Removed. * platform/graphics/gpu/GPUObjectBase.h: Removed. * platform/graphics/gpu/GPUOutOfMemoryError.h: Removed. * platform/graphics/gpu/GPUPipeline.cpp: Removed. * platform/graphics/gpu/GPUPipeline.h: Removed. * platform/graphics/gpu/GPUPipelineDescriptorBase.h: Removed. * platform/graphics/gpu/GPUPipelineLayout.cpp: Removed. * platform/graphics/gpu/GPUPipelineLayout.h: Removed. * platform/graphics/gpu/GPUPipelineLayoutDescriptor.h: Removed. * platform/graphics/gpu/GPUPlatformTypes.h: Removed. * platform/graphics/gpu/GPUProgrammablePassEncoder.cpp: Removed. * platform/graphics/gpu/GPUProgrammablePassEncoder.h: Removed. * platform/graphics/gpu/GPUProgrammableStageDescriptor.h: Removed. * platform/graphics/gpu/GPUQueue.h: Removed. * platform/graphics/gpu/GPURenderPassDescriptor.h: Removed. * platform/graphics/gpu/GPURenderPassEncoder.h: Removed. * platform/graphics/gpu/GPURenderPipeline.h: Removed. * platform/graphics/gpu/GPURenderPipelineDescriptor.h: Removed. * platform/graphics/gpu/GPURequestAdapterOptions.h: Removed. * platform/graphics/gpu/GPUSampler.h: Removed. * platform/graphics/gpu/GPUSamplerDescriptor.h: Removed. * platform/graphics/gpu/GPUShaderModule.h: Removed. * platform/graphics/gpu/GPUShaderModuleDescriptor.h: Removed. * platform/graphics/gpu/GPUStoreOp.h: Removed. * platform/graphics/gpu/GPUSwapChain.h: Removed. * platform/graphics/gpu/GPUSwapChainDescriptor.h: Removed. * platform/graphics/gpu/GPUTexture.h: Removed. * platform/graphics/gpu/GPUTextureDescriptor.h: Removed. * platform/graphics/gpu/GPUTextureFormat.h: Removed. * platform/graphics/gpu/GPUTextureUsage.h: Removed. * platform/graphics/gpu/GPUUtils.h: Removed. * platform/graphics/gpu/GPUValidationError.cpp: Removed. * platform/graphics/gpu/GPUValidationError.h: Removed. * platform/graphics/gpu/GPUVertexAttributeDescriptor.h: Removed. * platform/graphics/gpu/GPUVertexBufferDescriptor.h: Removed. * platform/graphics/gpu/GPUVertexInputDescriptor.h: Removed. * platform/graphics/gpu/cocoa/GPUBindGroupAllocatorMetal.mm: Removed. * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm: Removed. * platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm: Removed. * platform/graphics/gpu/cocoa/GPUBufferMetal.mm: Removed. * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm: Removed. * platform/graphics/gpu/cocoa/GPUComputePassEncoderMetal.mm: Removed. * platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm: Removed. * platform/graphics/gpu/cocoa/GPUDeviceMetal.mm: (WebCore::prewarmGPU): (WebCore::isAcceptableDevice): Deleted. (WebCore::GPUDevice::prewarm): Deleted. (WebCore::GPUDevice::tryCreate): Deleted. (WebCore::GPUDevice::GPUDevice): Deleted. * platform/graphics/gpu/cocoa/GPUPipelineMetalConvertLayout.cpp: Removed. * platform/graphics/gpu/cocoa/GPUPipelineMetalConvertLayout.h: Removed. * platform/graphics/gpu/cocoa/GPUPlatformTypesMetal.h: Removed. * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm: Removed. * platform/graphics/gpu/cocoa/GPUQueueMetal.mm: Removed. * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm: Removed. * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: Removed. * platform/graphics/gpu/cocoa/GPUSamplerMetal.mm: Removed. * platform/graphics/gpu/cocoa/GPUShaderModuleMetal.mm: Removed. * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm: Removed. * platform/graphics/gpu/cocoa/GPUTextureMetal.mm: Removed. * platform/graphics/gpu/cocoa/GPUUtilsMetal.mm: Removed. * platform/graphics/gpu/dawn/GPUBindGroupAllocatorDawn.cpp: Removed. * platform/graphics/gpu/dawn/GPUBindGroupDawn.cpp: Removed. * platform/graphics/gpu/dawn/GPUBindGroupLayoutDawn.cpp: Removed. * platform/graphics/gpu/dawn/GPUBufferDawn.cpp: Removed. * platform/graphics/gpu/dawn/GPUCommandBufferDawn.cpp: Removed. * platform/graphics/gpu/dawn/GPUComputePassEncoderDawn.cpp: Removed. * platform/graphics/gpu/dawn/GPUComputePipelineDawn.cpp: Removed. * platform/graphics/gpu/dawn/GPUDeviceDawn.cpp: Removed. * platform/graphics/gpu/dawn/GPUPlatformTypesDawn.h: Removed. * platform/graphics/gpu/dawn/GPUProgrammablePassEncoderDawn.cpp: Removed. * platform/graphics/gpu/dawn/GPUQueueDawn.cpp: Removed. * platform/graphics/gpu/dawn/GPURenderPassEncoderDawn.cpp: Removed. * platform/graphics/gpu/dawn/GPURenderPipelineDawn.cpp: Removed. * platform/graphics/gpu/dawn/GPUSamplerDawn.cpp: Removed. * platform/graphics/gpu/dawn/GPUShaderModuleDawn.cpp: Removed. * platform/graphics/gpu/dawn/GPUSwapChainDawn.cpp: Removed. * platform/graphics/gpu/dawn/GPUTextureDawn.cpp: Removed. * platform/ios/DragImageIOS.mm: * platform/mediastream/mac/WindowDisplayCapturerMac.mm: * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateConfiguration): (WebCore::RenderLayerBacking::contentChanged): Source/WebKit: * FeatureFlags/WebKit-appletvos.plist: * FeatureFlags/WebKit-ios.plist: * FeatureFlags/WebKit-macos.plist: * FeatureFlags/WebKit-watchos.plist: * Shared/WebPreferencesDefaultValues.cpp: (WebKit::defaultWebGPUEnabled): Deleted. * Shared/WebPreferencesDefaultValues.h: Source/WebKitLegacy/mac: * WebView/WebPreferenceKeysPrivate.h: * WebView/WebPreferences.mm: (-[WebPreferences webGPUEnabled]): Deleted. (-[WebPreferences setWebGPUEnabled:]): Deleted. * WebView/WebPreferencesDefaultValues.h: * WebView/WebPreferencesDefaultValues.mm: (WebKit::defaultWebGPUEnabled): Deleted. * WebView/WebPreferencesPrivate.h: Source/WTF: * Scripts/Preferences/WebPreferencesExperimental.yaml: * wtf/PlatformEnable.h: * wtf/PlatformEnableCocoa.h: LayoutTests: * TestExpectations: * fast/dom/navigator-detached-no-crash-expected.txt: * inspector/canvas/create-context-webgpu-expected.txt: Removed. * inspector/canvas/create-context-webgpu.html: Removed. * inspector/canvas/requestClientNodes-webgpu-expected.txt: Removed. * inspector/canvas/requestClientNodes-webgpu.html: Removed. * inspector/canvas/requestShaderSource-webgpu-expected.txt: Removed. * inspector/canvas/requestShaderSource-webgpu.html: Removed. * inspector/canvas/resolveContext-webgpu-expected.txt: Removed. * inspector/canvas/resolveContext-webgpu.html: Removed. * inspector/canvas/shaderProgram-add-remove-webgpu-expected.txt: Removed. * inspector/canvas/shaderProgram-add-remove-webgpu.html: Removed. * inspector/canvas/updateShader-webgpu-expected.txt: Removed. * inspector/canvas/updateShader-webgpu-sharedVertexFragment-expected.txt: Removed. * inspector/canvas/updateShader-webgpu-sharedVertexFragment.html: Removed. * inspector/canvas/updateShader-webgpu.html: Removed. * platform/glib/TestExpectations: * platform/ios/TestExpectations: * platform/mac-wk1/TestExpectations: * platform/mac-wk2/TestExpectations: * platform/mac-wk2/fast/dom/navigator-detached-no-crash-expected.txt: * platform/mac/TestExpectations: * platform/win/TestExpectations: * webgpu/bind-groups-expected.txt: Removed. * webgpu/bind-groups.html: Removed. * webgpu/blend-color-triangle-strip-expected.html: Removed. * webgpu/blend-color-triangle-strip.html: Removed. * webgpu/blend-triangle-strip-expected.html: Removed. * webgpu/blend-triangle-strip.html: Removed. * webgpu/blit-commands-expected.html: Removed. * webgpu/blit-commands-texture-to-texture-expected.html: Removed. * webgpu/blit-commands-texture-to-texture.html: Removed. * webgpu/blit-commands.html: Removed. * webgpu/buffer-command-buffer-races-expected.html: Removed. * webgpu/buffer-command-buffer-races.html: Removed. * webgpu/buffer-errors-expected.txt: Removed. * webgpu/buffer-errors.html: Removed. * webgpu/color-write-mask-triangle-strip-expected.html: Removed. * webgpu/color-write-mask-triangle-strip.html: Removed. * webgpu/command-buffers-expected.txt: Removed. * webgpu/command-buffers.html: Removed. * webgpu/compute-pipeline-errors-expected.txt: Removed. * webgpu/compute-pipeline-errors.html: Removed. * webgpu/depth-enabled-triangle-strip-expected.html: Removed. * webgpu/depth-enabled-triangle-strip.html: Removed. * webgpu/draw-indexed-triangles-expected.html: Removed. * webgpu/draw-indexed-triangles.html: Removed. * webgpu/error-scopes-test-expected.txt: Removed. * webgpu/error-scopes-test.html: Removed. * webgpu/expando-properties-expected.txt: Removed. * webgpu/expando-properties.html: Removed. * webgpu/js/webgpu-functions.js: Removed. * webgpu/map-read-buffers-expected.txt: Removed. * webgpu/map-read-buffers.html: Removed. * webgpu/map-write-buffers-expected.txt: Removed. * webgpu/map-write-buffers.html: Removed. * webgpu/pipeline-layouts-expected.txt: Removed. * webgpu/pipeline-layouts.html: Removed. * webgpu/queue-creation-expected.txt: Removed. * webgpu/queue-creation.html: Removed. * webgpu/render-command-encoding-expected.txt: Removed. * webgpu/render-command-encoding.html: Removed. * webgpu/render-pipeline-errors-expected.txt: Removed. * webgpu/render-pipeline-errors.html: Removed. * webgpu/render-pipelines-expected.txt: Removed. * webgpu/render-pipelines.html: Removed. * webgpu/resources/blue-checkered.png: Removed. * webgpu/resources/green-400.png: Removed. * webgpu/shader-modules-expected.txt: Removed. * webgpu/shader-modules.html: Removed. * webgpu/simple-triangle-strip-expected.html: Removed. * webgpu/simple-triangle-strip.html: Removed. * webgpu/texture-creation-expected.txt: Removed. * webgpu/texture-creation.html: Removed. * webgpu/texture-triangle-strip-expected.html: Removed. * webgpu/texture-triangle-strip.html: Removed. * webgpu/textures-textureviews-expected.txt: Removed. * webgpu/textures-textureviews.html: Removed. * webgpu/uncaptured-errors-expected.txt: Removed. * webgpu/uncaptured-errors.html: Removed. * webgpu/vertex-buffer-triangle-strip-expected.html: Removed. * webgpu/vertex-buffer-triangle-strip.html: Removed. * webgpu/viewport-scissor-rect-triangle-strip-expected.html: Removed. * webgpu/viewport-scissor-rect-triangle-strip.html: Removed. * webgpu/whlsl/address-of-swizzle-expected.txt: Removed. * webgpu/whlsl/address-of-swizzle.html: Removed. * webgpu/whlsl/arbitrary-vertex-attribute-locations-expected.html: Removed. * webgpu/whlsl/arbitrary-vertex-attribute-locations.html: Removed. * webgpu/whlsl/argument-evaluation-order-expected.txt: Removed. * webgpu/whlsl/argument-evaluation-order.html: Removed. * webgpu/whlsl/array-length-spec-tests-expected.txt: Removed. * webgpu/whlsl/array-length-spec-tests.html: Removed. * webgpu/whlsl/array-oob-alias-expected.txt: Removed. * webgpu/whlsl/array-oob-alias.html: Removed. * webgpu/whlsl/array-spec-tests-expected.txt: Removed. * webgpu/whlsl/array-spec-tests.html: Removed. * webgpu/whlsl/bad-add-expected.txt: Removed. * webgpu/whlsl/bad-add.html: Removed. * webgpu/whlsl/bad-literals-expected.txt: Removed. * webgpu/whlsl/bad-literals.html: Removed. * webgpu/whlsl/bitwise-bool-ops-expected.txt: Removed. * webgpu/whlsl/bitwise-bool-ops.html: Removed. * webgpu/whlsl/bool-matrix-expected.txt: Removed. * webgpu/whlsl/bool-matrix.html: Removed. * webgpu/whlsl/bools-expected.txt: Removed. * webgpu/whlsl/bools.html: Removed. * webgpu/whlsl/buffer-fragment-expected.html: Removed. * webgpu/whlsl/buffer-fragment.html: Removed. * webgpu/whlsl/buffer-length-expected.txt: Removed. * webgpu/whlsl/buffer-length.html: Removed. * webgpu/whlsl/buffer-vertex-expected.html: Removed. * webgpu/whlsl/buffer-vertex.html: Removed. * webgpu/whlsl/builtin-vectors-2-expected.txt: Removed. * webgpu/whlsl/builtin-vectors-2.html: Removed. * webgpu/whlsl/builtin-vectors-expected.txt: Removed. * webgpu/whlsl/builtin-vectors.html: Removed. * webgpu/whlsl/casts-expected.txt: Removed. * webgpu/whlsl/casts.html: Removed. * webgpu/whlsl/checker-should-set-type-of-read-modify-write-variables-expected.txt: Removed. * webgpu/whlsl/checker-should-set-type-of-read-modify-write-variables.html: Removed. * webgpu/whlsl/clamp-stdlib-expected.txt: Removed. * webgpu/whlsl/clamp-stdlib.html: Removed. * webgpu/whlsl/comment-parsing-expected.txt: Removed. * webgpu/whlsl/comment-parsing.html: Removed. * webgpu/whlsl/compute-expected.txt: Removed. * webgpu/whlsl/compute.html: Removed. * webgpu/whlsl/copy-expected.txt: Removed. * webgpu/whlsl/copy.html: Removed. * webgpu/whlsl/dereference-ordering-expected.txt: Removed. * webgpu/whlsl/dereference-ordering.html: Removed. * webgpu/whlsl/dereference-pointer-should-type-check-expected.html: Removed. * webgpu/whlsl/dereference-pointer-should-type-check.html: Removed. * webgpu/whlsl/device-proper-type-checker-expected.txt: Removed. * webgpu/whlsl/device-proper-type-checker.html: Removed. * webgpu/whlsl/do-while-loop-break-expected.html: Removed. * webgpu/whlsl/do-while-loop-break.html: Removed. * webgpu/whlsl/do-while-loop-continue-expected.html: Removed. * webgpu/whlsl/do-while-loop-continue.html: Removed. * webgpu/whlsl/do-while-loop-expected.html: Removed. * webgpu/whlsl/do-while-loop.html: Removed. * webgpu/whlsl/dont-crash-parsing-enum-expected.html: Removed. * webgpu/whlsl/dont-crash-parsing-enum.html: Removed. * webgpu/whlsl/dot-expressions-expected.html: Removed. * webgpu/whlsl/dot-expressions.html: Removed. * webgpu/whlsl/double-not-expected.txt: Removed. * webgpu/whlsl/double-not.html: Removed. * webgpu/whlsl/duplicate-types-should-not-produce-duplicate-ctors-expected.txt: Removed. * webgpu/whlsl/duplicate-types-should-not-produce-duplicate-ctors.html: Removed. * webgpu/whlsl/duplicates-expected.txt: Removed. * webgpu/whlsl/duplicates.html: Removed. * webgpu/whlsl/ensure-proper-pointer-usage-expected.txt: Removed. * webgpu/whlsl/ensure-proper-pointer-usage.html: Removed. * webgpu/whlsl/ensure-proper-variable-lifetime-2-expected.html: Removed. * webgpu/whlsl/ensure-proper-variable-lifetime-2.html: Removed. * webgpu/whlsl/ensure-proper-variable-lifetime-3-expected.html: Removed. * webgpu/whlsl/ensure-proper-variable-lifetime-3.html: Removed. * webgpu/whlsl/ensure-proper-variable-lifetime-expected.html: Removed. * webgpu/whlsl/ensure-proper-variable-lifetime.html: Removed. * webgpu/whlsl/enum-integer-constructor-expected.txt: Removed. * webgpu/whlsl/enum-integer-constructor.html: Removed. * webgpu/whlsl/enum-spec-tests-expected.txt: Removed. * webgpu/whlsl/enum-spec-tests.html: Removed. * webgpu/whlsl/enums-2-expected.txt: Removed. * webgpu/whlsl/enums-2.html: Removed. * webgpu/whlsl/enums-expected.txt: Removed. * webgpu/whlsl/enums.html: Removed. * webgpu/whlsl/equality-expected.txt: Removed. * webgpu/whlsl/equality.html: Removed. * webgpu/whlsl/float-math-expected.txt: Removed. * webgpu/whlsl/float-math.html: Removed. * webgpu/whlsl/getter-setter-type-expected.txt: Removed. * webgpu/whlsl/getter-setter-type.html: Removed. * webgpu/whlsl/huge-array-expected.txt: Removed. * webgpu/whlsl/huge-array.html: Removed. * webgpu/whlsl/if-statement-expected.txt: Removed. * webgpu/whlsl/if-statement.html: Removed. * webgpu/whlsl/increment-decrement-expected.txt: Removed. * webgpu/whlsl/increment-decrement.html: Removed. * webgpu/whlsl/increment-setter-expected.txt: Removed. * webgpu/whlsl/increment-setter.html: Removed. * webgpu/whlsl/index-getter-setter-expected.txt: Removed. * webgpu/whlsl/index-getter-setter.html: Removed. * webgpu/whlsl/int-bit-math-expected.txt: Removed. * webgpu/whlsl/int-bit-math.html: Removed. * webgpu/whlsl/int-literal-compare-expected.txt: Removed. * webgpu/whlsl/int-literal-compare.html: Removed. * webgpu/whlsl/js/test-harness.js: Removed. * webgpu/whlsl/length-stdlib-expected.txt: Removed. * webgpu/whlsl/length-stdlib.html: Removed. * webgpu/whlsl/lexing-expected.txt: Removed. * webgpu/whlsl/lexing.html: Removed. * webgpu/whlsl/literals-expected.txt: Removed. * webgpu/whlsl/literals.html: Removed. * webgpu/whlsl/logical-negation-expected.txt: Removed. * webgpu/whlsl/logical-negation.html: Removed. * webgpu/whlsl/loops-break-expected.html: Removed. * webgpu/whlsl/loops-break.html: Removed. * webgpu/whlsl/loops-continue-expected.html: Removed. * webgpu/whlsl/loops-continue.html: Removed. * webgpu/whlsl/loops-expected.html: Removed. * webgpu/whlsl/loops-spec-tests-expected.txt: Removed. * webgpu/whlsl/loops-spec-tests.html: Removed. * webgpu/whlsl/loops.html: Removed. * webgpu/whlsl/lots-of-local-variables-expected.txt: Removed. * webgpu/whlsl/lots-of-local-variables.html: Removed. * webgpu/whlsl/lvalues-expected.txt: Removed. * webgpu/whlsl/lvalues.html: Removed. * webgpu/whlsl/make-array-ref-spec-tests-expected.txt: Removed. * webgpu/whlsl/make-array-ref-spec-tests.html: Removed. * webgpu/whlsl/make-array-reference-expected.txt: Removed. * webgpu/whlsl/make-array-reference.html: Removed. * webgpu/whlsl/matrices-spec-tests-expected.txt: Removed. * webgpu/whlsl/matrices-spec-tests.html: Removed. * webgpu/whlsl/matrix-2-expected.txt: Removed. * webgpu/whlsl/matrix-2.html: Removed. * webgpu/whlsl/matrix-alignment-expected.txt: Removed. * webgpu/whlsl/matrix-alignment.html: Removed. * webgpu/whlsl/matrix-compare-expected.txt: Removed. * webgpu/whlsl/matrix-compare.html: Removed. * webgpu/whlsl/matrix-constructors-expected.txt: Removed. * webgpu/whlsl/matrix-constructors-list-of-scalars-expected.txt: Removed. * webgpu/whlsl/matrix-constructors-list-of-scalars.html: Removed. * webgpu/whlsl/matrix-constructors.html: Removed. * webgpu/whlsl/matrix-expected.txt: Removed. * webgpu/whlsl/matrix-index-assign-expected.txt: Removed. * webgpu/whlsl/matrix-index-assign.html: Removed. * webgpu/whlsl/matrix-index-order-expected.txt: Removed. * webgpu/whlsl/matrix-index-order.html: Removed. * webgpu/whlsl/matrix-memory-layout-expected.txt: Removed. * webgpu/whlsl/matrix-memory-layout.html: Removed. * webgpu/whlsl/matrix.html: Removed. * webgpu/whlsl/nested-dot-expression-rvalue-expected.html: Removed. * webgpu/whlsl/nested-dot-expression-rvalue.html: Removed. * webgpu/whlsl/nested-loop-expected.html: Removed. * webgpu/whlsl/nested-loop.html: Removed. * webgpu/whlsl/null-arg-expected.txt: Removed. * webgpu/whlsl/null-arg.html: Removed. * webgpu/whlsl/null-array-property-access-expected.txt: Removed. * webgpu/whlsl/null-array-property-access.html: Removed. * webgpu/whlsl/null-array-ref.html: Removed. * webgpu/whlsl/oob-access-2-expected.txt: Removed. * webgpu/whlsl/oob-access-2.html: Removed. * webgpu/whlsl/oob-access-expected.txt: Removed. * webgpu/whlsl/oob-access.html: Removed. * webgpu/whlsl/operator-div-expected.txt: Removed. * webgpu/whlsl/operator-div.html: Removed. * webgpu/whlsl/operator-equal-equal-expected.txt: Removed. * webgpu/whlsl/operator-equal-equal.html: Removed. * webgpu/whlsl/operator-minus-expected.txt: Removed. * webgpu/whlsl/operator-minus.html: Removed. * webgpu/whlsl/operator-overload-expected.txt: Removed. * webgpu/whlsl/operator-overload.html: Removed. * webgpu/whlsl/operator-plus-expected.txt: Removed. * webgpu/whlsl/operator-plus.html: Removed. * webgpu/whlsl/operator-syntax-expected.txt: Removed. * webgpu/whlsl/operator-syntax.html: Removed. * webgpu/whlsl/operator-times-expected.txt: Removed. * webgpu/whlsl/operator-times.html: Removed. * webgpu/whlsl/operator-vector-assign-expected.txt: Removed. * webgpu/whlsl/operator-vector-assign.html: Removed. * webgpu/whlsl/operator-vector-load-expected.txt: Removed. * webgpu/whlsl/operator-vector-load.html: Removed. * webgpu/whlsl/operator-xy-expected.txt: Removed. * webgpu/whlsl/operator-xy.html: Removed. * webgpu/whlsl/overload-expected.txt: Removed. * webgpu/whlsl/overload.html: Removed. * webgpu/whlsl/plus-equals-expected.txt: Removed. * webgpu/whlsl/plus-equals.html: Removed. * webgpu/whlsl/pointer-spec-tests-expected.txt: Removed. * webgpu/whlsl/pointer-spec-tests.html: Removed. * webgpu/whlsl/postfix-prefix-expected.txt: Removed. * webgpu/whlsl/postfix-prefix.html: Removed. * webgpu/whlsl/property-evaluation-order-expected.txt: Removed. * webgpu/whlsl/property-evaluation-order.html: Removed. * webgpu/whlsl/read-modify-write-expected.txt: Removed. * webgpu/whlsl/read-modify-write-high-zombies-expected.txt: Removed. * webgpu/whlsl/read-modify-write-high-zombies.html: Removed. * webgpu/whlsl/read-modify-write.html: Removed. * webgpu/whlsl/recursive-structs-expected.txt: Removed. * webgpu/whlsl/recursive-structs.html: Removed. * webgpu/whlsl/return-local-variable-expected.html: Removed. * webgpu/whlsl/return-local-variable.html: Removed. * webgpu/whlsl/return-spec-tests-expected.txt: Removed. * webgpu/whlsl/return-spec-tests.html: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-10-expected.html: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-10.html: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-11-expected.html: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-11.html: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-12-expected.html: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-12.html: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-13-expected.html: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-13.html: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-14-expected.html: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-14.html: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-15-expected.html: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-15.html: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-16-expected.html: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-16.html: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-17-expected.html: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-17.html: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-18-expected.html: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-18.html: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-19-expected.html: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-19.html: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-2-expected.html: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-2.html: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-20-expected.txt: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-20.html: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-21-expected.txt: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-21.html: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-22-expected.txt: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-22.html: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-23-expected.txt: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-23.html: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-24-expected.html: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-24.html: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-25-expected.txt: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-25.html: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-26-expected.html: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-26.html: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-27-expected.txt: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-27.html: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-3-expected.txt: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-3.html: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-4-expected.txt: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-4.html: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-5-expected.txt: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-5.html: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-6-expected.txt: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-6.html: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-7-expected.html: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-7.html: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-8-expected.txt: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-8.html: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-9-expected.txt: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-9.html: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules-expected.html: Removed. * webgpu/whlsl/separate-shader-modules/separate-shader-modules.html: Removed. * webgpu/whlsl/setter-spec-tests-expected.txt: Removed. * webgpu/whlsl/setter-spec-tests.html: Removed. * webgpu/whlsl/simple-arrays-expected.txt: Removed. * webgpu/whlsl/simple-arrays.html: Removed. * webgpu/whlsl/simple-getter-setter-expected.txt: Removed. * webgpu/whlsl/simple-getter-setter.html: Removed. * webgpu/whlsl/simple-tests-expected.txt: Removed. * webgpu/whlsl/simple-tests.html: Removed. * webgpu/whlsl/simple-while-loop-expected.txt: Removed. * webgpu/whlsl/simple-while-loop.html: Removed. * webgpu/whlsl/smaller-than-32-bit-types-expected.txt: Removed. * webgpu/whlsl/smaller-than-32-bit-types.html: Removed. * webgpu/whlsl/sparse-bind-group-2-expected.txt: Removed. * webgpu/whlsl/sparse-bind-group-2.html: Removed. * webgpu/whlsl/sparse-bind-group-3-expected.txt: Removed. * webgpu/whlsl/sparse-bind-group-3.html: Removed. * webgpu/whlsl/sparse-bind-group-expected.txt: Removed. * webgpu/whlsl/sparse-bind-group.html: Removed. * webgpu/whlsl/store-null-expected.txt: Removed. * webgpu/whlsl/store-null.html: Removed. * webgpu/whlsl/store-to-property-updates-properly-expected.html: Removed. * webgpu/whlsl/store-to-property-updates-properly.html: Removed. * webgpu/whlsl/struct-expected.txt: Removed. * webgpu/whlsl/struct.html: Removed. * webgpu/whlsl/structure-field-enumeration-element-clash-expected.txt: Removed. * webgpu/whlsl/structure-field-enumeration-element-clash.html: Removed. * webgpu/whlsl/switch-expected.txt: Removed. * webgpu/whlsl/switch.html: Removed. * webgpu/whlsl/ternary-spec-test-expected.txt: Removed. * webgpu/whlsl/ternary-spec-test.html: Removed. * webgpu/whlsl/test-harness-test-expected.txt: Removed. * webgpu/whlsl/test-harness-test.html: Removed. * webgpu/whlsl/textures-getdimensions-expected.txt: Removed. * webgpu/whlsl/textures-getdimensions.html: Removed. * webgpu/whlsl/textures-load-expected.html: Removed. * webgpu/whlsl/textures-load.html: Removed. * webgpu/whlsl/textures-sample-bias-expected.html: Removed. * webgpu/whlsl/textures-sample-bias.html: Removed. * webgpu/whlsl/textures-sample-expected.html: Removed. * webgpu/whlsl/textures-sample-grad-expected.html: Removed. * webgpu/whlsl/textures-sample-grad.html: Removed. * webgpu/whlsl/textures-sample-level-expected.html: Removed. * webgpu/whlsl/textures-sample-level.html: Removed. * webgpu/whlsl/textures-sample.html: Removed. * webgpu/whlsl/two-dimensional-array-expected.txt: Removed. * webgpu/whlsl/two-dimensional-array.html: Removed. * webgpu/whlsl/type-mismatch-expected.txt: Removed. * webgpu/whlsl/type-mismatch.html: Removed. * webgpu/whlsl/uint-bitwise-expected.txt: Removed. * webgpu/whlsl/uint-bitwise.html: Removed. * webgpu/whlsl/use-undefined-variable-2-expected.txt: Removed. * webgpu/whlsl/use-undefined-variable-2.html: Removed. * webgpu/whlsl/use-undefined-variable-expected.txt: Removed. * webgpu/whlsl/use-undefined-variable.html: Removed. * webgpu/whlsl/variable-shadowing-expected.txt: Removed. * webgpu/whlsl/variable-shadowing.html: Removed. * webgpu/whlsl/vector-compare-expected.txt: Removed. * webgpu/whlsl/vector-compare.html: Removed. * webgpu/whlsl/vector-constructors-expected.txt: Removed. * webgpu/whlsl/vector-constructors.html: Removed. * webgpu/whlsl/vector-matrix-addition-subtraction-expected.txt: Removed. * webgpu/whlsl/vector-matrix-addition-subtraction.html: Removed. * webgpu/whlsl/vector-syntax-expected.txt: Removed. * webgpu/whlsl/vector-syntax.html: Removed. * webgpu/whlsl/void-variable-parameter-expected.txt: Removed. * webgpu/whlsl/void-variable-parameter.html: Removed. * webgpu/whlsl/while-loop-break-expected.html: Removed. * webgpu/whlsl/while-loop-break.html: Removed. * webgpu/whlsl/while-loop-continue-expected.html: Removed. * webgpu/whlsl/while-loop-continue.html: Removed. * webgpu/whlsl/whlsl-expected.html: Removed. * webgpu/whlsl/whlsl.html: Removed. * webgpu/whlsl/wrong-argument-length-expected.txt: Removed. * webgpu/whlsl/wrong-argument-length.html: Removed. * webgpu/whlsl/wrong-types-expected.txt: Removed. * webgpu/whlsl/wrong-types.html: Removed. * webgpu/whlsl/zero-initialize-values-2-expected.html: Removed. * webgpu/whlsl/zero-initialize-values-2.html: Removed. * webgpu/whlsl/zero-initialize-values-expected.html: Removed. * webgpu/whlsl/zero-initialize-values.html: Removed. Canonical link: https://commits.webkit.org/240102@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280467 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-30 03:53:49 +00:00
2021-07-29 Myles C. Maxfield <mmaxfield@apple.com>
Stop building WebGPU and the WHLSL compiler to decrease binary size
https://bugs.webkit.org/show_bug.cgi?id=228179
Reviewed by Dean Jackson, Robin Morisset, and Devin Rousso.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
* wtf/PlatformEnable.h:
* wtf/PlatformEnableCocoa.h:
[Payment Request] `additionalShippingMethods` are not used if a `paymentMethodType` is provided https://bugs.webkit.org/show_bug.cgi?id=228599 <rdar://problem/81190366> Reviewed by Andy Estes. Source/WebCore: r275169 made it so that `paymentMethodType` is no longer `required` so that `additionalShippingMethods` can be specified without having to limit it to a specific payment method type. While this works in theory, WebKit doesn't know about the user's selected payment method type until the user actually selects a payment method, meaning that until then the `additionalShippingMethods` are not used. Unfortunately (until now) `PKPaymentRequestPaymentMethodUpdate` did not support providing a `NSArray<PKShippingMethod *> *`, so there was no way to update the list of shipping methods when the user changed their selected payment method, meaning that WebKit would have to wait/rely on the user to change their shipping address _after_ selecting a payment method in order for `additionalShippingMethods` to take effect. This also fixes an issue with WebKit's implementation of the W3C Payment Request API by allowing any generic (i.e. things not specific to Apple Pay) `shippingOptions` provided in `PaymentDetailsUpdate` to actually be used and update the Apple Pay sheet accordingly. Test: http/tests/paymentrequest/ApplePayModifier-paymentMethodType.https.html * Modules/applepay/ApplePayModifier.idl: * Modules/applepay/ApplePayModifier.h: * Modules/applepay/ApplePayPaymentMethodUpdate.idl: * Modules/applepay/ApplePayPaymentMethodUpdate.h: (WebCore::ApplePayPaymentMethodUpdate::encode const): (WebCore::ApplePayPaymentMethodUpdate::decode): * Modules/applepay/ApplePayShippingMethodUpdate.idl: * Modules/applepay/ApplePayShippingMethodUpdate.h: (WebCore::ApplePayShippingMethodUpdate::encode const): (WebCore::ApplePayShippingMethodUpdate::decode): Add (or wrap existing) `additionalShippingMethods`/`newShippingMethods` properties. * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp: (WebCore::ApplePayPaymentHandler::computeShippingMethods): (WebCore::ApplePayPaymentHandler::detailsUpdated): (WebCore::ApplePayPaymentHandler::shippingOptionUpdated): (WebCore::ApplePayPaymentHandler::paymentMethodUpdated): Also call `computeShippingMethods()` and add the result to the update. * testing/MockPaymentCoordinator.cpp: (WebCore::MockPaymentCoordinator::completeShippingMethodSelection): (WebCore::MockPaymentCoordinator::completeShippingContactSelection): (WebCore::MockPaymentCoordinator::completePaymentMethodSelection): (WebCore::MockPaymentCoordinator::completeCouponCodeChange): Support for testing. Source/WebCore/PAL: r275169 made it so that `paymentMethodType` is no longer `required` so that `additionalShippingMethods` can be specified without having to limit it to a specific payment method type. While this works in theory, WebKit doesn't know about the user's selected payment method type until the user actually selects a payment method, meaning that until then the `additionalShippingMethods` are not used. Unfortunately (until now) `PKPaymentRequestPaymentMethodUpdate` did not support providing a `NSArray<PKShippingMethod *> *`, so there was no way to update the list of shipping methods when the user changed their selected payment method, meaning that WebKit would have to wait/rely on the user to change their shipping address _after_ selecting a payment method in order for `additionalShippingMethods` to take effect. This also fixes an issue with WebKit's implementation of the W3C Payment Request API by allowing any generic (i.e. things not specific to Apple Pay) `shippingOptions` provided in `PaymentDetailsUpdate` to actually be used and update the Apple Pay sheet accordingly. * pal/spi/cocoa/PassKitSPI.h: - add the new `shippingMethods` property on `PKPaymentRequestUpdate` - add the existing `errors` property on `PKPaymentRequestPaymentMethodUpdate` Source/WebKit: r275169 made it so that `paymentMethodType` is no longer `required` so that `additionalShippingMethods` can be specified without having to limit it to a specific payment method type. While this works in theory, WebKit doesn't know about the user's selected payment method type until the user actually selects a payment method, meaning that until then the `additionalShippingMethods` are not used. Unfortunately (until now) `PKPaymentRequestPaymentMethodUpdate` did not support providing a `NSArray<PKShippingMethod *> *`, so there was no way to update the list of shipping methods when the user changed their selected payment method, meaning that WebKit would have to wait/rely on the user to change their shipping address _after_ selecting a payment method in order for `additionalShippingMethods` to take effect. This also fixes an issue with WebKit's implementation of the W3C Payment Request API by allowing any generic (i.e. things not specific to Apple Pay) `shippingOptions` provided in `PaymentDetailsUpdate` to actually be used and update the Apple Pay sheet accordingly. * Platform/cocoa/PaymentAuthorizationPresenter.mm: (WebKit::PaymentAuthorizationPresenter::completePaymentMethodSelection): (WebKit::PaymentAuthorizationPresenter::completeShippingMethodSelection): Also convert and set the `shippingMethods` on the update. Source/WTF: r275169 made it so that `paymentMethodType` is no longer `required` so that `additionalShippingMethods` can be specified without having to limit it to a specific payment method type. While this works in theory, WebKit doesn't know about the user's selected payment method type until the user actually selects a payment method, meaning that until then the `additionalShippingMethods` are not used. Unfortunately (until now) `PKPaymentRequestPaymentMethodUpdate` did not support providing a `NSArray<PKShippingMethod *> *`, so there was no way to update the list of shipping methods when the user changed their selected payment method, meaning that WebKit would have to wait/rely on the user to change their shipping address _after_ selecting a payment method in order for `additionalShippingMethods` to take effect. This also fixes an issue with WebKit's implementation of the W3C Payment Request API by allowing any generic (i.e. things not specific to Apple Pay) `shippingOptions` provided in `PaymentDetailsUpdate` to actually be used and update the Apple Pay sheet accordingly. * wtf/PlatformHave.h: * wtf/PlatformEnableCocoa.h: Add new compile flags for PassKit supporting modifying shipping methods with any update. LayoutTests: * http/tests/paymentrequest/ApplePayModifier-paymentMethodType.https.html: Added. * http/tests/paymentrequest/ApplePayModifier-paymentMethodType.https-expected.txt: Added. * platform/ios-14-wk2/TestExpectations: * platform/mac-bigsur-wk2/TestExpectations: Added. Skip on older macOS/iOS since they don't support modifying shipping methods with any update. Canonical link: https://commits.webkit.org/240094@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280459 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-30 00:28:45 +00:00
2021-07-29 Devin Rousso <drousso@apple.com>
[Payment Request] `additionalShippingMethods` are not used if a `paymentMethodType` is provided
https://bugs.webkit.org/show_bug.cgi?id=228599
<rdar://problem/81190366>
Reviewed by Andy Estes.
r275169 made it so that `paymentMethodType` is no longer `required` so that `additionalShippingMethods`
can be specified without having to limit it to a specific payment method type. While this
works in theory, WebKit doesn't know about the user's selected payment method type until the
user actually selects a payment method, meaning that until then the `additionalShippingMethods`
are not used. Unfortunately (until now) `PKPaymentRequestPaymentMethodUpdate` did not
support providing a `NSArray<PKShippingMethod *> *`, so there was no way to update the list
of shipping methods when the user changed their selected payment method, meaning that WebKit
would have to wait/rely on the user to change their shipping address _after_ selecting a
payment method in order for `additionalShippingMethods` to take effect.
This also fixes an issue with WebKit's implementation of the W3C Payment Request API by
allowing any generic (i.e. things not specific to Apple Pay) `shippingOptions` provided in
`PaymentDetailsUpdate` to actually be used and update the Apple Pay sheet accordingly.
* wtf/PlatformHave.h:
* wtf/PlatformEnableCocoa.h:
Add new compile flags for PassKit supporting modifying shipping methods with any update.
[JSC] Yarr should perform BoyerMoore search https://bugs.webkit.org/show_bug.cgi?id=228301 Reviewed by Saam Barati. JSTests: * microbenchmarks/jquery-todomvc-regexp.js: * stress/regexp--bm-search-long-character.js: Added. (shouldBe): * stress/regexp--bm-search-long-map.js: Added. (shouldBe): * stress/regexp-bitvector-reuse.js: Added. (shouldBe): * stress/regexp-non-ascii-bm-search-character.js: Added. (shouldBe): * stress/regexp-non-ascii-bm-search-map.js: Added. (shouldBe): Source/JavaScriptCore: This patch emits skipping fast-path at the beginning of body alternatives with a large stride. So we can quickly discard unrelated characters and attempt to find possibly related sequence in the long sequence. The method is derived from V8's implementation (with some extensions). If we have a searching pattern /abcdef/, then we can check the 6th character against a set of {a, b, c, d, e, f}. If it does not match, we can shift 6 characters. We use this strategy since this way can be extended easily to support disjunction, character-class, and ignore-cases. For example, in the case of /(?:abc|def)/, we can check 3rd character against {a, b, c, d, e, f} and shift 3 characters if it does not match. Then, the best way to perform the above shifting is that finding the longest character sequence which does not have many candidates. In the case of /[a-z]aaaaaaa[a-z]/, we can extract "aaaaaaa" sequence and check 8th character against {a}. If it does not match, then we can shift 7 characters (length of "aaaaaaa"). This shifting is better than using "[a-z]aaaaaaa[a-z]" sequence and {a-z} set since {a-z} set will almost always match. We first collect possible characters for each character position. Then, apply heuristics to extract good character sequence from that and construct fast searching with long stride. Microbenchmark which performs RegExp ops in Speedometer2/jQuery-TodoMVC shows 25% improvement. ToT Patched jquery-todomvc-regexp 723.9739+-1.3997 ^ 579.1698+-1.2505 ^ definitely 1.2500x faster This improves Speedometer2/jQuery-TodoMVC by 3%. ---------------------------------------------------------------------------------------------------------------------------------- | subtest | ms | ms | b / a | pValue (significance using False Discovery Rate) | ---------------------------------------------------------------------------------------------------------------------------------- | Elm-TodoMVC |123.365625 |123.456250 |1.000735 | 0.804077 | | VueJS-TodoMVC |26.912500 |26.925000 |1.000464 | 0.969603 | | EmberJS-TodoMVC |127.540625 |127.562500 |1.000172 | 0.960474 | | BackboneJS-TodoMVC |50.606250 |50.518750 |0.998271 | 0.670313 | | Preact-TodoMVC |21.018750 |20.850000 |0.991971 | 0.563818 | | AngularJS-TodoMVC |136.943750 |137.271875 |1.002396 | 0.531513 | | Vanilla-ES2015-TodoMVC |68.521875 |68.593750 |1.001049 | 0.701376 | | Inferno-TodoMVC |65.559375 |65.803125 |1.003718 | 0.414418 | | Flight-TodoMVC |77.284375 |76.715625 |0.992641 | 0.219870 | | Angular2-TypeScript-TodoMVC |40.725000 |40.318750 |0.990025 | 0.281212 | | VanillaJS-TodoMVC |55.209375 |54.715625 |0.991057 | 0.056921 | | jQuery-TodoMVC |266.396875 |258.471875 |0.970251 | 0.000000 (significant) | | EmberJS-Debug-TodoMVC |341.550000 |341.856250 |1.000897 | 0.618140 | | React-TodoMVC |88.731250 |88.871875 |1.001585 | 0.512407 | | React-Redux-TodoMVC |150.340625 |150.065625 |0.998171 | 0.412940 | | Vanilla-ES2015-Babel-Webpack-TodoMVC |65.390625 |65.362500 |0.999570 | 0.834760 | ---------------------------------------------------------------------------------------------------------------------------------- a mean = 245.96997 b mean = 246.86366 pValue = 0.0061448402 (Bigger means are better.) 1.004 times better Results ARE significant * runtime/OptionsList.h: * yarr/YarrJIT.cpp: (JSC::Yarr::BoyerMooreInfo::BoyerMooreInfo): (JSC::Yarr::BoyerMooreInfo::length const): (JSC::Yarr::BoyerMooreInfo::set): (JSC::Yarr::BoyerMooreInfo::index const): (JSC::Yarr::BoyerMooreInfo::setIndex): (JSC::Yarr::BoyerMooreInfo::create): (JSC::Yarr::BoyerMooreInfo::findBestCharacterSequence const): (JSC::Yarr::BoyerMooreInfo::findWorthwhileCharacterSequenceForLookahead const): (JSC::Yarr::BoyerMooreInfo::createCandidateBitmap const): * yarr/YarrJIT.h: (JSC::Yarr::BoyerMooreBitmap::count const): (JSC::Yarr::BoyerMooreBitmap::map const): (JSC::Yarr::BoyerMooreBitmap::isMaskEffective const): (JSC::Yarr::BoyerMooreBitmap::add): (JSC::Yarr::BoyerMooreByteVector::BoyerMooreByteVector): (JSC::Yarr::YarrCodeBlock::set8BitCode): (JSC::Yarr::YarrCodeBlock::set16BitCode): (JSC::Yarr::YarrCodeBlock::set8BitCodeMatchOnly): (JSC::Yarr::YarrCodeBlock::set16BitCodeMatchOnly): (JSC::Yarr::YarrCodeBlock::clear): (JSC::Yarr::YarrCodeBlock::findSameVector const): Source/WTF: * wtf/BitVector.cpp: (WTF::BitVector::dump const): * wtf/Bitmap.h: (WTF::WordType>::dump const): * wtf/UniqueRef.h: (WTF::makeUniqueRefFromNonNullUniquePtr): (WTF::UniqueRef::UniqueRef): Canonical link: https://commits.webkit.org/240087@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280452 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-29 22:26:13 +00:00
2021-07-28 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Yarr should perform BoyerMoore search
https://bugs.webkit.org/show_bug.cgi?id=228301
Reviewed by Saam Barati.
* wtf/BitVector.cpp:
(WTF::BitVector::dump const):
* wtf/Bitmap.h:
(WTF::WordType>::dump const):
* wtf/UniqueRef.h:
(WTF::makeUniqueRefFromNonNullUniquePtr):
(WTF::UniqueRef::UniqueRef):
REGRESSION (r278877) [Cocoa] WebAuthn stopped working for non-Safari browsers https://bugs.webkit.org/show_bug.cgi?id=228116 <rdar://problem/80693607> Patch by Brent Fulgham. Patch by Kate Cheney <katherine_cheney@apple.com> on 2021-07-29 Reviewed by Per Arne Vollan. Source/WebKit: We should not be using the PAC key to confirm a valid WebContent process is the source of WebAuthn-related messages. Instead, we should confirm the message source is an Apple-signed executable, and that the signining identity is for the WebContent process. * Shared/Cocoa/CodeSigning.h: Renamed from Source/WebKit/Shared/mac/CodeSigning.h. * Shared/Cocoa/CodeSigning.mm: Renamed from Source/WebKit/Shared/mac/CodeSigning.mm. (WebKit::codeSigningIdentifier): (WebKit::codeSigningIdentifierForCurrentProcess): (WebKit::currentProcessIsPlatformBinary): (WebKit::codeSigningIdentifierAndPlatformBinaryStatus): * Shared/Cocoa/XPCEndpoint.mm: (WebKit::XPCEndpoint::XPCEndpoint): * SourcesCocoa.txt: * UIProcess/Cocoa/WebProcessProxyCocoa.mm: (WebKit::WebProcessProxy::messageSourceIsValidWebContentProcess): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::getWebAuthnProcessConnection): * UIProcess/WebProcessProxy.h: * UIProcess/mac/WebProcessProxyMac.mm: * WebKit.xcodeproj/project.pbxproj: Source/WTF: Add new SPI header for code signing features. * WTF.xcodeproj/project.pbxproj: * wtf/spi/cocoa/SecuritySPI.h: * wtf/spi/darwin/CodeSignSPI.h: Added. Canonical link: https://commits.webkit.org/240086@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280451 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-29 22:12:16 +00:00
2021-07-29 Kate Cheney <katherine_cheney@apple.com>
REGRESSION (r278877) [Cocoa] WebAuthn stopped working for non-Safari browsers
https://bugs.webkit.org/show_bug.cgi?id=228116
<rdar://problem/80693607>
Patch by Brent Fulgham.
Reviewed by Per Arne Vollan.
Add new SPI header for code signing features.
* WTF.xcodeproj/project.pbxproj:
* wtf/spi/cocoa/SecuritySPI.h:
* wtf/spi/darwin/CodeSignSPI.h: Added.
2021-07-29 Eric Carlson <eric.carlson@apple.com>
[iOS] Don't set capture attribution dynamically in the simulator
https://bugs.webkit.org/show_bug.cgi?id=228596
rdar://81176531
Reviewed by Jer Noble.
* wtf/PlatformHave.h: Don't define HAVE_SYSTEM_STATUS for the simulator.
2021-07-29 Kate Cheney <katherine_cheney@apple.com>
GetIdentifierStringForPreferredVoiceInListWithLocale() is deprecated in Monterey
<https://webkit.org/b/228066>
<rdar://problem/80577312>
Patch by David Kilzer.
Reviewed by David Kilzer.
* wtf/PlatformHave.h:
- Add HAVE(SPEECHSYNTHESIS_MONTEREY_SPI).
[WebAudio] Add webm/opus container support https://bugs.webkit.org/show_bug.cgi?id=227110 <rdar://problem/79437067> Reviewed by Jer Noble. Source/WebCore: Add support for webm in Web Audio. As decoding needs to be performed in the web content process we need to ensure that the decoders are available there. For security reasons, com.apple.audio.AudioComponentRegistrar mach calls are blocked which prevents registering a new audio component. We instead register it in the UI process so that AudioComponentFetchServerRegistrations SPI can forward the registration in the web process. Unfortunately, for unknown reasons, this fails for Vorbis audio codec (bug 228139). To demux the webm content, we use the existing SourceBufferParserWebM to extract all audio packets. We then iterate over all CM Samples and decode them into PCM, performing resampling as needed on the fly. There are things left to fix. - Opus and Vorbis encoder delay isn't handled (bug 228140) which leaves audible silence at the beginning of the destination buffer. - We can only decode mono and stereo content. Opus and Vorbis let you define a custom channel ordering, this is particularly used with ambisonic audio (with opus 255 mode). CoreMedia doesn't easily deal with such re-ordering as it appears to be essentially designed for audible content. With more than 2 channels, decoding will either fail or produce channels in the wrong order. Test: webaudio/decode-audio-data-webm-opus.html * Headers.cmake: Export header so that we can register the decoder in the UI process. * WebCore.xcodeproj/project.pbxproj: same as above. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::canPlayType const): Make canPlayType(webm/audio; codecs=opus) work if features is set. * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setWebMWebAudioEnabled): (WebCore::RuntimeEnabledFeatures::webMWebAudioEnabled const): * platform/MediaSample.h: Fly-by fix: remove unnecessary WEBCORE_EXPORT * platform/audio/AudioBus.cpp: (WebCore::AudioBus::setLength): * platform/audio/AudioBus.h: Add setLength method. Will change the reported length without touching the underlying storage. * platform/audio/AudioChannel.h: Add setLength method. Will change the reported length without touching the underlying storage. * platform/audio/cocoa/AudioFileReaderCocoa.cpp: (WebCore::tryCreateAudioBufferList): Fix checkedInt use to catch potential overflow (WebCore::AudioBufferListHolder::AudioBufferListHolder): Add convenience class that free wrapped AudioBufferList object on exit. (WebCore::AudioBufferListHolder::~AudioBufferListHolder): (WebCore::AudioBufferListHolder::operator bool const): (WebCore::AudioBufferListHolder::operator-> const): (WebCore::AudioBufferListHolder::operator* const): (WebCore::AudioBufferListHolder::isValid const): (WebCore::AudioFileReader::AudioFileReader): (WebCore::AudioFileReader::isMaybeWebM const): Method to check if the buffer contains WebM data. (WebCore::passthroughInputDataCallback): Required for AudioConverterFillComplexBuffer. Will feed the decoder the data to decode, splitting the multiple packets found in the CMSampleBuffer. (WebCore::AudioFileReader::numberOfFrames const): Return the total number of decoded frames in the packets. (WebCore::AudioFileReader::fileDataFormat const): Create AudioStreamBasicDescription related to the demuxed audio track. nullopt if unsupported content. (WebCore::AudioFileReader::clientDataFormat const): (WebCore::AudioFileReader::createBus): (WebCore::AudioFileReader::logChannel const): * platform/audio/cocoa/AudioFileReaderCocoa.h: * platform/audio/cocoa/AudioSampleDataSource.h: Remove unused typedef. * platform/audio/cocoa/AudioSampleDataSource.mm: (WebCore::AudioSampleDataSource::~AudioSampleDataSource): Fly-by fix, make it use PAL softlinks (WebCore::AudioSampleDataSource::setupConverter): Fly-by fix, make it use PAL softlinks * platform/gamepad/mac/HIDGamepadProvider.mm: Fly-by fix, add missing header. * platform/graphics/TrackPrivateBase.cpp: Fly-by fix, add missing header. * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h: Fly-by fix required by webkit-prepare : don't tag the whole class as WEBCORE_EXPORT. Move constructor and destructor function definitions out-of-line to prevent linkage errors. * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm: (WebCore::MediaSampleAVFObjC::MediaSampleAVFObjC): Move code * platform/graphics/cocoa/WebCoreDecompressionSession.mm: Fly-by fix, add missing header. * platform/graphics/cocoa/WebMAudioUtilitiesCocoa.h: Export some symbols, add new method definitions. * platform/graphics/cocoa/WebMAudioUtilitiesCocoa.mm: (WebCore::registerDecoderFactory): Instead of attempting to register the decoder by dl-opening the required library, first attempting to see if the decoder is already available. Calling AudioComponentRegister in the web content process when the GPU process is enabled will fail due to sandbox settings. Which would incorrectly report the codec to not be available when it was. (WebCore::createAudioFormatDescriptionForFormat): (WebCore::isOpusDecoderAvailable): Fly-by fix, should the method be called on non-mac platform it would have return the unitialized value of the available static variable. (WebCore::registerOpusDecoderIfNeeded): Added (WebCore::isVorbisDecoderAvailable): Same as isOpusDecoderAvailable (WebCore::registerVorbisDecoderIfNeeded): Added Source/WebCore/PAL: Add various AVFoundation (AVAudioConverter) related methods and CoreMedia to access required CMSampleBuffer related methods. * pal/cf/CoreMediaSoftLink.cpp: * pal/cf/CoreMediaSoftLink.h: * pal/cocoa/AVFoundationSoftLink.h: * pal/cocoa/AVFoundationSoftLink.mm: Source/WebKit: Add default value for webm_webaudio feature flag for the different platforms. Disabled by default on all platforms. Fly-by fix: don't make webm parser dependent on VP9 support. * FeatureFlags/WebKit-appletvos.plist: * FeatureFlags/WebKit-ios.plist: * FeatureFlags/WebKit-macos.plist: * FeatureFlags/WebKit-watchos.plist: * GPUProcess/GPUProcess.h: * GPUProcess/GPUProcess.messages.in: * Shared/WebPreferencesDefaultValues.cpp: (WebKit::defaultWebMWebAudioEnabled): * Shared/WebPreferencesDefaultValues.h: * UIProcess/Cocoa/WebProcessProxyCocoa.mm: (WebKit::WebProcessProxy::sendAudioComponentRegistrations): Source/WTF: Add WebMWebAudioEnabled preference to make canPlayType return probably for mimetype: "audio/webm; codecs=opus" Disabled by default. * Scripts/Preferences/WebPreferencesExperimental.yaml: LayoutTests: * platform/mac/TestExpectations: Only enable test on macOS Monterey * webaudio/decode-audio-data-basic.html: fix whitespace * webaudio/decode-audio-data-webm-opus-expected.txt: Added. * webaudio/decode-audio-data-webm-opus.html: Added. * webaudio/resources/media/opus.webm: Added. * webaudio/resources/media/vorbis.webm: Added. Canonical link: https://commits.webkit.org/240056@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280416 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-29 04:18:16 +00:00
2021-07-28 Jean-Yves Avenard <jya@apple.com>
[WebAudio] Add webm/opus container support
https://bugs.webkit.org/show_bug.cgi?id=227110
<rdar://problem/79437067>
Reviewed by Jer Noble.
Add WebMWebAudioEnabled preference to make canPlayType return probably for mimetype:
"audio/webm; codecs=opus"
Disabled by default.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
2021-07-28 Ryosuke Niwa <rniwa@webkit.org>
makeWeakPtr should support Ref and RefPtr as the argument
https://bugs.webkit.org/show_bug.cgi?id=228574
Reviewed by Wenson Hsieh.
This patch adds variants of makeWeakPtr<T> which take Ref<T> and RefPtr<T>.
Tests: TestWebKitAPI.WTF_WeakPtr.MakeWeakPtrTakesRef
TestWebKitAPI.WTF_WeakPtr.MakeWeakPtrTakesRefPtr
* wtf/WeakPtr.h:
(WTF::makeWeakPtr):
2021-07-28 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] macOS Monterey and parallel OSes no longer need r280103
https://bugs.webkit.org/show_bug.cgi?id=228539
Reviewed by Alan Bujtas.
Core Text's behavior changed on these OSes.
* wtf/PlatformUse.h:
Unreviewed, speculative revert of r280193 https://bugs.webkit.org/show_bug.cgi?id=228142 Source/WebCore: * html/parser/HTMLConstructionSite.cpp: (WebCore::HTMLConstructionSite::insertTextNode): * html/parser/HTMLConstructionSite.h: * html/parser/HTMLDocumentParser.cpp: (WebCore::HTMLDocumentParser::pumpTokenizerLoop): * html/parser/HTMLMetaCharsetParser.cpp: (WebCore::HTMLMetaCharsetParser::checkForMetaCharset): * html/parser/HTMLPreloadScanner.cpp: (WebCore::HTMLPreloadScanner::scan): * html/parser/HTMLToken.h: (WebCore::HTMLToken::clear): (WebCore::HTMLToken::beginStartTag): (WebCore::HTMLToken::beginEndTag): (WebCore::HTMLToken::shrinkToBestFit): Deleted. * html/parser/HTMLTokenizer.h: (WebCore::HTMLTokenizer::shrinkToBestFit): Deleted. * html/parser/HTMLTreeBuilder.cpp: (WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::characterPredicate): (WebCore::HTMLTreeBuilder::processFakeCharacters): (WebCore::HTMLTreeBuilder::insertPhoneNumberLink): (WebCore::HTMLTreeBuilder::linkifyPhoneNumbers): (WebCore::HTMLTreeBuilder::processCharacterBuffer): (WebCore::HTMLTreeBuilder::processCharacterBufferForInBody): (WebCore::HTMLTreeBuilder::defaultForInTableText): (WebCore::HTMLTreeBuilder::processTokenInForeignContent): * html/parser/HTMLTreeBuilder.h: Source/WTF: * wtf/Vector.h: (WTF::Malloc>::shrinkCapacity): (WTF::Malloc>::shrinkToBestFit): Deleted. * wtf/text/AtomStringImpl.cpp: (WTF::UCharBufferTranslator::equal): (WTF::LCharBufferTranslator::equal): (WTF::BufferFromStaticDataTranslator::equal): * wtf/text/StringView.h: (WTF::StringView::stripLeadingMatchedCharacters): Deleted. Tools: * TestWebKitAPI/Tests/WTF/StringView.cpp: * TestWebKitAPI/Tests/WTF/Vector.cpp: Canonical link: https://commits.webkit.org/239982@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280335 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-27 01:43:33 +00:00
2021-07-26 Yusuke Suzuki <ysuzuki@apple.com>
Unreviewed, speculative revert of r280193
https://bugs.webkit.org/show_bug.cgi?id=228142
* wtf/Vector.h:
(WTF::Malloc>::shrinkCapacity):
(WTF::Malloc>::shrinkToBestFit): Deleted.
* wtf/text/AtomStringImpl.cpp:
(WTF::UCharBufferTranslator::equal):
(WTF::LCharBufferTranslator::equal):
(WTF::BufferFromStaticDataTranslator::equal):
* wtf/text/StringView.h:
(WTF::StringView::stripLeadingMatchedCharacters): Deleted.
2021-07-26 Jer Noble <jer.noble@apple.com>
[Cocoa] WebKit is making GroupActivities API calls for all WebKit clients
https://bugs.webkit.org/show_bug.cgi?id=228299
<rdar://80802982>
Reviewed by Eric Carlson.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
2021-07-26 Per Arne <pvollan@apple.com>
The layout test fast/images/heic-as-background-image.html is a constant failure
https://bugs.webkit.org/show_bug.cgi?id=228195
<rdar://80334724>
Reviewed by Said Abou-Hallawa.
Add HAVE macro for the system function CMPhotoIsTileDecoderAvailable.
* wtf/PlatformHave.h:
[iOS] All home screen web apps resume when any home screen web app is foregrounded https://bugs.webkit.org/show_bug.cgi?id=228246 <rdar://72949281> Reviewed by Eric Carlson. Source/WebCore: Test: media/video-page-visibility-restriction.html On iOS, home screen web apps all run from the same UIProcess, SafariViewService. So when one Web App is foregrounded, the SafariViewService itself is foregrounded, and all WKWebViews (one for each Web App) are foregrounded as well, allowing all Web Apps to resume audio playback. This is not ideal; ideally, all Web Apps will be allowed to continue to play audio in the background. But until we can fix that bug, the current behavior of pausing audio from Web App A when A is backgrounded, and resuming audio from A when Web App B is foregrounded feels super broken. Add a new WKPreference/WebPreference/Setting and matching MediaElementSession restriction that will block playback of audible media elements when the media element's page is not visible. When adopted by SafariViewService, this would keep multiple Web Apps (and indeed SafariViewController pages) from starting playback when any other is foregrounded. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::initializeMediaSession): (WebCore::HTMLMediaElement::visibilityStateChanged): * html/MediaElementSession.cpp: (WebCore::MediaElementSession::visibilityChanged): (WebCore::MediaElementSession::playbackStateChangePermitted const): * html/MediaElementSession.h: * platform/audio/PlatformMediaSession.h: * testing/Internals.cpp: (WebCore::Internals::setMediaElementRestrictions): Source/WebKit: Add a private WKPreference for setting the new WebPreference. * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _requiresPageVisibilityToPlayAudio]): (-[WKPreferences _setRequiresPageVisibilityToPlayAudio:]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: Source/WTF: * Scripts/Preferences/WebPreferences.yaml: LayoutTests: * media/video-page-visibility-restriction-expected.txt: Added. * media/video-page-visibility-restriction.html: Added. Canonical link: https://commits.webkit.org/239951@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280298 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-26 17:51:09 +00:00
2021-07-26 Jer Noble <jer.noble@apple.com>
[iOS] All home screen web apps resume when any home screen web app is foregrounded
https://bugs.webkit.org/show_bug.cgi?id=228246
<rdar://72949281>
Reviewed by Eric Carlson.
* Scripts/Preferences/WebPreferences.yaml:
SharedBuffer::takeData() is a bit dangerous https://bugs.webkit.org/show_bug.cgi?id=228161 Reviewed by Darin Adler. Source/WebCore: SharedBuffer::takeData() is a bit dangerous since SharedBuffer is RefCounted and several object may be sharing ownership of the buffer. Having one owner call takeData() in case ownership is shared leads to bugs such as Bug 228096. To address the issue, I made SharedBuffer::takeData() private and introduced a new SharedBuffer::extractData() member function which calls takeData() only if the SharedBuffer is not shared (RefCount is 1) and falls back to calling copyData() otherwise. I also optimized copyData() a bit by iterating over the segments to build the vector, instead of calling the potentially very slow SharedBuffer::data(). * Modules/fetch/FetchBodyConsumer.cpp: (WebCore::FetchBodyConsumer::takeAsBlob): * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::createDataAvailableEvent): * editing/WebCorePasteboardFileReader.cpp: (WebCore::WebCorePasteboardFileReader::readBuffer): * editing/cocoa/WebContentReaderCocoa.mm: (WebCore::createFragmentForImageAttachment): (WebCore::WebContentReader::readImage): * editing/gtk/WebContentReaderGtk.cpp: (WebCore::WebContentReader::readImage): * html/HTMLAttachmentElement.cpp: (WebCore::HTMLAttachmentElement::updateEnclosingImageWithData): * platform/SharedBuffer.cpp: (WebCore::SharedBuffer::copyData): * platform/SharedBuffer.h: (WebCore::SharedBuffer::extractData): * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::createResponseBlob): Source/WTF: Add Vector::uncheckedAppend() overload that takes in a Span. * wtf/Vector.h: (WTF::Vector::uncheckedAppend): (WTF::Malloc>::uncheckedAppend): Canonical link: https://commits.webkit.org/239926@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280260 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-23 22:05:03 +00:00
2021-07-23 Chris Dumez <cdumez@apple.com>
SharedBuffer::takeData() is a bit dangerous
https://bugs.webkit.org/show_bug.cgi?id=228161
Reviewed by Darin Adler.
Add Vector::uncheckedAppend() overload that takes in a Span.
* wtf/Vector.h:
(WTF::Vector::uncheckedAppend):
(WTF::Malloc>::uncheckedAppend):
2021-07-23 Robert Jenner <Jenner@apple.com>
Unreviewed, reverting r280205.
Broke multiple WebAuthn tests.
Reverted changeset:
"REGRESSION (r278877) [Cocoa] WebAuthn stopped working for
non-Safari browsers"
https://bugs.webkit.org/show_bug.cgi?id=228116
https://commits.webkit.org/r280205
[GLib] Remove libportal dependency https://bugs.webkit.org/show_bug.cgi?id=228056 Reviewed by Carlos Garcia Campos. .: * Source/cmake/FindLIBPORTAL.cmake: Removed. * Source/cmake/GStreamerChecks.cmake: Source/WebCore: The pure-GDBus approach allows us to request the input device (Monitor or Window) depending on the CaptureDevice type and make the mouse cursor visible in the generated video stream. Also requesting capture support within computeCaptureDevices() was a bad idea because this being used by the enumerateMediaDevices API could potentially spam the user with permission popups. * platform/GStreamer.cmake: * platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp: * platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.h: * platform/mediastream/gstreamer/GStreamerDisplayCaptureDeviceManager.cpp: Added. (WebCore::GStreamerDisplayCaptureDeviceManager::singleton): (WebCore::GStreamerDisplayCaptureDeviceManager::GStreamerDisplayCaptureDeviceManager): (WebCore::GStreamerDisplayCaptureDeviceManager::~GStreamerDisplayCaptureDeviceManager): (WebCore::GStreamerDisplayCaptureDeviceManager::computeCaptureDevices): (WebCore::GStreamerDisplayCaptureDeviceManager::createDisplayCaptureSource): (WebCore::GStreamerDisplayCaptureDeviceManager::stopSource): (WebCore::GStreamerDisplayCaptureDeviceManager::waitResponseSignal): * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp: (WebCore::GStreamerVideoCaptureSource::createPipewireSource): (WebCore::GStreamerVideoCaptureSource::factory): (WebCore::GStreamerVideoCaptureSource::displayFactory): (WebCore::GStreamerVideoCaptureSource::GStreamerVideoCaptureSource): (WebCore::GStreamerVideoCaptureSource::stopProducingData): * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h: * platform/mediastream/gstreamer/GStreamerVideoCapturer.cpp: * platform/mediastream/gstreamer/GStreamerVideoCapturer.h: Source/WTF: * Scripts/Preferences/WebPreferencesExperimental.yaml: Enable screen capture on GStreamer ports. The PIPEWIRE ifdef is redundant. Canonical link: https://commits.webkit.org/239909@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280239 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-23 10:51:17 +00:00
2021-07-23 Philippe Normand <pnormand@igalia.com>
[GLib] Remove libportal dependency
https://bugs.webkit.org/show_bug.cgi?id=228056
Reviewed by Carlos Garcia Campos.
* Scripts/Preferences/WebPreferencesExperimental.yaml: Enable screen capture on GStreamer
ports. The PIPEWIRE ifdef is redundant.
REGRESSION (r278877) [Cocoa] WebAuthn stopped working for non-Safari browsers https://bugs.webkit.org/show_bug.cgi?id=228116 <rdar://problem/80693607> Reviewed by Per Arne Vollan. Source/WebKit: We should not be using the PAC key to confirm a valid WebContent process is the source of WebAuthn-related messages. Instead, we should confirm the message source is an Apple-signed executable, and that the signining identity is for the WebContent process. * Shared/Cocoa/CodeSigning.h: Renamed from Source/WebKit/Shared/mac/CodeSigning.h. * Shared/Cocoa/CodeSigning.mm: Renamed from Source/WebKit/Shared/mac/CodeSigning.mm. (WebKit::codeSigningIdentifier): (WebKit::codeSigningIdentifierForCurrentProcess): (WebKit::codeSigningIdentifierAndPlatformBinaryStatus): Added. * Shared/Cocoa/XPCEndpoint.mm: (WebKit::XPCEndpoint::XPCEndpoint): Update to use new method. * SourcesCocoa.txt: * UIProcess/Cocoa/WebProcessProxyCocoa.mm: (WebKit::WebProcessProxy::messageSourceIsValidWebContentProcess): * UIProcess/WebProcessProxy.cpp: (WebKit:WebProcessProxy::getWebAuthnProcessConnection): Update for new message check name. * UIProcess/WebProcessProxy.h: * WebKit.xcodeproj/project.pbxproj: Source/WTF: Add new SPI header for code signing features. * WTF.xcodeproj/project.pbxproj: * wtf/spi/cocoa/SecuritySPI.h: Move some SecTask calls out of PLATFORM(MAC). * wtf/spi/darwin/CodeSignSPI.h: Added. Canonical link: https://commits.webkit.org/239893@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280205 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-22 22:58:08 +00:00
2021-07-22 Brent Fulgham <bfulgham@apple.com>
REGRESSION (r278877) [Cocoa] WebAuthn stopped working for non-Safari browsers
https://bugs.webkit.org/show_bug.cgi?id=228116
<rdar://problem/80693607>
Reviewed by Per Arne Vollan.
Add new SPI header for code signing features.
* WTF.xcodeproj/project.pbxproj:
* wtf/spi/cocoa/SecuritySPI.h: Move some SecTask calls out of PLATFORM(MAC).
* wtf/spi/darwin/CodeSignSPI.h: Added.
Fix uses of Dependency::fence with respect to the compiler outsmarting us https://bugs.webkit.org/show_bug.cgi?id=227757 <rdar://problem/80280931> Reviewed by Robin Morisset. Source/JavaScriptCore: We were running into issues on arm64 with respect to the memory model ordering of loads, and how the compiler optimized code around Dependency::fence. The issue manifested as calls to isMarked incorrectly returning true. To see the issue, let's consider a program like this: a = load(p1) b = load(p2) if (a != b) return; d = Dependency::fence(b) At the point of defining the dependency, the compiler has proven a == b. So, instead of building the dependency on the register used for b, we end up using the register for a. So the actual compiled code ends up with a dependency on load(p1), not load(p2). To fix this, we end up adding a new API, Dependency::loadEndFence(pointer, result), which is defined as: template<typename T> static Dependency loadAndFence(T* pointer, T& output) { T value = *opaque(pointer); Dependency dependency = Dependency::fence(value); output = opaque(value); return dependency; } The reason for this is that it split "b" in the above program into two values, and the "b" the program compares against is not known to the compiler to be the same value that we build a dependency on. * heap/MarkedBlock.h: (JSC::MarkedBlock::aboutToMark): (JSC::MarkedBlock::isMarked): * runtime/JSObject.cpp: (JSC::JSObject::visitButterflyImpl): * runtime/JSObject.h: (JSC::JSObject::fencedButterfly): * runtime/SparseArrayValueMap.cpp: (JSC::SparseArrayEntry::getConcurrently): (JSC::SparseArrayEntry::getConcurrently const): Deleted. * runtime/SparseArrayValueMap.h: * runtime/Structure.h: (JSC::Structure::fencedIndexingMode): * runtime/StructureIDBlob.h: (JSC::StructureIDBlob::fencedIndexingModeIncludingHistory): Source/WTF: * wtf/Atomics.h: (WTF::opaque): (WTF::Dependency::loadAndFence): Canonical link: https://commits.webkit.org/239883@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280195 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-22 20:05:09 +00:00
2021-07-22 Saam Barati <sbarati@apple.com>
Fix uses of Dependency::fence with respect to the compiler outsmarting us
https://bugs.webkit.org/show_bug.cgi?id=227757
<rdar://problem/80280931>
Reviewed by Robin Morisset.
* wtf/Atomics.h:
(WTF::opaque):
(WTF::Dependency::loadAndFence):
2021-07-22 Yusuke Suzuki <ysuzuki@apple.com>
Unreviewed, follow-up after r280193
https://bugs.webkit.org/show_bug.cgi?id=228142
I accidentally reverted auto change when switching branches.
* wtf/text/AtomStringImpl.cpp:
(WTF::UCharBufferTranslator::equal):
(WTF::LCharBufferTranslator::equal):
(WTF::BufferFromStaticDataTranslator::equal):
Micro-optimize innerHTML https://bugs.webkit.org/show_bug.cgi?id=228142 Reviewed by Simon Fraser. Source/WebCore: No behavior change. This patch does some micro optimizations revealed by the profiler when running some of Speedometer2 tests which intensively use innerHTML. This offers improvement in jQuery-TodoMVC and Vanilla-ES2015-Babel-Webpack-TodoMVC since both are super innerHTML heavy benchmarks. ---------------------------------------------------------------------------------------------------------------------------------- | subtest | ms | ms | b / a | pValue (significance using False Discovery Rate) | ---------------------------------------------------------------------------------------------------------------------------------- | Elm-TodoMVC |126.862500 |126.687500 |0.998621 | 0.673462 | | VueJS-TodoMVC |27.775000 |27.645833 |0.995350 | 0.741588 | | EmberJS-TodoMVC |129.350000 |129.129167 |0.998293 | 0.624196 | | BackboneJS-TodoMVC |51.129167 |51.204167 |1.001467 | 0.716622 | | Preact-TodoMVC |21.870833 |21.337500 |0.975614 | 0.217771 | | AngularJS-TodoMVC |139.854167 |140.266667 |1.002950 | 0.489838 | | Vanilla-ES2015-TodoMVC |69.229167 |68.895833 |0.995185 | 0.238772 | | Inferno-TodoMVC |68.391667 |68.266667 |0.998172 | 0.762281 | | Flight-TodoMVC |77.979167 |78.166667 |1.002404 | 0.710324 | | Angular2-TypeScript-TodoMVC |39.741667 |39.966667 |1.005662 | 0.524123 | | VanillaJS-TodoMVC |55.416667 |55.512500 |1.001729 | 0.781447 | | jQuery-TodoMVC |268.812500 |266.966667 |0.993133 | 0.003384 (significant) | | EmberJS-Debug-TodoMVC |345.383333 |345.662500 |1.000808 | 0.695259 | | React-TodoMVC |90.679167 |90.179167 |0.994486 | 0.067477 | | React-Redux-TodoMVC |152.691667 |152.687500 |0.999973 | 0.991207 | | Vanilla-ES2015-Babel-Webpack-TodoMVC |66.487500 |65.729167 |0.988594 | 0.000118 (significant) | ---------------------------------------------------------------------------------------------------------------------------------- a mean = 242.12319 b mean = 242.80485 pValue = 0.1992654128 (Bigger means are better.) 1.003 times better Results ARE NOT significant * html/parser/HTMLConstructionSite.cpp: (WebCore::HTMLConstructionSite::insertTextNode): * html/parser/HTMLConstructionSite.h: * html/parser/HTMLDocumentParser.cpp: (WebCore::HTMLDocumentParser::pumpTokenizerLoop): We do not need to call `shrinkToBestFit` in fragment parsing case since we will discard HTMLToken soon. * html/parser/HTMLMetaCharsetParser.cpp: (WebCore::HTMLMetaCharsetParser::checkForMetaCharset): * html/parser/HTMLPreloadScanner.cpp: (WebCore::HTMLPreloadScanner::scan): * html/parser/HTMLToken.h: (WebCore::HTMLToken::clear): We found that these `clear` calls cause performance problem according to the Instruments: we repeatedly use this Vector, and we repeatedly allocate and deallocate this Vector unnecessarily. We use `resize(0)` instead to avoid this allocation and deallocation. (WebCore::HTMLToken::shrinkToBestFit): But HTMLToken is kept so long, so at some point, we would like to make backing storage small. So, we add shrinkToBestFit and we call it only after finishing batching of HTMLToken processing. (WebCore::HTMLToken::beginStartTag): (WebCore::HTMLToken::beginEndTag): * html/parser/HTMLTokenizer.h: (WebCore::HTMLTokenizer::shrinkToBestFit): * html/parser/HTMLTreeBuilder.cpp: (WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::characterPredicate): (WebCore::HTMLTreeBuilder::insertPhoneNumberLink): (WebCore::HTMLTreeBuilder::linkifyPhoneNumbers): (WebCore::HTMLTreeBuilder::processCharacterBuffer): (WebCore::HTMLTreeBuilder::processCharacterBufferForInBody): (WebCore::HTMLTreeBuilder::defaultForInTableText): (WebCore::HTMLTreeBuilder::processTokenInForeignContent): (WebCore::HTMLTreeBuilder::processFakeCharacters): Deleted. It is dead code before this patch. * html/parser/HTMLTreeBuilder.h: Source/WTF: * wtf/Vector.h: (WTF::Malloc>::shrinkToBestFit): This shrinks the backing storage to "appropriate for the living Vector". * wtf/text/AtomStringImpl.cpp: (WTF::UCharBufferTranslator::equal): WTF::equal for String does not check hash. This is because computing hash is expensive and we would like to avoid that if it is not necessary. But when inserting string into AtomStringTable, we can use hash value since they must be already computed because of HashMap's requirement. So let's use it before calling WTF::equal. (WTF::LCharBufferTranslator::equal): (WTF::BufferFromStaticDataTranslator::equal): * wtf/text/StringView.h: (WTF::StringView::stripLeadingMatchedCharacters): Add this and use it in HTMLTreeBuilder. Tools: * TestWebKitAPI/Tests/WTF/StringView.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WTF/Vector.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/239881@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-22 19:18:45 +00:00
2021-07-22 Yusuke Suzuki <ysuzuki@apple.com>
Micro-optimize innerHTML
https://bugs.webkit.org/show_bug.cgi?id=228142
Reviewed by Simon Fraser.
* wtf/Vector.h:
(WTF::Malloc>::shrinkToBestFit): This shrinks the backing storage to "appropriate for the living Vector".
* wtf/text/AtomStringImpl.cpp:
(WTF::UCharBufferTranslator::equal): WTF::equal for String does not check hash. This is because computing hash is expensive
and we would like to avoid that if it is not necessary. But when inserting string into AtomStringTable, we can use hash value
since they must be already computed because of HashMap's requirement. So let's use it before calling WTF::equal.
(WTF::LCharBufferTranslator::equal):
(WTF::BufferFromStaticDataTranslator::equal):
* wtf/text/StringView.h:
(WTF::StringView::stripLeadingMatchedCharacters): Add this and use it in HTMLTreeBuilder.
2021-07-22 Alex Christensen <achristensen@webkit.org>
XHR.send(Document) should replace mismatched surrogates with replacement character before sending
https://bugs.webkit.org/show_bug.cgi?id=228170
Reviewed by Chris Dumez.
* wtf/text/WTFString.cpp:
(WTF::replaceUnpairedSurrogatesWithReplacementCharacter):
* wtf/text/WTFString.h:
Move from WebCore, rename as suggested, update spec link to one that works.
2021-07-22 Zan Dobersek <zdobersek@igalia.com>
Add CPU(RISCV64)
https://bugs.webkit.org/show_bug.cgi?id=228178
Reviewed by Adrian Perez de Castro.
Detect when compiling for the RISC-V 64-bit architecture and define
the WTF_CPU_RISCV64 macro under that condition, enabling use of
CPU(RISCV64) build guards.
* wtf/PageBlock.h: Use 4 kB as the page size ceiling for CPU(RISCV64).
* wtf/PlatformCPU.h:
[GTK][WPE] Allow the user to configure the MemoryPressureHandler inside the web process https://bugs.webkit.org/show_bug.cgi?id=222738 Reviewed by Carlos Garcia Campos. Source/WebCore: MemoryPressureHandler::currentMemoryUsagePolicy() is now an instance method and not a class one, so update the call in RenderLayerCompositor to use the singleton instance. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateCompositingPolicy): Source/WebKit: Add a new API type WebKitMemoryPressureSettings that can be used to configure the behavior of the MemoryPressureHandler. Add a property to WebKitWebContext that can be used to pass new settings to it, and store them inside its API::ProcessPoolConfiguration. Those settings will be set to new web processes during the platform initialization stage. * PlatformGTK.cmake: * PlatformWPE.cmake: * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * SourcesGTK.txt: * SourcesWPE.txt: * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/glib/WebKitMemoryPressureSettings.cpp: Added. (webkit_memory_pressure_settings_new): (webkit_memory_pressure_settings_copy): (webkit_memory_pressure_settings_free): (webkit_memory_pressure_settings_set_memory_limit): (webkit_memory_pressure_settings_get_memory_limit): (webkit_memory_pressure_settings_set_conservative_threshold): (webkit_memory_pressure_settings_get_conservative_threshold): (webkit_memory_pressure_settings_set_strict_threshold): (webkit_memory_pressure_settings_get_strict_threshold): (webkit_memory_pressure_settings_set_kill_threshold): (webkit_memory_pressure_settings_get_kill_threshold): (webkit_memory_pressure_settings_set_poll_interval): (webkit_memory_pressure_settings_get_poll_interval): (webkitMemoryPressureSettingsGetMemoryPressureHandlerConfiguration): * UIProcess/API/glib/WebKitMemoryPressureSettingsPrivate.h: Added. * UIProcess/API/glib/WebKitWebContext.cpp: (webkitWebContextSetProperty): (webkitWebContextConstructed): (webkit_web_context_class_init): * UIProcess/API/gtk/WebKitAutocleanups.h: * UIProcess/API/gtk/WebKitMemoryPressureSettings.h: Added. * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: * UIProcess/API/gtk/webkit2.h: * UIProcess/API/wpe/WebKitAutocleanups.h: * UIProcess/API/wpe/WebKitMemoryPressureSettings.h: Added. * UIProcess/API/wpe/docs/wpe-1.0-sections.txt: * UIProcess/API/wpe/webkit.h: * UIProcess/glib/WebProcessPoolGLib.cpp: (WebKit::WebProcessPool::platformInitializeWebProcess): * WebProcess/glib/WebProcessGLib.cpp: (WebKit::WebProcess::platformInitializeWebProcess): Source/WTF: Add a configuration structure to MemoryPressureHandler, with the methods to encode/decode it. Also add a method to set a configuration structure to a MemoryPressureHandler instance, and modify the behavior so the the configuration is used when checking the memory used by the process. * wtf/MemoryPressureHandler.cpp: (WTF::MemoryPressureHandler::setShouldUsePeriodicMemoryMonitor): (WTF::MemoryPressureHandler::thresholdForMemoryKill): (WTF::MemoryPressureHandler::thresholdForPolicy): (WTF::MemoryPressureHandler::policyForFootprint): (WTF::MemoryPressureHandler::Configuration::Configuration): * wtf/MemoryPressureHandler.h: (WTF::MemoryPressureHandler::Configuration::encode const): (WTF::MemoryPressureHandler::Configuration::decode): (WTF::MemoryPressureHandler::setConfiguration): Tools: Add a test for WebKitMemoryPressureSettings API and to test WebKitWebContext with non default WebKitMemoryPressureSettings values. * TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebContext.cpp: (MemoryPressureTest::setup): (MemoryPressureTest::teardown): (MemoryPressureTest::webProcessTerminatedCallback): (MemoryPressureTest::waitUntilWebProcessTerminated): (testMemoryPressureSettings): (beforeAll): * TestWebKitAPI/glib/WebKitGLib/TestMain.cpp: * TestWebKitAPI/glib/WebKitGLib/TestMain.h: (Test::Test): Canonical link: https://commits.webkit.org/239852@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280155 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-21 20:10:49 +00:00
2021-07-21 Miguel Gomez <magomez@igalia.com>
[GTK][WPE] Allow the user to configure the MemoryPressureHandler inside the web process
https://bugs.webkit.org/show_bug.cgi?id=222738
Reviewed by Carlos Garcia Campos.
Add a configuration structure to MemoryPressureHandler, with the methods to encode/decode it. Also
add a method to set a configuration structure to a MemoryPressureHandler instance, and modify the
behavior so the the configuration is used when checking the memory used by the process.
* wtf/MemoryPressureHandler.cpp:
(WTF::MemoryPressureHandler::setShouldUsePeriodicMemoryMonitor):
(WTF::MemoryPressureHandler::thresholdForMemoryKill):
(WTF::MemoryPressureHandler::thresholdForPolicy):
(WTF::MemoryPressureHandler::policyForFootprint):
(WTF::MemoryPressureHandler::Configuration::Configuration):
* wtf/MemoryPressureHandler.h:
(WTF::MemoryPressureHandler::Configuration::encode const):
(WTF::MemoryPressureHandler::Configuration::decode):
(WTF::MemoryPressureHandler::setConfiguration):
2021-07-21 Chris Dumez <cdumez@apple.com>
Unreviewed, reverting r280129.
Broke the internal Monterey build bots
Reverted changeset:
"GetIdentifierStringForPreferredVoiceInListWithLocale() is
deprecated in Monterey"
https://bugs.webkit.org/show_bug.cgi?id=228066
https://commits.webkit.org/r280129
2021-07-21 David Kilzer <ddkilzer@apple.com>
GetIdentifierStringForPreferredVoiceInListWithLocale() is deprecated in Monterey
<https://webkit.org/b/228066>
<rdar://problem/80577312>
Reviewed by Alexey Proskuryakov.
* wtf/PlatformHave.h:
- Add HAVE(SPEECHSYNTHESIS_MONTEREY_SPI).
2021-07-20 Myles C. Maxfield <mmaxfield@apple.com>
r280103 is not necessary on all operating systems
https://bugs.webkit.org/show_bug.cgi?id=228136
Reviewed by Alan Bujtas.
* wtf/PlatformUse.h:
[GTK][WPE] Support color-schemes CSS property https://bugs.webkit.org/show_bug.cgi?id=208204 Patch by Alexander Mikhaylenko <alexm@gnome.org> on 2021-07-16 Reviewed by Adrian Perez de Castro. .: * Source/cmake/OptionsGTK.cmake: Enable HAVE_OS_DARK_MODE_SUPPORT. * Source/cmake/OptionsWPE.cmake: Enable ENABLE_DARK_MODE_CSS and HAVE_OS_DARK_MODE_SUPPORT. Source/WebCore: Last time we tried enabling dark mode, we broke many webpages since we couldn't have diferent controls, and more importantly, different system colors and defaults for pages that do and don't support dark mode. Now that we don't use GTK for this, we can try again. This time, use hardcoded system colors and return different colors depending on StyleColor::Options::UseDarkAppearance. To avoid dark-on-dark text on entries, we also need to enable HAVE_OS_DARK_MODE_SUPPORT for GTK and make sure it's passed to use agent CSS. And since Adwaita controls are also used in WPE, we need to enable it for WPE as well, and since WPE didn't have ENABLE_DARK_MODE_CSS, flip that as well, all in lockstep. No new tests, reenabled the existing css-dark-mode tests. * PlatformGTK.cmake: * PlatformWPE.cmake: Pass HAVE_OS_DARK_MODE_SUPPORT to user agent CSS. * css/CSSValueKeywords.in: Expose -webkit-control-background for anything with HAVE_OS_DARK_MODE_SUPPORT. * css/themeAdwaita.css: (input[type="search"]::-webkit-search-results-button,): (input[type="search"]::-webkit-search-cancel-button): (body[dir="rtl"] input[type="search"]::-webkit-search-cancel-button): (input[type="search"]::-webkit-search-results-button:hover,): (input[type="search"]::-webkit-search-cancel-button:hover): Deleted. Use mask images instead of content so we can recolor them. Change color on hover as opacity and inherit entry's color otherwise to make sure it's legible with dark appearance. * page/FrameView.cpp: (WebCore::FrameView::updateBackgroundRecursively): Use CSSValueWindow for background instead of CSSValueAppleSystemControlBackground when the latter is not available. * platform/adwaita/ThemeAdwaita.cpp: (WebCore::ThemeAdwaita::focusColor): (WebCore::ThemeAdwaita::paintFocus): (WebCore::ThemeAdwaita::paintArrow): (WebCore::ThemeAdwaita::paint): (WebCore::ThemeAdwaita::paintCheckbox): (WebCore::ThemeAdwaita::paintRadio): (WebCore::ThemeAdwaita::paintButton): (WebCore::ThemeAdwaita::paintSpinButton): * platform/adwaita/ThemeAdwaita.h: * rendering/RenderThemeAdwaita.cpp: (WebCore::RenderThemeAdwaita::platformFocusRingColor const): (WebCore::RenderThemeAdwaita::systemColor const): (WebCore::RenderThemeAdwaita::paintTextField): (WebCore::RenderThemeAdwaita::adjustTextFieldStyle const): (WebCore::RenderThemeAdwaita::adjustTextAreaStyle const): (WebCore::RenderThemeAdwaita::adjustSearchFieldStyle const): Add a border radius to the default style, so the background doesn't bleed through the corners. (WebCore::RenderThemeAdwaita::paintMenuList): (WebCore::RenderThemeAdwaita::paintProgressBar): (WebCore::RenderThemeAdwaita::paintSliderTrack): (WebCore::RenderThemeAdwaita::paintSliderThumb): * rendering/RenderThemeAdwaita.h: Source/WTF: * wtf/PlatformHave.h: Enable HAVE_OS_DARK_MODE_SUPPORT for GTK and WPE. LayoutTests: Reenable css-dark-mode tests for GTK as they pass now. Enable the same tests in WPE. Keep css-dark-mode/older-syntax/supported-color-schemes-css.html as [ Pass Crash ] for now, according to https://bugs.webkit.org/show_bug.cgi?id=202229#c2 * platform/gtk/TestExpectations: * platform/gtk/css-dark-mode/color-scheme-css-expected.txt: Removed. * platform/gtk/css-dark-mode/color-scheme-meta-expected.txt: Removed. * platform/gtk/css-dark-mode/color-scheme-priority-expected.txt: Removed. * platform/gtk/css-dark-mode/default-colors-expected.txt: Removed. * platform/gtk/css-dark-mode/older-syntax/supported-color-schemes-css-expected.txt: Removed. * platform/gtk/css-dark-mode/older-syntax/supported-color-schemes-meta-expected.txt: Removed. * platform/wpe/TestExpectations: Canonical link: https://commits.webkit.org/239730@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279987 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-16 16:39:15 +00:00
2021-07-16 Alexander Mikhaylenko <alexm@gnome.org>
[GTK][WPE] Support color-schemes CSS property
https://bugs.webkit.org/show_bug.cgi?id=208204
Reviewed by Adrian Perez de Castro.
* wtf/PlatformHave.h:
Enable HAVE_OS_DARK_MODE_SUPPORT for GTK and WPE.
2021-07-15 Jean-Yves Avenard <jya@apple.com>
[Wk1] media/media-source/media-webm-opus-partial.html is a consistent failure (Enable VP8/VP9/Vorbis/Opus in WebKitLegacy)
https://bugs.webkit.org/show_bug.cgi?id=228005
rdar://80346720
Reviewed by Jer Noble.
* Scripts/Preferences/WebPreferencesExperimental.yaml: Enable VP8/VP9/Vorbis/Opus
codecs for WebKitLegacy, no reasons they weren't already enabled.
2021-07-15 Joonghun Park <jh718.park@samsung.com>
Unreviewed. Fix the build warning below since r279895.
warning: comparison of integer expressions of different signedness: int and unsigned int [-Wsign-compare]
* wtf/URL.cpp:
(WTF::URL::setPath):
Add initial support for BroadcastChannel behind a runtime flag https://bugs.webkit.org/show_bug.cgi?id=227924 Reviewed by Sam Weinig. LayoutTests/imported/w3c: Rebaseline WPT tests now that more tests are running and we are passing more checks. * web-platform-tests/FileAPI/url/url-in-tags-revoke.window-expected.txt: * web-platform-tests/html/browsers/the-window-object/noopener-noreferrer-BarProp.window-expected.txt: * web-platform-tests/html/browsers/the-window-object/noopener-noreferrer-sizing.window-expected.txt: * web-platform-tests/html/browsers/the-window-object/window-open-noreferrer-expected.txt: * web-platform-tests/html/cross-origin-embedder-policy/report-only-require-corp.https-expected.txt: * web-platform-tests/html/cross-origin-embedder-policy/require-corp.https-expected.txt: * web-platform-tests/html/dom/idlharness.worker-expected.txt: * web-platform-tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/broadcastchannel-success.https-expected.txt: * web-platform-tests/html/semantics/forms/form-submission-target/rel-base-target-expected.txt: * web-platform-tests/html/semantics/forms/form-submission-target/rel-button-target-expected.txt: * web-platform-tests/html/semantics/forms/form-submission-target/rel-form-target-expected.txt: * web-platform-tests/html/semantics/forms/form-submission-target/rel-input-target-expected.txt: * web-platform-tests/html/semantics/links/links-created-by-a-and-area-elements/htmlanchorelement_noopener-expected.txt: * web-platform-tests/html/semantics/links/links-created-by-a-and-area-elements/target_blank_implicit_noopener-expected.txt: * web-platform-tests/html/semantics/links/links-created-by-a-and-area-elements/target_blank_implicit_noopener_base-expected.txt: * web-platform-tests/wasm/serialization/module/broadcastchannel-success-and-failure-expected.txt: * web-platform-tests/wasm/serialization/module/broadcastchannel-success-expected.txt: * web-platform-tests/webmessaging/MessageEvent-trusted.any-expected.txt: * web-platform-tests/webmessaging/MessageEvent-trusted.any.worker-expected.txt: * web-platform-tests/webmessaging/broadcastchannel/basics-expected.txt: Removed. * web-platform-tests/webmessaging/broadcastchannel/basics.any-expected.txt: * web-platform-tests/webmessaging/broadcastchannel/basics.any.worker-expected.txt: * web-platform-tests/webmessaging/broadcastchannel/blobs-expected.txt: * web-platform-tests/webmessaging/broadcastchannel/interface-expected.txt: Removed. * web-platform-tests/webmessaging/broadcastchannel/interface.any-expected.txt: * web-platform-tests/webmessaging/broadcastchannel/interface.any.worker-expected.txt: * web-platform-tests/webmessaging/broadcastchannel/sandbox-expected.txt: * web-platform-tests/webmessaging/broadcastchannel/workers-expected.txt: Added. * web-platform-tests/webmessaging/multi-globals/broadcastchannel-current.sub-expected.txt: * web-platform-tests/webstorage/storage_session_window_noopener.window-expected.txt: * web-platform-tests/workers/semantics/interface-objects/001.worker-expected.txt: Source/WebCore: Add initial support for BroadcastChannel behind a runtime flag, off by default: - https://html.spec.whatwg.org/multipage/web-messaging.html#broadcasting-to-other-browsing-contexts Both Firefox and Blink have been supporting BroadcastChannel for a long time. The implementation is complete and spec-compliant. It works both in Window and Worker environments, in WebKit1 and WebKit2. However, the feature is off-by-default because of privacy concerns that have not been addresssed yet: - https://github.com/whatwg/html/issues/5803 We should be able to add partioning to address the privacy concerns and ship this later on. In the mean time though, having a working BroadcastChannel implementation in the context of layout tests is already very useful because a lot of Web-Platform-Tests are relying on it to test other Web features. This means better test coverage for WebKit. Tests: - fast/html/broadcast-channel-between-different-sessions.html - Rebaselined WPT tests * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Headers.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: * dom/BroadcastChannel.cpp: Added. (WebCore::channelToContextIdentifier): (WebCore::BroadcastChannel::BroadcastChannel): (WebCore::BroadcastChannel::~BroadcastChannel): (WebCore::BroadcastChannel::postMessage): (WebCore::BroadcastChannel::close): (WebCore::BroadcastChannel::dispatchMessageTo): (WebCore::BroadcastChannel::dispatchMessage): (WebCore::BroadcastChannel::ensureOnMainThread): (WebCore::BroadcastChannel::activeDOMObjectName const): (WebCore::BroadcastChannel::eventListenersDidChange): (WebCore::BroadcastChannel::virtualHasPendingActivity const): * dom/BroadcastChannel.h: Added. (WebCore::BroadcastChannel::create): (WebCore::BroadcastChannel::identifier const): (WebCore::BroadcastChannel::name const): * dom/BroadcastChannel.idl: Added. * dom/BroadcastChannelIdentifier.h: Added. * dom/BroadcastChannelRegistry.h: Added. (WebCore::BroadcastChannelRegistry::~BroadcastChannelRegistry): * dom/DeviceOrientationAndMotionAccessController.h: * dom/DeviceOrientationEvent.cpp: * dom/DeviceOrientationEvent.h: * dom/EventTargetFactory.in: * loader/EmptyClients.cpp: (WebCore::pageConfigurationWithEmptyClients): * page/Page.cpp: (WebCore::Page::Page): (WebCore::Page::setBroadcastChannelRegistry): * page/Page.h: (WebCore::Page::broadcastChannelRegistry): * page/PageConfiguration.cpp: (WebCore::PageConfiguration::PageConfiguration): * page/PageConfiguration.h: Source/WebKit: Add initial support for BroadcastChannel behind a runtime flag, off by default: - https://html.spec.whatwg.org/multipage/web-messaging.html#broadcasting-to-other-browsing-contexts Both Firefox and Blink have been supporting BroadcastChannel for a long time. The implementation is complete and spec-compliant. It works both in Window and Worker environments, in WebKit1 and WebKit2. However, the feature is off-by-default because of privacy concerns that have not been addresssed yet: - https://github.com/whatwg/html/issues/5803 We should be able to add partioning to address the privacy concerns and ship this later on. In the mean time though, having a working BroadcastChannel implementation in the context of layout tests is already very useful because a lot of Web-Platform-Tests are relying on it to test other Web features. This means better test coverage for WebKit. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * NetworkProcess/Downloads/DownloadManager.cpp: * NetworkProcess/NetworkBroadcastChannelRegistry.cpp: Added. (WebKit::NetworkBroadcastChannelRegistry::registerChannel): (WebKit::NetworkBroadcastChannelRegistry::unregisterChannel): (WebKit::NetworkBroadcastChannelRegistry::postMessage): (WebKit::NetworkBroadcastChannelRegistry::removeConnection): * NetworkProcess/NetworkBroadcastChannelRegistry.h: Added. (WebKit::NetworkBroadcastChannelRegistry::GlobalBroadcastChannelIdentifier::operator== const): * NetworkProcess/NetworkBroadcastChannelRegistry.messages.in: Added. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::didReceiveMessage): (WebKit::NetworkConnectionToWebProcess::didClose): * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::NetworkSession): * NetworkProcess/NetworkSession.h: (WebKit::NetworkSession::broadcastChannelRegistry): * Scripts/webkit/messages.py: (types_that_cannot_be_forward_declared): * Sources.txt: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Network/NetworkProcessConnection.cpp: (WebKit::NetworkProcessConnection::didReceiveMessage): * WebProcess/WebCoreSupport/WebBroadcastChannelRegistry.cpp: Added. (WebKit::networkProcessConnection): (WebKit::WebBroadcastChannelRegistry::registerChannel): (WebKit::WebBroadcastChannelRegistry::unregisterChannel): (WebKit::WebBroadcastChannelRegistry::postMessage): (WebKit::WebBroadcastChannelRegistry::postMessageToRemote): * WebProcess/WebCoreSupport/WebBroadcastChannelRegistry.h: Added. * WebProcess/WebCoreSupport/WebBroadcastChannelRegistry.messages.in: Added. * WebProcess/WebPage/WebPage.cpp: (WebKit::m_appHighlightsVisible): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::WebProcess): * WebProcess/WebProcess.h: (WebKit::WebProcess::broadcastChannelRegistry): Source/WebKitLegacy: Add BroadcastChannelRegistry implementation for WebKitLegacy. * Sources.txt: * WebCoreSupport/WebBroadcastChannelRegistry.cpp: Added. (WebBroadcastChannelRegistry::getOrCreate): (WebBroadcastChannelRegistry::registerChannel): (WebBroadcastChannelRegistry::unregisterChannel): (WebBroadcastChannelRegistry::postMessage): * WebCoreSupport/WebBroadcastChannelRegistry.h: Added. * WebKitLegacy.xcodeproj/project.pbxproj: Source/WebKitLegacy/mac: * WebView/WebView.mm: (-[WebView _commonInitializationWithFrameName:groupName:]): (-[WebView _preferencesChanged:]): Source/WebKitLegacy/win: * WebView.cpp: (WebView::initWithFrame): (WebView::notifyPreferencesChanged): Source/WTF: Add experimental feature flag for BroadcastChannel, off by default. * Scripts/Preferences/WebPreferencesExperimental.yaml: LayoutTests: * TestExpectations: * fast/html/broadcast-channel-between-different-sessions-expected.txt: Added. * fast/html/broadcast-channel-between-different-sessions.html: Added. * fast/html/resources/broadcast-channel-between-different-sessions-window.html: Added. Add layout test coverage to make sure that windows belonging to different session are unable to communicate via BroadcastChannel. * platform/ios-wk2/imported/w3c/web-platform-tests/html/browsers/the-window-object/noopener-noreferrer-sizing.window-expected.txt: Copied from LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/noopener-noreferrer-sizing.window-expected.txt. * platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt: * platform/mac-wk1/TestExpectations: * platform/mac-wk1/imported/w3c/web-platform-tests/html/browsers/the-window-object/noopener-noreferrer-BarProp.window-expected.txt: Added. * platform/mac-wk1/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt: * platform/mac-wk1/imported/w3c/web-platform-tests/html/semantics/links/links-created-by-a-and-area-elements/htmlanchorelement_noopener-expected.txt: Added. * platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt: * platform/win/TestExpectations: * platform/wk2/TestExpectations: Update test expectations now that we support BroadcastChannel. Canonical link: https://commits.webkit.org/239714@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279971 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-16 00:36:39 +00:00
2021-07-15 Chris Dumez <cdumez@apple.com>
Add initial support for BroadcastChannel behind a runtime flag
https://bugs.webkit.org/show_bug.cgi?id=227924
Reviewed by Sam Weinig.
Add experimental feature flag for BroadcastChannel, off by default.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
[GStreamer][Pipewire] Implement getDisplayMedia() backend https://bugs.webkit.org/show_bug.cgi?id=210926 Reviewed by Xabier Rodriguez-Calvar. .: * Source/cmake/FindLIBPORTAL.cmake: Added. * Source/cmake/GStreamerChecks.cmake: Enable Pipewire support if libportal was found. Source/WebCore: Display capture is now supported by GStreamer ports. When requested, the capture device manager queries the host through the libportal API. The user is presented with a prompt allowing to select either a monitor or an application window. Once selected, the manager creates the associated CaptureDevice, passing the pipewire file descriptor along. The existing GStreamer video capture source infrastructure is reused, leveraging the GStreamer pipewiresrc element to generate a live video stream of the display device. As display capture devices need to respect the aspect-ratio of the video frame, taking into account max-{widther,height}, some code was reused from the Cocoa display capture code and placed in RealtimeVideoCaptureSource as ensureIntrinsicSizeMaintainsAspectRatio(). Unfortunately this aspect-ratio enforcing feature is currently used only for mock capture sources. The GStreamer pipewiresrc doesn't support caps renegotiation well yet, so we can't comply with the aspect-ratio enforcing, for the time being. This patch is covered by newly unskipped layout tests and API tests. * platform/GStreamer.cmake: * platform/mediastream/RealtimeMediaSource.cpp: (WebCore::RealtimeMediaSource::setIntrinsicSize): (WebCore::RealtimeMediaSource::hashedId const): * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/RealtimeVideoCaptureSource.cpp: (WebCore::RealtimeVideoCaptureSource::ensureIntrinsicSizeMaintainsAspectRatio): * platform/mediastream/RealtimeVideoCaptureSource.h: * platform/mediastream/RealtimeVideoSource.cpp: (WebCore::RealtimeVideoSource::sourceSettingsChanged): * platform/mediastream/gstreamer/GStreamerAudioCapturer.cpp: (WebCore::GStreamerAudioCapturer::GStreamerAudioCapturer): * platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp: (WebCore::GStreamerDisplayCaptureDeviceManager::GStreamerDisplayCaptureDeviceManager): (WebCore::GStreamerDisplayCaptureDeviceManager::~GStreamerDisplayCaptureDeviceManager): (WebCore::GStreamerDisplayCaptureDeviceManager::computeCaptureDevices): (WebCore::GStreamerDisplayCaptureDeviceManager::setSession): (WebCore::GStreamerDisplayCaptureDeviceManager::sessionStarted): (WebCore::GStreamerDisplayCaptureDeviceManager::notifyClient): (WebCore::GStreamerDisplayCaptureDeviceManager::sessionWasClosed): * platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.h: * platform/mediastream/gstreamer/GStreamerCapturer.cpp: (WebCore::GStreamerCapturer::GStreamerCapturer): (WebCore::GStreamerCapturer::Observer::~Observer): (WebCore::GStreamerCapturer::addObserver): (WebCore::GStreamerCapturer::removeObserver): (WebCore::GStreamerCapturer::forEachObserver): (WebCore::GStreamerCapturer::createSource): * platform/mediastream/gstreamer/GStreamerCapturer.h: (WebCore::GStreamerCapturer::Observer::sourceCapsChanged): (WebCore::GStreamerCapturer::deviceType const): * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp: (WebCore::GStreamerVideoCaptureSource::create): (WebCore::GStreamerVideoCaptureSource::createPipewireSource): (WebCore::GStreamerVideoCaptureSource::GStreamerVideoCaptureSource): (WebCore::m_deviceType): (WebCore::GStreamerVideoCaptureSource::~GStreamerVideoCaptureSource): (WebCore::GStreamerVideoCaptureSource::sourceCapsChanged): (WebCore::GStreamerVideoCaptureSource::startProducingData): (WebCore::GStreamerVideoCaptureSource::stopProducingData): (WebCore::m_capturer): Deleted. * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h: * platform/mediastream/gstreamer/GStreamerVideoCapturer.cpp: (WebCore::initializeDebugCategory): (WebCore::GStreamerVideoCapturer::GStreamerVideoCapturer): (WebCore::GStreamerVideoCapturer::createSource): (WebCore::GStreamerVideoCapturer::setPipewireFD): (WebCore::GStreamerVideoCapturer::setSize): (WebCore::GStreamerVideoCapturer::setFrameRate): * platform/mediastream/gstreamer/GStreamerVideoCapturer.h: * platform/mediastream/gstreamer/MockRealtimeVideoSourceGStreamer.cpp: (WebCore::MockRealtimeVideoSource::create): (WebCore::MockRealtimeVideoSourceGStreamer::createMockDisplayCaptureSource): * platform/mediastream/gstreamer/MockRealtimeVideoSourceGStreamer.h: * platform/mock/MockRealtimeMediaSourceCenter.cpp: * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::capabilities): (WebCore::MockRealtimeVideoSource::generateFrame): * platform/mock/MockRealtimeVideoSource.h: Source/WTF: * Scripts/Preferences/WebPreferencesExperimental.yaml: Enable screen-capture if libportal was found. LayoutTests: * platform/glib/TestExpectations: Unskip now-passing getDisplayMedia tests. Canonical link: https://commits.webkit.org/239684@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279940 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-15 11:48:58 +00:00
2021-07-15 Philippe Normand <pnormand@igalia.com>
[GStreamer][Pipewire] Implement getDisplayMedia() backend
https://bugs.webkit.org/show_bug.cgi?id=210926
Reviewed by Xabier Rodriguez-Calvar.
* Scripts/Preferences/WebPreferencesExperimental.yaml: Enable screen-capture if libportal
was found.
2021-07-14 Jer Noble <jer.noble@apple.com>
Unreviewed build fix after r279912 (239661@main); Add a HAVE(SYSTEM_STATUS) macro.
* wtf/PlatformHave.h:
2021-07-13 Alex Christensen <achristensen@webkit.org>
Update and fix URL WPT tests
https://bugs.webkit.org/show_bug.cgi?id=227820
Reviewed by Chris Dumez.
There was an edge case where if we set a path to an empty string, it would add a slash. No more.
* wtf/URL.cpp:
(WTF::URL::setPath):
2021-07-13 Michael Catanzaro <mcatanzaro@gnome.org>
Remove USE_64KB_PAGE_BLOCK
https://bugs.webkit.org/show_bug.cgi?id=227905
Reviewed by Yusuke Suzuki.
* wtf/PageBlock.h:
New malloc algorithm https://bugs.webkit.org/show_bug.cgi?id=226404 Reviewed by Yusuke Suzuki. Source/bmalloc: This change replaces bmalloc with libpas, by importing libpas and making it expose API that looks like the current bmalloc API. Libpas replaces everything bmalloc gave us: the main bmalloc API, the Gigacage API, and the IsoHeap API. Libpas also replaces the JSC ExecutableAllocator (more on that in the JSC ChangeLog). I've been working on libpas for about three years, and you'll be able to see the age of some of it in the copyrights. Libpas is a totally new malloc implementation that focuses on allowing for the creation of lots of isolated heaps, and making it possible for those heaps to provide certain type guarantees. I'm not going to summarize everything that it does in this changelog; I'll mostly focus on things that are interesting to its use in WebKit. Libpas tries hard to make having lots of heaps cheap both by having a good isolated heap implementation and by offsetting the cost by having a bunch of space saving improvements for all kinds of heaps. Libpas heaps can be configured to be either very compact or very fast. In WebKit, we configure libpas to be as fast as possible, except for the jit_heap, where we configure it to be as compact as possible. The fast configuration relies on the segregated heap for most allocations, while the compact configuration relies on bitfit for most configurations. It's possible to use both in combination with any size cut-off before you switch to bitfit. Libpas's segregated heap is competitive to bmalloc in speed. This patch is a speed-up on AS, and it's only enabled on AS for now. Libpas is still a regression relative to bmalloc on some devices that I have measured, so it should probably stay enabled on AS only for now. This patch ought to be a 1% speed-up on Speedometer and MotionMark and be neutral elsewhere. When it comes to memory usage, libpas's segregated heap is a 19% improvement on membuster and a 11% improvement on RAMification on AS, with most other devices exhibiting similar wins if you enable libpas on them. Here's the basic design: - Libpas makes extreme use of generic programming in C, sometimes using macros, but mostly using a technique where ALWAYS_INLINE functions are passed structs with function pointers to other ALWAYS_INLINE functions, sometimes many layers deep. I've perfected this so that I can cause outlining to happen wherever I want without losing the specialization, and I can cause anything I want to become generic (i.e. it gets a pointer to that struct with function pointers and it really has to call them). This allows libpas to have many copies of the same algorithm, but configured differently. That's why, for example, I was able to make libpas's bitfit obey ExecutableAllocator rules like that you cannot put any metadata inside the memory you're managing. That's also how libpas "scales" it's algorithm: there are the small configurations, and then with a different struct, we get the medium configurations (larger overall page size, ability to decommit each physical page within the logical page), and the marge configurations (optimized for even bigger object sizes). - Allocation uses thread-local caches that hold on to up to a page of memory. This is similar overall to bmalloc, but rather different in the details. When allocating from that memory (see bmalloc_heap_inlines.h, then pas_try_allocate_intrinsic_primitive.h, then pas_try_allocate_common.h, then pas_local_allocator_inlines.h), libpas uses either bump pointer or bit search. The bit search is optimized to death. Libpas does lots of clever things with bits: for example, each bit represents just a "minalign" worth of memory (so like 16 bytes), and bits are set at the beginnings of objects. Lots of interesting bit manipulation happens on the slow path to quickly turn this into a bitvector where the bits are set at free object beginnings, which is what the allocator consumes (see for example pas_local_allocator_scan_bits_to_set_up_free_bits() in pas_local_allocator_inlines.h). This saves libpas from having to use multiplications on the allocation and deallocation paths. Allocation fast paths are super fast and require no locks. Slow paths use fine-grained locking so the likelihood of contention is very low. Each page has a lock, and they do crazy things with their locks: pages will all share the same lock so long as that's efficient, but will pick up different locks if that causes contention, and then they will share the same lock again if contention goes away. Allocation caches can be reclaimed by the scavenger. This is done using an ask-nicely-then-more-firmly kind of mechanism: first the scavenger will just ask allocators that haven't been used in a while to return their memory, and the thread will service this request on the next allocation slow path for any thread-local allocator. But if the thread doesn't do this, then the scavenger will eventually suspend the thread and take its caches. - Deallocation uses a log. The log flush amortizes lock acquisition and memory access to libpas metadata. This is quite a bit like bmalloc. The differences are: libpas may acquire multiple locks during deallocation log flush, but because pages try to share locks, that usually doesn't happen. Usually, all pages that were most recently used by some CPU will share the same lock. The other difference is that the libpas scavenger can flush deallocation logs, and does so on every tick. The design described so far is for the libpas segregated heap, which is the most performance-optimized heap, as well as the heap most suited for isoheaps. Segregated heap has many isoheap optimizations, like allowing multiple heaps to share different slabs of the same page. But libpas also has two other heap kinds: - Bitfit. The bitfit heap uses a bit-per-minalign but uses it to implement first-fit. Allocation searches for a span of set "free" bits and then clears them. Deallocation uses a second bitvector, the "object ends" bits, to find the end of the object and then sets the whole range of free bits. This allocator uses per-page locking and a clever short-circuiting algorithm to find the first page that will have a contiguous slab of free memory big enough for the size you're trying to allocate. This is much slower than the segregated heap, but also much faster than the other option, which is the libpas large allocator. Bitfit is the most space-efficient heap in libpas, except for super large objects. The space efficiency comes from the fact that it's first-fit. It should be noted that segregated is also first-fit, but within size classes, so segregated gets more external fragmentation than bitfit. This patch causes us to use bitfit for the mini mode. We also use bitfit for marge allocations (so bigger than segregated medium but too small for large) and for jit_heap. I think the most interesting file for bitfit is pas_bitfit_page_inlines.h. - Large. This is a first-fit allocator implemented using cartesian trees. Something special about it is that it can do type-safe array allocations with complex combinations of memalign. For example, you can tell it to create a heap that allocates arrays of a type whose size is 42, and then it will guarantee you that no matter how big or how small of an array you allocate, no element of that array will ever be an "offset overlap" with a previously freed element. So, it won't create any type confusions. It will guarantee this even if you did memalign with any alignment (I needed to use extended GCD for this -- see pas_extended_gcd.c and pas_coalign.c). The large algorithm is implemented generically (pas_generic_large_free_heap.h), so it can use either cartesian trees (pas_fast_large_free_heap.c) or just an array (pas_simple_large_free_heap.c). The large heap is used internally in libpas a lot, for example for the bootstrap heap, which is how all of libpas gets its memory. One particularly neat thing about this is that the bootstrap heap allocates a freelist array inside of the memory it is managing using a kind of wild metacircular design. One of the main space saving features is that libpas has a fine-grained-locked LRU decommit policy using a 10Hz scavenger thread. This scavenger incurs almost no perf cost but is able to return a ton of memory. At any tick, it will decommit any totally free pages that haven't been used in the last 300ms. This includes pages used for internal libpas metadata, like the thread-local caches. Decommitting pages holds locks that other threads are unlikely to want to grab (because of policies that actively avoid it), so decommit happens with minimal interference to the running program. Libpas is written in C and strongly assumes that the C compiler is modern enough to fixpoint inlining of always-inline functions with the right other optimizations. Llvm does this, which enables a wonderful style of generic programming. The fact that the same code can be used for generic, specialized-and-inline, and specialized-but-out-of-line functions is great. I use WebKit C++ style (so foo* p rather than foo *p) but with lower_case_identifiers for anything that isn't a macro. Anything that isn't static is prefixed pas_, unless it's some specific heap configuration, like the bmalloc one, which prefixes every non-static with bmalloc_. Libpas includes a giant test suite. Lots of the heap configurations (iso_test, thingy, minalign32, pagesize64k) are just for testing. The test suite has both unit tests and chaos tests as well as everything in between. The test suite is written in C++. This glues libpas into the DebugHeap mechanism in bmalloc, so Malloc=1 will give you system malloc. Libpas supports libmalloc enumeration, and this patch exposes it (though you need a shared cache rebuild to enjoy the benefits). All of bmalloc's external-facing API are replaced with libpas when the BUSE(LIBPAS) flag is set (so the bmalloc::XYZ functions, Gigacage::XYZ, and IsoHeap<> and friends). This also exposes the jit_heap API for the ExecutableAllocator to use. Notes for porting: this uses lots of Darwin APIs, like the APIs for getting an approximate time very quickly, APIs for fast TLS, thread suspension, and probably other stuff. It'll be hard, but possible, to port to Linux. It may never perform as well on Linux as it does on Darwin. It's also worth noting that libpas strongly assumes 64-bit, that the CPU can do 128-bit compare-and-swap, that there is no big downside to misaligned loads and stores, and that the memory model is either the one in ARM64 or the one on x86_64 (or something not weaker than either of them). Trying to make libpas work on 32-bit CPUs will quickly run into cases where some pointer math doesn't work right because it was written strongly assuming properties unique to 64-bit CPUs (like that some number of top bits are not used for the address), as well as cases where lock-free algorithms are using uintptr_t for a versioning scheme (which may not be as reliable as you want on 32-bit). * CMakeLists.txt: * Configurations/Base.xcconfig: * bmalloc.xcodeproj/project.pbxproj: * bmalloc/BPlatform.h: * bmalloc/DebugHeap.cpp: (bmalloc::DebugHeap::tryGetSlow): (pas_debug_heap_is_enabled): (pas_debug_heap_malloc): (pas_debug_heap_memalign): (pas_debug_heap_realloc): (pas_debug_heap_free): * bmalloc/DebugHeap.h: (bmalloc::debugHeapDisabled): (bmalloc::DebugHeap::tryGet): (bmalloc::DebugHeap::getExisting): * bmalloc/Gigacage.cpp: (Gigacage::ensureGigacage): (Gigacage::allocBase): (Gigacage::size): * bmalloc/Gigacage.h: * bmalloc/GigacageConfig.h: (Gigacage::Config::allocBasePtr const): (Gigacage::Config::setAllocBasePtr): (Gigacage::Config::allocSize const): (Gigacage::Config::setAllocSize): * bmalloc/Heap.cpp: (bmalloc::Heap::gigacageSize): * bmalloc/Heap.h: * bmalloc/IsoHeap.cpp: Added. (bmalloc::api::isoAllocate): (bmalloc::api::isoTryAllocate): (bmalloc::api::isoDeallocate): * bmalloc/IsoHeap.h: (bmalloc::api::IsoHeap::IsoHeap): (bmalloc::api::IsoHeap::allocate): (bmalloc::api::IsoHeap::tryAllocate): (bmalloc::api::IsoHeap::deallocate): (bmalloc::api::IsoHeap::scavenge): (bmalloc::api::IsoHeap::initialize): (bmalloc::api::IsoHeap::isInitialized): * bmalloc/IsoHeapImplInlines.h: (bmalloc::IsoHeapImpl<Config>::IsoHeapImpl): * bmalloc/IsoHeapInlines.h: * bmalloc/IsoMallocFallback.cpp: Added. (bmalloc::IsoMallocFallback::tryMalloc): (bmalloc::IsoMallocFallback::tryFree): * bmalloc/IsoMallocFallback.h: Copied from Source/bmalloc/bmalloc/DebugHeap.h. (bmalloc::IsoMallocFallback::shouldTryToFallBack): (bmalloc::IsoMallocFallback::MallocResult::MallocResult): * bmalloc/IsoTLS.cpp: (bmalloc::IsoTLS::determineMallocFallbackState): Deleted. * bmalloc/IsoTLS.h: * bmalloc/IsoTLSInlines.h: (bmalloc::IsoTLS::allocateSlow): (bmalloc::IsoTLS::deallocateSlow): * bmalloc/PerThread.h: (bmalloc::PerThreadStorage<PerHeapKind<Cache>>::init): * bmalloc/bmalloc.cpp: (bmalloc::api::tryLargeZeroedMemalignVirtual): (bmalloc::api::freeLargeVirtual): (bmalloc::api::scavengeThisThread): (bmalloc::api::scavenge): (bmalloc::api::setScavengerThreadQOSClass): (bmalloc::api::commitAlignedPhysical): (bmalloc::api::decommitAlignedPhysical): (bmalloc::api::enableMiniMode): (bmalloc::api::disableScavenger): * bmalloc/bmalloc.h: (bmalloc::api::heapForKind): (bmalloc::api::tryMalloc): (bmalloc::api::malloc): (bmalloc::api::tryMemalign): (bmalloc::api::memalign): (bmalloc::api::tryRealloc): (bmalloc::api::realloc): (bmalloc::api::free): (bmalloc::api::scavengeThisThread): Deleted. * libpas/.gitignore: Added. * libpas/build.sh: Added. * libpas/build_and_test.sh: Added. * libpas/common.sh: Added. * libpas/libpas.xcodeproj/project.pbxproj: Added. * libpas/scripts/tally_verifier_output: Added. * libpas/src/chaos/Chaos.cpp: Added. (std::Object::Object): (std::Packet::~Packet): (std::Locker::Locker): (std::Locker::~Locker): (std::threadMain): (main): * libpas/src/libpas/bmalloc_heap.c: Added. (bmalloc_try_allocate): (bmalloc_try_allocate_with_alignment): (bmalloc_try_allocate_zeroed): (bmalloc_allocate): (bmalloc_allocate_with_alignment): (bmalloc_allocate_zeroed): (bmalloc_try_reallocate): (bmalloc_reallocate): (bmalloc_try_iso_allocate): (bmalloc_iso_allocate): (bmalloc_heap_ref_get_heap): (bmalloc_try_allocate_auxiliary): (bmalloc_allocate_auxiliary): (bmalloc_try_allocate_auxiliary_zeroed): (bmalloc_allocate_auxiliary_zeroed): (bmalloc_try_allocate_auxiliary_with_alignment): (bmalloc_allocate_auxiliary_with_alignment): (bmalloc_try_reallocate_auxiliary): (bmalloc_reallocate_auxiliary): (bmalloc_deallocate): (bmalloc_force_auxiliary_heap_into_reserved_memory): * libpas/src/libpas/bmalloc_heap.h: Added. * libpas/src/libpas/bmalloc_heap_config.c: Copied from Source/WTF/wtf/FastTLS.h. (bmalloc_heap_config_activate): * libpas/src/libpas/bmalloc_heap_config.h: Added. * libpas/src/libpas/bmalloc_heap_inlines.h: Added. (bmalloc_try_allocate_inline): (bmalloc_try_allocate_with_alignment_inline): (bmalloc_try_allocate_zeroed_inline): (bmalloc_allocate_inline): (bmalloc_allocate_with_alignment_inline): (bmalloc_allocate_zeroed_inline): (bmalloc_try_reallocate_inline): (bmalloc_reallocate_inline): (bmalloc_try_iso_allocate_inline): (bmalloc_iso_allocate_inline): (bmalloc_try_allocate_auxiliary_inline): (bmalloc_allocate_auxiliary_inline): (bmalloc_try_allocate_auxiliary_zeroed_inline): (bmalloc_allocate_auxiliary_zeroed_inline): (bmalloc_try_allocate_auxiliary_with_alignment_inline): (bmalloc_allocate_auxiliary_with_alignment_inline): (bmalloc_try_reallocate_auxiliary_inline): (bmalloc_reallocate_auxiliary_inline): (bmalloc_deallocate_inline): * libpas/src/libpas/bmalloc_heap_innards.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/bmalloc_heap_ref.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/hotbit_heap.c: Copied from Source/WTF/wtf/FastTLS.h. (hotbit_try_allocate): (hotbit_try_allocate_with_alignment): (hotbit_try_reallocate): (hotbit_deallocate): * libpas/src/libpas/hotbit_heap.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/hotbit_heap_config.c: Copied from Source/WTF/wtf/FastTLS.h. (hotbit_heap_config_activate): * libpas/src/libpas/hotbit_heap_config.h: Added. * libpas/src/libpas/hotbit_heap_inlines.h: Added. (hotbit_try_allocate_inline): (hotbit_try_allocate_with_alignment_inline): (hotbit_try_reallocate_inline): (hotbit_deallocate_inline): * libpas/src/libpas/hotbit_heap_innards.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/iso_heap.c: Added. (iso_try_allocate_common_primitive): (iso_try_allocate_common_primitive_with_alignment): (iso_try_allocate_common_primitive_zeroed): (iso_allocate_common_primitive): (iso_allocate_common_primitive_with_alignment): (iso_allocate_common_primitive_zeroed): (iso_try_reallocate_common_primitive): (iso_reallocate_common_primitive): (iso_try_allocate_dynamic_primitive): (iso_try_allocate_dynamic_primitive_with_alignment): (iso_try_allocate_dynamic_primitive_zeroed): (iso_try_reallocate_dynamic_primitive): (iso_heap_ref_construct): (iso_try_allocate): (iso_allocate): (iso_try_allocate_array): (iso_allocate_array): (iso_try_allocate_array_zeroed): (iso_allocate_array_zeroed): (iso_try_reallocate_array): (iso_reallocate_array): (iso_heap_ref_get_heap): (iso_primitive_heap_ref_construct): (iso_try_allocate_primitive): (iso_allocate_primitive): (iso_try_allocate_primitive_zeroed): (iso_allocate_primitive_zeroed): (iso_try_allocate_primitive_with_alignment): (iso_allocate_primitive_with_alignment): (iso_try_reallocate_primitive): (iso_reallocate_primitive): (iso_try_allocate_for_objc): (iso_has_object): (iso_get_allocation_size): (iso_get_heap): (iso_deallocate): (iso_force_primitive_heap_into_reserved_memory): * libpas/src/libpas/iso_heap.h: Added. * libpas/src/libpas/iso_heap_config.c: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/iso_heap_config.h: Added. * libpas/src/libpas/iso_heap_inlines.h: Added. (iso_try_allocate_common_primitive_inline): (iso_try_allocate_common_primitive_with_alignment_inline): (iso_try_allocate_common_primitive_zeroed_inline): (iso_allocate_common_primitive_inline): (iso_allocate_common_primitive_with_alignment_inline): (iso_allocate_common_primitive_zeroed_inline): (iso_try_reallocate_common_primitive_inline): (iso_reallocate_common_primitive_inline): (iso_try_allocate_inline): (iso_allocate_inline): (iso_try_allocate_array_inline): (iso_allocate_array_inline): (iso_try_allocate_array_zeroed_inline): (iso_allocate_array_zeroed_inline): (iso_try_reallocate_array_inline): (iso_reallocate_array_inline): (iso_try_allocate_primitive_inline): (iso_allocate_primitive_inline): (iso_try_allocate_primitive_zeroed_inline): (iso_allocate_primitive_zeroed_inline): (iso_try_allocate_primitive_with_alignment_inline): (iso_allocate_primitive_with_alignment_inline): (iso_try_reallocate_primitive_inline): (iso_reallocate_primitive_inline): (iso_try_allocate_for_objc_inline): (iso_has_object_inline): (iso_get_allocation_size_inline): (iso_get_heap_inline): (iso_deallocate_inline): * libpas/src/libpas/iso_heap_innards.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/iso_heap_ref.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/iso_test_heap.c: Added. (iso_test_allocate_common_primitive): (iso_test_allocate): (iso_test_allocate_array): (iso_test_deallocate): (iso_test_heap_ref_get_heap): * libpas/src/libpas/iso_test_heap.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/iso_test_heap_config.c: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/iso_test_heap_config.h: Added. * libpas/src/libpas/jit_heap.c: Added. (jit_heap_add_fresh_memory): (jit_heap_try_allocate): (jit_heap_shrink): (jit_heap_get_size): (jit_heap_deallocate): * libpas/src/libpas/jit_heap.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/jit_heap_config.c: Added. (fresh_memory_aligned_allocator): (initialize_fresh_memory_config): (allocate_from_fresh): (page_provider): (jit_page_header_for_boundary_remote): (jit_small_bitfit_allocate_page): (jit_small_bitfit_create_page_header): (jit_small_bitfit_destroy_page_header): (jit_medium_bitfit_allocate_page): (jit_medium_bitfit_create_page_header): (jit_medium_bitfit_destroy_page_header): (jit_aligned_allocator): (jit_prepare_to_enumerate): (jit_heap_config_for_each_shared_page_directory): (jit_heap_config_for_each_shared_page_directory_remote): (jit_heap_config_add_fresh_memory): * libpas/src/libpas/jit_heap_config.h: Added. (jit_type_size): (jit_type_alignment): (jit_heap_config_fast_megapage_kind): (jit_small_bitfit_page_header_for_boundary): (jit_small_bitfit_boundary_for_page_header): (jit_medium_bitfit_page_header_for_boundary): (jit_medium_bitfit_boundary_for_page_header): (jit_heap_config_page_header): * libpas/src/libpas/jit_heap_config_root_data.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/minalign32_heap.c: Added. (minalign32_allocate_common_primitive): (minalign32_allocate): (minalign32_allocate_array): (minalign32_deallocate): (minalign32_heap_ref_get_heap): * libpas/src/libpas/minalign32_heap.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/minalign32_heap_config.c: Copied from Source/WTF/wtf/FastTLS.h. (minalign32_heap_config_activate): * libpas/src/libpas/minalign32_heap_config.h: Added. * libpas/src/libpas/pagesize64k_heap.c: Added. (pagesize64k_allocate_common_primitive): (pagesize64k_allocate): (pagesize64k_allocate_array): (pagesize64k_deallocate): (pagesize64k_heap_ref_get_heap): * libpas/src/libpas/pagesize64k_heap.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pagesize64k_heap_config.c: Copied from Source/WTF/wtf/FastTLS.h. (pagesize64k_heap_config_activate): * libpas/src/libpas/pagesize64k_heap_config.h: Added. * libpas/src/libpas/pas_aligned_allocation_result.h: Added. (pas_aligned_allocation_result_create_empty): (pas_aligned_allocation_result_as_allocation_result): * libpas/src/libpas/pas_aligned_allocator.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_alignment.c: Copied from Source/WTF/wtf/FastTLS.h. (pas_alignment_dump): * libpas/src/libpas/pas_alignment.h: Added. (pas_alignment_create): (pas_alignment_create_traditional): (pas_alignment_create_trivial): (pas_alignment_validate): (pas_alignment_is_ptr_aligned): (pas_alignment_round_up): (pas_alignment_is_equal): * libpas/src/libpas/pas_all_biasing_directories.c: Added. (pas_all_biasing_directories_append): (pas_all_biasing_directories_activate): (scavenge_for_each_set_bit_bits_source): (scavenge_for_each_set_bit_callback): (scavenge_bitvector_word_callback): (pas_all_biasing_directories_scavenge): * libpas/src/libpas/pas_all_biasing_directories.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_all_heap_configs.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_all_heaps.c: Added. (pas_all_heaps_add_heap): (pas_all_heaps_for_each_static_heap): (pas_all_heaps_for_each_dynamic_heap): (pas_all_heaps_for_each_heap): (pas_all_heaps_for_each_static_segregated_heap_not_part_of_a_heap): (for_each_segregated_heap_callback): (pas_all_heaps_for_each_static_segregated_heap): (pas_all_heaps_for_each_segregated_heap): (get_num_free_bytes_for_each_heap_callback): (pas_all_heaps_get_num_free_bytes): (reset_heap_ref_for_each_heap_callback): (pas_all_heaps_reset_heap_ref): (for_each_segregated_directory_global_size_directory_callback): (for_each_segregated_directory_shared_page_directory_callback): (for_each_segregated_directory_segregated_heap_callback): (pas_all_heaps_for_each_segregated_directory): (dump_directory_nicely): (dump_view_nicely): (verify_in_steady_state_segregated_directory_callback): (pas_all_heaps_verify_in_steady_state): (compute_total_non_utility_segregated_summary_directory_callback): (pas_all_heaps_compute_total_non_utility_segregated_summary): (compute_total_non_utility_bitfit_summary_heap_callback): (pas_all_heaps_compute_total_non_utility_bitfit_summary): (compute_total_non_utility_large_summary_heap_callback): (pas_all_heaps_compute_total_non_utility_large_summary): (pas_all_heaps_compute_total_non_utility_summary): * libpas/src/libpas/pas_all_heaps.h: Added. * libpas/src/libpas/pas_all_magazines.c: Added. (pas_all_magazines_get_current): * libpas/src/libpas/pas_all_magazines.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_all_shared_page_directories.c: Copied from Source/WTF/wtf/FastTLS.h. (pas_all_shared_page_directories_add): (pas_all_shared_page_directories_for_each): * libpas/src/libpas/pas_all_shared_page_directories.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_allocation_callbacks.c: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_allocation_callbacks.h: Added. (pas_did_allocate): (pas_will_deallocate): * libpas/src/libpas/pas_allocation_config.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_allocation_kind.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_allocation_kind_get_string): * libpas/src/libpas/pas_allocation_result.c: Copied from Source/WTF/wtf/FastTLS.h. (pas_allocation_result_zero): * libpas/src/libpas/pas_allocation_result.h: Added. (pas_allocation_result_create_failure): (pas_allocation_result_create_success_with_zero_mode): (pas_allocation_result_create_success): * libpas/src/libpas/pas_allocator_counts.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_allocator_index.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_allocator_scavenge_action.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_allocator_scavenge_action_get_string): * libpas/src/libpas/pas_baseline_allocator.c: Copied from Source/WTF/wtf/FastTLS.h. (pas_baseline_allocator_attach_directory): (pas_baseline_allocator_detach_directory): * libpas/src/libpas/pas_baseline_allocator.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_baseline_allocator_result.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_baseline_allocator_result_create_failure): (pas_baseline_allocator_result_create_success): * libpas/src/libpas/pas_baseline_allocator_table.c: Added. (initialize): (pas_baseline_allocator_table_initialize_if_necessary): (pas_baseline_allocator_table_get_random_index): (pas_baseline_allocator_table_for_all): * libpas/src/libpas/pas_baseline_allocator_table.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_basic_heap_config_enumerator_data.c: Added. (pas_basic_heap_config_enumerator_data_add_page_header_table): * libpas/src/libpas/pas_basic_heap_config_enumerator_data.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_basic_heap_config_root_data.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_basic_heap_page_caches.h: Added. (pas_basic_heap_page_caches_get_shared_page_directories): * libpas/src/libpas/pas_basic_heap_runtime_config.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_basic_segregated_page_caches.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_biasing_directory.c: Added. (pas_biasing_directory_construct): (pas_biasing_directory_get_sharing_pool): (pas_biasing_directory_did_create_delta): (pas_biasing_directory_take_last_unused): (pas_biasing_directory_did_use_index_slow): (pas_biasing_directory_index_did_become_eligible): * libpas/src/libpas/pas_biasing_directory.h: Added. (pas_is_segregated_biasing_directory): (pas_is_bitfit_biasing_directory): (pas_biasing_directory_magazine_index): (pas_biasing_directory_ownership_threshold): (pas_biasing_directory_unused_span_size): (pas_biasing_directory_did_use_index): * libpas/src/libpas/pas_biasing_directory_inlines.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_unwrap_segregated_biasing_directory): (pas_unwrap_bitfit_biasing_directory): * libpas/src/libpas/pas_biasing_directory_kind.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_biasing_directory_kind_get_string): * libpas/src/libpas/pas_bitfield_vector.h: Added. (pas_bitfield_vector_get): (pas_bitfield_vector_set): * libpas/src/libpas/pas_bitfit_allocation_result.h: Added. (pas_bitfit_allocation_result_create_success): (pas_bitfit_allocation_result_create_failure): (pas_bitfit_allocation_result_create_empty): (pas_bitfit_allocation_result_create_need_to_lock_commit_lock): * libpas/src/libpas/pas_bitfit_allocator.c: Added. (pas_bitfit_allocator_commit_view): (pas_bitfit_allocator_finish_failing): * libpas/src/libpas/pas_bitfit_allocator.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_bitfit_allocator_inlines.h: Added. (pas_bitfit_allocator_reset): (pas_bitfit_allocator_assert_reset): (pas_bitfit_allocator_try_allocate): * libpas/src/libpas/pas_bitfit_biasing_directory.c: Added. (pas_bitfit_biasing_directory_create): (pas_bitfit_biasing_directory_take_last_unused): * libpas/src/libpas/pas_bitfit_biasing_directory.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_bitfit_directory.c: Added. (pas_bitfit_directory_construct): (pas_bitfit_directory_update_biasing_eligibility): (pas_bitfit_directory_max_free_did_become_unprocessed): (pas_bitfit_directory_max_free_did_become_unprocessed_unchecked): (pas_bitfit_directory_max_free_did_become_empty_without_biasing_update): (pas_bitfit_directory_max_free_did_become_empty): (pas_bitfit_directory_get_first_free_view): (pas_bitfit_directory_compute_summary): (for_each_live_object_callback): (pas_bitfit_directory_for_each_live_object): * libpas/src/libpas/pas_bitfit_directory.h: Added. (pas_bitfit_directory_size): (pas_bitfit_directory_get_max_free_ptr): (pas_bitfit_directory_get_max_free): (pas_bitfit_directory_set_max_free_unchecked): (pas_bitfit_directory_set_max_free_not_empty_impl): (pas_bitfit_directory_set_processed_max_free): (pas_bitfit_directory_set_unprocessed_max_free_unchecked): (pas_bitfit_directory_set_empty_max_free): (pas_bitfit_directory_set_unprocessed_max_free): (pas_bitfit_directory_get_view_ptr): (pas_bitfit_directory_get_view): * libpas/src/libpas/pas_bitfit_directory_and_index.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_bitfit_directory_and_index_create): * libpas/src/libpas/pas_bitfit_directory_inlines.h: Added. (pas_bitfit_directory_get_global): (pas_bitfit_directory_find_first_free_for_num_bits_iterate_callback): (pas_bitfit_directory_find_first_free_for_num_bits): (pas_bitfit_directory_find_first_free): (pas_bitfit_directory_find_first_empty_iterate_callback): (pas_bitfit_directory_find_first_empty): * libpas/src/libpas/pas_bitfit_directory_kind.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_bitfit_directory_kind_get_string): * libpas/src/libpas/pas_bitfit_global_directory.c: Added. (pas_bitfit_global_directory_construct): (pas_bitfit_global_directory_does_sharing): (pas_bitfit_global_directory_get_use_epoch): (pas_bitfit_global_directory_get_empty_bit_at_index): (pas_bitfit_global_directory_set_empty_bit_at_index): (pas_bitfit_global_directory_view_did_become_empty_at_index): (pas_bitfit_global_directory_view_did_become_empty): (pas_bitfit_global_directory_take_last_empty): (pas_bitfit_global_directory_dump_reference): (pas_bitfit_global_directory_dump_for_spectrum): * libpas/src/libpas/pas_bitfit_global_directory.h: Added. * libpas/src/libpas/pas_bitfit_global_size_class.c: Added. (pas_bitfit_global_size_class_create): (pas_bitfit_global_size_class_select_for_magazine): * libpas/src/libpas/pas_bitfit_global_size_class.h: Added. * libpas/src/libpas/pas_bitfit_heap.c: Added. (pas_bitfit_heap_create): (pas_bitfit_heap_select_variant): (pas_bitfit_heap_ensure_global_size_class): (pas_bitfit_heap_compute_summary): (for_each_live_object_callback): (pas_bitfit_heap_for_each_live_object): * libpas/src/libpas/pas_bitfit_heap.h: Added. (pas_bitfit_heap_get_directory): * libpas/src/libpas/pas_bitfit_max_free.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_bitfit_page.c: Added. (pas_bitfit_page_construct): (pas_bitfit_page_get_config): (pas_bitfit_page_log_bits): (pas_bitfit_page_deallocation_did_fail): (pas_bitfit_page_for_each_live_object): (verify_for_each_object_callback): (pas_bitfit_page_verify): * libpas/src/libpas/pas_bitfit_page.h: Added. (pas_bitfit_page_header_size): (pas_bitfit_page_free_bits): (pas_bitfit_page_object_end_bits): (pas_bitfit_page_get_granule_use_counts): (pas_bitfit_page_offset_to_first_object): (pas_bitfit_page_offset_to_end_of_last_object): (pas_bitfit_page_payload_size): (pas_bitfit_page_for_boundary): (pas_bitfit_page_for_boundary_or_null): (pas_bitfit_page_for_boundary_unchecked): (pas_bitfit_page_boundary): (pas_bitfit_page_boundary_or_null): (pas_bitfit_page_for_address_and_page_config): (pas_bitfit_page_testing_verify): * libpas/src/libpas/pas_bitfit_page_config.h: Added. (pas_bitfit_page_config_is_enabled): (pas_bitfit_page_config_num_alloc_bits): (pas_bitfit_page_config_num_alloc_words): (pas_bitfit_page_config_num_alloc_words64): (pas_bitfit_page_config_num_alloc_bit_bytes): (pas_bitfit_page_config_byte_offset_for_object_bits): (pas_bitfit_page_config_uses_subpages): * libpas/src/libpas/pas_bitfit_page_config_inlines.h: Added. * libpas/src/libpas/pas_bitfit_page_config_kind.c: Added. (pas_bitfit_page_config_kind_for_each): * libpas/src/libpas/pas_bitfit_page_config_kind.def: Added. * libpas/src/libpas/pas_bitfit_page_config_kind.h: Added. (pas_bitfit_page_config_kind_get_string): (pas_bitfit_page_config_kind_get_config): * libpas/src/libpas/pas_bitfit_page_config_utils.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_bitfit_page_config_utils_inlines.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_bitfit_page_config_variant.h: Added. (pas_bitfit_page_config_variant_get_string): (pas_bitfit_page_config_variant_get_capitalized_string): * libpas/src/libpas/pas_bitfit_page_inlines.h: Added. (pas_bitfit_page_compute_offset): (pas_bitfit_page_allocation_satisfies_alignment): (pas_bitfit_page_allocation_commit_granules_or_reloop): (pas_bitfit_page_finish_allocation): (pas_bitfit_page_allocate): (pas_bitfit_page_deallocate_with_page_impl_mode_get_string): (pas_bitfit_page_deallocate_with_page_impl): (pas_bitfit_page_deallocate_with_page): (pas_bitfit_page_deallocate): (pas_bitfit_page_get_allocation_size_with_page): (pas_bitfit_page_get_allocation_size): (pas_bitfit_page_shrink_with_page): (pas_bitfit_page_shrink): * libpas/src/libpas/pas_bitfit_size_class.c: Added. (pas_bitfit_size_class_find_insertion_point): (pas_bitfit_size_class_construct): (pas_bitfit_size_class_create): (pas_bitfit_size_class_get_first_free_view): * libpas/src/libpas/pas_bitfit_size_class.h: Added. * libpas/src/libpas/pas_bitfit_view.c: Added. (pas_bitfit_view_create): (pas_bitfit_view_lock_ownership_lock_slow): (pas_bitfit_view_note_nonemptiness): (did_become_empty_for_bits): (pas_bitfit_view_note_full_emptiness): (pas_bitfit_view_note_partial_emptiness): (pas_bitfit_view_note_max_free): (compute_summary): (pas_bitfit_view_compute_summary): (for_each_live_object_callback): (for_each_live_object): (pas_bitfit_view_for_each_live_object): * libpas/src/libpas/pas_bitfit_view.h: Added. (pas_bitfit_view_lock_ownership_lock): * libpas/src/libpas/pas_bitfit_view_and_index.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_bitfit_view_and_index_create): (pas_bitfit_view_and_index_create_empty): * libpas/src/libpas/pas_bitfit_view_inlines.h: Added. (pas_bitfit_view_current_directory_and_index): (pas_bitfit_view_current_directory): (pas_bitfit_view_index_in_current): (pas_bitfit_view_is_empty): * libpas/src/libpas/pas_bitvector.h: Added. (pas_bitvector_get_from_word): (pas_bitvector_get): (pas_bitvector_get_from_one_word): (pas_backward_bitvector_get): (pas_bitvector_set_in_word): (pas_bitvector_set): (pas_bitvector_set_in_one_word): (pas_bitvector_set_atomic_in_word): (pas_bitvector_set_atomic): (pas_backward_bitvector_set): (pas_bitvector_find_first_set): (pas_bitvector_for_each_set_bit): (pas_bitvector64_set_range): * libpas/src/libpas/pas_bootstrap_free_heap.c: Copied from Source/WTF/wtf/FastTLS.h. (bootstrap_source_allocate_aligned): (initialize_config): * libpas/src/libpas/pas_bootstrap_free_heap.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_bootstrap_heap_page_provider.c: Copied from Source/WTF/wtf/FastTLS.h. (pas_bootstrap_heap_page_provider): * libpas/src/libpas/pas_bootstrap_heap_page_provider.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_cares_about_size_mode.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_cartesian_tree.h: Added. (pas_cartesian_tree_node_child_ptr): (pas_cartesian_tree_node_is_null_constrained): (pas_cartesian_tree_node_minimum): (pas_cartesian_tree_node_minimum_constrained): (pas_cartesian_tree_node_maximum): (pas_cartesian_tree_node_maximum_constrained): (pas_cartesian_tree_node_successor): (pas_cartesian_tree_node_successor_constrained): (pas_cartesian_tree_node_predecessor): (pas_cartesian_tree_node_predecessor_constrained): (pas_cartesian_tree_node_reset): (pas_cartesian_tree_construct): (pas_cartesian_tree_node_find_exact): (pas_cartesian_tree_find_exact): (pas_cartesian_tree_node_find_least_greater_than_or_equal): (pas_cartesian_tree_find_least_greater_than_or_equal): (pas_cartesian_tree_node_find_least_greater_than): (pas_cartesian_tree_find_least_greater_than): (pas_cartesian_tree_node_find_greatest_less_than_or_equal): (pas_cartesian_tree_find_greatest_less_than_or_equal): (pas_cartesian_tree_node_find_greatest_less_than): (pas_cartesian_tree_find_greatest_less_than): (pas_cartesian_tree_minimum): (pas_cartesian_tree_minimum_constrained): (pas_cartesian_tree_maximum): (pas_cartesian_tree_maximum_constrained): (pas_cartesian_tree_is_empty): (pas_cartesian_tree_insert): (pas_cartesian_tree_remove): (pas_cartesian_tree_validate_recurse): (pas_cartesian_tree_validate): (pas_cartesian_tree_size): * libpas/src/libpas/pas_coalign.c: Added. (formal_mod): (ceiling_div): (pas_coalign_one_sided): (pas_coalign): * libpas/src/libpas/pas_coalign.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_coalign_empty_result): (pas_coalign_result_create): * libpas/src/libpas/pas_commit_mode.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_commit_mode_get_string): * libpas/src/libpas/pas_commit_span.c: Added. (pas_commit_span_construct): (pas_commit_span_add_to_change): (pas_commit_span_add_unchanged): (commit): (pas_commit_span_add_unchanged_and_commit): (decommit): (pas_commit_span_add_unchanged_and_decommit): * libpas/src/libpas/pas_commit_span.h: Added. * libpas/src/libpas/pas_compact_atomic_allocator_index_ptr.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_compact_atomic_biasing_directory_ptr.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_compact_atomic_bitfit_biasing_directory_ptr.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_compact_atomic_bitfit_global_size_class_ptr.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_compact_atomic_bitfit_heap_ptr.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_compact_atomic_bitfit_size_class_ptr.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_compact_atomic_bitfit_view_ptr.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_compact_atomic_enumerable_range_list_chunk_ptr.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_compact_atomic_page_sharing_pool_ptr.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_compact_atomic_ptr.h: Added. * libpas/src/libpas/pas_compact_atomic_segregated_exclusive_view_ptr.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_compact_atomic_segregated_global_size_directory_ptr.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_compact_atomic_segregated_heap_page_sharing_pools_ptr.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_compact_atomic_segregated_partial_view_ptr.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_compact_atomic_segregated_view.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_compact_atomic_thread_local_cache_layout_node.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_compact_atomic_unsigned_ptr.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_compact_biasing_directory_ptr.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_compact_bitfit_directory_ptr.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_compact_bitfit_global_directory_ptr.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_compact_bitfit_view_ptr.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_compact_bootstrap_free_heap.c: Copied from Source/WTF/wtf/FastTLS.h. (compact_bootstrap_source_allocate_aligned): (initialize_config): * libpas/src/libpas/pas_compact_bootstrap_free_heap.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_compact_cartesian_tree_node_ptr.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_compact_heap_ptr.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_compact_heap_reservation.c: Added. (pas_compact_heap_reservation_try_allocate): * libpas/src/libpas/pas_compact_heap_reservation.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_compact_large_utility_free_heap.c: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_compact_large_utility_free_heap.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_compact_page_granule_use_count_ptr.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_compact_ptr.h: Added. * libpas/src/libpas/pas_compact_segregated_biasing_directory_ptr.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_compact_segregated_global_size_directory_ptr.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_compact_segregated_heap_ptr.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_compact_segregated_shared_page_directory_ptr.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_compact_segregated_shared_view_ptr.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_compact_segregated_view.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_compact_skip_list_node_ptr.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_compact_skip_list_node_ptr_ptr.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_compact_subpage_map_entry_ptr.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_compact_tagged_atomic_ptr.h: Added. * libpas/src/libpas/pas_compact_tagged_page_granule_use_count_ptr.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_compact_tagged_ptr.h: Added. * libpas/src/libpas/pas_compact_tagged_unsigned_ptr.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_compact_unsigned_ptr.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_compute_summary_object_callbacks.c: Added. (pas_compute_summary_live_object_callback): (pas_compute_summary_live_object_callback_without_physical_sharing): (config): (pas_compute_summary_dead_object_callback): (pas_compute_summary_dead_object_callback_without_physical_sharing): * libpas/src/libpas/pas_compute_summary_object_callbacks.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_config.h: Added. * libpas/src/libpas/pas_config_prefix.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_count_lookup_mode.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_count_lookup_mode_get_string): * libpas/src/libpas/pas_create_basic_heap_page_caches_with_reserved_memory.c: Added. (pas_create_basic_heap_page_caches_with_reserved_memory): * libpas/src/libpas/pas_create_basic_heap_page_caches_with_reserved_memory.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_deallocate.c: Added. (pas_try_deallocate_known_large): (pas_deallocate_known_large): (pas_try_deallocate_slow): (deallocate_segregated): (pas_try_deallocate_slow_no_cache): * libpas/src/libpas/pas_deallocate.h: Added. (pas_deallocate_known_segregated_impl): (pas_deallocate_known_segregated): (pas_try_deallocate_not_small): (pas_try_deallocate_impl): (pas_try_deallocate): (pas_deallocate): * libpas/src/libpas/pas_deallocation_mode.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_deallocation_mode_get_string): * libpas/src/libpas/pas_deallocator.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_deallocator_scavenge_action.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_deallocator_scavenge_action_get_string): * libpas/src/libpas/pas_debug_heap.h: Added. (pas_debug_heap_is_enabled): (pas_debug_heap_malloc): (pas_debug_heap_memalign): (pas_debug_heap_realloc): (pas_debug_heap_free): * libpas/src/libpas/pas_debug_spectrum.c: Added. (pas_debug_spectrum_add): (pas_debug_spectrum_dump): (pas_debug_spectrum_reset): * libpas/src/libpas/pas_debug_spectrum.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_deferred_decommit_log.c: Added. (pas_deferred_decommit_log_construct): (pas_deferred_decommit_log_destruct): (already_holds_lock): (pas_deferred_decommit_log_lock_for_adding): (pas_deferred_decommit_log_add): (pas_deferred_decommit_log_add_already_locked): (pas_deferred_decommit_log_add_maybe_locked): (pas_deferred_decommit_log_unlock_after_aborted_add): (decommit_all): (pas_deferred_decommit_log_decommit_all): (pas_deferred_decommit_log_pretend_to_decommit_all): * libpas/src/libpas/pas_deferred_decommit_log.h: Added. * libpas/src/libpas/pas_designated_intrinsic_heap.c: Added. (set_up_range): (pas_designated_intrinsic_heap_initialize): * libpas/src/libpas/pas_designated_intrinsic_heap.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_designated_intrinsic_heap_inlines.h: Added. (pas_designated_intrinsic_heap_num_allocator_indices): (pas_designated_index_result_create_failure): (pas_designated_index_result_create_success): (pas_designated_intrinsic_heap_num_designated_indices): (pas_designated_intrinsic_heap_designated_index): * libpas/src/libpas/pas_dyld_state.c: Added. (pas_dyld_is_libsystem_initialized): * libpas/src/libpas/pas_dyld_state.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_dynamic_primitive_heap_map.c: Added. (pas_dynamic_primitive_heap_map_find_slow): * libpas/src/libpas/pas_dynamic_primitive_heap_map.h: Added. (pas_dynamic_primitive_heap_map_heaps_for_size_table_entry_create_empty): (pas_dynamic_primitive_heap_map_heaps_for_size_table_entry_create_deleted): (pas_dynamic_primitive_heap_map_heaps_for_size_table_entry_is_empty_or_deleted): (pas_dynamic_primitive_heap_map_heaps_for_size_table_entry_is_empty): (pas_dynamic_primitive_heap_map_heaps_for_size_table_entry_is_deleted): (pas_dynamic_primitive_heap_map_heaps_for_size_table_entry_get_key): (pas_dynamic_primitive_heap_map_heaps_for_size_table_key_get_hash): (pas_dynamic_primitive_heap_map_heaps_for_size_table_key_is_equal): (pas_dynamic_primitive_heap_map_hash): (pas_dynamic_primitive_heap_map_find): * libpas/src/libpas/pas_ensure_heap_forced_into_reserved_memory.c: Copied from Source/WTF/wtf/FastTLS.h. (pas_ensure_heap_forced_into_reserved_memory): * libpas/src/libpas/pas_ensure_heap_forced_into_reserved_memory.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_ensure_heap_with_page_caches.c: Copied from Source/WTF/wtf/FastTLS.h. (pas_ensure_heap_with_page_caches): * libpas/src/libpas/pas_ensure_heap_with_page_caches.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_enumerable_page_malloc.c: Copied from Source/WTF/wtf/FastTLS.h. (pas_enumerable_page_malloc_try_allocate_without_deallocating_padding): * libpas/src/libpas/pas_enumerable_page_malloc.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_enumerable_range_list.c: Added. (pas_enumerable_range_list_append): (pas_enumerable_range_list_iterate): (pas_enumerable_range_list_iterate_remote): * libpas/src/libpas/pas_enumerable_range_list.h: Added. * libpas/src/libpas/pas_enumerate_bitfit_heaps.c: Added. (view_callback): (enumerate_bitfit_directory): (enumerate_bitfit_heap_callback): (pas_enumerate_bitfit_heaps): * libpas/src/libpas/pas_enumerate_bitfit_heaps.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_enumerate_initially_unaccounted_pages.c: Added. (range_list_iterate_add_unaccounted_callback): (range_list_iterate_exclude_accounted_callback): (pas_enumerate_initially_unaccounted_pages): * libpas/src/libpas/pas_enumerate_initially_unaccounted_pages.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_enumerate_large_heaps.c: Added. (range_list_iterate_add_large_payload_callback): (record_span): (large_map_hashtable_entry_callback): (small_large_map_hashtable_entry_callback): (tiny_large_map_second_level_hashtable_entry_callback): (tiny_large_map_hashtable_entry_callback): (pas_enumerate_large_heaps): * libpas/src/libpas/pas_enumerate_large_heaps.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_enumerate_segregated_heaps.c: Added. (local_allocator_map_entry_create_empty): (local_allocator_map_entry_create_deleted): (local_allocator_map_entry_is_empty_or_deleted): (local_allocator_map_entry_is_empty): (local_allocator_map_entry_is_deleted): (local_allocator_map_entry_get_key): (local_allocator_map_key_get_hash): (local_allocator_map_key_is_equal): (for_each_view): (collect_shared_page_directories_shared_page_directory_callback): (collect_shared_page_directories_heap_callback): (record_page_payload_and_meta): (record_page_objects): (enumerate_exclusive_view): (enumerate_shared_view): (enumerate_partial_view): (shared_page_directory_view_callback): (size_directory_view_callback): (enumerate_segregated_heap_callback): (consider_allocator): (pas_enumerate_segregated_heaps): * libpas/src/libpas/pas_enumerate_segregated_heaps.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_enumerate_unaccounted_pages_as_meta.c: Added. (pas_enumerate_unaccounted_pages_as_meta): * libpas/src/libpas/pas_enumerate_unaccounted_pages_as_meta.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_enumerator.c: Added. (allocate): (deallocate): (pas_enumerator_create): (pas_enumerator_destroy): (pas_enumerator_allocate): (pas_enumerator_read_compact): (pas_enumerator_read): (pas_enumerator_add_unaccounted_pages): (pas_enumerator_exclude_accounted_page): (pas_enumerator_exclude_accounted_pages): (pas_enumerator_record): (record_payload_span): (pas_enumerator_record_page_payload_and_meta): (pas_enumerator_for_each_heap): (pas_enumerator_enumerate_all): * libpas/src/libpas/pas_enumerator.h: Added. (pas_enumerator_record_kind_get_string): * libpas/src/libpas/pas_enumerator_internal.h: Added. * libpas/src/libpas/pas_enumerator_region.c: Added. (pas_enumerator_region_allocate): (pas_enumerator_region_destroy): * libpas/src/libpas/pas_enumerator_region.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_epoch.c: Copied from Source/WTF/wtf/FastTLS.h. (pas_get_epoch): * libpas/src/libpas/pas_epoch.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_exclusive_view_template_memo_table.c: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_exclusive_view_template_memo_table.h: Added. (pas_exclusive_view_template_memo_key_create): (pas_exclusive_view_template_memo_entry_create_empty): (pas_exclusive_view_template_memo_entry_create_deleted): (pas_exclusive_view_template_memo_entry_is_empty_or_deleted): (pas_exclusive_view_template_memo_entry_is_empty): (pas_exclusive_view_template_memo_entry_is_deleted): (pas_exclusive_view_template_memo_entry_get_key): (pas_exclusive_view_template_memo_key_get_hash): (pas_exclusive_view_template_memo_key_is_equal): * libpas/src/libpas/pas_extended_gcd.c: Added. (pas_extended_gcd): * libpas/src/libpas/pas_extended_gcd.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_fast_large_free_heap.c: Added. (key_compare_callback): (get_x_key_callback): (get_y_key_callback): (initialize_cartesian_config): (pas_fast_large_free_heap_construct): (insert_node): (remove_node): (dump_heap): (fast_find_first): (fast_find_by_end): (fast_read_cursor): (fast_write_cursor): (fast_merge): (fast_remove): (fast_append): (fast_commit): (fast_dump): (fast_add_mapped_bytes): (initialize_generic_heap_config): (pas_fast_large_free_heap_try_allocate): (pas_fast_large_free_heap_deallocate): (pas_fast_large_free_heap_for_each_free): (pas_fast_large_free_heap_get_num_free_bytes): (pas_fast_large_free_heap_validate): (pas_fast_large_free_heap_dump_to_printf): * libpas/src/libpas/pas_fast_large_free_heap.h: Added. (pas_fast_large_free_heap_get_num_mapped_bytes): * libpas/src/libpas/pas_fast_megapage_cache.c: Added. (table_set_by_index): (pas_fast_megapage_cache_try_allocate): * libpas/src/libpas/pas_fast_megapage_cache.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_fast_megapage_kind.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_fast_megapage_kind_get_string): * libpas/src/libpas/pas_fast_megapage_table.c: Added. (pas_fast_megapage_table_initialize_static): (pas_fast_megapage_table_set_by_index): * libpas/src/libpas/pas_fast_megapage_table.h: Added. (pas_fast_megapage_table_get_by_index): (pas_fast_megapage_table_get): * libpas/src/libpas/pas_fast_path_allocation_result.h: Added. (pas_fast_path_allocation_result_create): (pas_fast_path_allocation_result_create_need_slow): (pas_fast_path_allocation_result_create_out_of_memory): (pas_fast_path_allocation_result_create_success): (pas_fast_path_allocation_result_from_allocation_result): (pas_fast_path_allocation_result_to_allocation_result): * libpas/src/libpas/pas_fast_path_allocation_result_kind.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_fast_path_allocation_result_kind_get_string): * libpas/src/libpas/pas_fast_tls.h: Added. * libpas/src/libpas/pas_fd_stream.c: Copied from Source/WTF/wtf/FastTLS.h. (fd_stream_vprintf): (pas_fd_stream_vprintf): * libpas/src/libpas/pas_fd_stream.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_first_level_tiny_large_map_entry.h: Added. (pas_first_level_tiny_large_map_entry_create_empty): (pas_first_level_tiny_large_map_entry_create_deleted): (pas_first_level_tiny_large_map_entry_is_empty_or_deleted): (pas_first_level_tiny_large_map_entry_is_empty): (pas_first_level_tiny_large_map_entry_is_deleted): (pas_first_level_tiny_large_map_entry_get_key): (pas_first_level_tiny_large_map_key_get_hash): (pas_first_level_tiny_large_map_key_is_equal): * libpas/src/libpas/pas_found_bit_index.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_found_bit_index_create_empty): (pas_found_bit_index_create): * libpas/src/libpas/pas_found_index.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_found_index_create_empty): (pas_found_index_create): (pas_found_index_create_unsuccessful): * libpas/src/libpas/pas_free_granules.c: Added. (pas_free_granules_compute_and_mark_decommitted): (pas_free_granules_unmark_decommitted): (pas_free_granules_decommit_after_locking_range): * libpas/src/libpas/pas_free_granules.h: Added. (pas_free_granules_is_free): * libpas/src/libpas/pas_free_mode.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_free_range_kind.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_free_range_kind_get_string): * libpas/src/libpas/pas_full_alloc_bits.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_full_alloc_bits_create_empty): (pas_full_alloc_bits_create): * libpas/src/libpas/pas_full_alloc_bits_inlines.h: Added. (pas_full_alloc_bits_create_for_exclusive): (pas_full_alloc_bits_create_for_partial): (pas_full_alloc_bits_create_for_view_and_directory): (pas_full_alloc_bits_create_for_view): * libpas/src/libpas/pas_generic_large_free_heap.h: Added. (pas_generic_large_free_heap_merge_physical): (pas_generic_large_free_heap_try_allocate_test_allocation_candidate): (pas_generic_large_free_heap_try_allocate): * libpas/src/libpas/pas_get_allocation_size.h: Added. (pas_get_allocation_size): * libpas/src/libpas/pas_get_heap.h: Added. (pas_get_heap_known_segregated): (pas_get_heap): * libpas/src/libpas/pas_get_object_kind.h: Added. (pas_get_object_kind): * libpas/src/libpas/pas_get_page_base.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_get_page_base): * libpas/src/libpas/pas_has_object.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_has_object): * libpas/src/libpas/pas_hashtable.h: Added. * libpas/src/libpas/pas_heap.c: Added. (pas_heap_create): (pas_heap_get_type_size): (pas_heap_get_num_free_bytes): (for_each_live_object_small_object_callback): (for_each_live_object_large_object_callback): (pas_heap_for_each_live_object): (pas_heap_compute_summary): (pas_heap_reset_heap_ref): (pas_heap_ensure_size_directory_for_count_slow): * libpas/src/libpas/pas_heap.h: Added. (pas_heap_for_large_heap): (pas_heap_for_segregated_heap): * libpas/src/libpas/pas_heap_config.c: Copied from Source/WTF/wtf/FastTLS.h. (pas_heap_config_activate): * libpas/src/libpas/pas_heap_config.h: Added. (pas_heap_config_segregated_page_config_ptr_for_variant): (pas_heap_config_bitfit_page_config_ptr_for_variant): (pas_heap_config_segregated_page_config_for_variant): (pas_heap_config_bitfit_page_config_for_variant): * libpas/src/libpas/pas_heap_config_inlines.h: Added. * libpas/src/libpas/pas_heap_config_kind.c: Added. (pas_heap_config_kind_for_each): * libpas/src/libpas/pas_heap_config_kind.def: Added. * libpas/src/libpas/pas_heap_config_kind.h: Added. (pas_heap_config_kind_get_string): (pas_heap_config_kind_get_config): (pas_heap_config_kind_is_active): * libpas/src/libpas/pas_heap_config_utils.c: Added. (pas_heap_config_utils_null_activate): (pas_heap_config_utils_for_each_shared_page_directory): (pas_heap_config_utils_for_each_shared_page_directory_remote): (pas_heap_config_utils_allocate_aligned): (pas_heap_config_utils_prepare_to_enumerate): * libpas/src/libpas/pas_heap_config_utils.h: Added. * libpas/src/libpas/pas_heap_config_utils_inlines.h: Added. * libpas/src/libpas/pas_heap_for_config.c: Added. (pas_heap_for_config_allocate): (pas_heap_for_page_config_kind_allocate): (pas_heap_for_page_config_allocate): (pas_heap_for_config_allocate_with_alignment): (pas_heap_for_page_config_allocate_with_alignment): (pas_heap_for_config_allocate_with_manual_alignment): (pas_heap_for_page_config_kind_allocate_with_manual_alignment): (pas_heap_for_page_config_allocate_with_manual_alignment): (pas_heap_for_config_deallocate): (pas_heap_for_page_config_kind_deallocate): (pas_heap_for_page_config_deallocate): * libpas/src/libpas/pas_heap_for_config.h: Added. * libpas/src/libpas/pas_heap_inlines.h: Added. (pas_heap_ensure_size_directory_for_count): * libpas/src/libpas/pas_heap_kind.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_heap_kind_get_string): * libpas/src/libpas/pas_heap_lock.c: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_heap_lock.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_heap_page_provider.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_heap_ref.c: Copied from Source/WTF/wtf/FastTLS.h. (pas_ensure_heap_slow): * libpas/src/libpas/pas_heap_ref.h: Added. (pas_ensure_heap): * libpas/src/libpas/pas_heap_ref_kind.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_heap_ref_kind_get_string): * libpas/src/libpas/pas_heap_ref_prefix.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_heap_runtime_config.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_heap_summary.c: Added. (pas_heap_summary_validate): (pas_heap_summary_dump): * libpas/src/libpas/pas_heap_summary.h: Added. (pas_heap_summary_create_empty): (pas_heap_summary_is_empty): (pas_heap_summary_add): (pas_heap_summary_committed_objects): (pas_heap_summary_total): (pas_heap_summary_fragmentation): * libpas/src/libpas/pas_heap_table.c: Copied from Source/WTF/wtf/FastTLS.h. (pas_heap_table_try_allocate_index): * libpas/src/libpas/pas_heap_table.h: Added. (pas_heap_table_has_index): (pas_heap_table_get_index): * libpas/src/libpas/pas_heap_table_state.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_heap_table_state_get_string): * libpas/src/libpas/pas_immortal_heap.c: Added. (bump_is_ok): (pas_immortal_heap_allocate_with_manual_alignment): (pas_immortal_heap_allocate_with_alignment): (pas_immortal_heap_allocate): (pas_immortal_heap_hold_lock_and_allocate): (pas_immortal_heap_allocate_with_heap_lock_hold_mode): (pas_immortal_heap_allocate_with_alignment_and_heap_lock_hold_mode): * libpas/src/libpas/pas_immortal_heap.h: Added. * libpas/src/libpas/pas_immutable_vector.h: Added. * libpas/src/libpas/pas_internal_config.h: Added. * libpas/src/libpas/pas_intrinsic_allocation_result.h: Added. (pas_intrinsic_allocation_result_create_empty): (pas_intrinsic_allocation_result_create): (pas_intrinsic_allocation_result_identity): (pas_intrinsic_allocation_result_zero): (pas_intrinsic_allocation_result_set_errno): (pas_intrinsic_allocation_result_crash_on_error): * libpas/src/libpas/pas_intrinsic_heap_support.h: Added. * libpas/src/libpas/pas_large_free.h: Added. (pas_large_free_create_empty): (pas_large_free_is_empty): (pas_large_free_size): (pas_large_free_offset_in_type_at_end): * libpas/src/libpas/pas_large_free_heap_config.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_large_free_heap_declarations.def: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_large_free_heap_deferred_commit_log.c: Added. (pas_large_free_heap_deferred_commit_log_construct): (pas_large_free_heap_deferred_commit_log_destruct): (pas_large_free_heap_deferred_commit_log_add): (dump_large_commit): (commit): (commit_all): (pas_large_free_heap_deferred_commit_log_commit_all): (pas_large_free_heap_deferred_commit_log_pretend_to_commit_all): * libpas/src/libpas/pas_large_free_heap_deferred_commit_log.h: Added. * libpas/src/libpas/pas_large_free_heap_definitions.def: Added. * libpas/src/libpas/pas_large_free_heap_helpers.c: Added. (large_utility_aligned_allocator): (initialize_config): (pas_large_free_heap_helpers_try_allocate_with_alignment): (pas_large_free_heap_helpers_deallocate): (pas_large_free_heap_helpers_compute_summary): * libpas/src/libpas/pas_large_free_heap_helpers.h: Added. * libpas/src/libpas/pas_large_free_inlines.h: Added. (pas_large_free_create_merged): (pas_large_free_split): (pas_large_free_allocation_candidate): (pas_large_free_usable_space): (pas_large_allocation_result_create_empty): (pas_large_free_allocate): (pas_large_free_create_merged_for_sure): (pas_large_free_can_merge): (pas_large_allocation_result_as_allocation_result): * libpas/src/libpas/pas_large_free_visitor.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_large_heap.c: Added. (pas_large_heap_construct): (aligned_allocator): (initialize_config): (pas_large_heap_try_allocate): (pas_large_heap_try_deallocate): (pas_large_heap_try_shrink): (pas_large_heap_shove_into_free): (for_each_live_object_entry_callback): (pas_large_heap_for_each_live_object): (pas_large_heap_for_object): (pas_large_heap_get_num_free_bytes): (compute_summary_live_object_callback): (pas_large_heap_compute_summary): * libpas/src/libpas/pas_large_heap.h: Added. * libpas/src/libpas/pas_large_heap_physical_page_sharing_cache.c: Added. (large_aligned_allocator): (pas_large_heap_physical_page_sharing_cache_construct): (pas_large_heap_physical_page_sharing_cache_try_allocate_with_alignment): * libpas/src/libpas/pas_large_heap_physical_page_sharing_cache.h: Added. * libpas/src/libpas/pas_large_map.c: Added. (pas_large_map_find): (pas_large_map_add): (pas_large_map_take): (pas_large_map_for_each_entry): * libpas/src/libpas/pas_large_map.h: Added. * libpas/src/libpas/pas_large_map_entry.h: Added. (pas_large_map_entry_create_empty): (pas_large_map_entry_create_deleted): (pas_large_map_entry_is_empty_or_deleted): (pas_large_map_entry_is_empty): (pas_large_map_entry_is_deleted): (pas_large_map_entry_get_key): (pas_large_map_key_get_hash): (pas_large_map_key_is_equal): * libpas/src/libpas/pas_large_sharing_pool.c: Added. (node_compare_callback): (inner_key_compare_callback): (update_min_epoch): (validate_min_heap): (validate_node): (validate_node_if_asserting_aggressively): (create_node): (create_and_insert): (boot_tree): (destroy_node): (remove_from_min_heap): (remove_and_destroy): (predecessor): (successor): (states_match): (is_eligible): (belongs_in_min_heap): (update_min_heap): (split_node_and_get_right_impl): (split_node_and_get_right): (split_node_and_get_left): (merge_if_possible): (node_containing): (min_node_for_range): (max_node_for_range): (splat_live_bytes): (should_do_commit_stuff_to): (splat_command_get_string): (splat_command_get_free_mode): (dump_large_commit): (try_splat_impl): (try_splat): (splat): (pas_large_sharing_pool_boot_free): (pas_large_sharing_pool_free): (pas_large_sharing_pool_allocate_and_commit): (pas_large_sharing_pool_decommit_least_recently_used): (pas_large_sharing_pool_validate): (pas_large_sharing_pool_compute_summary): (pas_large_sharing_pool_for_each): * libpas/src/libpas/pas_large_sharing_pool.h: Added. (pas_large_sharing_node_heap_compare): (pas_large_sharing_node_heap_get_index): (pas_large_sharing_node_heap_set_index): * libpas/src/libpas/pas_large_sharing_pool_epoch_update_mode.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_large_sharing_pool_epoch_update_mode_get_string): * libpas/src/libpas/pas_large_utility_free_heap.c: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_large_utility_free_heap.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_line_word_config.h: Added. (pas_line_word_config_count_low_zeroes_8_bit): (pas_line_word_config_count_high_zeroes_8_bit): (pas_line_word_config_count_low_zeroes_16_bit): (pas_line_word_config_count_high_zeroes_16_bit): (pas_line_word_config_count_low_zeroes_32_bit): (pas_line_word_config_count_high_zeroes_32_bit): (pas_line_word_config_count_low_zeroes_64_bit): (pas_line_word_config_count_high_zeroes_64_bit): (pas_line_word_config_construct): * libpas/src/libpas/pas_list_direction.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_list_direction_get_string): (pas_list_direction_invert): * libpas/src/libpas/pas_local_allocator.c: Added. (pas_local_allocator_construct): (pas_local_allocator_destruct): (pas_local_allocator_reset): (pas_local_allocator_move): (pas_local_allocator_refill_with_bitfit): (pas_local_allocator_finish_refill_with_bitfit): (stop_impl): (pas_local_allocator_stop): (pas_local_allocator_scavenge): * libpas/src/libpas/pas_local_allocator.h: Added. (pas_local_allocator_is_null): (pas_local_allocator_is_active): (pas_local_allocator_has_bitfit): (pas_local_allocator_get_bitfit): (pas_local_allocator_page_boundary): (pas_local_allocator_alignment): * libpas/src/libpas/pas_local_allocator_config_kind.h: Added. (pas_local_allocator_config_kind_is_primordial_partial): (pas_local_allocator_config_kind_is_bitfit): (pas_local_allocator_config_kind_create_normal): (pas_local_allocator_config_kind_create_primordial_partial): (pas_local_allocator_config_kind_create_bitfit): (pas_local_allocator_config_kind_get_segregated_page_config_kind): (pas_local_allocator_config_kind_get_bitfit_page_config_kind): (pas_local_allocator_config_kind_get_string): * libpas/src/libpas/pas_local_allocator_inlines.h: Added. (pas_local_allocator_reset_impl): (pas_local_allocator_set_up_bump): (pas_local_allocator_scan_bits_to_set_up_use_counts_bits_source): (pas_local_allocator_scan_bits_to_set_up_use_counts_bit_callback): (pas_local_allocator_scan_bits_to_set_up_free_bits): (pas_local_allocator_set_up_free_bits): (pas_local_allocator_make_bump): (pas_local_allocator_prepare_to_allocate): (pas_local_allocator_set_up_primordial_bump): (pas_local_allocator_start_allocating_in_primordial_partial_view): (pas_local_allocator_bless_primordial_partial_view_before_stopping): (pas_local_allocator_try_allocate_in_primordial_partial_view): (pas_local_allocator_refill_with_known_config): (pas_local_allocator_return_memory_to_page_bits_source): (pas_local_allocator_return_memory_to_page_set_bit_callback): (pas_local_allocator_return_memory_to_page): (pas_local_allocator_try_allocate_with_free_bits): (pas_local_allocator_try_allocate_inline_cases): (pas_local_allocator_try_allocate_small_segregated_slow_impl): (pas_local_allocator_try_allocate_small_segregated_slow): (pas_local_allocator_try_allocate_out_of_line_cases): (pas_local_allocator_try_allocate_slow_impl): (pas_local_allocator_try_allocate_slow): (pas_local_allocator_try_allocate): * libpas/src/libpas/pas_local_allocator_line.h: Added. (pas_local_allocator_line_fits_without_shift): (pas_local_allocator_line_decode): (pas_local_allocator_line_encode): (pas_local_allocator_line_remaining): (pas_local_allocator_line_set_remaining): (pas_local_allocator_line_payload_end_delta): (pas_local_allocator_line_set_payload_end_delta): * libpas/src/libpas/pas_local_allocator_refill_mode.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_local_allocator_result.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_local_allocator_result_create_failure): (pas_local_allocator_result_create_success): * libpas/src/libpas/pas_lock.c: Copied from Source/WTF/wtf/FastTLS.h. (pas_lock_lock_slow): * libpas/src/libpas/pas_lock.h: Added. (pas_lock_construct): (pas_lock_construct_disabled): (pas_lock_lock): (pas_lock_try_lock): (pas_lock_unlock): (pas_lock_assert_held): (pas_lock_testing_assert_held): (pas_lock_lock_with_mode): (pas_lock_switch_with_mode): (pas_lock_switch): (pas_lock_lock_conditionally): (pas_lock_unlock_conditionally): (pas_lock_for_switch_conditionally): (pas_lock_switch_conditionally): * libpas/src/libpas/pas_lock_free_read_hashtable.h: Added. (if): * libpas/src/libpas/pas_lock_free_read_ptr_ptr_hashtable.c: Added. (pas_lock_free_read_ptr_ptr_hashtable_set): * libpas/src/libpas/pas_lock_free_read_ptr_ptr_hashtable.h: Added. (pas_lock_free_read_ptr_ptr_hashtable_find): (pas_lock_free_read_ptr_ptr_hashtable_size): * libpas/src/libpas/pas_log.c: Added. (pas_vlog_fd): (pas_log_fd): (pas_vlog): (pas_log): (pas_start_crash_logging): * libpas/src/libpas/pas_log.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_magazine.c: Copied from Source/WTF/wtf/FastTLS.h. (pas_magazine_create): * libpas/src/libpas/pas_magazine.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_medium_megapage_cache.c: Copied from Source/WTF/wtf/FastTLS.h. (pas_medium_megapage_cache_try_allocate): * libpas/src/libpas/pas_medium_megapage_cache.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_megapage_cache.c: Added. (megapage_cache_allocate_aligned): (pas_megapage_cache_construct): (pas_megapage_cache_try_allocate): * libpas/src/libpas/pas_megapage_cache.h: Added. * libpas/src/libpas/pas_min_heap.h: Added. * libpas/src/libpas/pas_monotonic_time.c: Copied from Source/WTF/wtf/FastTLS.h. (get_timebase_info): (pas_get_current_monotonic_time_nanoseconds): * libpas/src/libpas/pas_monotonic_time.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_mutation_count.h: Added. (pas_mutation_count_start_mutating): (pas_mutation_count_stop_mutating): (pas_mutation_count_is_mutating): (pas_mutation_count_matches): (pas_mutation_count_depend): * libpas/src/libpas/pas_object_kind.h: Added. (pas_object_kind_get_string): (pas_object_kind_for_segregated_variant): (pas_object_kind_for_bitfit_variant): * libpas/src/libpas/pas_object_size_mode.h: Added. (pas_object_size_mode_get_string): * libpas/src/libpas/pas_page_base.c: Added. (pas_page_base_get_config): (pas_page_base_get_granule_use_counts): (pas_page_base_compute_committed_when_owned): (pas_page_base_is_empty): (pas_page_base_add_free_range): * libpas/src/libpas/pas_page_base.h: Added. (pas_page_base_construct): (pas_page_base_get_kind): (pas_page_base_get_config_kind): (pas_page_base_is_segregated): (pas_page_base_get_segregated): (pas_page_base_is_bitfit): (pas_page_base_get_bitfit): (pas_page_base_index_of_object_at_offset_from_page_boundary): (pas_page_base_object_offset_from_page_boundary_at_index): (pas_page_base_boundary): (pas_page_base_boundary_or_null): (pas_page_base_for_boundary): (pas_page_base_for_boundary_or_null): (pas_page_base_boundary_for_address_and_page_config): (pas_page_base_for_address_and_page_config): * libpas/src/libpas/pas_page_base_config.h: Added. (pas_page_base_config_min_align): (pas_page_base_config_object_payload_end_offset_from_boundary): (pas_page_base_config_num_granule_bytes): (pas_page_base_config_get_config_kind): (pas_page_base_config_is_segregated): (pas_page_base_config_is_bitfit): (pas_page_base_config_get_segregated): (pas_page_base_config_get_bitfit): * libpas/src/libpas/pas_page_base_config_inlines.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_page_base_config_is_utility): * libpas/src/libpas/pas_page_base_config_utils.h: Added. * libpas/src/libpas/pas_page_base_config_utils_inlines.h: Added. * libpas/src/libpas/pas_page_base_inlines.h: Added. (pas_page_base_free_granule_uses_in_range_action): (pas_page_base_free_granule_uses_in_range): * libpas/src/libpas/pas_page_config_kind.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_page_config_kind_get_string): * libpas/src/libpas/pas_page_granule_use_count.h: Added. (pas_page_granule_get_indices): (pas_page_granule_for_each_use_in_range): (pas_page_granule_use_count_increment): (pas_page_granule_increment_uses_for_range): * libpas/src/libpas/pas_page_header_placement_mode.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_page_header_placement_mode_get_string): * libpas/src/libpas/pas_page_header_table.c: Added. (pas_page_header_table_add): (pas_page_header_table_remove): * libpas/src/libpas/pas_page_header_table.h: Added. (pas_page_header_table_hash): (pas_page_header_table_get_boundary_ptr): (pas_page_header_table_get_boundary): (pas_page_header_table_get_for_boundary): (pas_page_header_table_get_for_address): * libpas/src/libpas/pas_page_kind.h: Added. (pas_page_kind_get_string): (pas_page_kind_get_config_kind): (pas_page_kind_get_segregated_variant): (pas_page_kind_get_bitfit_variant): * libpas/src/libpas/pas_page_malloc.c: Added. (pas_page_malloc_alignment_slow): (pas_page_malloc_alignment_shift_slow): (pas_page_malloc_try_allocate_without_deallocating_padding): (pas_page_malloc_commit): (pas_page_malloc_decommit): (pas_page_malloc_deallocate): * libpas/src/libpas/pas_page_malloc.h: Added. (pas_page_malloc_alignment): (pas_page_malloc_alignment_shift): * libpas/src/libpas/pas_page_sharing_mode.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_page_sharing_mode_does_sharing): (pas_page_sharing_mode_get_string): * libpas/src/libpas/pas_page_sharing_participant.c: Added. (pas_page_sharing_participant_create): (pas_page_sharing_participant_get_payload): (pas_page_sharing_participant_payload_construct): (pas_page_sharing_participant_payload_with_use_epoch_construct): (pas_page_sharing_participant_get_use_epoch): (pas_page_sharing_participant_set_parent_pool): (pas_page_sharing_participant_get_parent_pool): (pas_page_sharing_participant_is_eligible): (pas_page_sharing_participant_take_least_recently_used): * libpas/src/libpas/pas_page_sharing_participant.h: Added. (pas_page_sharing_participant_get_ptr): (pas_page_sharing_participant_get_kind): * libpas/src/libpas/pas_page_sharing_participant_kind.h: Added. (pas_page_sharing_participant_kind_select_for_segregated_directory): (pas_page_sharing_participant_kind_get_string): * libpas/src/libpas/pas_page_sharing_pool.c: Added. (verify_participants): (verify_min_heap): (dump_min_heap): (pas_page_sharing_pool_construct): (pas_page_sharing_pool_add_at_index): (pas_page_sharing_pool_add): (get_current_participant): (take_from): (pas_page_sharing_pool_take_least_recently_used): (atomic_add_balance): (pas_physical_page_sharing_pool_take): (pas_physical_page_sharing_pool_scavenge): (pas_physical_page_sharing_pool_take_later): (pas_physical_page_sharing_pool_give_back): (pas_physical_page_sharing_pool_take_for_page_config): (pas_bias_page_sharing_pool_take): (pas_page_sharing_pool_did_create_delta): (pas_page_sharing_pool_verify): (pas_page_sharing_pool_has_delta): (pas_page_sharing_pool_has_current_participant): * libpas/src/libpas/pas_page_sharing_pool.h: Added. (pas_page_sharing_participant_compare): (pas_page_sharing_participant_get_index): (pas_page_sharing_participant_set_index): (pas_page_sharing_pool_num_participants): (pas_page_sharing_pool_get_participant): * libpas/src/libpas/pas_page_sharing_pool_take_result.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_page_sharing_pool_take_result_get_string): * libpas/src/libpas/pas_payload_reservation_page_list.c: Copied from Source/WTF/wtf/FastTLS.h. (pas_payload_reservation_page_list_append): * libpas/src/libpas/pas_payload_reservation_page_list.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_physical_memory_synchronization_style.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_physical_memory_synchronization_style_get_string): * libpas/src/libpas/pas_physical_memory_transaction.c: Added. (pas_physical_memory_transaction_construct): (pas_physical_memory_transaction_begin): (pas_physical_memory_transaction_end): (pas_physical_memory_transaction_did_fail_to_acquire_lock): * libpas/src/libpas/pas_physical_memory_transaction.h: Added. * libpas/src/libpas/pas_primitive_heap_ref.c: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_primitive_heap_ref.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_promote_intrinsic_heap.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_ptr_hash_map.h: Added. (pas_ptr_hash_map_entry_create_empty): (pas_ptr_hash_map_entry_create_deleted): (pas_ptr_hash_map_entry_is_empty_or_deleted): (pas_ptr_hash_map_entry_is_empty): (pas_ptr_hash_map_entry_is_deleted): (pas_ptr_hash_map_entry_get_key): (pas_ptr_hash_map_key_get_hash): (pas_ptr_hash_map_key_is_equal): * libpas/src/libpas/pas_ptr_hash_set.h: Added. (pas_ptr_hash_set_entry_create_empty): (pas_ptr_hash_set_entry_create_deleted): (pas_ptr_hash_set_entry_is_empty_or_deleted): (pas_ptr_hash_set_entry_is_empty): (pas_ptr_hash_set_entry_is_deleted): (pas_ptr_hash_set_entry_get_key): (pas_ptr_hash_set_key_get_hash): (pas_ptr_hash_set_key_is_equal): * libpas/src/libpas/pas_ptr_min_heap.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_ptr_min_heap_compare): (pas_ptr_min_heap_get_index): (pas_ptr_min_heap_set_index): * libpas/src/libpas/pas_ptr_worklist.c: Added. (pas_ptr_worklist_construct): (pas_ptr_worklist_destruct): (pas_ptr_worklist_push): (pas_ptr_worklist_pop): * libpas/src/libpas/pas_ptr_worklist.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_race_test_hooks.c: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_race_test_hooks.h: Added. (pas_race_test_hook_kind_get_string): (pas_race_test_hook): (pas_race_test_will_lock): (pas_race_test_did_lock): (pas_race_test_did_try_lock): (pas_race_test_will_unlock): * libpas/src/libpas/pas_random.c: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_random.h: Added. (pas_get_random): * libpas/src/libpas/pas_range.h: Added. (pas_range_create): (pas_range_create_empty): (pas_range_create_forgiving): (pas_range_is_empty): (pas_range_size): (pas_range_contains): (pas_range_subsumes): (pas_range_overlaps): (pas_range_create_intersection): (pas_range_compare): * libpas/src/libpas/pas_range16.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_range16_create): * libpas/src/libpas/pas_range_begin_min_heap.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_range_begin_min_heap_compare): (pas_range_begin_min_heap_get_index): (pas_range_begin_min_heap_set_index): * libpas/src/libpas/pas_range_locked_mode.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_range_locked_mode_get_string): * libpas/src/libpas/pas_range_min_heap.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_range_compare_begin): (pas_range_get_index): (pas_range_set_index): * libpas/src/libpas/pas_reallocate_free_mode.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_reallocate_heap_teleport_rule.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_red_black_tree.c: Added. (tree_insert): (left_rotate): (right_rotate): (remove_fixup): (pas_red_black_tree_insert): (pas_red_black_tree_remove): (pas_red_black_tree_size): * libpas/src/libpas/pas_red_black_tree.h: Added. (pas_red_black_tree_validate_enumerable): (pas_red_black_tree_get_root): (pas_red_black_tree_node_get_left): (pas_red_black_tree_node_get_right): (pas_red_black_tree_node_get_parent): (pas_red_black_tree_node_get_color): (pas_red_black_tree_set_root): (pas_red_black_tree_node_set_left): (pas_red_black_tree_node_set_right): (pas_red_black_tree_node_set_parent): (pas_red_black_tree_node_set_color): (pas_red_black_tree_node_minimum): (pas_red_black_tree_node_maximum): (pas_red_black_tree_node_successor): (pas_red_black_tree_node_predecessor): (pas_red_black_tree_node_reset): (pas_red_black_tree_construct): (pas_red_black_tree_node_find_exact): (pas_red_black_tree_find_exact): (pas_red_black_tree_node_find_least_greater_than_or_equal): (pas_red_black_tree_find_least_greater_than_or_equal): (pas_red_black_tree_node_find_least_greater_than): (pas_red_black_tree_find_least_greater_than): (pas_red_black_tree_node_find_greatest_less_than_or_equal): (pas_red_black_tree_find_greatest_less_than_or_equal): (pas_red_black_tree_node_find_greatest_less_than): (pas_red_black_tree_find_greatest_less_than): (pas_red_black_tree_minimum): (pas_red_black_tree_maximum): (pas_red_black_tree_is_empty): * libpas/src/libpas/pas_redundant_local_allocator_node.c: Copied from Source/WTF/wtf/FastTLS.h. (pas_redundant_local_allocator_node_create): * libpas/src/libpas/pas_redundant_local_allocator_node.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_reserved_memory_provider.c: Added. (null_aligned_allocator): (initialize_config): (pas_reserved_memory_provider_construct): (pas_reserved_memory_provider_try_allocate): * libpas/src/libpas/pas_reserved_memory_provider.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_root.c: Added. (count_static_heaps_callback): (collect_static_heaps_callback): (pas_root_construct): (pas_root_create): (default_reader): (enumerator_reader): (enumerator_recorder): (pas_root_enumerate_for_libmalloc): (pas_root_enumerate_for_libmalloc_with_root_after_zone): (malloc_introspect_good_size): (malloc_introspect_check): (malloc_introspect_print): (malloc_introspect_log): (malloc_introspect_force_lock): (malloc_introspect_force_unlock): (malloc_introspect_statistics): (pas_root_ensure_for_libmalloc_enumeration): * libpas/src/libpas/pas_root.h: Added. * libpas/src/libpas/pas_scavenger.c: Added. (ensure_data_instance): (get_time_in_milliseconds): (timed_wait): (scavenger_thread_main): (pas_scavenger_did_create_eligible): (pas_scavenger_notify_eligibility_if_needed): (pas_scavenger_suspend): (pas_scavenger_resume): (pas_scavenger_clear_all_non_tlc_caches): (pas_scavenger_clear_all_caches_except_remote_tlcs): (pas_scavenger_clear_all_caches): (pas_scavenger_decommit_free_memory): (pas_scavenger_run_synchronously_now): (pas_scavenger_perform_synchronous_operation): * libpas/src/libpas/pas_scavenger.h: Added. * libpas/src/libpas/pas_segmented_vector.h: Added. * libpas/src/libpas/pas_segregated_biasing_directory.c: Added. (pas_segregated_biasing_directory_create): (take_first_eligible_loop_head_callback): (take_first_eligible_create_new_view_callback): (pas_segregated_biasing_directory_take_first_eligible): (pas_segregated_biasing_directory_take_last_unused): * libpas/src/libpas/pas_segregated_biasing_directory.h: Added. (pas_segregated_biasing_directory_magazine_index): * libpas/src/libpas/pas_segregated_biasing_view.c: Added. (pas_segregated_biasing_view_create): (pas_segregated_biasing_view_is_owned): (pas_segregated_biasing_view_lock_ownership_lock): (pas_segregated_biasing_view_should_table): (pas_segregated_biasing_view_note_eligibility): (pas_segregated_biasing_view_note_emptiness): (pas_segregated_biasing_view_compute_summary): (pas_segregated_biasing_view_is_eligible): (pas_segregated_biasing_view_is_empty): * libpas/src/libpas/pas_segregated_biasing_view.h: Added. (pas_segregated_biasing_view_as_view): (pas_segregated_biasing_view_as_ineligible_view): (pas_segregated_biasing_view_as_view_non_null): (pas_segregated_biasing_view_as_ineligible_view_non_null): * libpas/src/libpas/pas_segregated_directory.c: Added. (pas_segregated_directory_construct): (pas_segregated_directory_get_data_slow): (pas_segregated_directory_get_use_epoch): (pas_segregated_directory_get_sharing_payload): (pas_segregated_directory_minimize_first_eligible): (pas_segregated_directory_update_first_eligible_after_search): (pas_segregated_directory_view_did_become_eligible_at_index_without_biasing_update): (pas_segregated_directory_view_did_become_eligible_at_index): (pas_segregated_directory_view_did_become_eligible_without_biasing_update): (pas_segregated_directory_view_did_become_eligible): (maximize_last_empty): (pas_segregated_directory_view_did_become_empty_at_index): (pas_segregated_directory_view_did_become_empty): (pas_segregated_directory_is_committed): (pas_segregated_directory_num_committed_views): (num_empty_views_should_consider_view_parallel): (pas_segregated_directory_num_empty_views): (pas_segregated_directory_update_last_empty_plus_one_after_search): (pas_segregated_directory_append): (pas_segregated_directory_compute_summary): (pas_segregated_directory_num_empty_granules): * libpas/src/libpas/pas_segregated_directory.h: Added. (pas_segregated_directory_size): (pas_segregated_directory_bits_get_by_mask): (pas_segregated_directory_bits_set_by_mask): (pas_segregated_directory_get_misc_bit): (pas_segregated_directory_set_misc_bit): (pas_segregated_directory_get_other_misc_bit): (pas_segregated_directory_set_other_misc_bit): (pas_segregated_directory_spoof_inline_segment): (pas_segregated_directory_get_empty_bit): (pas_segregated_directory_set_empty_bit): (pas_segregated_directory_get_data): (pas_segregated_directory_can_do_sharing): (pas_segregated_directory_is_doing_sharing): (pas_segregated_directory_data_try_get_sharing_payload): (pas_segregated_directory_start_sharing_if_necessary): (pas_segregated_directory_data_get_first_eligible_ptr): (pas_segregated_directory_is_eligible): (pas_segregated_directory_is_empty): (pas_segregated_directory_is_tabled): (pas_segregated_directory_get_first_eligible_impl): (pas_segregated_directory_get_first_eligible): (pas_segregated_directory_get_first_eligible_torn): (pas_segregated_directory_watch_first_eligible): (pas_segregated_directory_get_last_empty_plus_one_impl): (pas_segregated_directory_get_last_empty_plus_one): (pas_segregated_directory_get_last_empty_plus_one_value): (pas_segregated_directory_watch_last_empty_plus_one): (pas_segregated_directory_last_empty_plus_one): (pas_segregated_directory_get): * libpas/src/libpas/pas_segregated_directory_bit_reference.h: Added. (pas_segregated_directory_bit_reference_create_null): (pas_segregated_directory_bit_reference_create_inline): (pas_segregated_directory_bit_reference_create_out_of_line): (pas_segregated_directory_bit_reference_is_null): (pas_segregated_directory_bit_reference_is_inline): (pas_segregated_directory_bit_reference_is_out_of_line): * libpas/src/libpas/pas_segregated_directory_first_eligible_kind.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_segregated_directory_find_eligible_kind_get_string): * libpas/src/libpas/pas_segregated_directory_inlines.h: Added. (pas_segregated_directory_iterate_iterate_callback): (pas_segregated_directory_iterate_forward_iterate_callback): (pas_segregated_directory_iterate_forward): (pas_segregated_directory_iterate_backward_iterate_callback): (pas_segregated_directory_iterate_backward): (pas_segregated_directory_iterate_forward_to_take_first_eligible): (pas_segregated_directory_iterate_backward_to_take_last_empty): * libpas/src/libpas/pas_segregated_directory_kind.h: Added. (pas_segregated_directory_kind_get_string): * libpas/src/libpas/pas_segregated_exclusive_view.c: Added. (pas_segregated_exclusive_view_create): (pas_segregated_exclusive_view_should_table): (pas_segregated_exclusive_ish_view_note_eligibility_impl): (pas_segregated_exclusive_view_note_eligibility): (pas_segregated_exclusive_view_note_emptiness): (pas_segregated_exclusive_ish_view_compute_summary_impl): (pas_segregated_exclusive_view_compute_summary): (pas_segregated_exclusive_view_install_full_use_counts): (pas_segregated_exclusive_view_is_eligible): (pas_segregated_exclusive_view_is_empty): * libpas/src/libpas/pas_segregated_exclusive_view.h: Added. (pas_segregated_exclusive_view_as_view): (pas_segregated_exclusive_view_as_ineligible_view): (pas_segregated_exclusive_view_as_view_non_null): (pas_segregated_exclusive_view_as_ineligible_view_non_null): * libpas/src/libpas/pas_segregated_exclusive_view_inlines.h: Added. (pas_segregated_exclusive_ish_view_did_start_allocating): * libpas/src/libpas/pas_segregated_exclusive_view_ownership_kind.h: Added. (pas_segregated_exclusive_view_ownership_kind_is_owned): (pas_segregated_exclusive_view_ownership_kind_is_biased): (pas_segregated_exclusive_view_ownership_kind_with_owned): (pas_segregated_exclusive_view_ownership_kind_with_biased): (pas_segregated_exclusive_view_ownership_kind_get_string): * libpas/src/libpas/pas_segregated_global_size_directory.c: Added. (pas_segregated_global_size_directory_create): (pas_segregated_global_size_directory_ensure_data): (pas_segregated_global_size_directory_get_extended_data): (pas_segregated_global_size_directory_create_tlc_allocator): (pas_segregated_global_size_directory_enable_exclusive_views): (pas_segregated_global_size_directory_explode): (pas_segregated_global_size_directory_select_allocator_slow): (take_first_eligible_direct_loop_head_callback): (take_first_eligible_direct_create_new_view_callback): (pas_segregated_global_size_directory_take_first_eligible_direct): (pas_segregated_global_size_directory_take_first_eligible): (take_last_empty_should_consider_view_parallel): (take_last_empty_consider_view): (pas_segregated_global_size_directory_take_last_empty): (pas_segregated_global_size_directory_for_object): (pas_segregated_global_size_directory_get_allocator_from_tlc): (pas_segregated_global_size_directory_compute_summary_for_unowned_exclusive): (for_each_live_object_callback): (pas_segregated_global_size_directory_for_each_live_object): (pas_segregated_global_size_directory_local_allocator_size): (pas_segregated_global_size_directory_num_allocator_indices): (pas_segregated_global_size_directory_dump_reference): (pas_segregated_global_size_directory_dump_for_spectrum): * libpas/src/libpas/pas_segregated_global_size_directory.h: Added. (pas_segregated_global_size_directory_as_view): (pas_segregated_global_size_directory_alignment): (pas_segregated_global_size_directory_contention_did_trigger_explosion): (pas_segregated_global_size_directory_set_contention_did_trigger_explosion): (pas_segregated_global_size_directory_has_tlc_allocator): (pas_segregated_global_size_directory_are_exclusive_views_enabled): (pas_segregated_global_size_directory_bias_sharing_pool): * libpas/src/libpas/pas_segregated_global_size_directory_inlines.h: Added. (pas_segregated_global_size_directory_select_allocator): (pas_segregated_global_size_directory_local_allocator_size_for_null_config): (pas_segregated_global_size_directory_local_allocator_size_for_config): (pas_segregated_global_size_directory_num_allocator_indices_for_allocator_size): (pas_segregated_global_size_directory_num_allocator_indices_for_config): * libpas/src/libpas/pas_segregated_heap.c: Added. (min_object_size_for_heap_config): (max_count_for_page_config): (max_object_size_for_page_config): (max_small_count_for_heap_config): (max_segregated_count_for_heap_config): (max_bitfit_count_for_heap_config): (max_count_for_heap_config): (max_bitfit_object_size_for_heap_config): (max_object_size_for_heap_config): (pas_segregated_heap_construct): (pas_segregated_heap_get_bitfit): (medium_directory_tuple_for_index_impl): (medium_directory_tuple_for_index_with_lock): (pas_segregated_heap_medium_directory_tuple_for_index): (pas_segregated_heap_medium_allocator_index_for_index): (pas_segregated_heap_medium_size_directory_for_index): (compute_small_index_upper_bound): (ensure_count_lookup): (pas_segregated_heap_ensure_allocator_index): (compute_ideal_object_size): (check_medium_directories): (check_part_of_all_heaps_callback): (check_part_of_all_segregated_heaps_callback): (ensure_count_lookup_if_necessary): (pas_segregated_heap_ensure_size_directory_for_count): (pas_segregated_heap_get_num_free_bytes): (pas_segregated_heap_for_each_global_size_directory): (for_each_committed_size_directory_callback): (pas_segregated_heap_for_each_committed_view): (for_each_view_index_directory_callback): (pas_segregated_heap_for_each_view_index): (for_each_live_object_object_callback): (for_each_live_object_directory_callback): (for_each_live_object_bitfit_callback): (pas_segregated_heap_for_each_live_object): (num_committed_views_directory_callback): (pas_segregated_heap_num_committed_views): (num_empty_views_directory_callback): (pas_segregated_heap_num_empty_views): (num_empty_granules_directory_callback): (pas_segregated_heap_num_empty_granules): (num_views_directory_callback): (pas_segregated_heap_num_views): (compute_summary_directory_callback): (pas_segregated_heap_compute_summary): * libpas/src/libpas/pas_segregated_heap.h: Added. (pas_segregated_heap_index_for_primitive_count): (pas_segregated_heap_primitive_count_for_index): (pas_segregated_heap_index_for_count): (pas_segregated_heap_count_for_index): (pas_segregated_heap_allocator_index_for_index): (pas_segregated_heap_allocator_index_for_count_not_primitive): * libpas/src/libpas/pas_segregated_heap_inlines.h: Added. (pas_segregated_heap_size_directory_for_index): (pas_segregated_heap_size_directory_for_count): * libpas/src/libpas/pas_segregated_heap_lookup_kind.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_segregated_heap_page_sharing_mode.h: Added. (pas_segregated_heap_page_sharing_mode_does_any_sharing): (pas_segregated_heap_page_sharing_mode_does_virtual_sharing): (pas_segregated_heap_page_sharing_mode_does_physical_sharing): (pas_segregated_heap_page_sharing_mode_get_string): * libpas/src/libpas/pas_segregated_page.c: Added. (pas_segregated_page_switch_lock_slow): (pas_segregated_page_switch_lock_and_rebias_to_magazine_while_ineligible_impl): (pas_segregated_page_construct): (pas_segregated_page_note_emptiness): (commit_lock_for): (pas_segregated_page_take_empty_granules): (pas_segregated_page_take_physically): (pas_segregated_page_commit_fully): (verify_granules_live_object_callback): (pas_segregated_page_verify_granules): (pas_segregated_page_deallocation_did_fail): (pas_segregated_page_get_num_empty_granules): (pas_segregated_page_get_num_committed_granules): (pas_segregated_page_get_config): (pas_segregated_page_add_commit_range): (pas_segregated_page_and_config_for_address_and_heap_config): (pas_segregated_page_verify_num_non_empty_words): * libpas/src/libpas/pas_segregated_page.h: Added. (pas_segregated_page_header_size): (pas_segregated_page_offset_from_page_boundary_to_first_object_for_hugging_mode): (pas_segregated_page_offset_from_page_boundary_to_end_of_last_object_for_hugging_mode): (pas_segregated_page_useful_object_payload_size_for_hugging_mode): (pas_segregated_page_best_hugging_mode): (pas_segregated_page_offset_from_page_boundary_to_first_object_exclusive): (pas_segregated_page_offset_from_page_boundary_to_end_of_last_object_exclusive): (pas_segregated_page_useful_object_payload_size): (pas_segregated_page_number_of_objects): (pas_segregated_page_bytes_dirtied_per_object): (pas_segregated_page_get_granule_use_counts): (pas_segregated_page_for_boundary): (pas_segregated_page_for_boundary_or_null): (pas_segregated_page_for_boundary_unchecked): (pas_segregated_page_boundary): (pas_segregated_page_boundary_or_null): (pas_segregated_page_for_address_and_page_config): (pas_segregated_page_is_allocated_with_page): (pas_segregated_page_is_allocated): (pas_segregated_page_for_address_and_heap_config): * libpas/src/libpas/pas_segregated_page_and_config.h: Added. (pas_segregated_page_and_config_create): (pas_segregated_page_and_config_create_empty): (pas_segregated_page_and_config_is_empty): * libpas/src/libpas/pas_segregated_page_config.c: Added. (pas_segregated_page_config_validate): * libpas/src/libpas/pas_segregated_page_config.h: Added. (pas_segregated_page_config_is_enabled): (pas_segregated_page_config_min_align): (pas_segregated_page_config_object_payload_end_offset_from_boundary): (pas_segregated_page_config_num_alloc_words): (pas_segregated_page_config_num_alloc_bytes): (pas_segregated_page_config_get_kind): (pas_segregated_page_config_kind_is_utility): (pas_segregated_page_config_is_utility): (pas_segregated_page_config_kind_heap_lock_hold_mode): (pas_segregated_page_config_heap_lock_hold_mode): * libpas/src/libpas/pas_segregated_page_config_inlines.h: Added. * libpas/src/libpas/pas_segregated_page_config_kind.c: Copied from Source/WTF/wtf/FastTLS.h. (pas_segregated_page_config_kind_for_each): * libpas/src/libpas/pas_segregated_page_config_kind.def: Added. * libpas/src/libpas/pas_segregated_page_config_kind.h: Added. (pas_segregated_page_config_kind_get_string): (pas_segregated_page_config_kind_get_config): * libpas/src/libpas/pas_segregated_page_config_utils.h: Added. (pas_segregated_page_config_verify_dealloc): * libpas/src/libpas/pas_segregated_page_config_utils_inlines.h: Added. * libpas/src/libpas/pas_segregated_page_config_variant.h: Added. (pas_segregated_page_config_variant_get_string): * libpas/src/libpas/pas_segregated_page_emptiness_kind.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_page_emptiness_kind_get_inverted): (pas_page_emptiness_kind_get_string): * libpas/src/libpas/pas_segregated_page_granule_use_count.h: Added. (pas_segregated_page_granule_use_count_increment): (pas_segregated_page_granule_for_each_use_in_range): (pas_segregated_page_granule_increment_uses_for_range): * libpas/src/libpas/pas_segregated_page_header_placement_mode.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_segregated_page_header_placement_mode_get_string): * libpas/src/libpas/pas_segregated_page_inlines.h: Added. (pas_segregated_page_offset_from_page_boundary_to_first_object): (pas_segregated_page_initialize_full_use_counts): (pas_segregated_page_lock_with_unbias_not_utility): (pas_segregated_page_lock_with_unbias): (pas_segregated_page_lock): (pas_segregated_page_unlock): (pas_segregated_page_switch_lock_with_mode): (pas_segregated_page_switch_lock): (pas_segregated_page_switch_lock_and_rebias_to_magazine_while_ineligible): (pas_segregated_page_deallocate_with_page): (pas_segregated_page_deallocate): (pas_segregated_page_qualifies_for_decommit): (pas_segregated_page_get_directory_for_address_in_page): (pas_segregated_page_get_directory_for_address_and_page_config): (pas_segregated_page_get_object_size_for_address_in_page): (pas_segregated_page_get_object_size_for_address_and_page_config): * libpas/src/libpas/pas_segregated_partial_view.c: Added. (pas_segregated_partial_view_create): (pas_segregated_partial_view_note_eligibility): (pas_segregated_partial_view_set_is_in_use_for_allocation): (pas_segregated_partial_view_should_table): (compute_summary): (pas_segregated_partial_view_compute_summary): (pas_segregated_partial_view_is_eligible): * libpas/src/libpas/pas_segregated_partial_view.h: Added. (pas_segregated_partial_view_as_view): (pas_segregated_partial_view_as_view_non_null): * libpas/src/libpas/pas_segregated_partial_view_inlines.h: Added. (pas_segregated_partial_view_tell_shared_handle_for_word_general_case_source): (pas_segregated_partial_view_tell_shared_handle_for_word_general_case_callback): (pas_segregated_partial_view_tell_shared_handle_for_word_general_case): (pas_segregated_partial_view_did_start_allocating): * libpas/src/libpas/pas_segregated_shared_handle.c: Added. (pas_segregated_shared_handle_create): (pas_segregated_shared_handle_destroy): (pas_segregated_shared_handle_note_emptiness): * libpas/src/libpas/pas_segregated_shared_handle.h: Added. (pas_segregated_shared_handle_num_views): (pas_segregated_shared_handle_size): (pas_segregated_shared_handle_as_view): (pas_segregated_shared_handle_as_view_non_null): * libpas/src/libpas/pas_segregated_shared_handle_inlines.h: Added. (pas_segregated_shared_handle_partial_view_ptr_for_index): (pas_segregated_shared_handle_partial_view_for_index): (pas_segregated_shared_handle_partial_view_for_object): * libpas/src/libpas/pas_segregated_shared_page_directory.c: Added. (find_first_eligible_should_consider_view_parallel): (find_first_eligible_consider_view): (pas_segregated_shared_page_directory_find_first_eligible): (take_last_empty_should_consider_view_parallel): (switch_to_ownership): (take_last_empty_consider_view): (pas_segregated_shared_page_directory_take_last_empty): (pas_segregated_shared_page_directory_dump_reference): (pas_segregated_shared_page_directory_dump_for_spectrum): * libpas/src/libpas/pas_segregated_shared_page_directory.h: Added. * libpas/src/libpas/pas_segregated_shared_view.c: Added. (pas_segregated_shared_view_create): (pas_segregated_shared_view_commit_page): (compute_summary_for_each_live_object_callback): (compute_summary): (pas_segregated_shared_view_compute_summary): (pas_segregated_shared_view_is_empty): * libpas/src/libpas/pas_segregated_shared_view.h: Added. (pas_segregated_shared_view_as_view): (pas_segregated_shared_view_as_view_non_null): (pas_shared_view_computed_bump_result_create_empty): (pas_segregated_shared_view_compute_initial_new_bump): (pas_segregated_shared_view_can_bump): (pas_segregated_shared_view_compute_new_bump): (pas_segregated_shared_view_bump): * libpas/src/libpas/pas_segregated_shared_view_inlines.h: Added. (pas_segregated_shared_view_commit_page_if_necessary): * libpas/src/libpas/pas_segregated_size_directory.c: Added. (pas_segregated_size_directory_construct): (for_each_live_object_object_callback): (pas_segregated_size_directory_for_each_live_object): (pas_segregated_size_directory_for_object): * libpas/src/libpas/pas_segregated_size_directory.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_segregated_size_directory_inlines.h: Added. (pas_segregated_size_directory_take_first_eligible_impl_should_consider_view_not_tabled_parallel): (pas_segregated_size_directory_take_first_eligible_impl_should_consider_view_tabled_parallel): (pas_segregated_size_directory_take_first_eligible_impl): (pas_segregated_size_directory_get_global): * libpas/src/libpas/pas_segregated_view.c: Added. (pas_segregated_view_get_size_directory_slow): (pas_segregated_view_get_global_size_directory_slow): (pas_segregated_view_get_page_config_kind): (pas_segregated_view_get_page_config): (pas_segregated_view_get_index): (pas_segregated_view_get_page_boundary): (pas_segregated_view_get_page): (pas_segregated_view_should_restart): (pas_segregated_view_could_bump): (pas_segregated_view_get_commit_lock): (pas_segregated_view_get_ownership_lock): (pas_segregated_view_is_owned): (pas_segregated_view_should_table): (pas_segregated_view_is_biased_exclusive): (pas_segregated_view_lock_ownership_lock): (pas_segregated_view_lock_ownership_lock_conditionally): (pas_segregated_view_lock_ownership_lock_if_owned): (pas_segregated_view_lock_ownership_lock_if_owned_conditionally): (pas_segregated_view_unlock_ownership_lock): (pas_segregated_view_unlock_ownership_lock_conditionally): (pas_segregated_view_is_primordial_partial): (pas_segregated_view_note_eligibility): (pas_segregated_view_note_emptiness): (for_each_live_object): (pas_segregated_view_for_each_live_object): (should_be_eligible): (pas_segregated_view_should_be_eligible): (pas_segregated_view_for_object): (pas_segregated_view_compute_summary): (pas_segregated_view_is_eligible): (pas_segregated_view_is_eligible_or_biased): (is_payload_empty_callback): (pas_segregated_view_is_payload_empty): (pas_segregated_view_is_empty): (pas_segregated_view_is_empty_or_biased): * libpas/src/libpas/pas_segregated_view.h: Added. (pas_segregated_view_create): (pas_segregated_view_create_non_null): (pas_segregated_view_get_ptr): (pas_segregated_view_get_kind): (pas_segregated_view_is_null): (pas_segregated_view_is_exclusive): (pas_segregated_view_is_ineligible_exclusive): (pas_segregated_view_is_some_exclusive): (pas_segregated_view_is_exclusive_ish): (pas_segregated_view_is_biasing): (pas_segregated_view_is_ineligible_biasing): (pas_segregated_view_is_some_biasing): (pas_segregated_view_get_biasing): (pas_segregated_view_is_eligible_kind): (pas_segregated_view_is_ineligible_kind): (pas_segregated_view_as_ineligible): (pas_segregated_view_as_eligible): (pas_segregated_view_is_shared): (pas_segregated_view_get_shared): (pas_segregated_view_is_shared_handle): (pas_segregated_view_get_shared_handle): (pas_segregated_view_is_partial): (pas_segregated_view_get_partial): (pas_segregated_view_is_global_size_directory): (pas_segregated_view_get_size_directory): (pas_segregated_view_get_global_size_directory): * libpas/src/libpas/pas_segregated_view_allocator_inlines.h: Added. (pas_segregated_view_will_start_allocating): (pas_segregated_view_did_stop_allocating): * libpas/src/libpas/pas_segregated_view_inlines.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_segregated_view_get_exclusive): * libpas/src/libpas/pas_segregated_view_kind.h: Added. (pas_segregated_view_kind_get_character_code): (pas_segregated_view_kind_get_string): (pas_segregated_view_kind_is_eligible): (pas_segregated_view_kind_is_exclusive_ish): (pas_segregated_view_kind_is_ineligible): (pas_segregated_view_kind_can_become_empty): * libpas/src/libpas/pas_shared_handle_or_page.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_wrap_page): (pas_is_wrapped_shared_handle): (pas_is_wrapped_page): (pas_unwrap_page): * libpas/src/libpas/pas_shared_handle_or_page_boundary.h: Added. (pas_wrap_page_boundary): (pas_is_wrapped_shared_handle): (pas_is_wrapped_page_boundary): (pas_unwrap_page_boundary): * libpas/src/libpas/pas_shared_handle_or_page_boundary_inlines.h: Added. (pas_wrap_shared_handle): (pas_unwrap_shared_handle_no_liveness_checks): (pas_unwrap_shared_handle): (pas_shared_handle_or_page_boundary_get_page_boundary_no_liveness_checks): (pas_shared_handle_or_page_boundary_get_page_boundary): * libpas/src/libpas/pas_shared_handle_or_page_inlines.h: Added. (pas_wrap_shared_handle): (pas_unwrap_shared_handle_no_liveness_checks): (pas_unwrap_shared_handle): (pas_shared_handle_or_page_get_page_no_liveness_checks): (pas_shared_handle_or_page_get_page): * libpas/src/libpas/pas_shared_page_directory_by_size.c: Added. (pas_shared_page_directory_by_size_get): (pas_shared_page_directory_by_size_for_each): (pas_shared_page_directory_by_size_for_each_remote): * libpas/src/libpas/pas_shared_page_directory_by_size.h: Added. * libpas/src/libpas/pas_simple_free_heap_declarations.def: Added. * libpas/src/libpas/pas_simple_free_heap_definitions.def: Added. * libpas/src/libpas/pas_simple_free_heap_helpers.c: Added. (pas_simple_free_heap_helpers_try_allocate_with_manual_alignment): (pas_simple_free_heap_helpers_deallocate): * libpas/src/libpas/pas_simple_free_heap_helpers.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_simple_large_free_heap.c: Added. (free_list_entry): (pas_simple_large_free_heap_construct): (dump_free_list): (consider_expanding): (append): (merge): (remove_entry): (index_to_cursor): (cursor_to_index): (simple_find_first): (simple_find_by_end): (simple_read_cursor): (simple_write_cursor): (simple_merge): (simple_remove): (simple_append): (simple_commit): (simple_dump): (simple_add_mapped_bytes): (initialize_generic_heap_config): (merge_physical): (try_allocate_without_fixing): (fix_free_list_if_necessary): (pas_simple_large_free_heap_try_allocate): (pas_simple_large_free_heap_deallocate): (pas_simple_large_free_heap_for_each_free): (pas_simple_large_free_heap_get_num_free_bytes): (pas_simple_large_free_heap_dump_to_printf): * libpas/src/libpas/pas_simple_large_free_heap.h: Added. * libpas/src/libpas/pas_simple_type.h: Added. (pas_simple_type_has_key): (pas_simple_type_get_key_data): (pas_simple_type_unwrap): (pas_simple_type_size): (pas_simple_type_alignment): (pas_simple_type_key): (pas_simple_type_create): (pas_simple_type_create_with_key_data): (pas_simple_type_as_heap_type_get_type_size): (pas_simple_type_as_heap_type_get_type_alignment): * libpas/src/libpas/pas_size_thunk.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_trivial_size_thunk): * libpas/src/libpas/pas_skip_list.c: Added. (pas_skip_list_construct): (pas_skip_list_node_allocate_with_height): (pas_skip_list_node_allocate): (pas_skip_list_node_deallocate): (pas_skip_list_remove): (pas_skip_list_size): (validate_other_node): (pas_skip_list_validate): * libpas/src/libpas/pas_skip_list.h: Added. (pas_skip_list_node_prev): (pas_skip_list_node_next): (pas_skip_list_head): (pas_skip_list_is_empty): * libpas/src/libpas/pas_skip_list_inlines.h: Added. (pas_skip_list_find_result_create_exact): (pas_skip_list_find_result_create_inexact): (pas_skip_list_level_get_direction): (pas_skip_list_find_impl): (pas_skip_list_find_ignore_head_attachment): (pas_skip_list_find_ignore_pole_attachment): (pas_skip_list_find): (pas_skip_list_insert_after_note_head_attachment): (pas_skip_list_insert_after_note_pole_attachment): (pas_skip_list_insert): * libpas/src/libpas/pas_slow_path_mode.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_slow_path_mode_prefix.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_small_large_map_entry.h: Added. (pas_small_large_map_entry_create_empty): (pas_small_large_map_entry_create_deleted): (pas_small_large_map_entry_is_empty_or_deleted): (pas_small_large_map_entry_is_empty): (pas_small_large_map_entry_is_deleted): (pas_small_large_map_entry_create): (pas_small_large_map_entry_begin): (pas_small_large_map_entry_get_key): (pas_small_large_map_entry_end): (pas_small_large_map_entry_heap): (pas_small_large_map_entry_get_entry): (pas_small_large_map_entry_can_create): * libpas/src/libpas/pas_snprintf.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_status_reporter.c: Added. (dump_ratio_initial): (dump_occupancy_initial): (dump_arrow): (report_bitfit_directory_contents): (pas_status_reporter_dump_bitfit_biasing_directory): (pas_status_reporter_dump_bitfit_global_directory): (report_segregated_directory_contents): (pas_status_reporter_dump_segregated_biasing_directory): (pas_status_reporter_dump_segregated_global_size_directory): (pas_status_reporter_dump_segregated_shared_page_directory): (pas_status_reporter_dump_large_heap): (pas_status_reporter_dump_large_map): (pas_status_reporter_dump_heap_table): (pas_status_reporter_dump_immortal_heap): (pas_status_reporter_dump_compact_large_utility_free_heap): (pas_status_reporter_dump_large_utility_free_heap): (pas_status_reporter_dump_compact_bootstrap_free_heap): (pas_status_reporter_dump_bootstrap_free_heap): (dump_segregated_heap_directory_callback): (pas_status_reporter_dump_bitfit_heap): (pas_status_reporter_dump_segregated_heap): (pas_status_reporter_dump_heap): (dump_all_heaps_heap_callback): (pas_status_reporter_dump_all_heaps): (dump_all_shared_page_directories_directory_callback): (pas_status_reporter_dump_all_shared_page_directories): (pas_status_reporter_dump_all_heaps_non_utility_summaries): (pas_status_reporter_dump_utility_heap): (add_to_size_histogram): (dump_histogram): (total_fragmentation_global_size_directory_callback): (total_fragmentation_heap_callback): (total_fragmentation_shared_page_directory_callback): (pas_status_reporter_dump_total_fragmentation): (tier_up_rate_global_size_directory_callback): (tier_up_rate_heap_callback): (dump_directory_tier_up_rate): (pas_status_reporter_dump_tier_up_rates): (allocator_state): (pas_status_reporter_dump_baseline_allocators): (pas_status_reporter_dump_thread_local_caches): (pas_status_reporter_dump_configuration): (pas_status_reporter_dump_everything): (status_reporter_thread_main): (start_reporter): (pas_status_reporter_start_if_necessary): * libpas/src/libpas/pas_status_reporter.h: Added. * libpas/src/libpas/pas_stream.c: Copied from Source/WTF/wtf/FastTLS.h. (pas_stream_vprintf): (pas_stream_printf): * libpas/src/libpas/pas_stream.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_stream_print_comma): * libpas/src/libpas/pas_string_stream.c: Added. (string_stream_vprintf): (pas_string_stream_destruct): (pas_string_stream_reset): (pas_string_stream_vprintf): * libpas/src/libpas/pas_string_stream.h: Added. (pas_string_stream_get_string): (pas_string_stream_get_string_length): * libpas/src/libpas/pas_subpage_map.c: Added. (pas_subpage_map_add): (pas_subpage_map_get): (pas_subpage_map_get_full_base): * libpas/src/libpas/pas_subpage_map.h: Added. (pas_subpage_map_hashtable_entry_create_empty): (pas_subpage_map_hashtable_entry_create_deleted): (pas_subpage_map_hashtable_entry_is_empty_or_deleted): (pas_subpage_map_hashtable_entry_is_empty): (pas_subpage_map_hashtable_entry_is_deleted): (pas_subpage_map_hashtable_entry_get_key): (pas_subpage_map_hashtable_key_get_hash): (pas_subpage_map_hashtable_key_is_equal): * libpas/src/libpas/pas_subpage_map_entry.c: Added. (set_packed_value): (pas_subpage_map_entry_create): (prepare_indices): (pas_subpage_map_assert_commit_state): (set_bits): (pas_subpage_map_entry_commit): (pas_subpage_map_entry_decommit): * libpas/src/libpas/pas_subpage_map_entry.h: Added. (pas_subpage_map_entry_full_base): (pas_subpage_map_entry_bits): * libpas/src/libpas/pas_thread_local_cache.c: Added. (pas_thread_local_cache_size_for_allocator_index_capacity): (deallocate): (destroy): (destructor): (allocate_cache): (dump_thread_diagnostics): (pas_thread_local_cache_create): (pas_thread_local_cache_destroy): (pas_thread_local_cache_get_slow): (pas_thread_local_cache_get_local_allocator_slow): (pas_thread_local_cache_get_local_allocator_if_can_set_cache_slow): (pas_thread_local_cache_stop_local_allocators): (stop_local_allocators_if_necessary_set_bit_source): (stop_local_allocators_if_necessary_set_bit_callback): (pas_thread_local_cache_stop_local_allocators_if_necessary): (process_deallocation_log_with_config): (flush_deallocation_log): (pas_thread_local_cache_flush_deallocation_log): (suspend): (resume): (pas_thread_local_cache_for_all): (pas_thread_local_cache_append_deallocation_slow): (pas_thread_local_cache_shrink): * libpas/src/libpas/pas_thread_local_cache.h: Added. (pas_thread_local_cache_try_get): (pas_thread_local_cache_is_guaranteed_to_destruct): (pas_thread_local_cache_can_set): (pas_thread_local_cache_set_impl): (pas_thread_local_cache_get_already_initialized): (pas_thread_local_cache_get_with_heap_lock_hold_mode): (pas_thread_local_cache_get): (pas_thread_local_cache_get_holding_heap_lock): (pas_thread_local_cache_get_local_allocator_impl): (pas_thread_local_cache_get_local_allocator): (pas_thread_local_cache_try_get_local_allocator): (pas_thread_local_cache_get_local_allocator_if_can_set_cache): (pas_thread_local_cache_encode_object): (pas_thread_local_cache_append_deallocation): (pas_thread_local_cache_append_deallocation_with_size): * libpas/src/libpas/pas_thread_local_cache_layout.c: Added. (pas_thread_local_cache_layout_add_node): (pas_thread_local_cache_layout_add): (pas_thread_local_cache_layout_duplicate): * libpas/src/libpas/pas_thread_local_cache_layout.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_thread_local_cache_layout_node.c: Added. (pas_thread_local_cache_layout_node_get_directory): (allocator_index_ptr): (pas_thread_local_cache_layout_node_get_allocator_index): (pas_thread_local_cache_layout_node_set_allocator_index): (next_ptr): (pas_thread_local_cache_layout_node_get_next): (pas_thread_local_cache_layout_node_set_next): * libpas/src/libpas/pas_thread_local_cache_layout_node.h: Added. (pas_wrap_segregated_global_size_directory): (pas_wrap_redundant_local_allocator_node): (pas_is_wrapped_segregated_global_size_directory): (pas_is_wrapped_redundant_local_allocator_node): (pas_unwrap_segregated_global_size_directory): (pas_unwrap_redundant_local_allocator_node): * libpas/src/libpas/pas_thread_local_cache_node.c: Added. (pas_thread_local_cache_node_allocate): (pas_thread_local_cache_node_deallocate): * libpas/src/libpas/pas_thread_local_cache_node.h: Added. * libpas/src/libpas/pas_tiny_large_map_entry.h: Added. (pas_tiny_large_map_entry_base): (pas_tiny_large_map_entry_create): (pas_tiny_large_map_entry_begin): (pas_tiny_large_map_entry_end): (pas_tiny_large_map_entry_heap): (pas_tiny_large_map_entry_get_entry): (pas_tiny_large_map_entry_can_create): (pas_tiny_large_map_entry_create_empty): (pas_tiny_large_map_entry_create_deleted): (pas_tiny_large_map_entry_is_empty_or_deleted): (pas_tiny_large_map_entry_is_empty): (pas_tiny_large_map_entry_is_deleted): (pas_tiny_large_map_entry_get_key): (pas_tiny_large_map_key_get_hash): (pas_tiny_large_map_key_is_equal): * libpas/src/libpas/pas_tree_direction.h: Added. (pas_tree_direction_get_string): (pas_tree_direction_invert): (pas_tree_direction_invert_comparison_result_if_right): * libpas/src/libpas/pas_tri_state.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_tri_state_get_string): (pas_tri_state_equals_boolean): * libpas/src/libpas/pas_try_allocate.h: Added. (pas_try_allocate_impl_size_thunk): (pas_try_allocate_impl): * libpas/src/libpas/pas_try_allocate_array.h: Added. (pas_try_allocate_array_impl): * libpas/src/libpas/pas_try_allocate_common.h: Added. (pas_try_allocate_common_can_go_fast): (pas_try_allocate_common_impl_fast): (pas_try_allocate_common_impl_slow): (pas_try_allocate_common_impl): * libpas/src/libpas/pas_try_allocate_intrinsic_primitive.h: Added. (pas_try_allocate_intrinsic_primitive_impl_medium_slow_case): (pas_try_allocate_intrinsic_primitive_impl): * libpas/src/libpas/pas_try_allocate_primitive.h: Added. (pas_try_allocate_primitive_impl): * libpas/src/libpas/pas_try_reallocate.h: Added. (pas_try_allocate_for_reallocate_and_copy): (pas_try_reallocate_table_segregated_case): (pas_try_reallocate_table_bitfit_case): (pas_try_reallocate): (pas_try_reallocate_intrinsic_primitive_allocate_callback): (pas_try_reallocate_intrinsic_primitive): (pas_try_reallocate_single_allocate_callback): (pas_try_reallocate_single): (pas_try_reallocate_array_allocate_callback): (pas_try_reallocate_array): (pas_try_reallocate_primitive_allocate_callback): (pas_try_reallocate_primitive): * libpas/src/libpas/pas_try_shrink.h: Added. (pas_try_shrink): * libpas/src/libpas/pas_typed_allocation_result.h: Added. (pas_typed_allocation_result_create_empty): (pas_typed_allocation_result_create): (pas_typed_allocation_result_as_intrinsic_allocation_result): (pas_typed_allocation_result_create_with_intrinsic_allocation_result): (pas_typed_allocation_result_zero): (pas_typed_allocation_result_set_errno): (pas_typed_allocation_result_crash_on_error): * libpas/src/libpas/pas_utility_heap.c: Added. (pas_utility_heap_allocate_with_alignment): (pas_utility_heap_try_allocate): (pas_utility_heap_allocate): (pas_utility_heap_deallocate): (pas_utility_heap_get_num_free_bytes): (for_each_live_object_small_object_callback): (pas_utility_heap_for_each_live_object): (pas_utility_heap_for_all_allocators): * libpas/src/libpas/pas_utility_heap.h: Added. (pas_utility_heap_allocate_with_asserted_kind): (pas_utility_heap_deallocate_with_ignored_size_and_asserted_kind): * libpas/src/libpas/pas_utility_heap_config.c: Added. (pas_utility_heap_allocate_page): (pas_utility_heap_config_for_each_shared_page_directory): * libpas/src/libpas/pas_utility_heap_config.h: Added. (pas_utility_heap_page_header_for_boundary): (pas_utility_heap_boundary_for_page_header): (pas_utility_heap_shared_page_directory_selector): (pas_utility_heap_create_page_header): (pas_utility_heap_destroy_page_header): (pas_heap_config_is_utility): (pas_heap_config_heap_lock_hold_mode): * libpas/src/libpas/pas_utility_heap_support.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_utils.c: Added. (pas_panic): (pas_assertion_failed): (pas_deallocation_did_fail): (pas_set_deallocation_did_fail_callback): (pas_reallocation_did_fail): (pas_set_reallocation_did_fail_callback): * libpas/src/libpas/pas_utils.h: Added. (pas_is_power_of_2): (pas_round_down_to_power_of_2): (pas_round_down): (pas_round_up_to_power_of_2): (pas_round_up): (pas_modulo_power_of_2): (pas_is_aligned): (pas_reverse): (pas_reverse64): (pas_make_mask64): (pas_compare_and_swap_uintptr_weak): (pas_compare_and_swap_uintptr_strong): (pas_compare_and_swap_bool_weak): (pas_compare_and_swap_bool_strong): (pas_compare_and_swap_uint16_weak): (pas_compare_and_swap_uint32_weak): (pas_compare_and_swap_uint32_strong): (pas_compare_and_swap_uint64_weak): (pas_compare_and_swap_uint64_strong): (pas_compare_and_swap_ptr_weak): (pas_compare_and_swap_ptr_strong): (pas_fence_after_load): (pas_store_store_fence): (pas_opaque): (pas_pair_create): (pas_compare_and_swap_pair_weak): (pas_compare_and_swap_pair_strong): (pas_atomic_load_pair): (pas_atomic_store_pair): (pas_hash32): (pas_hash64): (pas_hash_intptr): (pas_hash_ptr): (pas_log2): (pas_log2_rounded_up): (pas_log2_rounded_up_safe): (pas_non_empty_ranges_overlap): (pas_ranges_overlap): (pas_xorshift32): (pas_large_object_hash): (pas_is_divisible_by): * libpas/src/libpas/pas_utils_prefix.h: Added. (__pas_round_up_to_power_of_2): (__pas_compiler_fence): (__pas_fence): (__pas_depend_impl): (__pas_depend): (__pas_depend_cpu_only): (__pas_memcpy): * libpas/src/libpas/pas_versioned_field.c: Added. (pas_versioned_field_minimize): (pas_versioned_field_maximize): (pas_versioned_field_minimize_watched): (pas_versioned_field_maximize_watched): * libpas/src/libpas/pas_versioned_field.h: Added. (pas_versioned_field_construct): (pas_versioned_field_create): (pas_versioned_field_create_with_invalid_version): (pas_versioned_field_create_empty): (pas_versioned_field_with_version): (pas_versioned_field_with_value): (pas_versioned_field_as_pair): (pas_versioned_field_from_pair): (pas_versioned_field_equals): (pas_versioned_field_read_torn): (pas_versioned_field_read): (pas_versioned_field_weak_cas): (pas_versioned_field_strong_cas): (pas_versioned_field_read_to_watch): (pas_versioned_field_try_write): (pas_versioned_field_try_write_watched): (pas_versioned_field_write): * libpas/src/libpas/pas_virtual_range.c: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/pas_virtual_range.h: Added. (pas_virtual_range_create): (pas_virtual_range_create_empty): (pas_virtual_range_get_range): (pas_virtual_range_is_empty): (pas_virtual_range_size): (pas_virtual_range_overlaps): * libpas/src/libpas/pas_virtual_range_min_heap.h: Copied from Source/WTF/wtf/FastTLS.h. (pas_virtual_range_compare_begin): (pas_virtual_range_get_index): (pas_virtual_range_set_index): * libpas/src/libpas/pas_zero_mode.h: Added. (pas_zero_mode_get_string): (pas_zero_mode_validate): (pas_zero_mode_merge): * libpas/src/libpas/thingy_heap.c: Added. (thingy_try_allocate_primitive): (thingy_try_allocate_primitive_zeroed): (thingy_try_allocate_primitive_with_alignment): (thingy_try_reallocate_primitive): (thingy_try_allocate): (thingy_try_allocate_zeroed): (thingy_try_allocate_array): (thingy_try_allocate_zeroed_array): (thingy_get_allocation_size): (thingy_try_reallocate_array): (thingy_deallocate): (thingy_heap_ref_get_heap): (thingy_utility_heap_allocate): * libpas/src/libpas/thingy_heap.h: Added. * libpas/src/libpas/thingy_heap_config.c: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/libpas/thingy_heap_config.h: Added. * libpas/src/libpas/thingy_heap_prefix.h: Added. * libpas/src/mbmalloc/mbmalloc_bmalloc.c: Copied from Source/WTF/wtf/FastTLS.h. (mbmalloc): (mbmemalign): (mbrealloc): (mbfree): (mbscavenge): * libpas/src/mbmalloc/mbmalloc_hotbit.c: Copied from Source/WTF/wtf/FastTLS.h. (mbmalloc): (mbmemalign): (mbrealloc): (mbfree): (mbscavenge): * libpas/src/mbmalloc/mbmalloc_iso_common_primitive.c: Added. (install_verifier_if_necessary): (mbmalloc): (mbmemalign): (mbrealloc): (mbfree): (dump_summary): (mbscavenge): * libpas/src/mbmalloc/mbmalloc_lineref.c: Copied from Source/WTF/wtf/FastTLS.h. (mbmalloc): (mbmemalign): (mbrealloc): (mbfree): (mbscavenge): * libpas/src/test/BitfieldVectorTests.cpp: Added. (std::testBitfieldNumWords): (std::testBitfieldNumFields): (std::testBitfieldWordIndex): (std::testBitfieldFieldIndex): (std::testBitfieldFieldShift): (std::BitfieldVector::BitfieldVector): (std::BitfieldVector::get const): (std::BitfieldVector::set): (std::testBitfieldVectorForward): (std::testBitfieldVectorBackward): (addBitfieldVectorTests): * libpas/src/test/BitvectorTests.cpp: Added. (std::testFindFirst): (addBitvectorTests): * libpas/src/test/CartesianTreeTests.cpp: Added. (std::TestNode::TestNode): (std::TestNode::compare): (std::TestNode::getXKey): (std::TestNode::getYKey): (std::Pair::Pair): (std::Pair::operator== const): (std::Pair::operator< const): (std::findExact): (std::remove): (std::findLeastGreaterThanOrEqual): (std::assertFoundAndRemove): (std::assertEqual): (std::assertSameValuesForKey): (std::cartesianTreePrintWidth): (std::printSpaces): (std::dumpCartesianTree): (std::dumpVector): (std::testDriver): (std::randomTestDriver): (addCartesianTreeTests): * libpas/src/test/CoalignTests.cpp: Added. (std::testCoalignOneSided): (std::testCoalignOneSidedError): (std::testCoalign): (addCoalignTests): * libpas/src/test/ExtendedGCDTests.cpp: Copied from Source/WTF/wtf/FastTLS.h. (std::testExtendedGCD): (addExtendedGCDTests): * libpas/src/test/HashtableTests.cpp: Added. (std::hashtableForEachEntryCallback): (std::hashtableForEachEntry): (std::Key::Key): (std::CollidingEntry_create_empty): (std::CollidingEntry_create_deleted): (std::CollidingEntry_is_empty_or_deleted): (std::CollidingEntry_is_empty): (std::CollidingEntry_is_deleted): (std::CollidingEntry_get_key): (std::CollidingKey_get_hash): (std::CollidingKey_is_equal): (std::testEmptyCollidingHashtable): (std::testCollidingHashtableAddFindTakeImpl): (std::testCollidingHashtableAddFindTake): (std::testCollidingHashtableAddAddTakeSet): (std::testCollidingHashtableAddAddAddTakeTakeSet): (std::testCollidingHashtableAddAddAddTakeTakeAddSet): (std::OutOfLineEntry_create_empty): (std::OutOfLineEntry_create_deleted): (std::OutOfLineEntry_is_empty_or_deleted): (std::OutOfLineEntry_is_empty): (std::OutOfLineEntry_is_deleted): (std::OutOfLineEntry_get_key): (std::OutOfLineKey_get_hash): (std::OutOfLineKey_is_equal): (std::testOutOfLineHashtable): (addHashtableTests): * libpas/src/test/HeapLocker.h: Copied from Source/WTF/wtf/FastTLS.h. (HeapLocker::HeapLocker): (HeapLocker::~HeapLocker): * libpas/src/test/IsoDynamicPrimitiveHeapTests.cpp: Added. (std::allocate42): (std::allocate42WithAlignment): (std::allocate42Zeroed): (std::reallocate42): (std::testManySizesAndKeys): (std::testManySizesAndKeysInTandem): (addIsoDynamicPrimitiveHeapTests): * libpas/src/test/IsoHeapChaosTests.cpp: Added. (std::flushDeallocationLogAndStopAllocators): (std::verifyObjectSet): (std::scavengerDidStart): (std::scavengerWillShutDown): (std::PageRange::PageRange): (std::PageRange::operator< const): (std::PageRange::end const): (std::addPageRange): (std::addPageRangeCallback): (std::RecordedRange::RecordedRange): (std::RecordedRange::operator< const): (std::RecordedRange::end const): (std::ReaderRange::ReaderRange): (std::ReaderRange::operator< const): (std::enumeratorReader): (std::enumeratorRecorder): (std::testAllocationChaos): (std::addTheTests): (std::addSpotTests): (addIsoHeapChaosTests): * libpas/src/test/IsoHeapPageSharingTests.cpp: Added. (std::testTakePages): (std::testTakePagesFromCorrectHeap): (std::testLargeHeapTakesPagesFromCorrectSmallHeap): (std::testLargeHeapTakesPagesFromCorrectSmallHeapAllocateAfterFree): (std::testLargeHeapTakesPagesFromCorrectSmallHeapWithFancyOrder): (std::testLargeHeapTakesPagesFromCorrectLargeHeap): (std::testLargeHeapTakesPagesFromCorrectLargeHeapAllocateAfterFreeOnSmallHeap): (std::testLargeHeapTakesPagesFromCorrectLargeHeapAllocateAfterFreeOnAnotherLargeHeap): (std::testLargeHeapTakesPagesFromCorrectLargeHeapWithFancyOrder): (std::testSmallHeapTakesPagesFromCorrectLargeHeap): (std::testSmallHeapTakesPagesFromCorrectLargeHeapWithFancyOrder): (std::testSmallHeapTakesPagesFromCorrectLargeHeapAllocateAfterFreeOnSmallHeap): (std::testSmallHeapTakesPagesFromCorrectLargeHeapAllocateAfterFreeOnAnotherLargeHeap): (std::thingyName): (std::forEachThingyKind): (std::setupThingy): (std::cleanThingy): (std::checkThingy): (std::addObject): (std::deleteThingy): (std::allocationKindName): (std::allocateThingiesImpl): (std::allocateThingies): (std::heapSummaryFor): (std::assertOnlyDecommitted): (std::testFullVdirToVdirObvious): (std::testFullVdirToVdirObviousBackwards): (std::testFullVdirToVdirOpportunistic): (std::testFullVdirToVdirOpportunisticBackwards): (std::testFullVdirToVdirNewAllocation): (std::testFullVdirToVdirNewLateAllocation): (std::testFullVdirToVdirNewDirAllocation): (std::testFullVdirToVdirNewLateDirAllocation): (std::testFullVdirToVdirNewLargeAllocation): (std::testFullVdirToVdirNewLateLargeAllocation): (std::testFullVdirToDir): (std::testFullVdirToDirBackwardsTarget): (std::testFullVdirToDirBackwardsSource): (std::testFullVdirToDirNewAllocation): (std::testFullVdirToDirNewLateAllocation): (std::testFullVdirToDirNewDirAllocation): (std::testFullVdirToDirNewLateDirAllocation): (std::testFullVdirToDirNewLargeAllocation): (std::testFullNotVdirButLargeToDirNewLargeAllocation): (std::testFullVdirToDirNewLateLargeAllocation): (std::testFullVdirToDirNewAllocationAlsoPhysical): (std::testFullVdirToDirNewLateAllocationAlsoPhysical): (std::testFullVdirToLarge): (std::testFullVdirToLargeBackwardsTarget): (std::testFullVdirToLargeBackwardsSource): (std::testFullVdirToLargeNewAllocation): (std::testFullVdirToLargeNewLateAllocation): (std::testFullVdirToLargeNewDirAllocation): (std::testFullVdirToLargeNewLateDirAllocation): (std::testFullVdirToLargeNewLargeAllocation): (std::testFullNotVdirButLargeToLargeNewLargeAllocation): (std::testFullVdirToLargeNewLateLargeAllocation): (std::testFullVdirToLargeNewAllocationAlsoPhysical): (std::testFullVdirToLargeNewLateAllocationAlsoPhysical): (std::testFullDirToVdir): (std::testFullDirToVdirBackwards): (std::testFullDirToVdirNewAllocation): (std::testFullDirToVdirNewLateAllocation): (std::testFullDirToDir): (std::testFullDirToDirBackwards): (std::testFullDirToDirWithThree): (std::testFullDirToDirWithThreeBackwards): (std::testFullDirToDirWithThreeNewAllocation): (std::testFullDirToDirWithThreeNewLateAllocation): (std::testFullDirToDirWithThreeNewVdirAllocation): (std::testFullDirToDirWithThreeNewLateVdirAllocation): (std::testFullDirToLarge): (std::testFullDirToLargeNewAllocation): (std::testFullDirToLargeNewLateAllocation): (std::testFullDirToLargeNewVdirAllocation): (std::testFullDirToLargeNewLateVdirAllocation): (std::testFullLargeToVdirForwardMinEpoch): (std::testFullNotLargeButDirToVdirCombinedUseEpoch): (std::testFullLargeToVdirCombinedUseEpoch): (std::testFullLargeToVdirBackwards): (std::testFullLargeToVdirNewAllocation): (std::testFullLargeToVdirNewLateAllocation): (std::testFullLargeToVdirNewDirAllocationForwardMinEpoch): (std::testFullLargeToVdirNewDirAllocationCombinedUseEpoch): (std::testFullLargeToVdirNewLateDirAllocationForwardMinEpoch): (std::testFullLargeToVdirNewLateDirAllocationCombinedUseEpoch): (std::testFullLargeToDirForwardMinEpoch): (std::testFullLargeToDirCombinedUseEpoch): (std::testFullLargeToDirBackwardsSource): (std::testFullLargeToDirBackwardsTarget): (std::testFullLargeToDirBackwardsSourceAndTarget): (std::testFullLargeToDirNewAllocation): (std::testFullLargeToDirNewLateAllocation): (std::testFullLargeToDirNewVdirAllocationForwardMinEpoch): (std::testFullLargeToDirNewVdirAllocationCombinedUseEpoch): (std::testFullLargeToDirNewLateVdirAllocationForwardMinEpoch): (std::testFullLargeToDirNewLateVdirAllocationCombinedUseEpoch): (std::testFullLargeToDirNewDirAllocationForwardMinEpoch): (std::testFullLargeToDirNewDirAllocationCombinedUseEpoch): (std::testFullLargeToDirNewLateDirAllocationForwardMinEpoch): (std::testFullLargeToDirNewLateDirAllocationCombinedUseEpoch): (std::testFullLargeToLargeForwardMinEpoch): (std::testFullLargeToLargeCombinedUseEpoch): (std::testFullLargeToLargeReverse): (std::testFullLargeToLargeNewAllocation): (std::testFullLargeToLargeNewLateAllocation): (std::testFullLargeToLargeNewVdirAllocation): (std::testFullLargeToLargeNewLateVdirAllocation): (std::testFullLargeToLargeNewDirAllocation): (std::testFullLargeToLargeNewLateDirAllocation): (std::testNewEligibleHasOlderEpoch): (std::scavengerCompletionCallback): (std::testScavengerEventuallyReturnsMemory): (std::testScavengerEventuallyReturnsMemoryEvenWithoutManualShrink): (std::scavengerShutDownCallback): (std::testScavengerShutsDownEventually): (std::addAllTests): (addIsoHeapPageSharingTests): * libpas/src/test/IsoHeapPartialAndBaselineTests.cpp: Added. (std::FreeOrder::setCount const): (std::FreeOrder::didSetCount const): (std::forEachSharedPageDirectoryCallbackAdaptor): (std::forEachSharedPageDirectory): (std::numSharedPages): (std::numCommittedSharedPages): (std::testSimplePartialAllocations): (std::testFreeAroundPrimordialStop): (std::testFreeInterleavedAroundPrimordialStop): (std::PartialProgram::PartialProgram): (std::testMultiplePartialsFromDifferentHeapsPerShared): (std::addMultiplePartialsFromDifferentHeapsPerSharedTests): (std::testMultiplePartialsFromDifferentThreadsPerShared): (std::incrementalRandom): (std::zeroRandom): (std::testTwoBaselinesEvictions): (std::addScavengerDependentTests): (addIsoHeapPartialAndBaselineTests): * libpas/src/test/IsoHeapReservedMemoryTests.cpp: Added. (std::testSizeProgression): (addIsoHeapReservedMemoryTests): * libpas/src/test/IsoHeapTablingTests.cpp: Added. (std::testTabling): (std::testUntabling): (std::addTablingTests): (addIsoHeapTablingTests): * libpas/src/test/JITHeapTests.cpp: Added. (std::testAllocateShrinkAndAllocate): (addJITHeapTests): * libpas/src/test/LargeFreeHeapTests.cpp: Added. (std::alignSimple): (std::trappingAllocator): (std::trappingDeallocator): (std::failingAllocator): (std::Action::allocate): (std::Action::deallocate): (std::Free::Free): (std::Free::operator== const): (std::Free::operator< const): (std::Allocation::Allocation): (std::function<pas_aligned_allocation_result): (std::function<void): (std::operator<<): (std::allocatorAdapter): (std::deallocatorAdapter): (std::iterateAdapter): (std::iterateHeap): (std::testLargeFreeHeapImpl): (std::testSimpleLargeFreeHeap): (std::testFastLargeFreeHeap): (std::testBootstrapHeap): (std::freeListSize): (addLargeFreeHeapTests): * libpas/src/test/LargeSharingPoolDump.cpp: Copied from Source/WTF/wtf/FastTLS.h. (std::forEachAdapter): (forEachLargeSharingPoolNode): (dumpLargeSharingPool): * libpas/src/test/LargeSharingPoolDump.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/src/test/LargeSharingPoolTests.cpp: Added. (std::Range::Range): (std::assertState): (std::testBadCoalesceEpochUpdate): (addLargeSharingPoolTests): * libpas/src/test/LockFreeReadPtrPtrHashtableTests.cpp: Added. (std::hashFunction): (std::testChaos): (addLockFreeReadPtrPtrHashtableTests): * libpas/src/test/MinHeapTests.cpp: Added. (std::Element::Element): (std::asChar): (std::compare): (std::getIndex): (std::setIndex): (std::dumpHeap): (std::testMinHeap): (std::minHeapChaos): (std::testMinHeapChaos): (std::makeBootstrapAllocationConfig): (std::testBootstrapMinHeapChaos): (addMinHeapTests): * libpas/src/test/RaceTests.cpp: Added. (std::hookCallbackAdapter): (std::willLockCallback): (std::recordLockAcquisition): (std::didLockCallback): (std::didTryLockCallback): (std::willUnlockCallback): (std::isHoldingContendedLocks): (std::InstallRaceHooks::InstallRaceHooks): (std::testLocalAllocatorStopRace): (std::testLocalAllocatorStopRaceAgainstScavenge): (addRaceTests): * libpas/src/test/RedBlackTreeTests.cpp: Added. (std::TestNode::TestNode): (std::TestNode::compare): (std::TestNode::compareKey): (std::Pair::Pair): (std::Pair::operator== const): (std::Pair::operator< const): (std::findExact): (std::remove): (std::findLeastGreaterThanOrEqual): (std::assertFoundAndRemove): (std::assertEqual): (std::assertSameValuesForKey): (std::push): (std::validateEnumerable): (std::testDriver): (std::randomTestDriver): (addRedBlackTreeTests): * libpas/src/test/SkipListTests.cpp: Added. (std::TestNode::TestNode): (std::TestNode::fromSkipListNode): (std::TestNode::compareKey): (std::TestNode::compareKeyLeastGreaterThanOrEqual): (std::TestNode::compareKeyForInsert): (std::TestNode::compare): (std::Pair::Pair): (std::Pair::operator== const): (std::Pair::operator< const): (std::findExact): (std::remove): (std::findLeastGreaterThanOrEqual): (std::assertFoundAndRemove): (std::assertEqual): (std::assertSameValuesForKey): (std::dumpSkipList): (std::dumpVector): (std::testDriver): (std::randomTestDriver): (addSkipListTests): * libpas/src/test/SuspendScavenger.h: Copied from Source/WTF/wtf/FastTLS.h. (SuspendScavenger::SuspendScavenger): (SuspendScavenger::~SuspendScavenger): * libpas/src/test/TSDTests.cpp: Added. (std::destructor): (std::testTSD): (addTSDTests): * libpas/src/test/TestHarness.cpp: Added. (allocationConfigAllocate): (allocationConfigDeallocate): (TestScopeImpl::TestScopeImpl): (RuntimeConfigTestScope::RuntimeConfigTestScope): (ForceExclusives::ForceExclusives): (ForceTLAs::ForceTLAs): (ForceBitfit::ForceBitfit): (DisableBitfit::DisableBitfit): (ForcePartials::ForcePartials): (ForceBaselines::ForceBaselines): (RunScavengerFully::RunScavengerFully): (RunScavengerOnNonRemoteCaches::RunScavengerOnNonRemoteCaches): (SuspendScavengerScope::SuspendScavengerScope): (VerifyGranules::VerifyGranules): (InstallVerifier::InstallVerifier): (DisableExplosion::DisableExplosion): (ForceExplosion::ForceExplosion): (ForceOneMagazine::ForceOneMagazine): (EpochIsCounter::EpochIsCounter): (BootJITHeap::BootJITHeap): (testSucceeded): (deterministicRandomNumber): (addTest): (TestScope::TestScope): (TestScope::~TestScope): (hasScope): (dumpObjectSet): (dumpObjectsInHeap): (dumpObjectsInHeaps): (forEachLiveObject): (verifyMinimumObjectDistance): (verifyExactObjectDistance): (runOneTest): (runForkedTest): (runTests): (runFilteredTests): (main): (scavenge): (printStatusReport): * libpas/src/test/TestHarness.h: Added. (stringStreamConstruct): (dumpToString): (operator<<): * libpas/src/test/ThingyAndUtilityHeapAllocationTests.cpp: Added. (std::flushDeallocationLog): (std::flushDeallocationLogAndStopAllocators): (std::sizeClassFor): (std::isLarge): (std::forEachLiveUtilityObjectAdapter): (std::forEachLiveUtilityObject): (std::forEachCommittedViewAdapter): (std::forEachCommittedView): (std::numCommittedViews): (std::numViews): (std::verifyMinimumObjectDistance): (std::verifyObjectSet): (std::verifyUtilityObjectSet): (std::verifyHeapEmpty): (std::PrimitiveAllocator::PrimitiveAllocator): (std::PrimitiveReallocAllocator::PrimitiveReallocAllocator): (std::AlignedPrimitiveAllocator::AlignedPrimitiveAllocator): (std::createIsolatedHeapRef): (std::IsolatedHeapAllocator::IsolatedHeapAllocator): (std::IsolatedHeapArrayAllocator::IsolatedHeapArrayAllocator): (std::CounterScope::CounterScope): (std::CounterScope::~CounterScope): (std::testDeallocateNull): (std::deallocationFailureCallback): (std::DeallocationShouldFail::DeallocationShouldFail): (std::DeallocationShouldFail::~DeallocationShouldFail): (std::testDeallocateMalloc): (std::testDeallocateStack): (std::testSimpleAllocation): (std::testSmallOrMediumAllocation): (std::testSmallAllocation): (std::testLargeAllocation): (std::testAllocationWithInterleavedFragmentation): (std::testFreeListRefillSpans): (std::testInternalScavenge): (std::testInternalScavengeFromCorrectDirectory): (std::SizeClassProgram::SizeClassProgram): (std::testSizeClassCreationImpl): (std::testSizeClassCreation): (std::testSpuriousEligibility): (std::testBasicSizeClassNotSet): (std::testSmallDoubleFree): (std::testSmallFreeInner): (std::testSmallFreeNextWithShrink): (std::testSmallFreeNextWithoutShrink): (std::testSmallFreeNextBeforeShrink): (std::AllocationProgram::allocate): (std::AllocationProgram::free): (std::AllocationProgram::kind const): (std::AllocationProgram::key const): (std::AllocationProgram::isAllocate const): (std::AllocationProgram::count const): (std::AllocationProgram::alignment const): (std::AllocationProgram::isFree const): (std::IsolatedComplexAllocator::IsolatedComplexAllocator): (std::IsolatedUnitComplexAllocator::IsolatedUnitComplexAllocator): (std::checkObjectDistances): (std::checkObjectBeginnings): (std::addObjectAllocation): (std::ExpectedBytes::exact): (std::ExpectedBytes::upperBound): (std::ExpectedBytes::check): (std::testComplexLargeAllocationImpl): (std::testComplexLargeAllocation): (std::testAllocationCountProgression): (std::testAllocationChaos): (std::testUtilityAllocationChaos): (std::testCombinedAllocationChaos): (std::testLargeDoubleFree): (std::testLargeOffsetFree): (std::addDeallocationTests): (std::testReallocatePrimitive): (std::testReallocateArray): (std::addSmallHeapTests): (std::addLargeHeapTests): (std::addMediumHeapTests): (std::addLargerThanMediumHeapTests): (std::addMargeBitfitTests): (std::addLargerThanMargeBitfitTests): (std::addCombinedHeapTests): (std::addAllTestsImpl): (std::addAllTests): (addThingyAndUtilityHeapAllocationTests): * libpas/src/test/UtilsTests.cpp: Added. (std::testIsDivisibleBy3): (addUtilsTests): * libpas/src/toys/QuadraticSizeClass.cpp: Added. (std::printSizeCell): (std::printProgression): (main): * libpas/src/verifier/Verifier.cpp: Added. (std::Locker::Locker): (std::Locker::~Locker): (std::Allocation::Allocation): (std::allocationCallback): (std::deallocationCallback): (std::dumpStateForHeapKind): (std::dumpStateHoldingLock): (std::uninstall): (pas_install_verifier): (pas_dump_state): * libpas/src/verifier/Verifier.h: Copied from Source/WTF/wtf/FastTLS.h. * libpas/test-impl.sh: Added. * libpas/test.sh: Added. Source/JavaScriptCore: Switch the ExecutableAllocator to the libpas jit_heap. The libpas jit_heap uses two size categories of bitfit and a large heap, and is happy to do its approximate first-fit in any ranges of memory you give it. Jit_heap never allocates metadata inside the memory it manages. Allocations and deallocations take a constant-bounded amount of time except for unusual situations, and are protected by fine-grained locking in most cases. Decommit follows libpas scavenging policy. This alone is a speed-up on Speedometer (probably about 1% or more). Also expose some libpas introspection via $vm. * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/MacroAssemblerCodeRef.h: * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::underMemoryPressure): (JSC::ExecutableAllocator::memoryPressureMultiplier): (JSC::ExecutableAllocator::allocate): (JSC::ExecutableAllocator::committedByteCount): (JSC::ExecutableMemoryHandle::createImpl): (JSC::ExecutableMemoryHandle::~ExecutableMemoryHandle): (JSC::ExecutableMemoryHandle::sizeInBytes const): (JSC::ExecutableMemoryHandle::shrink): * jit/ExecutableAllocator.h: * jit/ExecutableMemoryHandle.h: Added. (JSC::ExecutableMemoryHandle::start const): (JSC::ExecutableMemoryHandle::end const): (JSC::ExecutableMemoryHandle::startAsInteger const): (JSC::ExecutableMemoryHandle::endAsInteger const): (JSC::ExecutableMemoryHandle::containsIntegerAddress const): (JSC::ExecutableMemoryHandle::contains const): (JSC::ExecutableMemoryHandle::key const): (JSC::ExecutableMemoryHandle::dump const): (JSC::ExecutableMemoryHandle::ExecutableMemoryHandle): * tools/JSDollarVM.cpp: (JSC::JSC_DEFINE_HOST_FUNCTION): (JSC::JSDollarVM::finishCreation): Source/WTF: Introduce flags for using libpas as the ExecutableAllocator. Explicitly ask for gigacage initialization, since libpas prefers it this way right now. * wtf/FastTLS.h: * wtf/PlatformUse.h: * wtf/Threading.cpp: (WTF::initialize): Tools: Disable the IsoHeap tests if we're using libpas. Libpas has its own tests. * TestWebKitAPI/Tests/WTF/bmalloc/IsoHeap.cpp: Canonical link: https://commits.webkit.org/239620@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279867 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-13 07:39:34 +00:00
2021-07-12 Filip Pizlo <fpizlo@apple.com> and Yusuke Suzuki <ysuzuki@apple.com>
New malloc algorithm
https://bugs.webkit.org/show_bug.cgi?id=226404
Reviewed by Yusuke Suzuki.
Introduce flags for using libpas as the ExecutableAllocator.
Explicitly ask for gigacage initialization, since libpas prefers it this way right now.
* wtf/FastTLS.h:
* wtf/PlatformUse.h:
* wtf/Threading.cpp:
(WTF::initialize):
2021-07-12 Wenson Hsieh <wenson_hsieh@apple.com>
[Cocoa] Turn on `USE(OS_STATE)` when building with a non-Apple-internal SDK
https://bugs.webkit.org/show_bug.cgi?id=227884
Reviewed by Tim Horton.
Enable the compile-time flag for all Cocoa builds.
* wtf/PlatformUse.h:
2021-07-12 Chris Fleizach <cfleizach@apple.com>
AX: Make WebKit observe spatial audio accessibility settings
https://bugs.webkit.org/show_bug.cgi?id=227848
Reviewed by Sam Weinig.
This flag was using the wrong format for a HAVE setting, so the code wasn't being compiled in.
* wtf/PlatformHave.h:
Add a StyleSheets log channel and some logging https://bugs.webkit.org/show_bug.cgi?id=227880 Reviewed by Alan Bujtas. Source/WebCore: Add some logging to help debug issues when pages dynamically build style sheets. Also make Document loggable. * css/CSSStyleSheet.cpp: (WebCore::CSSStyleSheet::insertRule): (WebCore::CSSStyleSheet::deleteRule): (WebCore::CSSStyleSheet::addRule): (WebCore::CSSStyleSheet::debugDescription const): * css/CSSStyleSheet.h: * css/StyleSheet.cpp: (WebCore::operator<<): * css/StyleSheet.h: * dom/Document.cpp: (WebCore::Document::debugDescription const): (WebCore::operator<<): * dom/Document.h: * html/HTMLLinkElement.cpp: (WebCore::HTMLLinkElement::process): (WebCore::HTMLLinkElement::debugDescription const): * html/HTMLLinkElement.h: * platform/Logging.h: * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::dumpProperties const): * platform/graphics/filters/FilterEffect.cpp: (WebCore::FilterEffect::imageBufferResult): * style/StyleScope.cpp: (WebCore::Style::Scope::addPendingSheet): (WebCore::Style::Scope::addStyleSheetCandidateNode): (WebCore::Style::Scope::collectActiveStyleSheets): (WebCore::Style::Scope::updateActiveStyleSheets): * xml/XSLStyleSheet.h: * xml/XSLStyleSheetLibxslt.cpp: (WebCore::XSLStyleSheet::debugDescription const): Source/WTF: Make it possible to feed Ref<> and RefPtr<> into TextStream. * wtf/text/TextStream.h: (WTF::operator<<): Canonical link: https://commits.webkit.org/239602@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279847 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-12 20:45:20 +00:00
2021-07-12 Simon Fraser <simon.fraser@apple.com>
Add a StyleSheets log channel and some logging
https://bugs.webkit.org/show_bug.cgi?id=227880
Reviewed by Alan Bujtas.
Make it possible to feed Ref<> and RefPtr<> into TextStream.
* wtf/text/TextStream.h:
(WTF::operator<<):
[Cocoa] Make Coordinator playback commands more precise https://bugs.webkit.org/show_bug.cgi?id=227756 Reviewed by Eric Carlson. Source/WebCore: Add support for precise playback commands from MediaSessionCoordinator to the underlying MediaPlayer. In the case where a play() command is issued to a HTMLMediaElement and: - There is an active MediaSession - The MediaSession's active HTMLMediaElement is the current one - There is a pending playSession command - That command has a hostTime parameter - The MediaPlayer backing the element supports playing at a specific host time Then use the MediaPlayer's playAtHostTime() facility to begin playback, synchronized with the specified hostTime. Add support for playAtHostTime() to both MediaPlayerPrivateAVFoundationObjC and MediaPlayerPrivateMediaSourceAVFObjC. * Modules/mediasession/MediaSession.h: * Modules/mediasession/MediaSessionCoordinator.cpp: (WebCore::MediaSessionCoordinator::playSession): * Modules/mediasession/MediaSessionCoordinator.h: (WebCore::MediaSessionCoordinator::currentPlaySessionCommand const): * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::updatePlayState): (WebCore::HTMLMediaElement::playPlayer): (WebCore::HTMLMediaElement::pausePlayer): * html/HTMLMediaElement.h: * html/MediaElementSession.h: * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::supportsPlayAtHostTime const): (WebCore::MediaPlayer::supportsPauseAtHostTime const): (WebCore::MediaPlayer::playAtHostTime): (WebCore::MediaPlayer::pauseAtHostTime): * platform/graphics/MediaPlayer.h: * platform/graphics/MediaPlayerPrivate.h: (WebCore::MediaPlayerPrivateInterface::supportsPlayAtHostTime const): (WebCore::MediaPlayerPrivateInterface::supportsPauseAtHostTime const): (WebCore::MediaPlayerPrivateInterface::playAtHostTime): (WebCore::MediaPlayerPrivateInterface::pauseAtHostTime): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): (WebCore::MediaPlayerPrivateAVFoundationObjC::playAtHostTime): (WebCore::MediaPlayerPrivateAVFoundationObjC::pauseAtHostTime): (WebCore::MediaPlayerPrivateAVFoundationObjC::setPlayerRate): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::playInternal): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pauseInternal): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::playAtHostTime): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pauseAtHostTime): Source/WebCore/PAL: Add SoftLink macros for CMClockMakeHostTimeFromSystemUnits. * pal/cf/CoreMediaSoftLink.cpp: * pal/cf/CoreMediaSoftLink.h: Source/WebKit: Pass through new {play,pause}AtHostTime() and supports{Play,Pause}AtHostTime() methods to and from the GPU process. * GPUProcess/media/RemoteMediaPlayerProxy.cpp: (WebKit::RemoteMediaPlayerProxy::getConfiguration): (WebKit::RemoteMediaPlayerProxy::playAtHostTime): (WebKit::RemoteMediaPlayerProxy::pauseAtHostTime): * GPUProcess/media/RemoteMediaPlayerProxy.h: * GPUProcess/media/RemoteMediaPlayerProxy.messages.in: * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::playAtHostTime): (WebKit::MediaPlayerPrivateRemote::pauseAtHostTime): * WebProcess/GPU/media/MediaPlayerPrivateRemote.h: * WebProcess/GPU/media/RemoteMediaPlayerConfiguration.h: (WebKit::RemoteMediaPlayerConfiguration::encode const): (WebKit::RemoteMediaPlayerConfiguration::decode): Source/WTF: Add a method to convert from a MonotonicTime to a MachAbsoluteTime. * wtf/CurrentTime.cpp: (WTF::machTimebaseInfo): (WTF::MonotonicTime::fromMachAbsoluteTime): (WTF::MonotonicTime::toMachAbsoluteTime const): * wtf/MonotonicTime.h: * wtf/PlatformHave.h: Canonical link: https://commits.webkit.org/239553@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279786 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-09 16:46:05 +00:00
2021-07-09 Jer Noble <jer.noble@apple.com>
[Cocoa] Make Coordinator playback commands more precise
https://bugs.webkit.org/show_bug.cgi?id=227756
Reviewed by Eric Carlson.
Add a method to convert from a MonotonicTime to a MachAbsoluteTime.
* wtf/CurrentTime.cpp:
(WTF::machTimebaseInfo):
(WTF::MonotonicTime::fromMachAbsoluteTime):
(WTF::MonotonicTime::toMachAbsoluteTime const):
* wtf/MonotonicTime.h:
* wtf/PlatformHave.h:
Fix some whitespace handling issues in URL setters https://bugs.webkit.org/show_bug.cgi?id=227806 Patch by Alex Christensen <achristensen@webkit.org> on 2021-07-08 Reviewed by Chris Dumez. LayoutTests/imported/w3c: * web-platform-tests/url/a-element-expected.txt: * web-platform-tests/url/a-element-xhtml-expected.txt: * web-platform-tests/url/url-setters-stripping.any-expected.txt: * web-platform-tests/url/url-setters-stripping.any.worker-expected.txt: Source/WebCore: Covered by newly passing wpt tests. * dom/Element.cpp: (WebCore::Element::getURLAttribute const): * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::href const): Don't remove whitespace before giving to completeURL, which will do that for us if it's a valid URL. If it's not a valid URL, we want the original string, not the trimmed string. * html/URLDecomposition.cpp: (WebCore::parsePort): Parse ports more like the URLParser, which ignores tabs and newlines. Source/WTF: Setters should ignore tabs and newlines like the main parser does. The protocol setter is problematic, which I reported in https://github.com/whatwg/url/issues/620 * wtf/URL.cpp: (WTF::URL::setFragmentIdentifier): * wtf/URLParser.cpp: (WTF::URLParser::isSpecialScheme): (WTF::URLParser::parse): * wtf/URLParser.h: The URL.hash setter should allow trailing C0 and control characters, which we would otherwise trim. Rather than introduce a new parameter, use a sentinel value for when we need to do this. LayoutTests: Update some old tests that failed in Chrome and Firefox to pass in all browsers after this change. * fast/dom/DOMURL/set-href-attribute-port-expected.txt: * fast/dom/DOMURL/set-href-attribute-port.html: * fast/dom/HTMLAnchorElement/set-href-attribute-port-expected.txt: * fast/dom/HTMLAnchorElement/set-href-attribute-port.html: Canonical link: https://commits.webkit.org/239531@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279760 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-08 22:59:59 +00:00
2021-07-08 Alex Christensen <achristensen@webkit.org>
Fix some whitespace handling issues in URL setters
https://bugs.webkit.org/show_bug.cgi?id=227806
Reviewed by Chris Dumez.
Setters should ignore tabs and newlines like the main parser does.
The protocol setter is problematic, which I reported in https://github.com/whatwg/url/issues/620
* wtf/URL.cpp:
(WTF::URL::setFragmentIdentifier):
* wtf/URLParser.cpp:
(WTF::URLParser::isSpecialScheme):
(WTF::URLParser::parse):
* wtf/URLParser.h:
The URL.hash setter should allow trailing C0 and control characters, which we would otherwise trim.
Rather than introduce a new parameter, use a sentinel value for when we need to do this.
[Cocoa] Expose SPI to opt out of Extensible SSO authentication https://bugs.webkit.org/show_bug.cgi?id=227729 <rdar://problem/75647892> Reviewed by Tim Horton. Source/WebKit: WKWebView clients should be able to disable Extensible SSO authentication flows, so exposing the internal mechanism as SPI. This is especially important for use cases where a WKWebView will be used to load content without being attached to a Window, since a Window is required to present the Extensible SSO authentication UI. Without a Window, WebKit will wait for a Window to be attached causing loads to timeout. By adopting this API, developers can opt out of Extensible SSO, allowing loads to fail quickly rather than waiting for a timeout. Tested by a new TestWebKitAPI test case: SOAuthorizationRedirect.DisableSSO * UIProcess/API/Cocoa/WKPreferences.h: * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _extensibleSSOEnabled]): Add getter for new preference. (-[WKPreferences _setExtensibleSSOEnabled:]): Add setter. * UIProcess/Cocoa/SOAuthorization/NavigationSOAuthorizationSession.mm: (WebKit::NavigationSOAuthorizationSession::shouldStartInternal): Add new logging so developers can see when a WKWebView without a Window is attempting to participate in Extensible SSO flows. * UIProcess/Cocoa/SOAuthorization/PopUpSOAuthorizationSession.mm: (WebKit::PopUpSOAuthorizationSession::initSecretWebView): Switch from SPI to API. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::decidePolicyForNavigationAction): Ditto. * UIProcess/WebPageProxy.h: Source/WTF: Create new WKPreference to allow WebKit clients to opt out of Extensible SSO authentication. * Scripts/Preferences/WebPreferences.yaml: Tools: Add a new test to confirm that Extenstible SSO authentication flows are bypassed when the new WKPreference is used. Updated other tests to confirm that the SSO delegate is called when expected. * TestWebKitAPI/Tests/WebKitCocoa/TestSOAuthorization.mm: (-[TestSOAuthorizationDelegate _webView:decidePolicyForSOAuthorizationLoadWithCurrentPolicy:forExtension:completionHandler:]): (resetState): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/239528@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279755 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-08 22:13:59 +00:00
2021-07-08 Brent Fulgham <bfulgham@apple.com>
[Cocoa] Expose SPI to opt out of Extensible SSO authentication
https://bugs.webkit.org/show_bug.cgi?id=227729
<rdar://problem/75647892>
Reviewed by Tim Horton.
Create new WKPreference to allow WebKit clients to opt out of Extensible SSO authentication.
* Scripts/Preferences/WebPreferences.yaml:
2021-07-07 Alex Christensen <achristensen@webkit.org>
URL host setter should pass host to URLParser instead of trying to encode it itself
https://bugs.webkit.org/show_bug.cgi?id=227749
Reviewed by Chris Dumez.
For non-special schemes, the host is percent-encoded instead of punycode-encoded.
Allowing the URL parser to handle all input directly does the right thing for non-special schemes.
* wtf/URL.cpp:
(WTF::URL::setHost):
(WTF::URL::setHostAndPort):
2021-07-07 Alex Christensen <achristensen@webkit.org>
URL path setter should add "./" before non-empty path and after empty host for URLs with non-special schemes
https://bugs.webkit.org/show_bug.cgi?id=227750
Reviewed by Chris Dumez.
This is related to r267837 but in the path setter, too.
This helps preserve idempotence in parsed URLs.
This is an edge case that will rarely be hit in practice, but now the path setter matches the parser.
* wtf/URL.cpp:
(WTF::URL::setPath):
2021-07-07 Christopher Reid <chris.reid@sony.com>
[PlayStation] Don't assume 4KB block size when estimating Network Cache disk usage
https://bugs.webkit.org/show_bug.cgi?id=227502
Reviewed by Chris Dumez.
Add getVolumeFileBlockSize to fetch the block size from the filesystem.
Currently only implemented for Windows and POSIX filesystems.
* wtf/FileSystem.cpp:
* wtf/FileSystem.h:
* wtf/playstation/FileSystemPlayStation.cpp:
Use more Span https://bugs.webkit.org/show_bug.cgi?id=227606 Reviewed by Darin Adler. Source/WebCore: * inspector/InspectorFrontendHost.cpp: (WebCore::InspectorFrontendHost::showCertificate): * platform/SharedBuffer.cpp: (WebCore::SharedBuffer::decoder const): * platform/network/cf/CertificateInfoCFNet.cpp: (WTF::Persistence::encodeCFData): * workers/service/server/RegistrationDatabase.cpp: (WebCore::RegistrationDatabase::importRecords): * workers/service/server/SWScriptStorage.cpp: (WebCore::SWScriptStorage::store): Source/WebKit: * NetworkProcess/cache/CacheStorageEngineCache.cpp: (WebKit::CacheStorage::Cache::decodeRecordHeader): * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::readOrigin): (WebKit::CacheStorage::decodeCachesNames): * NetworkProcess/cache/NetworkCacheData.cpp: (WebKit::NetworkCache::Data::mapToFile const): (WebKit::NetworkCache::computeSHA1): * NetworkProcess/cache/NetworkCacheData.h: (WebKit::NetworkCache::Data::span const): * NetworkProcess/cache/NetworkCacheDataCocoa.mm: (WebKit::NetworkCache::Data::apply const): * NetworkProcess/cache/NetworkCacheDataCurl.cpp: (WebKit::NetworkCache::Data::apply const): * NetworkProcess/cache/NetworkCacheDataGLib.cpp: (WebKit::NetworkCache::Data::apply const): * NetworkProcess/cache/NetworkCacheEntry.cpp: (WebKit::NetworkCache::Entry::decodeStorageRecord): * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::decodeRecordMetaData): * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp: (WebKit::NetworkCache::SubresourcesEntry::decodeStorageRecord): * UIProcess/API/APIContentRuleListStore.cpp: (API::getData): (API::decodeContentRuleListMetaData): (API::writeDataToFile): Source/WTF: New is always better, right? * wtf/FileSystem.cpp: (WTF::FileSystemImpl::mapToFile): * wtf/FileSystem.h: * wtf/persistence/PersistentCoders.cpp: (WTF::Persistence::Coder<CString>::encode): (WTF::Persistence::Coder<CString>::decode): (WTF::Persistence::Coder<String>::encode): (WTF::Persistence::decodeStringText): (WTF::Persistence::Coder<SHA1::Digest>::encode): (WTF::Persistence::Coder<SHA1::Digest>::decode): * wtf/persistence/PersistentCoders.h: * wtf/persistence/PersistentDecoder.cpp: (WTF::Persistence::Decoder::Decoder): (WTF::Persistence::Decoder::bufferIsLargeEnoughToContain const): (WTF::Persistence::Decoder::bufferPointerForDirectRead): (WTF::Persistence::Decoder::decodeFixedLengthData): (WTF::Persistence::Decoder::decodeNumber): (WTF::Persistence::Decoder::verifyChecksum): * wtf/persistence/PersistentDecoder.h: (WTF::Persistence::Decoder::length const): (WTF::Persistence::Decoder::currentOffset const): * wtf/persistence/PersistentEncoder.cpp: (WTF::Persistence::Encoder::updateChecksumForData): (WTF::Persistence::Encoder::encodeFixedLengthData): (WTF::Persistence::Encoder::encodeChecksum): * wtf/persistence/PersistentEncoder.h: Canonical link: https://commits.webkit.org/239458@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279645 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-07 17:07:57 +00:00
2021-07-07 Alex Christensen <achristensen@webkit.org>
Use more Span
https://bugs.webkit.org/show_bug.cgi?id=227606
Reviewed by Darin Adler.
New is always better, right?
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::mapToFile):
* wtf/FileSystem.h:
* wtf/persistence/PersistentCoders.cpp:
(WTF::Persistence::Coder<CString>::encode):
(WTF::Persistence::Coder<CString>::decode):
(WTF::Persistence::Coder<String>::encode):
(WTF::Persistence::decodeStringText):
(WTF::Persistence::Coder<SHA1::Digest>::encode):
(WTF::Persistence::Coder<SHA1::Digest>::decode):
* wtf/persistence/PersistentCoders.h:
* wtf/persistence/PersistentDecoder.cpp:
(WTF::Persistence::Decoder::Decoder):
(WTF::Persistence::Decoder::bufferIsLargeEnoughToContain const):
(WTF::Persistence::Decoder::bufferPointerForDirectRead):
(WTF::Persistence::Decoder::decodeFixedLengthData):
(WTF::Persistence::Decoder::decodeNumber):
(WTF::Persistence::Decoder::verifyChecksum):
* wtf/persistence/PersistentDecoder.h:
(WTF::Persistence::Decoder::length const):
(WTF::Persistence::Decoder::currentOffset const):
* wtf/persistence/PersistentEncoder.cpp:
(WTF::Persistence::Encoder::updateChecksumForData):
(WTF::Persistence::Encoder::encodeFixedLengthData):
(WTF::Persistence::Encoder::encodeChecksum):
* wtf/persistence/PersistentEncoder.h:
[JSC] Optimize Object.assign and putDirectInternal https://bugs.webkit.org/show_bug.cgi?id=227677 Reviewed by Filip Pizlo. JSTests: * microbenchmarks/object-assign-replace.js: Added. (test): * microbenchmarks/object-assign-transition.js: Added. (test): Source/JavaScriptCore: This patch improves Object.assign performance (and this requires putDirectInternal improvement). 1. Object.assign is handled by DFG / FTL as ObjectAssign node 2. We found that putDirectInternal is suboptimal. This patch removes several bottlenecks. They are super critical from the measurement of microbenchmarks. 2.1. Creating and destroying DeferredStructureTransitionWatchpointFire is not free. We should do that only when we need it. 2.2. Before r277620, we are checking m_replacementWatchpointSets's nullptr and that was fast. But after that, we are always calling HashMap::get, and it is not inlined. This means that if we have StructureRareData, we are always calling HashMap::get even though there is no m_replacementWatchpointSets set. This patch adds HashMap::isNullStorage to avoid this call by inlinely check this via `LIKELY(m_replacementWatchpointSets.isNullStorage())`. 2.3. Structure::addPropertyTransitionToExistingStructure has very cheap fast path and we must inline them to get performance benefit for major single-transition case. Added microbenchmarks show significant performance improvements. And Speedometer2 shows 0.6 - 1.0% improvement. ToT Patched object-assign-transition 105.2539+-0.2970 ^ 88.8046+-0.2029 ^ definitely 1.1852x faster object-assign-replace 116.1568+-0.0905 ^ 75.0673+-0.0658 ^ definitely 1.5474x faster * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/Watchpoint.cpp: (JSC::DeferredWatchpointFire::fireAllSlow): (JSC::DeferredWatchpointFire::DeferredWatchpointFire): Deleted. (JSC::DeferredWatchpointFire::~DeferredWatchpointFire): Deleted. (JSC::DeferredWatchpointFire::fireAll): Deleted. * bytecode/Watchpoint.h: (JSC::DeferredWatchpointFire::DeferredWatchpointFire): (JSC::DeferredWatchpointFire::fireAll): (JSC::FireDetail::FireDetail): Deleted. (JSC::FireDetail::~FireDetail): Deleted. * dfg/DFGAbstractInterpreterInlines.h: (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::handleIntrinsicCall): * dfg/DFGClobberize.h: (JSC::DFG::clobberize): * dfg/DFGDoesGC.cpp: (JSC::DFG::doesGC): * dfg/DFGFixupPhase.cpp: (JSC::DFG::FixupPhase::fixupNode): * dfg/DFGMayExit.cpp: * dfg/DFGNodeType.h: * dfg/DFGOperations.cpp: (JSC::DFG::JSC_DEFINE_JIT_OPERATION): * dfg/DFGOperations.h: * dfg/DFGPredictionPropagationPhase.cpp: * dfg/DFGSafeToExecute.h: (JSC::DFG::safeToExecute): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compileObjectAssign): * dfg/DFGSpeculativeJIT.h: * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::compile): * ftl/FTLCapabilities.cpp: (JSC::FTL::canCompile): * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::compileNode): (JSC::FTL::DFG::LowerDFGToB3::compileObjectAssign): * runtime/Intrinsic.cpp: (JSC::intrinsicName): * runtime/Intrinsic.h: * runtime/JSObject.cpp: (JSC::JSObject::deleteProperty): * runtime/JSObjectInlines.h: (JSC::JSObject::putDirectInternal): * runtime/ObjectConstructor.cpp: (JSC::objectAssignGeneric): (JSC::JSC_DEFINE_HOST_FUNCTION): * runtime/ObjectConstructor.h: * runtime/ObjectConstructorInlines.h: Added. (JSC::canPerformFastPropertyEnumerationForObjectAssign): * runtime/Structure.cpp: (JSC::StructureTransitionTable::singleTransition const): Deleted. (JSC::StructureTransitionTable::get const): Deleted. (JSC::Structure::addPropertyTransitionToExistingStructureImpl): Deleted. (JSC::Structure::addPropertyTransitionToExistingStructure): Deleted. (JSC::Structure::addPropertyTransitionToExistingStructureConcurrently): Deleted. * runtime/Structure.h: * runtime/StructureInlines.h: (JSC::Structure::didReplaceProperty): (JSC::Structure::propertyReplacementWatchpointSet): (JSC::Structure::addPropertyTransitionToExistingStructureImpl): (JSC::Structure::addPropertyTransitionToExistingStructure): (JSC::Structure::addPropertyTransitionToExistingStructureConcurrently): (JSC::StructureTransitionTable::singleTransition const): (JSC::StructureTransitionTable::get const): Source/WTF: * wtf/HashMap.h: * wtf/HashSet.h: * wtf/HashTable.h: (WTF::HashTable::isNullStorage const): Canonical link: https://commits.webkit.org/239428@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279604 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-06 19:25:04 +00:00
2021-07-05 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Optimize Object.assign and putDirectInternal
https://bugs.webkit.org/show_bug.cgi?id=227677
Reviewed by Filip Pizlo.
* wtf/HashMap.h:
* wtf/HashSet.h:
* wtf/HashTable.h:
(WTF::HashTable::isNullStorage const):
2021-07-02 Brent Fulgham <bfulgham@apple.com>
[macOS] Only use WebGL on Metal by default on safe versions of macOS
https://bugs.webkit.org/show_bug.cgi?id=227633
<rdar://problem/78527887>
Reviewed by Dean Jackson.
Tested by WebGL test suite.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
* wtf/PlatformHave.h:
Disable relay for UDP sockets when not needed https://bugs.webkit.org/show_bug.cgi?id=227253 Source/WebCore: Reviewed by Eric Carlson. * Modules/mediastream/PeerConnectionBackend.h: (WebCore::PeerConnectionBackend::shouldFilterICECandidates const): * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::setConfiguration): * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h: (WebCore::LibWebRTCMediaEndpoint::rtcSocketFactory): * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::LibWebRTCPeerConnectionBackend::disableICECandidateFiltering): * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h: * platform/mediastream/libwebrtc/LibWebRTCProvider.h: Source/WebKit: Reviewed by Eric Carlson. * NetworkProcess/webrtc/NetworkRTCProvider.cpp: (WebKit::NetworkRTCProvider::createUDPSocket): * NetworkProcess/webrtc/NetworkRTCProvider.h: * NetworkProcess/webrtc/NetworkRTCProvider.messages.in: * NetworkProcess/webrtc/NetworkRTCUDPSocketCocoa.h: * NetworkProcess/webrtc/NetworkRTCUDPSocketCocoa.mm: (WebKit::NetworkRTCUDPSocketCocoaConnections::create): (WebKit::NetworkRTCUDPSocketCocoa::createUDPSocket): (WebKit::NetworkRTCUDPSocketCocoa::NetworkRTCUDPSocketCocoa): (WebKit::NetworkRTCUDPSocketCocoaConnections::NetworkRTCUDPSocketCocoaConnections): (WebKit::NetworkRTCUDPSocketCocoaConnections::createNWConnection): * WebKit.xcodeproj/project.pbxproj: * WebProcess/Network/webrtc/LibWebRTCProvider.cpp: (WebKit::RTCSocketFactory::RTCSocketFactory): (WebKit::RTCSocketFactory::CreateUdpSocket): (WebKit::LibWebRTCProvider::createSocketFactory): * WebProcess/Network/webrtc/LibWebRTCProvider.h: * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp: (WebKit::LibWebRTCSocketFactory::createUdpSocket): * WebProcess/Network/webrtc/LibWebRTCSocketFactory.h: Source/WTF: <rdar://problem/79912154> Reviewed by Eric Carlson. * wtf/PlatformHave.h: Add a macro for new NW methods. Canonical link: https://commits.webkit.org/239336@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279483 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-01 20:56:00 +00:00
2021-07-01 Youenn Fablet <youenn@apple.com>
Disable relay for UDP sockets when not needed
https://bugs.webkit.org/show_bug.cgi?id=227253
<rdar://problem/79912154>
Reviewed by Eric Carlson.
* wtf/PlatformHave.h:
Add a macro for new NW methods.
[Model] Restrict IPC calls to ARKit SPI availability and runtime flag https://bugs.webkit.org/show_bug.cgi?id=227581 Reviewed by Tim Horton. Source/WebCore: Guard all IPC calls related to <model> by the most appropriate platform-specific flag and also ensure that those calls don't do anything unless the runtime flag is also enabled. * Modules/model-element/HTMLModelElement.cpp: * Modules/model-element/HTMLModelElement.h: * Modules/model-element/HTMLModelElementCocoa.mm: (WebCore::HTMLModelElement::inlinePreviewDidObtainContextId): * loader/EmptyClients.cpp: (WebCore::EmptyChromeClient::modelElementDidCreatePreview const): * loader/EmptyClients.h: * page/ChromeClient.h: Source/WebKit: Guard all IPC calls related to <model> by the most appropriate platform-specific flag and also ensure that those calls don't do anything unless the runtime flag is also enabled. * Shared/WebProcessDataStoreParameters.h: (WebKit::WebProcessDataStoreParameters::encode const): (WebKit::WebProcessDataStoreParameters::decode): * UIProcess/Cocoa/ModelElementControllerCocoa.mm: (WebKit::ModelElementController::takeModelElementFullscreen): (WebKit::ModelElementController::modelElementDidCreatePreview): * UIProcess/ModelElementController.cpp: * UIProcess/ModelElementController.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didAttachToRunningProcess): (WebKit::WebPageProxy::resetState): (WebKit::WebPageProxy::takeModelElementFullscreen): (WebKit::WebPageProxy::modelElementDidCreatePreview): (WebKit::WebPageProxy::modelElementPreviewDidObtainContextId): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::webProcessDataStoreParameters): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary): * UIProcess/WebsiteData/WebsiteDataStore.h: * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp: (WebKit::WebsiteDataStoreConfiguration::WebsiteDataStoreConfiguration): (WebKit::WebsiteDataStoreConfiguration::copy const): * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::modelElementDidCreatePreview const): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::modelElementPreviewDidObtainContextId): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::setWebsiteDataStoreParameters): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformSetWebsiteDataStoreParameters): Source/WTF: Define a new compile-time flag when either of the iOS or macOS ARKit SPIs are available. * wtf/PlatformHave.h: Canonical link: https://commits.webkit.org/239330@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279477 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-01 19:37:13 +00:00
2021-07-01 Antoine Quint <graouts@webkit.org>
[Model] Restrict IPC calls to ARKit SPI availability and runtime flag
https://bugs.webkit.org/show_bug.cgi?id=227581
Reviewed by Tim Horton.
Define a new compile-time flag when either of the iOS or macOS ARKit SPIs are available.
* wtf/PlatformHave.h:
2021-07-01 Aditya Keerthi <akeerthi@apple.com>
[iOS] <select> menus should scroll to the selected option
https://bugs.webkit.org/show_bug.cgi?id=227562
<rdar://problem/77887668>
Reviewed by Wenson Hsieh.
* wtf/PlatformHave.h:
Add HAVE(UIMENUOPTIONS_SINGLE_SELECTION).
[Cocoa] Migrate WebRTC UDP socket handling to NW API https://bugs.webkit.org/show_bug.cgi?id=227210 LayoutTests/imported/w3c: Reviewed by Eric Carlson. Rebasing tests as timing changes a bit. This aligns with Chrome and Firefox behavior. * web-platform-tests/webrtc/no-media-call-expected.txt: * web-platform-tests/webrtc/promises-call-expected.txt: Source/ThirdParty/libwebrtc: Reviewed by Eric Carlson. * Configurations/libwebrtc.iOS.exp: * Configurations/libwebrtc.iOSsim.exp: * Configurations/libwebrtc.mac.exp: Source/WebCore: Reviewed by Eric Carlson. Add infrastructure to new experimental feature flag for NW backed UDP sockets. * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::webRTCPlatformTCPSocketsEnabled const): (WebCore::RuntimeEnabledFeatures::setWebRTCPlatformTCPSocketsEnabled): (WebCore::RuntimeEnabledFeatures::webRTCPlatformUDPSocketsEnabled const): (WebCore::RuntimeEnabledFeatures::setWebRTCPlatformUDPSocketsEnabled): Source/WebKit: Reviewed by Eric Carlson. Migrate UDP socket handling from WebRTC physical socket server to nw API for Cocoa ports. For each UDP socket opened, we open a nw_listener that will listen to inbound connections. On inbound connection, we receive a nw_connection that we store in a address -> connection map. Whenever sending a packet, we look at the remote address. If needed, we create a nw_connection to that particular remote address and store it in the address -> connection map. We then use the pre-existing or newly created nw_connection to send the packet. Make sure to cancel NW connection in case of failure before releasing the socket. Covered by existing tests * NetworkProcess/webrtc/NetworkRTCProvider.cpp: (WebKit::NetworkRTCProvider::createUDPSocket): (WebKit::NetworkRTCProvider::createClientTCPSocket): * NetworkProcess/webrtc/NetworkRTCProvider.h: (WebKit::NetworkRTCProvider::setPlatformTCPSocketsEnabled): (WebKit::NetworkRTCProvider::setPlatformUDPSocketsEnabled): * NetworkProcess/webrtc/NetworkRTCProvider.messages.in: * NetworkProcess/webrtc/NetworkRTCTCPSocketCocoa.h: Copied from Source/WebKit/NetworkProcess/webrtc/NetworkRTCSocketCocoa.h. * NetworkProcess/webrtc/NetworkRTCTCPSocketCocoa.mm: Renamed from Source/WebKit/NetworkProcess/webrtc/NetworkRTCSocketCocoa.mm. (WebKit::tcpSocketQueue): (WebKit::NetworkRTCTCPSocketCocoa::createClientTCPSocket): (WebKit::NetworkRTCTCPSocketCocoa::NetworkRTCTCPSocketCocoa): (WebKit::NetworkRTCTCPSocketCocoa::close): (WebKit::NetworkRTCTCPSocketCocoa::setOption): (WebKit::NetworkRTCTCPSocketCocoa::createMessageBuffer): (WebKit::NetworkRTCTCPSocketCocoa::sendTo): * NetworkProcess/webrtc/NetworkRTCUDPSocketCocoa.h: Added. (WTF::DefaultHash<rtc::SocketAddress>::hash): (WTF::DefaultHash<rtc::SocketAddress>::equal): (WTF::HashTraits<rtc::SocketAddress>::emptyValue): (WTF::HashTraits<rtc::SocketAddress>::constructDeletedValue): (WTF::HashTraits<rtc::SocketAddress>::isDeletedValue): * NetworkProcess/webrtc/NetworkRTCUDPSocketCocoa.mm: Added. (WebKit::NetworkRTCUDPSocketCocoaConnections::create): (WebKit::NetworkRTCUDPSocketCocoaConnections::WTF_GUARDED_BY_LOCK): (WebKit::udpSocketQueue): (WebKit::NetworkRTCUDPSocketCocoa::createUDPSocket): (WebKit::NetworkRTCUDPSocketCocoa::NetworkRTCUDPSocketCocoa): (WebKit::NetworkRTCUDPSocketCocoa::~NetworkRTCUDPSocketCocoa): (WebKit::NetworkRTCUDPSocketCocoa::close): (WebKit::NetworkRTCUDPSocketCocoa::setOption): (WebKit::NetworkRTCUDPSocketCocoa::sendTo): (WebKit::NetworkRTCUDPSocketCocoaConnections::NetworkRTCUDPSocketCocoaConnections): (WebKit::NetworkRTCUDPSocketCocoaConnections::close): (WebKit::NetworkRTCUDPSocketCocoaConnections::setOption): (WebKit::processUDPData): (WebKit::NetworkRTCUDPSocketCocoaConnections::createNWConnection): (WebKit::NetworkRTCUDPSocketCocoaConnections::setupNWConnection): (WebKit::NetworkRTCUDPSocketCocoaConnections::sendTo): * SourcesCocoa.txt: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp: (WebKit::LibWebRTCSocketFactory::setConnection): Source/WTF: Reviewed by Eric Carlson. Add a new experimental flag for NW backed UDP sockets. * Scripts/Preferences/WebPreferencesExperimental.yaml: LayoutTests: <rdar://problem/79859045> Reviewed by Eric Carlson. * platform/ios-simulator-wk2/TestExpectations: Mark test as failed, as this test is using unsupported API (transport). Canonical link: https://commits.webkit.org/239317@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279461 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-01 10:37:39 +00:00
2021-07-01 Youenn Fablet <youenn@apple.com>
[Cocoa] Migrate WebRTC UDP socket handling to NW API
https://bugs.webkit.org/show_bug.cgi?id=227210
Reviewed by Eric Carlson.
Add a new experimental flag for NW backed UDP sockets.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
2021-07-01 Jer Noble <jer.noble@apple.com>
[Mac] (Re-)enable GroupActivities after upstreaming
https://bugs.webkit.org/show_bug.cgi?id=227546
Reviewed by Eric Carlson.
Add support for HAVE_GROUP_ACTIVITIES.
* wtf/PlatformHave.h:
[Model] [macOS] Add support for rendering model resources https://bugs.webkit.org/show_bug.cgi?id=227530 <rdar://problem/79968206> Reviewed by Dean Jackson. Source/WebCore: On macOS, ASVInlinePreview requires an instance in both the WebProcess and the UIProcess to exist with a matching UUID. On the WebCore side, in the WebProcess, after writing the model resource as a file to disk, we create an instance when a <model> element is created and message the UIProcess through the ChromeClient providing the UUID generated for it. When the UIProcess is done processing this message, it will reply with another message which calls into HTMLModelElement::inlinePreviewDidObtainContextId() with the matching UUID and a context ID for the remote context. We can then set that remote context ID on our ASVInlinePreview instance. We also introduce a HTMLModelElement::platformLayer() method such that RenderLayerBacking::updateConfiguration() can call it to host the ASVInlinePreview layer. * Modules/model-element/HTMLModelElement.cpp: (WebCore::HTMLModelElement::~HTMLModelElement): (WebCore::HTMLModelElement::setSourceURL): (WebCore::HTMLModelElement::notifyFinished): * Modules/model-element/HTMLModelElement.h: * Modules/model-element/HTMLModelElementCocoa.mm: Added. (WebCore::HTMLModelElement::createFile): (WebCore::HTMLModelElement::clearFile): (WebCore::HTMLModelElement::modelDidChange): (WebCore::HTMLModelElement::inlinePreviewDidObtainContextId): (WebCore::HTMLModelElement::platformLayer const): * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * loader/EmptyClients.cpp: (WebCore::EmptyChromeClient::modelElementDidCreatePreview const): * loader/EmptyClients.h: * page/ChromeClient.h: (WebCore::ChromeClient::modelElementDidCreatePreview const): * platform/Logging.h: * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateConfiguration): Source/WebCore/PAL: Declare the ASVInlinePreview class for macOS. * PAL.xcodeproj/project.pbxproj: * pal/spi/mac/SystemPreviewSPI.h: Added. Source/WebKit: On macOS, ASVInlinePreview requires an instance in both the WebProcess and the UIProcess to exist with a matching UUID. On the WebKit side, in the UIProcess, we receive a message from the WebProcess when the ASVInlinePreview in that process was created with its generated UUID. We provide this to the ModelElementController, set the remote connection up and load the file. When those tasks complete successfully we message back the WebProcess with the UUID and the provided ElementContext to talk back to the HTMLModelElement instance that initiated the message to the UIProcess in the first place. * UIProcess/Cocoa/ModelElementControllerCocoa.mm: (WebKit::ModelElementController::modelElementDidCreatePreview): * UIProcess/ModelElementController.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::modelElementDidCreatePreview): (WebKit::WebPageProxy::modelElementPreviewDidObtainContextId): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::modelElementDidCreatePreview const): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::modelElementDidCreatePreview): (WebKit::WebPage::modelElementPreviewDidObtainContextId): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: Source/WTF: Add a new compile-time flag indicating the availability of the ASVInlinePreview SPI on macOS. We only define it when the header itself is present for now to avoid issues with older macOS 12 SDKs, but ultimately we will only use the macOS version check. * wtf/PlatformHave.h: Canonical link: https://commits.webkit.org/239307@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279451 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-01 06:32:12 +00:00
2021-06-30 Antoine Quint <graouts@webkit.org>
[Model] [macOS] Add support for rendering model resources
https://bugs.webkit.org/show_bug.cgi?id=227530
<rdar://problem/79968206>
Reviewed by Dean Jackson.
Add a new compile-time flag indicating the availability of the ASVInlinePreview SPI on macOS.
We only define it when the header itself is present for now to avoid issues with older macOS
12 SDKs, but ultimately we will only use the macOS version check.
* wtf/PlatformHave.h:
Add ID and versioning support for AppHighlights https://bugs.webkit.org/show_bug.cgi?id=227279 Reviewed by Tim Horton. Source/WebCore: AppHighlights.AppHighlightRestoreFromStorage AppHighlights.AppHighlightCreateAndRestoreAndDropBytes AppHighlights.AppHighlightCreateAndRestoreWithLaterVersion AppHighlights.AppHighlightCreateAndRestoreWithExtraBytes AppHighlights.AppHighlightRestoreFromStorageV0 AppHighlights.AppHighlightRestoreFromStorageV1 Reformat the storage of Highlight Data to allow for accurate deletion of active highlights, as well as making them more robust and future-proof. Support decoding v0 highlights as well. * Modules/highlight/AppHighlightRangeData.cpp: (WebCore::AppHighlightRangeData::NodePathComponent::decode): (WebCore::AppHighlightRangeData::encode const): (WebCore::AppHighlightRangeData::decode): * Modules/highlight/AppHighlightRangeData.h: (WebCore::AppHighlightRangeData::NodePathComponent::NodePathComponent): (WebCore::AppHighlightRangeData::AppHighlightRangeData): (WebCore::AppHighlightRangeData::identifier const): (WebCore::AppHighlightRangeData::startOffset const): (WebCore::AppHighlightRangeData::endOffset const): * Modules/highlight/AppHighlightStorage.cpp: (WebCore::createAppHighlightRangeData): Source/WebKit: Reformat the storage of Highlight Data to allow for accurate deletion of active highlights, as well as making them more robust and future-proof. Also found an issue with creating SharedBuffers from the memory map, in that the ipcHandle size should be used instead of the sharedMemory->size(). * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::restoreAppHighlightsAndScrollToIndex): Source/WTF: Allow PersistentDecoders to rewind, to help support v0 highlight data. * wtf/persistence/PersistentDecoder.cpp: (WTF::Persistence::Decoder::Decoder): (WTF::Persistence::Decoder::rewind): * wtf/persistence/PersistentDecoder.h: Tools: * TestWebKitAPI/Tests/WebKitCocoa/WKAppHighlights.mm: (TestWebKitAPI::createAppHighlightWithHTML): (TestWebKitAPI::createWebViewForAppHighlightsWithHTML): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/239300@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279444 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-30 23:54:40 +00:00
2021-06-30 Megan Gardner <megan_gardner@apple.com>
Add ID and versioning support for AppHighlights
https://bugs.webkit.org/show_bug.cgi?id=227279
Reviewed by Tim Horton.
Allow PersistentDecoders to rewind, to help support v0 highlight data.
* wtf/persistence/PersistentDecoder.cpp:
(WTF::Persistence::Decoder::Decoder):
(WTF::Persistence::Decoder::rewind):
* wtf/persistence/PersistentDecoder.h:
Use WeakHashMap and WeakPtr with Node in more places https://bugs.webkit.org/show_bug.cgi?id=227192 <rdar://problem/79828322> Reviewed by Geoffrey Garen. Source/WebCore: Deploy WeakHashMap and WeakPtr with Node/Element in more places. * dom/Document.cpp: (WebCore::Document::elementForAccessKey): (WebCore::Document::buildAccessKeyCache): (WebCore::Document::registerForVisibilityStateChangedCallbacks): (WebCore::Document::unregisterForVisibilityStateChangedCallbacks): (WebCore::Document::visibilityStateChanged): * dom/Document.h: * dom/VisibilityChangeClient.h: * html/FormController.cpp: (WebCore::FormKeyGenerator::formKey): (WebCore::FormKeyGenerator::willDeleteForm): * html/HTMLAnchorElement.cpp: (WebCore::rootEditableElementMap): (WebCore::HTMLAnchorElement::rootEditableElementForSelectionOnMouseDown const): (WebCore::HTMLAnchorElement::clearRootEditableElementForSelectionOnMouseDown): (WebCore::HTMLAnchorElement::setRootEditableElementForSelectionOnMouseDown): * inspector/agents/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::bind): (WebCore::InspectorDOMAgent::unbind): (WebCore::InspectorDOMAgent::nodeForId): (WebCore::InspectorDOMAgent::pushNodePathToFrontend): (WebCore::InspectorDOMAgent::boundNodeId): (WebCore::InspectorDOMAgent::willDestroyDOMNode): (WebCore::InspectorDOMAgent::mediaMetricsTimerFired): * inspector/agents/InspectorDOMAgent.h: * inspector/agents/InspectorLayerTreeAgent.cpp: (WebCore::InspectorLayerTreeAgent::bindPseudoElement): (WebCore::InspectorLayerTreeAgent::unbindPseudoElement): * inspector/agents/InspectorLayerTreeAgent.h: * style/StyleSharingResolver.h: Source/WTF: * wtf/WeakHashMap.h: (WTF::WeakHashMap::WeakHashMapIteratorBase::makePeek): Fixed type mismatch errors. (WTF::WeakHashMap::ensure): Made this function return AddResult like HashMap::ensure. (WTF::WeakHashMap::take): Added. (WTF::WeakHashMap::removeIf): Fixed the bug that the callback was called with the iterator of m_impl and not WeakHashMapIterator. * wtf/WeakHashSet.h: (WTF::HashTraits<Ref<WeakPtrImpl<Counter>>>::isReleasedWeakValue): Moved to WeakPtr.h * wtf/WeakPtr.h: (WTF::HashTraits<Ref<WeakPtrImpl<Counter>>>::isReleasedWeakValue): Moved from WeakHashSet.h Canonical link: https://commits.webkit.org/239295@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279439 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-30 22:51:21 +00:00
2021-06-30 Ryosuke Niwa <rniwa@webkit.org>
Use WeakHashMap and WeakPtr with Node in more places
https://bugs.webkit.org/show_bug.cgi?id=227192
<rdar://problem/79828322>
Reviewed by Geoffrey Garen.
* wtf/WeakHashMap.h:
(WTF::WeakHashMap::WeakHashMapIteratorBase::makePeek): Fixed type mismatch errors.
(WTF::WeakHashMap::ensure): Made this function return AddResult like HashMap::ensure.
(WTF::WeakHashMap::take): Added.
(WTF::WeakHashMap::removeIf): Fixed the bug that the callback was called with the iterator
of m_impl and not WeakHashMapIterator.
* wtf/WeakHashSet.h:
(WTF::HashTraits<Ref<WeakPtrImpl<Counter>>>::isReleasedWeakValue): Moved to WeakPtr.h
* wtf/WeakPtr.h:
(WTF::HashTraits<Ref<WeakPtrImpl<Counter>>>::isReleasedWeakValue): Moved from WeakHashSet.h
2021-06-30 Truitt Savell <tsavell@apple.com>
Unreviewed, reverting r279405.
Casued 50+ webrtc crashes on Big Sur Debug
Reverted changeset:
"[Cocoa] Migrate WebRTC UDP socket handling to NW API"
https://bugs.webkit.org/show_bug.cgi?id=227210
https://commits.webkit.org/r279405
2021-06-30 Tim Horton <timothy_horton@apple.com>
Fix the build.
* wtf/PlatformHave.h:
This is not available on the simulator; disable it.
[Cocoa] Migrate WebRTC UDP socket handling to NW API https://bugs.webkit.org/show_bug.cgi?id=227210 LayoutTests/imported/w3c: Reviewed by Eric Carlson. Rebasing tests as timing changes a bit. This aligns with Chrome and Firefox behavior. * web-platform-tests/webrtc/no-media-call-expected.txt: * web-platform-tests/webrtc/promises-call-expected.txt: Source/ThirdParty/libwebrtc: Reviewed by Eric Carlson. * Configurations/libwebrtc.iOS.exp: * Configurations/libwebrtc.iOSsim.exp: * Configurations/libwebrtc.mac.exp: Source/WebCore: Reviewed by Eric Carlson. Add infrastructure to new experimental feature flag for NW backed UDP sockets. * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::webRTCPlatformTCPSocketsEnabled const): (WebCore::RuntimeEnabledFeatures::setWebRTCPlatformTCPSocketsEnabled): (WebCore::RuntimeEnabledFeatures::webRTCPlatformUDPSocketsEnabled const): (WebCore::RuntimeEnabledFeatures::setWebRTCPlatformUDPSocketsEnabled): Source/WebKit: Reviewed by Eric Carlson. Migrate UDP socket handling from WebRTC physical socket server to nw API for Cocoa ports. For each UDP socket opened, we open a nw_listener that will listen to inbound connections. On inbound connection, we receive a nw_connection that we store in a address -> connection map. Whenever sending a packet, we look at the remote address. If needed, we create a nw_connection to that particular remote address and store it in the address -> connection map. We then use the pre-existing or newly created nw_connection to send the packet. Make sure to cancel NW connection in case of failure before releasing the socket. Covered by existing tests * NetworkProcess/webrtc/NetworkRTCProvider.cpp: (WebKit::NetworkRTCProvider::createUDPSocket): (WebKit::NetworkRTCProvider::createClientTCPSocket): * NetworkProcess/webrtc/NetworkRTCProvider.h: (WebKit::NetworkRTCProvider::setPlatformTCPSocketsEnabled): (WebKit::NetworkRTCProvider::setPlatformUDPSocketsEnabled): * NetworkProcess/webrtc/NetworkRTCProvider.messages.in: * NetworkProcess/webrtc/NetworkRTCTCPSocketCocoa.h: Copied from Source/WebKit/NetworkProcess/webrtc/NetworkRTCSocketCocoa.h. * NetworkProcess/webrtc/NetworkRTCTCPSocketCocoa.mm: Renamed from Source/WebKit/NetworkProcess/webrtc/NetworkRTCSocketCocoa.mm. (WebKit::tcpSocketQueue): (WebKit::NetworkRTCTCPSocketCocoa::createClientTCPSocket): (WebKit::NetworkRTCTCPSocketCocoa::NetworkRTCTCPSocketCocoa): (WebKit::NetworkRTCTCPSocketCocoa::close): (WebKit::NetworkRTCTCPSocketCocoa::setOption): (WebKit::NetworkRTCTCPSocketCocoa::createMessageBuffer): (WebKit::NetworkRTCTCPSocketCocoa::sendTo): * NetworkProcess/webrtc/NetworkRTCUDPSocketCocoa.h: Added. (WTF::DefaultHash<rtc::SocketAddress>::hash): (WTF::DefaultHash<rtc::SocketAddress>::equal): (WTF::HashTraits<rtc::SocketAddress>::emptyValue): (WTF::HashTraits<rtc::SocketAddress>::constructDeletedValue): (WTF::HashTraits<rtc::SocketAddress>::isDeletedValue): * NetworkProcess/webrtc/NetworkRTCUDPSocketCocoa.mm: Added. (WebKit::NetworkRTCUDPSocketCocoaConnections::create): (WebKit::NetworkRTCUDPSocketCocoaConnections::WTF_GUARDED_BY_LOCK): (WebKit::udpSocketQueue): (WebKit::NetworkRTCUDPSocketCocoa::createUDPSocket): (WebKit::NetworkRTCUDPSocketCocoa::NetworkRTCUDPSocketCocoa): (WebKit::NetworkRTCUDPSocketCocoa::~NetworkRTCUDPSocketCocoa): (WebKit::NetworkRTCUDPSocketCocoa::close): (WebKit::NetworkRTCUDPSocketCocoa::setOption): (WebKit::NetworkRTCUDPSocketCocoa::sendTo): (WebKit::NetworkRTCUDPSocketCocoaConnections::NetworkRTCUDPSocketCocoaConnections): (WebKit::NetworkRTCUDPSocketCocoaConnections::close): (WebKit::NetworkRTCUDPSocketCocoaConnections::setOption): (WebKit::processUDPData): (WebKit::NetworkRTCUDPSocketCocoaConnections::createNWConnection): (WebKit::NetworkRTCUDPSocketCocoaConnections::setupNWConnection): (WebKit::NetworkRTCUDPSocketCocoaConnections::sendTo): * SourcesCocoa.txt: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp: (WebKit::LibWebRTCSocketFactory::setConnection): Source/WTF: Reviewed by Eric Carlson. Add a new experimental flag for NW backed UDP sockets. * Scripts/Preferences/WebPreferencesExperimental.yaml: LayoutTests: <rdar://problem/79859045> Reviewed by Eric Carlson. * platform/ios-simulator-wk2/TestExpectations: Mark test as failed, as this test is using unsupported API (transport). Canonical link: https://commits.webkit.org/239270@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279405 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-30 08:46:38 +00:00
2021-06-30 Youenn Fablet <youenn@apple.com>
[Cocoa] Migrate WebRTC UDP socket handling to NW API
https://bugs.webkit.org/show_bug.cgi?id=227210
Reviewed by Eric Carlson.
Add a new experimental flag for NW backed UDP sockets.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
2021-06-29 Antoine Quint <graouts@webkit.org>
WebKit_iosmac build failure: SystemPreviewSPI.h:29:9: fatal error: 'AssetViewer/ARQuickLookWebKitItem.h' file not found
https://bugs.webkit.org/show_bug.cgi?id=227507
<rdar://problem/79902043>
Reviewed by Dean Jackson.
When we added new SPIs in Source/WebCore/PAL/pal/spi/ios/SystemPreviewSPI.h as part of r279312 we also included this file
from a new file that is compiled on Catalyst. This revealed an issue where existing SPIs included in that file weren't
actually available on Catalyst. We now make sure we compile those out on Catalyst.
* wtf/PlatformHave.h:
2021-06-29 Antti Koivisto <antti@apple.com>
Enable Probabilistic Guard Malloc for RuleData and RuleFeature vectors
https://bugs.webkit.org/show_bug.cgi?id=227446
Reviewed by Geoffrey Garen.
Add SystemMalloc type that can be used with containers like Vector and
ProbabilisticGuardMalloc alias for it on Mac/iOS platforms.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/SystemMalloc.h: Added.
(WTF::SystemMalloc::malloc):
(WTF::SystemMalloc::tryMalloc):
(WTF::SystemMalloc::zeroedMalloc):
(WTF::SystemMalloc::tryZeroedMalloc):
(WTF::SystemMalloc::realloc):
(WTF::SystemMalloc::tryRealloc):
(WTF::SystemMalloc::free):
* wtf/Vector.h:
(WTF::Malloc>::appendVector):
Include all template parameters for the appendVector argument.
2021-06-28 Mikhail R. Gadelha <mikhail@igalia.com>
Prevent sign-extended casts for 32 bits arch
https://bugs.webkit.org/show_bug.cgi?id=227170
Reviewed by Yusuke Suzuki.
In a number of places, addresses are reinterpreted as uint64, which can
lead to wrong addresses in 32 bits arch.
* wtf/LoggerHelper.h:
(WTF::LoggerHelper::childLogIdentifier):
2021-06-28 Sam Weinig <weinig@apple.com>
Add helpers to create Spans from CFDataRef and NSData
https://bugs.webkit.org/show_bug.cgi?id=227217
Reviewed by Chris Dumez.
Add overloads of asBytes() for CFDataRef and NSData. This is going to
be a common enough pattern to warrent these helpers.
* WTF.xcodeproj/project.pbxproj:
* wtf/PlatformFTW.cmake:
* wtf/PlatformMac.cmake:
* wtf/PlatformWin.cmake:
* wtf/cf/SpanCF.h: Added.
(WTF::asBytes):
* wtf/cocoa/SpanCocoa.h: Added.
(WTF::asBytes):
[Model] [iOS] Add support for rendering model resources https://bugs.webkit.org/show_bug.cgi?id=227392 <rdar://problem/79770136> Reviewed by Tim Horton. Source/WebCore: Ensure the anchor point is set correctly for model content layers, otherwise the preview layer shows its center at the corner of the parent layer's origin. * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::setContentsToModel): Source/WebCore/PAL: Declare the ASVInlinePreview class. * pal/spi/ios/SystemPreviewSPI.h: Source/WebKit: Add a new WKModelView class which manages an ASVInlinePreview and displays its layer. The current incarnation of the ASVInlinePreview SPI requires a URL to a file to specify the resource, so we write a file to the temporary directory added in 279267 with the data wrapped in the Model object passed through the remote layer tree. Ultimately we will be able to use an SPI that does not require a file and instead will allow data to be passed directly, this is purely for a temporary experimentation. * Platform/Logging.h: * SourcesCocoa.txt: * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm: (WebKit::RemoteLayerTreeHost::makeNode): * UIProcess/ios/WKModelView.h: Added. * UIProcess/ios/WKModelView.mm: Added. (-[WKModelView preview]): (-[WKModelView initWithFrame:]): (-[WKModelView initWithCoder:]): (-[WKModelView initWithModel:]): (-[WKModelView createFileForModel:]): (-[WKModelView layoutSubviews]): (-[WKModelView updateBounds]): * WebKit.xcodeproj/project.pbxproj: Source/WTF: Add a new compile-time flag indicating the availability of the ASVInlinePreview SPI on iOS. We only define it when the header itself is present for now to avoid issues with older iOS 15 SDKs, but ultimately we will only use the iOS version check. * wtf/PlatformHave.h: Canonical link: https://commits.webkit.org/239188@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279312 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-27 08:55:52 +00:00
2021-06-27 Antoine Quint <graouts@webkit.org>
[Model] [iOS] Add support for rendering model resources
https://bugs.webkit.org/show_bug.cgi?id=227392
<rdar://problem/79770136>
Reviewed by Tim Horton.
Add a new compile-time flag indicating the availability of the ASVInlinePreview SPI on iOS.
We only define it when the header itself is present for now to avoid issues with older iOS
15 SDKs, but ultimately we will only use the iOS version check.
* wtf/PlatformHave.h:
2021-06-25 Kenneth Russell <kbr@chromium.org>
Set ImageBitmap experimental feature flag to true
https://bugs.webkit.org/show_bug.cgi?id=227140
Reviewed by Dean Jackson.
Web developers - most recently Google's Meet team - have asked for
ImageBitmap support in WebKit. The implementation was
substantially upgraded during development of WebGL 2.0, and is
thoroughly tested on the EWS. Change the default value for
ImageBitmap's experimental flag to true; this can be removed
completely after one release cycle.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
[css-scroll-snap] Remove ENABLE_SCROLL_SNAP compile-time option https://bugs.webkit.org/show_bug.cgi?id=227067 Reviewed by Simon Fraser. Remove compile-time ENABLE_SCROLL_SNAP configuration option. .: * Source/cmake/WebKitFeatures.cmake: Remove the flag from the CMake configuration. Source/WebCore: No new tests. This should not change behavior in any way. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): * css/CSSPrimitiveValueMappings.h: * css/CSSProperties.json: * css/CSSValueKeywords.in: * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseSingleValue): * page/EventHandler.cpp: (WebCore::EventHandler::handleWheelEventInAppropriateEnclosingBox): * page/FrameView.cpp: (WebCore::FrameView::updateScrollingCoordinatorScrollSnapProperties const): (WebCore::FrameView::performPostLayoutTasks): * page/FrameView.h: * page/mac/EventHandlerMac.mm: (WebCore::EventHandler::processWheelEventForScrollSnap): * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::setStateScrollingNodeSnapOffsetsAsFloat): (WebCore::AsyncScrollingCoordinator::setScrollingNodeScrollableAreaGeometry): (WebCore::AsyncScrollingCoordinator::updateScrollSnapPropertiesWithFrameView): * page/scrolling/AsyncScrollingCoordinator.h: * page/scrolling/ScrollSnapOffsetsInfo.cpp: * page/scrolling/ScrollSnapOffsetsInfo.h: * page/scrolling/ScrollingMomentumCalculator.cpp: * page/scrolling/ScrollingMomentumCalculator.h: * page/scrolling/ScrollingStateScrollingNode.cpp: (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode): (WebCore::ScrollingStateScrollingNode::applicableProperties const): (WebCore::ScrollingStateScrollingNode::setCurrentVerticalSnapPointIndex): (WebCore::ScrollingStateScrollingNode::dumpProperties const): * page/scrolling/ScrollingStateScrollingNode.h: * page/scrolling/ScrollingTreeScrollingNode.cpp: (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren): (WebCore::ScrollingTreeScrollingNode::dumpProperties const): (WebCore::ScrollingTreeScrollingNode::setCurrentVerticalSnapPointIndex): * page/scrolling/ScrollingTreeScrollingNode.h: * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent): * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h: * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: (WebCore::ScrollingTreeScrollingNodeDelegateMac::updateFromStateNode): (WebCore::ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent): (WebCore::ScrollingTreeScrollingNodeDelegateMac::viewportSize const): * page/scrolling/nicosia/ScrollingTreeScrollingNodeDelegateNicosia.cpp: (WebCore::ScrollingTreeScrollingNodeDelegateNicosia::handleWheelEvent): * platform/ScrollAnimator.cpp: (WebCore::ScrollAnimator::ScrollAnimator): (WebCore::ScrollAnimator::~ScrollAnimator): (WebCore::ScrollAnimator::scroll): (WebCore::ScrollAnimator::resnapAfterLayout): (WebCore::ScrollAnimator::handleWheelEvent): (WebCore::ScrollAnimator::updateActiveScrollSnapIndexForOffset): (WebCore::ScrollAnimator::notifyPositionChanged): (WebCore::ScrollAnimator::pageScaleFactor const): (WebCore::ScrollAnimator::scrollControllerAnimationTimerFired): (WebCore::ScrollAnimator::adjustScrollOffsetForSnappingIfNeeded): * platform/ScrollAnimator.h: * platform/ScrollController.cpp: (WebCore::ScrollController::usesScrollSnap const): (WebCore::ScrollController::resnapAfterLayout): * platform/ScrollController.h: * platform/ScrollSnapAnimatorState.cpp: * platform/ScrollSnapAnimatorState.h: * platform/ScrollableArea.cpp: (WebCore::ScrollableArea::doPostThumbMoveSnapping): * platform/ScrollableArea.h: * platform/mac/ScrollAnimatorMac.mm: (WebCore::ScrollAnimatorMac::isScrollSnapInProgress const): (WebCore::ScrollAnimatorMac::didBeginScrollGesture const): (WebCore::ScrollAnimatorMac::didEndScrollGesture const): (WebCore::gestureShouldBeginSnap): (WebCore::ScrollAnimatorMac::allowsVerticalStretching const): (WebCore::ScrollAnimatorMac::allowsHorizontalStretching const): * platform/mac/ScrollController.mm: (WebCore::ScrollController::stopAllTimers): (WebCore::ScrollController::handleWheelEvent): (WebCore::ScrollController::isScrollSnapInProgress const): (WebCore::ScrollController::updateScrollSnapAnimatingState): * rendering/RenderBox.cpp: (WebCore::RenderBox::willBeDestroyed): (WebCore::RenderBox::styleWillChange): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateScrollSnapPropertiesWithFrameView const): * rendering/RenderLayerCompositor.h: * rendering/RenderLayerModelObject.cpp: (WebCore::RenderLayerModelObject::styleDidChange): * rendering/RenderLayerScrollableArea.cpp: (WebCore::RenderLayerScrollableArea::updateScrollInfoAfterLayout): (WebCore::RenderLayerScrollableArea::isScrollSnapInProgress const): * rendering/RenderLayerScrollableArea.h: * rendering/RenderView.cpp: (WebCore::RenderView::unregisterBoxWithScrollSnapPositions): * rendering/RenderView.h: * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::changeRequiresLayout const): (WebCore::RenderStyle::setScrollPaddingRight): (WebCore::RenderStyle::hasSnapPosition const): * rendering/style/RenderStyle.h: * rendering/style/RenderStyleConstants.cpp: (WebCore::operator<<): * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): (WebCore::StyleRareNonInheritedData::operator== const): * rendering/style/StyleRareNonInheritedData.h: * rendering/style/StyleScrollSnapPoints.h: * style/StyleBuilderConverter.h: * testing/Internals.cpp: (WebCore::Internals::isScrollSnapInProgress): * testing/Internals.h: * testing/Internals.idl: Source/WebKit: * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp: (ArgumentCoder<ScrollingStateScrollingNode>::encode): (ArgumentCoder<ScrollingStateScrollingNode>::decode): (WebKit::dump): * UIProcess/API/ios/WKWebViewIOS.mm: (-[WKWebView scrollViewWillBeginDragging:]): (-[WKWebView scrollViewWillEndDragging:withVelocity:targetContentOffset:]): (-[WKWebView _updateVisibleContentRects]): * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp: (WebKit::RemoteScrollingCoordinatorProxy::resetStateAfterProcessExited): * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h: * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm: * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm: (-[WKScrollingNodeScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]): (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren): * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.h: Source/WTF: * wtf/PlatformEnable.h: Remove the global feature definition. Tools: * Scripts/webkitperl/FeatureList.pm: Remove the option from the list of features. Canonical link: https://commits.webkit.org/239104@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279218 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-24 10:49:27 +00:00
2021-06-24 Martin Robinson <mrobinson@webkit.org>
[css-scroll-snap] Remove ENABLE_SCROLL_SNAP compile-time option
https://bugs.webkit.org/show_bug.cgi?id=227067
Reviewed by Simon Fraser.
Remove compile-time ENABLE_SCROLL_SNAP configuration option.
* wtf/PlatformEnable.h: Remove the global feature definition.
2021-06-23 Mark Lam <mark.lam@apple.com>
Base Options::useWebAssemblyFastMemory's default value on Gigacage::hasCapacityToUseLargeGigacage.
https://bugs.webkit.org/show_bug.cgi?id=227328
Reviewed by Saam Barati.
Provide a Gigacage::hasCapacityToUseLargeGigacage value for when !GIGACAGE_ENABLED.
* wtf/Gigacage.h:
Add a new pattern to instruction selector to utilize UBFIZ supported by ARM64 https://bugs.webkit.org/show_bug.cgi?id=227204 Patch by Yijia Huang <yijia_huang@apple.com> on 2021-06-23 Reviewed by Filip Pizlo. Source/JavaScriptCore: This patch includes three parts: A) Add UBFIZ to instruction selector. B) Fix UBFX, introduced in https://bugs.webkit.org/show_bug.cgi?id=226984, to match all patterns. C) Fix error condition in one strength reduction introduced in https://bugs.webkit.org/show_bug.cgi?id=227138. Part A Unsigned Bitfield Insert in Zero(UBFIZ), supported by ARM64, zeros the destination register and copies any number of contiguous bits from a source register into any position in the destination register. The instruction selector can utilize this to lowering certain patterns in B3 IR before further Air optimization. Given the operation: ubfiz d, n, lsb, width This is equivalent to "d = (n << lsb) & (((1 << width) - 1) << lsb)". Since wasm introduces constant folding, then the matched patterns would be: 1.1 d = (n << lsb) & maskShift 1.2 d = maskShift & (n << lsb) 2.1 d = (n & mask) << lsb 2.2 d = (mask & n) << lsb Where: maskShift = mask << lsb mask = (1 << width) - 1 To make the pattern matching in instruction selection beneficial to JIT, these constraints should be introduced: 1. 0 <= lsb < datasize 2. 0 < width < datasize 3. lsb + width <= datasize Choose (n & mask) << lsb as the canonical form and introduce a strength reduction. Turn this: (n << lsb) & maskShift Into this: (n & mask) << lsb Given B3 IR: Int @0 = ArgumentReg(%x0) Int @1 = lsb Int @2 = 0b0110 Int @3 = Shl(@0, @1) Int @4 = BitAnd(@3, @2) Void@5 = Return(@4, Terminal) Before Adding UBFIZ Pattern: // Old optimized AIR Lshift %x0, $62, %x0, @3 And 0b0110, %x0, %x0, @4 Ret %x0, @5 After Adding UBFIZ Pattern: // New optimized AIR Ubfiz %x0, lsb, 2, %x0, @4 Ret %x0, @5 Part B Fix UBFX to match both patterns: dest = (src >> lsb) & mask dest = mask & (src >> lsb) Where: 1. mask = (1 << width) - 1 2. 0 <= lsb < datasize 3. 0 < width < datasize 4. lsb + width <= datasize Part C Fix one B3 strength reduction. Turn this: (src >> shiftAmount) & mask Into this: src >> shiftAmount With updated constraints: 1. mask = (1 << width) - 1 2. 0 <= shiftAmount < datasize 3. 0 < width < datasize 4. shiftAmount + width >= datasize * assembler/MacroAssemblerARM64.h: (JSC::MacroAssemblerARM64::ubfiz32): (JSC::MacroAssemblerARM64::ubfiz64): * assembler/testmasm.cpp: (JSC::testUbfiz32): (JSC::testUbfiz64): * b3/B3LowerToAir.cpp: * b3/air/AirOpcode.opcodes: * b3/testb3.h: * b3/testb3_2.cpp: (testUbfx32ArgLeft): (testUbfx32ArgRight): (testUbfx64ArgLeft): (testUbfx64ArgRight): (testUbfiz32ArgLeft): (testUbfiz32ArgRight): (testUbfiz64ArgLeft): (testUbfiz64ArgRight): (addBitTests): (testUbfx32): Deleted. (testUbfx32PatternMatch): Deleted. (testUbfx64): Deleted. (testUbfx64PatternMatch): Deleted. Source/WTF: Add functions to count the consecutive zero bits (trailing) on the right with modulus division and lookup. Reference: Bit Twiddling Hacks. * wtf/MathExtras.h: (WTF::countTrailingZeros): Canonical link: https://commits.webkit.org/239084@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-23 22:09:31 +00:00
2021-06-23 Yijia Huang <yijia_huang@apple.com>
Add a new pattern to instruction selector to utilize UBFIZ supported by ARM64
https://bugs.webkit.org/show_bug.cgi?id=227204
Reviewed by Filip Pizlo.
Add functions to count the consecutive zero bits (trailing) on the
right with modulus division and lookup. Reference: Bit Twiddling Hacks.
* wtf/MathExtras.h:
(WTF::countTrailingZeros):
2021-06-23 Kate Cheney <katherine_cheney@apple.com>
Migrate App Privacy Report code from WebKitAdditions
https://bugs.webkit.org/show_bug.cgi?id=227045
<rdar://problem/74333287>
Reviewed by Alex Christensen.
Update compile flag naming to align with the App Privacy Report
feature. Added a new check for Symptoms for a simpler, more clear
check.
* wtf/PlatformEnableCocoa.h:
* wtf/PlatformHave.h:
[iOS] Adopt new date picker presentation SPI https://bugs.webkit.org/show_bug.cgi?id=227221 <rdar://problem/77930086> Reviewed by Wenson Hsieh. Source/WebKit: In native applications, tapping on a compact UIDatePicker presents an inline picker using _UIDatePickerOverlayPresentation. To avoid maintaining our own presentation logic, and to better match the native presentation, use _UIDatePickerOverlayPresentation when tapping on a date/time input in WebKit. Covered by existing tests. * Platform/spi/ios/UIKitSPI.h: Declare the SPI rather than importing the header directly, as the _UIDatePickerOverlayAnchor enum is not available in all SDKs with the header. * UIProcess/ios/forms/WKDateTimeInputControl.mm: (-[WKDateTimePickerViewController initWithDatePicker:]): (-[WKDateTimePickerViewController setDelegate:]): (-[WKDateTimePicker initWithView:datePickerMode:]): Create the UIDatePicker here so it can be shared by the old context menu presentation and the new overlay presentation. (-[WKDateTimePicker handleDatePickerPresentationDismissal]): (-[WKDateTimePicker removeDatePickerPresentation]): `accessoryDone` eventually removes the presentation. If the date picker is already being dismissed, do not dismiss it without an animation. For programmatic dismissal (using blur()) this method is called prior to `accessoryDone`, in which case we force dismissal without animation. (-[WKDateTimePicker dateTimePickerViewControllerDidPressResetButton:]): (-[WKDateTimePicker dateTimePickerViewControllerDidPressDoneButton:]): (-[WKDateTimePicker showDateTimePicker]): (-[WKDateTimePicker datePickerChanged:]): (-[WKDateTimePicker reset:]): (-[WKDateTimePicker done:]): (-[WKDateTimePicker dealloc]): (-[WKDateTimePicker _timeZoneOffsetFromGMT:]): (-[WKDateTimePicker dateFormatterForPicker]): (-[WKDateTimePicker _dateChangedSetAsNumber]): (-[WKDateTimePicker _dateChangedSetAsString]): (-[WKDateTimePicker setDateTimePickerToInitialValue]): (-[WKDateTimePicker controlBeginEditing]): (-[WKDateTimePicker controlEndEditing]): (-[WKDateTimePicker calendarType]): (-[WKDateTimePicker hour]): (-[WKDateTimePicker minute]): (-[WKDateTimePicker setHour:minute:]): Source/WTF: * wtf/PlatformHave.h: Add HAVE(UIDATEPICKER_OVERLAY_PRESENTATION) and HAVE(UITOOLBAR_STANDARD_APPEARANCE). LayoutTests: * fast/forms/ios/constant-scroll-area-when-moving-focus-between-fields.html: Re-order the call to wait for the keyboard to dismiss since the presentation SPI doesn't tell us exactly when the presentation animation is complete. The other alternative was to add a manual delay, however, re-ordering the calls is safe and preserves the original test behavior. Canonical link: https://commits.webkit.org/239077@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279181 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-23 20:02:35 +00:00
2021-06-23 Aditya Keerthi <akeerthi@apple.com>
[iOS] Adopt new date picker presentation SPI
https://bugs.webkit.org/show_bug.cgi?id=227221
<rdar://problem/77930086>
Reviewed by Wenson Hsieh.
* wtf/PlatformHave.h:
Add HAVE(UIDATEPICKER_OVERLAY_PRESENTATION) and HAVE(UITOOLBAR_STANDARD_APPEARANCE).
Improve more of the CSS list style implementations https://bugs.webkit.org/show_bug.cgi?id=227206 Reviewed by Antti Koivisto. Source/WebCore: Added support for 12 new values for list-style-type: disclosure-closed, disclosure-open, ethiopic-numeric, japanese-formal, japanese-informal, korean-hangul-formal, korean-hanja-formal, korean-hanja-informal, simp-chinese-formal, simp-chinese-informal, trad-chinese-informal, and trad-chinese-formal. Improved implementation to match specification more closely for a few existing values for list-style-type: armenian, cjk-ideographic, hebrew, lower-armenian, lower-roman, upper-armenian, and upper-roman. Fixed a rendering issue where we would position list items incorrectly in list-style-position:inside cases because of measuring the list marker widths and the list marker suffix widths separately and adding them instead of measuring them together. This was causing some of the Web Platform Tests, done using ref tests, to fail. * accessibility/AccessibilityObject.cpp: (WebCore::listMarkerTextForNode): Updated since RenderListItem::markerTextWithSuffix now returns a StringView. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::stringValue const): Updated to call RenderListMarker::textWithoutSuffix. * accessibility/atk/WebKitAccessibleHyperlink.cpp: (rangeLengthForObject): Ditto. * accessibility/atk/WebKitAccessibleInterfaceText.cpp: (accessibilityObjectLength): Ditto. (webkitAccessibleTextGetText): Updated since RenderListItem::markerTextWithSuffix now returns a StringView. * css/CSSPrimitiveValueMappings.h: (WebCore::toCSSValueID): Factored this out into a separate helper. Also made it take advantage of the relationship between the enumeration and the CSS value keywords that the code in the other direction already was relying on so we don't have to list all the keywords. (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Refactored to call the toCSSValueID function. * css/CSSValueKeywords.in: Added 12 new list-type-style constants: disclosure-open, disclosure-closed, japanese-informal, japanese-formal, korean-hangul-formal, korean-hanja-informal, korean-hanja-formal, simp-chinese-informal, simp-chinese-formal, trad-chinese-informal, trad-chinese-formal, and ethiopic-numeric. * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::isPredefinedCounterStyle): Updated since the last predefined counter style is EthiopicNumeric. * rendering/RenderListItem.cpp: (WebCore::RenderListItem::markerTextWithoutSuffix const): Renamed from markerText, and changed to return a StringView. (WebCore::RenderListItem::markerTextWithSuffix const): Return a StringView. * rendering/RenderListItem.h: Updated for the above. * rendering/RenderListMarker.cpp: (WebCore::toRoman): Deleted. (WebCore::toAlphabeticOrNumeric): Tweaked to use compile time instead of runtime checks for alphabetic vs. numeric. (WebCore::toSymbolic): Updated for above. (WebCore::toAlphabetic): Ditto. (WebCore::toNumeric): Ditto. (WebCore::toHebrewUnder1000): Deleted. (WebCore::toHebrew): Deleted. (WebCore::toArmenianUnder10000): Deleted. (WebCore::toArmenian): Deleted. (WebCore::toGeorgian): Deleted. (WebCore::toCJKIdeographic): Added handling for negative numbers and also tweaked coding style a bit. (WebCore::toPredefinedAdditiveSystem): Added. Implements the additive system concept, which we use below to re-implement Hebrew, Armenian, Georgian, Japanese, and Korean styles. (WebCore::toEthiopicNumeric): Added. (WebCore::effectiveListMarkerType): Added the new styles. Also updated the allowable values for CJKIdeographic to allow negative numbers, and for Hebrew to no longer allow 0 or numbers over 10999. Also sorted the sections by the name of the first list style type in each section. (WebCore::listMarkerSuffix): Changed to return a StringView instead of a UChar, and include the trailing space. Choose the suffix based on the specified type and not the effective type, so fallback does not cause the suffix to fall back. Added the new types. (WebCore::suffixRequiresSpace): Deleted. (WebCore::listMarkerText): Added implementations for all the new types. Also updated the implementation of CJKIdeographic, LowerRoman, UpperRoman, Armenian, UpperArmenian, LowerArmenian, Georgian, and Hebrew to match a newer CSS specification draft, and in most cases was able to use toPredefinedAdditiveSystem instead of language-specific functions. (WebCore::RenderListMarker::createInlineBox): Stop using the isText function, which was only used here. (WebCore::RenderListMarker::paint): Updated for the name change of relativeMarkerRect. Removed unneeded special case for ListStyleType::None. Use the new RenderListMarker::textRun function, moving all the code that deals with direction and suffix in there. (WebCore::reversed): Added. Helper used by textRun. (WebCore::RenderListMarker::textRun const): Added. Composes a TextRun for drawing or measuring text. By using the same function in all those places, we guarantee we measure the text together instead of in pieces, which fixes some layout errors leading to test failures that measuring separately and adding the results together was causing. (WebCore::RenderListMarker::addOverflowFromListMarker): Use the data member m_lineOffsetForListItem instead of the lineOffsetForListItem function, which was only used here. (WebCore::RenderListMarker::updateMarginsAndContent): Moved the check of preferredLogicalWidthsDirty and the comment about it here. (WebCore::RenderListMarker::updateContent): Moved check of preferredLogicalWidthsDirty out of this function since one caller asserts it, and so the other caller can do the check itself. Added code to set m_textWithSuffix, m_textWithoutSuffixLength, and m_textIsLeftToRightDirection. Removed unneeded special cases for ListStyleType::None, Circle, Disc, and Square, which are all handled correctly by the main algorithm. Added a FIXME about the inadequacy of our bidi algorithm implementation for the general case. (WebCore::RenderListMarker::computePreferredLogicalWidths): Use the new textRun function, allowing us to remove some special case code, including the special cases for ListStyleType::None, Asterisks, Footnotes, and String. (WebCore::RenderListMarker::updateMargins): Removed unneeded special case for ListStyleType::None, and updated string empty checks for the new name of the m_textWithSuffix data member. (WebCore::RenderListMarker::suffix const): Deleted. (WebCore::RenderListMarker::relativeMarkerRect): Renamed from getRelativeMarkerRect. Use the new textRun function, allowing us to remove some special case code, including the special cases for ListTyleType::None, Asterisks, Footnotes, and String. (WebCore::RenderListMarker::textWithoutSuffix const): Added. * rendering/RenderListMarker.h: Marked functions as final instead of just override. Got rid of unneeded suffix and lineOffsetForListItem functions. Renamed text ot textWithoutSuffix and added textWithSuffix. Added textRun private member function. Replaced m_text with m_textWithSuffix, m_textWithoutSuffixLength, and m_textIsLeftToRightDirection. * rendering/RenderTreeAsText.cpp: (WebCore::RenderTreeAsText::writeRenderObject): Use textWithoutSuffix. (WebCore::markerTextForListItem): Use markerTextWithoutSuffix. * rendering/style/RenderStyleConstants.cpp: (WebCore::operator<<): Use getValueName from CSSValueKeywords.h and toCSSValueID to avoid repeating the names of all the list style types here. * rendering/style/RenderStyleConstants.h: Added the 12 new list style types. Source/WTF: * wtf/unicode/CharacterNames.h: Added blackDown/Left/RightPointingSmallTriangle. LayoutTests: * TestExpectations: Expect about 50 more css-counter-styles tests to pass. * fast/lists/li-values-expected.txt: Updated to expect newly specified behavior. When this test was written, the specification was different. * fast/lists/li-values.html: Ditto. * fast/lists/w3-css3-list-styles-fallback-style-expected.txt: Ditto. Also many of these were expecting failures. * fast/lists/w3-css3-list-styles-fallback-style.html: Ditto. * fast/lists/w3-css3-list-styles-numeric-expected.txt: Ditto. Also added tests for ethiopic-numeric. * fast/lists/w3-css3-list-styles-numeric.html: Ditto. * fast/lists/w3-list-styles-expected.txt: Updated expected result for 0 in Hebrew. * platform/mac/TestExpectations: Moved some image failure expectations from here to the main TestExpectations because they do not seem to be platform-specific. Canonical link: https://commits.webkit.org/239062@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279165 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-23 01:33:57 +00:00
2021-06-21 Darin Adler <darin@apple.com>
Improve more of the CSS list style implementations
https://bugs.webkit.org/show_bug.cgi?id=227206
Reviewed by Antti Koivisto.
* wtf/unicode/CharacterNames.h: Added blackDown/Left/RightPointingSmallTriangle.
[Live Text] [macOS] Add an internal option to disable inline text selection in images https://bugs.webkit.org/show_bug.cgi?id=227265 rdar://79460142 Reviewed by Tim Horton. Source/WebCore: Add support for the new feature flag. See WebKit/ChangeLog for more details. * en.lproj/Localizable.strings: Add additional localizable strings to represent each of the possible titles for the "Quick Look"/"Look Up" context menu item. When inline text selection is enabled, the item shows up as "Look Up", and is only added if we actually discover visual search results. However, when inline text selection is disabled, this item will always be added to the context menu under the title "Quick Look", and will be retitled to either "Look Up in Quick Look" or "Select Text in Quick Look" once either visual search results or text is recognized, respectively. * page/ContextMenuController.cpp: (WebCore::ContextMenuController::contextMenuItemSelected): (WebCore::ContextMenuController::populate): In the case where inline text selection is disabled, add the Quick Look item to the end of the context menu, after a separator. Note that in the case where inline text selection is enabled, it doesn't actually matter where we add this item, since it is automatically removed and only reinserted if we find visual search results for the image. (WebCore::ContextMenuController::checkOrEnableIfNeeded const): Rename the existing ContextMenuItemTagLookUpImage to ContextMenuItemTagQuickLookImage, since it is no longer limited to the visual look up feature. * page/EventHandler.cpp: (WebCore::EventHandler::updateMouseEventTargetNode): Consult the feature flag and avoid kicking off the text recognition timer if inline text selection is disabled. * platform/ContextMenuItem.cpp: (WebCore::isValidContextMenuAction): * platform/ContextMenuItem.h: * platform/LocalizedStrings.h: * platform/cocoa/LocalizedStringsCocoa.mm: (WebCore::contextMenuItemTagQuickLookImage): (WebCore::contextMenuItemTagQuickLookImageForTextSelection): (WebCore::contextMenuItemTagQuickLookImageForVisualSearch): Source/WebKit: Refactor Live Text and Visual Look Up logic, such that the ability to select text inside of images is behind an internal feature flag that can be toggled at runtime. When Live Text is disabled, we'll unconditionally show the "Look Up" context menu action using the more generic title "Quick Look". This "Quick Look" action is then retitled to either "Look Up in Quick Look" or "Select Text in Quick Look" once image analysis completes. * Shared/API/c/WKSharedAPICast.h: (WebKit::toAPI): (WebKit::toImpl): Rename ContextMenuItemTagLookUpImage to ContextMenuItemTagQuickLookImage. * UIProcess/Cocoa/QuickLookPreviewActivity.h: Copied from Source/WebKit/UIProcess/mac/WKQuickLookPreviewController.h. Move this enum out of WKQuickLookPreviewController.h, such that we can use and import it in non-Cocoa headers and implementation files. * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::computeHasImageAnalysisResults): Rename `computeHasVisualSearchResults` to `computeHasImageAnalysisResults`, and allow it to take a flag to indicate whether or not it should request text recognition results or visual search results. We use this for the "Quick Look" context menu action when inline text selection is disabled, in order to retitle the item to "Select Text in Quick Look". (WebKit::WebViewImpl::computeHasVisualSearchResults): Deleted. * UIProcess/PageClient.h: (WebKit::PageClient::computeHasImageAnalysisResults): (WebKit::PageClient::computeHasVisualSearchResults): Deleted. * UIProcess/WebContextMenuProxy.h: (WebKit::WebContextMenuProxy::quickLookPreviewActivity const): Add a flag to WebContextMenuProxy to determine what initial activity to use when presenting the QuickLook preview panel after selecting the ContextMenuItemTagQuickLookImage item. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::contextMenuItemSelected): (WebKit::WebPageProxy::computeHasImageAnalysisResults): (WebKit::WebPageProxy::computeHasVisualSearchResults): Deleted. * UIProcess/WebPageProxy.h: * UIProcess/mac/PageClientImplMac.h: * UIProcess/mac/PageClientImplMac.mm: (WebKit::PageClientImpl::computeHasImageAnalysisResults): (WebKit::PageClientImpl::computeHasVisualSearchResults): Deleted. * UIProcess/mac/WKQuickLookPreviewController.h: * UIProcess/mac/WKQuickLookPreviewController.mm: * UIProcess/mac/WebContextMenuProxyMac.h: * UIProcess/mac/WebContextMenuProxyMac.mm: (WebKit::menuItemIdentifier): (WebKit::WebContextMenuProxyMac::getContextMenuFromItems): Add logic to either remove and reinsert the "Look Up" context menu action (if inline text selection in images is enabled), or to promote the "Quick Look" context menu action to either "Select Text in Quick Look" or "Look Up in Quick Look" in the case where inline text selection in images is disabled. Note that when inline text selection in images is disabled, we'll first check for visual search results before checking for text. This is because visual search results will take precedence over text selection (i.e., we'll show "Look Up in Quick Look" even if both visual search results and text is present), so we can avoid performing text analysis in the case where we already found visual search results. (WebKit::WebContextMenuProxyMac::insertOrUpdateQuickLookImageItem): (WebKit::WebContextMenuProxyMac::updateQuickLookContextMenuItemTitle): Add a helper method to find and update the title of the NSMenuItem corresponding to ContextMenuItemTagQuickLookImage. See `getContextMenuFromItems` above for more details. * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::handleContextMenuQuickLookImage): (WebKit::WebPageProxy::handleContextMenuLookUpImage): Deleted. Rename this to `handleContextMenuQuickLookImage`, and have it take an argument to indicate whether the QuickLook panel should start out in Visual Look Up mode. * WebKit.xcodeproj/project.pbxproj: Source/WebKitLegacy/mac: Rename ContextMenuItemTagLookUpImage to ContextMenuItemTagQuickLookImage. * WebView/WebHTMLView.mm: (toTag): Source/WTF: Add a new internal feature flag. See WebKit ChangeLog for more details. * Scripts/Preferences/WebPreferencesInternal.yaml: Canonical link: https://commits.webkit.org/239061@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279164 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-23 01:32:54 +00:00
2021-06-22 Wenson Hsieh <wenson_hsieh@apple.com>
[Live Text] [macOS] Add an internal option to disable inline text selection in images
https://bugs.webkit.org/show_bug.cgi?id=227265
rdar://79460142
Reviewed by Tim Horton.
Add a new internal feature flag. See WebKit ChangeLog for more details.
* Scripts/Preferences/WebPreferencesInternal.yaml:
2021-06-22 Fujii Hironori <Hironori.Fujii@sony.com>
[GLib] Rewrite NetworkCache::Data::adoptMap without FileSystem::MappedFileData::leakHandle and munmap
https://bugs.webkit.org/show_bug.cgi?id=227017
Reviewed by Carlos Garcia Campos.
* wtf/FileSystem.h: MappedFileData::leakHandle is used only if PLATFORM(COCOA) now.
jitCompileAndSetHeuristics shouldn't return true when we fail to compile https://bugs.webkit.org/show_bug.cgi?id=227155 Reviewed by Tadeu Zagallo. JSTests: * microbenchmarks/interpreter-wasm.js: * microbenchmarks/memcpy-wasm-large.js: * microbenchmarks/memcpy-wasm-medium.js: * microbenchmarks/memcpy-wasm-small.js: * microbenchmarks/memcpy-wasm.js: * stress/wasm-error-message-cross-threads.js: Source/JavaScriptCore: jitCompileAndSetHeuristics should only return true when we've successfully compiled a baseline JIT CodeBlock. However, with the rewrite to using a unified JIT worklist, the code was changed to returning true when a compilation finished, regardless of it being successful or not. This patch fixes that error. This bug was found by our existing executable allocation fuzzer, but at a low hit rate. That fuzzer only ran a single test case. This patch also introduces a new form of the executable fuzzer where we fail to allocate JIT code randomly, and the crash manifests more reliably. And this patch also hooks the new fuzzer into more JSC stress tests. * dfg/DFGLICMPhase.cpp: (JSC::DFG::LICMPhase::run): * jit/ExecutableAllocationFuzz.cpp: (JSC::doExecutableAllocationFuzzing): * jsc.cpp: (runJSC): * llint/LLIntSlowPaths.cpp: (JSC::LLInt::jitCompileAndSetHeuristics): (JSC::LLInt::LLINT_SLOW_PATH_DECL): * runtime/OptionsList.h: Source/WTF: * wtf/WeakRandom.h: Tools: * Scripts/run-jsc-stress-tests: Canonical link: https://commits.webkit.org/239041@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279126 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-22 17:48:42 +00:00
2021-06-22 Saam Barati <sbarati@apple.com>
jitCompileAndSetHeuristics shouldn't return true when we fail to compile
https://bugs.webkit.org/show_bug.cgi?id=227155
Reviewed by Tadeu Zagallo.
* wtf/WeakRandom.h:
2021-06-22 Truitt Savell <tsavell@apple.com>
Unreviewed, reverting r279083.
Broke Mac Builds
Reverted changeset:
"Migrate App Privacy Report code from WebKitAdditions"
https://bugs.webkit.org/show_bug.cgi?id=227045
https://commits.webkit.org/r279083
Functions dispatched to WorkQueue are sometimes destroyed in the calling thread due to block refcounting https://bugs.webkit.org/show_bug.cgi?id=227160 Patch by Kimmo Kinnunen <kkinnunen@apple.com> on 2021-06-22 Reviewed by Antti Koivisto. Source/WebKit: As an example, remove one workaround mutability of dispatched function and nullptr assignment that was needed for working around WorkQueue::dispatch bug where the dispatched function was not always destroyed in the queue. * Shared/mac/MediaFormatReader/MediaTrackReader.cpp: (WebKit::MediaTrackReader::finalize): Source/WTF: WorkQueue::dispatch Function bodies always execute in the thread of target queue. However, sometimes the Function destruction would happen in the dispatched-from thread. This is not what the WorkQueue::dispatch callers expect. Implement some of the WorkQueue::dispatch* in terms of dispatch_..._f() variants which take a function and context pointer instead of a block. Blocks are reference counted objects without the ability to pass the ownership of the reference. For dispatch case, it means that caller will need to hold the reference while dispatch_...() returns. In thread contention cases the called block might complete and reference be dropped in the thread of the queue before the dispatched-from thread would drop its reference to the block. This would cause the dispatched Function to be destroyed in the dispatched-from thread. * wtf/cocoa/WorkQueueCocoa.cpp: (WTF::dispatchWorkItem): (WTF::WorkQueue::dispatch): (WTF::WorkQueue::dispatchAfter): (WTF::WorkQueue::dispatchSync): Tools: Test that the Function passed to WorkQueue::dispatch is always destroyed in the WorkQueue. Test by using the knowledge that WorkQueues use threads. Start up many WorkQueues to create more thread contention to ensure that the dispatched-from thread is sometimes not run while the thread of the queue finishes processing the dispatch. * TestWebKitAPI/Tests/WTF/WorkQueue.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/239032@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279115 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-22 13:25:03 +00:00
2021-06-22 Kimmo Kinnunen <kkinnunen@apple.com>
Functions dispatched to WorkQueue are sometimes destroyed in the calling thread due to block refcounting
https://bugs.webkit.org/show_bug.cgi?id=227160
Reviewed by Antti Koivisto.
WorkQueue::dispatch Function bodies always execute in the thread of target
queue. However, sometimes the Function destruction would happen in the
dispatched-from thread. This is not what the WorkQueue::dispatch callers
expect.
Implement some of the WorkQueue::dispatch* in terms of dispatch_..._f()
variants which take a function and context pointer instead of a block.
Blocks are reference counted objects without the ability to pass the
ownership of the reference. For dispatch case, it means that caller will
need to hold the reference while dispatch_...() returns. In thread
contention cases the called block might complete and reference be
dropped in the thread of the queue before the dispatched-from thread
would drop its reference to the block. This would cause the dispatched
Function to be destroyed in the dispatched-from thread.
* wtf/cocoa/WorkQueueCocoa.cpp:
(WTF::dispatchWorkItem):
(WTF::WorkQueue::dispatch):
(WTF::WorkQueue::dispatchAfter):
(WTF::WorkQueue::dispatchSync):
Adjust `fetch` port blocking for ports 990, 989 https://bugs.webkit.org/show_bug.cgi?id=226971 <rdar://problem/79287147> Reviewed by Geoffrey Garen. LayoutTests/imported/w3c: Re-sync some WPT tests from upstream d41f24fb67a2d65c to gain test coverage from: - https://github.com/web-platform-tests/wpt/pull/29343 * web-platform-tests/fetch/api/request/request-bad-port.any-expected.txt: * web-platform-tests/fetch/api/request/request-bad-port.any.js: * web-platform-tests/fetch/api/request/request-bad-port.any.worker-expected.txt: * web-platform-tests/tools/wptserve/wptserve/utils.py: (isomorphic_decode): (isomorphic_encode): (is_bad_port): (http2_compatible): * web-platform-tests/websockets/Create-blocked-port.any-expected.txt: * web-platform-tests/websockets/Create-blocked-port.any.js: * web-platform-tests/websockets/Create-blocked-port.any.worker-expected.txt: * web-platform-tests/websockets/constants.sub.js: Added. (url_has_variant): (else.url_has_flag): (url_has_flag): (IsWebSocket): (CreateWebSocketNonAbsolute): (CreateWebSocketNonWsScheme): (CreateWebSocketNonAsciiProtocol): (CreateWebSocketWithAsciiSep): (CreateWebSocketWithBlockedPort): (CreateWebSocketWithSpaceInUrl): (CreateWebSocketWithSpaceInProtocol): (CreateWebSocketWithRepeatedProtocols): (CreateWebSocketWithRepeatedProtocolsCaseInsensitive): (CreateWebSocket): Source/WTF: Prevent connecting to ports 989 & 990 as per: - https://github.com/whatwg/fetch/pull/1250 * wtf/URL.cpp: (WTF::portAllowed): Canonical link: https://commits.webkit.org/239016@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279099 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-22 01:24:46 +00:00
2021-06-21 Chris Dumez <cdumez@apple.com>
Adjust `fetch` port blocking for ports 990, 989
https://bugs.webkit.org/show_bug.cgi?id=226971
<rdar://problem/79287147>
Reviewed by Geoffrey Garen.
Prevent connecting to ports 989 & 990 as per:
- https://github.com/whatwg/fetch/pull/1250
* wtf/URL.cpp:
(WTF::portAllowed):
2021-06-21 Fujii Hironori <Hironori.Fujii@sony.com>
[WinCairo] Turn ENABLE_SHAREABLE_RESOURCE on
https://bugs.webkit.org/show_bug.cgi?id=227011
Reviewed by Don Olmstead.
Added a new member m_fileMapping to MappedFileData to store a file
mapping object handle to create a SharedMemory from a
MappedFileData on Windows.
Conditioned out MappedFileData::leakHandle() if OS(WINDOWS). And,
removed unmapViewOfFile(). Destruction of MappedFileData should be
done by ~MappedFileData.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::MappedFileData::~MappedFileData):
(WTF::FileSystemImpl::MappedFileData::mapFileHandle):
(WTF::FileSystemImpl::unmapViewOfFile): Deleted.
* wtf/FileSystem.h:
(WTF::FileSystemImpl::MappedFileData::fileMapping const):
(WTF::FileSystemImpl::MappedFileData::MappedFileData):
(WTF::FileSystemImpl::MappedFileData::operator=):
* wtf/win/FileSystemWin.cpp:
(WTF::FileSystemImpl::MappedFileData::~MappedFileData):
(WTF::FileSystemImpl::MappedFileData::mapFileHandle):
(WTF::FileSystemImpl::unmapViewOfFile): Deleted.
2021-06-21 Kate Cheney <katherine_cheney@apple.com>
Migrate App Privacy Report code from WebKitAdditions
https://bugs.webkit.org/show_bug.cgi?id=227045
<rdar://problem/74333287>
Reviewed by Alex Christensen.
Update compile flag naming to align with the App Privacy Report
feature.
* wtf/PlatformEnableCocoa.h:
2021-06-21 18:48:29 +00:00
2021-06-21 Kimmo Kinnunen <kkinnunen@apple.com>
makeUnique cannot be used to instantiate function-local classes
https://bugs.webkit.org/show_bug.cgi?id=227163
Reviewed by Antti Koivisto.
Make WTF_MAKE_FAST_ALLOCATED and similar macros work in function
local classes. Mark the typedef that is used to enforce semicolon
after the macro as unused to avoid unused typedef warning.
Fixes cases where the compiler is able to prove that it sees all the
use sites of the class and the typedef is not used.
* wtf/Compiler.h:
* wtf/FastMalloc.h:
2021-06-21 Philippe Normand <pnormand@igalia.com>
Unreviewed build fix after r279062
* wtf/Span.h:
(std::is_convertible_v<std::remove_pointer_t<decltype):
2021-06-20 Sam Weinig <weinig@apple.com>
Replace Span implementation with one from libc++, which is more spec complient
https://bugs.webkit.org/show_bug.cgi?id=227197
Reviewed by Darin Adler.
* wtf/Span.h:
The tcb span implementation had some SFINAE issues when converting containers
had data() and size() member functions but were not span compatible that were
causing failures. Rather than trying to fix those, this adopts a modified version
of the libc++ span implementation which is more up-to-date.
To fix MSVC compile issues, the as_bytes/as_writable_bytes functions have been
re-implemented to not work around a compile issue seen where using the dynamic_extent
specicialization from the static extent specicialization was failing to compile.
[macOS] Rename WKVisualSearchPreviewController to WKQuickLookPreviewController https://bugs.webkit.org/show_bug.cgi?id=227193 Reviewed by Sam Weinig. Source/WebCore/PAL: Fix up some compiler flags in this SPI header. Instead of using `HAVE(VK_IMAGE_ANALYSIS)` to guard SPI declarations, use the new `HAVE(QUICKLOOK_PREVIEW_ITEM_DATA_PROVIDER)`, `HAVE(QUICKLOOK_ITEM_PREVIEW_OPTIONS)` and `HAVE(QUICKLOOK_PREVIEW_ACTIVITY)` flags. * pal/spi/mac/QuickLookMacSPI.h: Source/WebKit: Rename WKVisualSearchPreviewController to WKQuickLookPreviewController, with the intention of using this logic to implement a new context menu action for opening images in a QuickLook preview panel. See below for more details. * SourcesCocoa.txt: * UIProcess/Cocoa/WebPageProxyCocoa.mm: (WebKit::WebPageProxy::handleContextMenuLookUpImage): Deleted. Move this into WebPageProxyMac.mm, since this is (1) only relevant to macOS, and (2) this logic now requires WKQuickLookPreviewController.h, which WebPageProxyMac.mm already imports. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::acceptsPreviewPanelControl): * UIProcess/WebPageProxy.h: * UIProcess/mac/WKQuickLookPreviewController.h: Renamed from Source/WebKit/UIProcess/mac/WKVisualSearchPreviewController.h. * UIProcess/mac/WKQuickLookPreviewController.mm: Renamed from Source/WebKit/UIProcess/mac/WKVisualSearchPreviewController.mm. (-[WKQuickLookPreviewController initWithPage:imageData:title:imageURL:activity:]): Add QuickLookPreviewActivity, a flag to indicate whether or not WKQuickLookPreviewController should start with QLPreviewActivityVisualSearch or QLPreviewActivityNone. For the time being, we only use this helper object for visual search, so we only pass in QuickLookPreviewActivity::VisualSearch. (-[WKQuickLookPreviewController beginControl:]): (-[WKQuickLookPreviewController endControl:]): (-[WKQuickLookPreviewController closePanelIfNecessary]): (-[WKQuickLookPreviewController isControlling:]): (-[WKQuickLookPreviewController provideDataForItem:]): (-[WKQuickLookPreviewController numberOfPreviewItemsInPreviewPanel:]): (-[WKQuickLookPreviewController previewPanel:previewItemAtIndex:]): (-[WKQuickLookPreviewController previewPanel:initialActivityForItem:]): * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::beginPreviewPanelControl): (WebKit::WebPageProxy::endPreviewPanelControl): (WebKit::WebPageProxy::closeSharedPreviewPanelIfNecessary): (WebKit::WebPageProxy::handleContextMenuLookUpImage): (WebKit::WebPageProxy::showImageInQuickLookPreviewPanel): (WebKit::WebPageProxy::showImageInVisualSearchPreviewPanel): Deleted. * WebKit.xcodeproj/project.pbxproj: Source/WTF: Add some compile-time flags to guard QuickLook SPI declarations. * wtf/PlatformHave.h: Canonical link: https://commits.webkit.org/238980@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279060 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-20 23:22:06 +00:00
2021-06-20 Wenson Hsieh <wenson_hsieh@apple.com>
[macOS] Rename WKVisualSearchPreviewController to WKQuickLookPreviewController
https://bugs.webkit.org/show_bug.cgi?id=227193
Reviewed by Sam Weinig.
Add some compile-time flags to guard QuickLook SPI declarations.
* wtf/PlatformHave.h:
2021-06-20 Sam Weinig <weinig@apple.com>
Adopt Span in SHA1.h
https://bugs.webkit.org/show_bug.cgi?id=227184
Reviewed by Chris Dumez.
Replaces overload of addBytes taking a Vector with ones taking
a Span and add overloads for Span<const std::byte> which all the
others are now implemented in terms of. This is useful since
any Span can be turned into one of type Span<const std::byte>
just by calling asBytes(existingSpan).
This leaves most of the existing overloads in place (though
simplifies them by implementing them as Span contructions),
though we should consider removing some in a separate pass.
* wtf/SHA1.cpp:
* wtf/SHA1.h:
Adopt Span in Base64.h https://bugs.webkit.org/show_bug.cgi?id=227132 Reviewed by Chris Dumez. Replaces overloads taking Vectors with ones taking Spans and add overloads for Span<const std::byte> which all the others are now implemented in terms of. This is useful since any Span can be turned into one of type Span<const std::byte> just by calling asBytes(existingSpan). This leaves most of the existing overloads in place (though simplifies them by implementing them as Span contructions) though we should consider removing some in a separate pass. * wtf/Vector.h: Add value_type typedef so that Vector<T> can be automatically deduced as Span<T>. * wtf/text/CString.h: Add bytes() and bytesInludingNullTerminator() (only the former is used in this patch, but the later will be needed shortly) which return Span<const uint8_t> of the CString. I chose to use an explicit function, rather than making it converible to Span like Vector, because some callers will want the null terminator and some will not. * wtf/text/Base64.cpp: * wtf/text/Base64.h: Canonicalize all input buffers either as a Span<const std::byte> or a StringView, making all the other overloads just forward to one of those two (String -> StringView, everything else -> Span<const std::byte>). Clean up the header a bit by putting all the declarations at the top of the file. Canonical link: https://commits.webkit.org/238971@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279051 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-20 02:05:08 +00:00
2021-06-19 Sam Weinig <weinig@apple.com>
Adopt Span in Base64.h
https://bugs.webkit.org/show_bug.cgi?id=227132
Reviewed by Chris Dumez.
Replaces overloads taking Vectors with ones taking Spans
and add overloads for Span<const std::byte> which all the
others are now implemented in terms of. This is useful since
any Span can be turned into one of type Span<const std::byte>
just by calling asBytes(existingSpan).
This leaves most of the existing overloads in place (though
simplifies them by implementing them as Span contructions)
though we should consider removing some in a separate pass.
* wtf/Vector.h:
Add value_type typedef so that Vector<T> can be automatically
deduced as Span<T>.
* wtf/text/CString.h:
Add bytes() and bytesInludingNullTerminator() (only the former
is used in this patch, but the later will be needed shortly)
which return Span<const uint8_t> of the CString. I chose to use
an explicit function, rather than making it converible to Span
like Vector, because some callers will want the null terminator
and some will not.
* wtf/text/Base64.cpp:
* wtf/text/Base64.h:
Canonicalize all input buffers either as a Span<const std::byte> or
a StringView, making all the other overloads just forward to one of
those two (String -> StringView, everything else -> Span<const std::byte>).
Clean up the header a bit by putting all the declarations at the top of
the file.
[Cocoa] Disable hardware decoding in the WebProcess https://bugs.webkit.org/show_bug.cgi?id=226869 <rdar://77548905> Reviewed by Per Arne Vollan and Simon Fraser. Source/WebCore: Pass kCGImageSourceEnableRestrictedDecoding : kCFBooleanTrue when decoding an image frame. Test: fast/images/heic-as-background-image.html * platform/graphics/cg/ImageDecoderCG.cpp: (WebCore::createImageSourceOptions): Source/WebCore/PAL: SoftLink 1. VTRestrictVideoDecoders from VideoToolbox 2. FigPhotoSupportsHEVCHWDecode from MediaToobox * PAL.xcodeproj/project.pbxproj: * pal/cf/VideoToolboxSoftLink.cpp: * pal/cf/VideoToolboxSoftLink.h: * pal/cocoa/MediaToolboxSoftLink.cpp: * pal/cocoa/MediaToolboxSoftLink.h: * pal/spi/cg/ImageIOSPI.h: * pal/spi/cocoa/VideoToolboxSPI.h: Added. Source/WebKit: Restrict video decoders and disable hardware image decoders. A temp extension is created for the service "com.apple.trustd.agent" to allow temporarily calling FigPhotoSupportsHEVCHWDecode(). This function needs access this service but we have recently closed access to it. FigPhotoSupportsHEVCHWDecode() sets a local static variable by using the service "com.apple.trustd.agent" when it is called for the first time. Our purpose of calling it in this context is to initialize the static variable only. And this is why we do not use its return value. This solution is fragile. If MediaToolbox is changed such that it needs 'com.apple.trustd.agent' while decoding an image, the decoding will fail. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): (WebKit::restrictImageAndVideoDecoders): (WebKit::WebProcess::initializeSandbox): Source/WTF: Add have macros for using: 1. kCGImageSourceEnableRestrictedDecoding 2. VTRestrictVideoDecoders() * wtf/PlatformHave.h: LayoutTests: Add a reference test for rendering the HEIF images. * TestExpectations: * fast/images/heic-as-background-image-expected.html: Added. * fast/images/heic-as-background-image.html: Added. * fast/images/resources/green-400x400.heic: Added. * platform/ios/TestExpectations: * platform/mac/TestExpectations: Canonical link: https://commits.webkit.org/238950@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279030 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-18 04:09:24 +00:00
2021-06-17 Said Abou-Hallawa <said@apple.com>
[Cocoa] Disable hardware decoding in the WebProcess
https://bugs.webkit.org/show_bug.cgi?id=226869
<rdar://77548905>
Reviewed by Per Arne Vollan and Simon Fraser.
Add have macros for using:
1. kCGImageSourceEnableRestrictedDecoding
2. VTRestrictVideoDecoders()
* wtf/PlatformHave.h:
2021-06-17 Mark Lam <mark.lam@apple.com>
Rename numberOfPACBits to maxNumberOfAllowedPACBits.
https://bugs.webkit.org/show_bug.cgi?id=227156
Reviewed by Saam Barati.
* wtf/CagedPtr.h:
Define MacroAssemblerARM64E::numberOfPACBits based on OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH). https://bugs.webkit.org/show_bug.cgi?id=227147 rdar://78785309 Reviewed by Saam Barati. Source/bmalloc: For OS(DARWIN), define BOS_EFFECTIVE_ADDRESS_WIDTH in terms of MACH_VM_MAX_ADDRESS, which is provided by the SDK. This ensures that it is correct for each target OS(DARWIN) platform. * bmalloc/Algorithm.h: (bmalloc::clzConstexpr): (bmalloc::getMSBSetConstexpr): * bmalloc/BPlatform.h: * bmalloc/Gigacage.h: * bmalloc/ObjectTypeTable.h: * bmalloc/Packed.h: Source/JavaScriptCore: * assembler/MacroAssemblerARM64E.h: * bytecode/CodeOrigin.h: * runtime/JSString.h: * runtime/OptionsList.h: Source/WTF: For OS(DARWIN), define OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH) in terms of MACH_VM_MAX_ADDRESS, which is provided by the SDK. This ensures that it is correct for each target OS(DARWIN) platform. Also update an assertion in WTFAssertions.cpp to verify that address bits are less than 48. The purpose of this assertion is to ensure that our 64-bit NaN boxing encoding for JSValues will work. Hence, we should use the encoding limit for pointers of 48 bits. It no longer makes sense to assert based on OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH), because OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH) is defined in terms of MACH_VM_MAX_ADDRESS. * wtf/CagedPtr.h: * wtf/CompactPointerTuple.h: * wtf/PlatformOS.h: * wtf/WTFAssertions.cpp: * wtf/threads/Signals.cpp: Tools: * TestWebKitAPI/Tests/WTF/Packed.cpp: Canonical link: https://commits.webkit.org/238948@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279028 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-18 01:44:42 +00:00
2021-06-17 Mark Lam <mark.lam@apple.com>
Define MacroAssemblerARM64E::numberOfPACBits based on OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH).
https://bugs.webkit.org/show_bug.cgi?id=227147
rdar://78785309
Reviewed by Saam Barati.
For OS(DARWIN), define OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH) in terms of
MACH_VM_MAX_ADDRESS, which is provided by the SDK. This ensures that it is
correct for each target OS(DARWIN) platform.
Also update an assertion in WTFAssertions.cpp to verify that address bits are
less than 48. The purpose of this assertion is to ensure that our 64-bit NaN
boxing encoding for JSValues will work. Hence, we should use the encoding limit
for pointers of 48 bits. It no longer makes sense to assert based on
OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH), because OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH)
is defined in terms of MACH_VM_MAX_ADDRESS.
* wtf/CagedPtr.h:
* wtf/CompactPointerTuple.h:
* wtf/PlatformOS.h:
* wtf/WTFAssertions.cpp:
* wtf/threads/Signals.cpp:
2021-06-17 Fujii Hironori <Hironori.Fujii@sony.com>
[Win] WTF.ParseInteger and WTF.ParseIntegerAllowingTrailingJunk are failing
https://bugs.webkit.org/show_bug.cgi?id=227090
Reviewed by Yusuke Suzuki.
ArithmeticOperations::sub unexpectedly reported an overflow for
the result of std::numeric_limits<ResultType>::min() in MSVC code path.
For example, Checked<int, RecordOverflow>(INT_MIN + 1) - 1 was reported an overflow.
In the case of calculating (lhs - rhs), and lhs < 0 and rhs > 0,
the original code reported an overflow if (rhs > max() + lhs).
Mathematically, this condition checks (lhs - rhs < -max()).
It should use min() instead of max() in this case. It should be
(lhs - rhs < min()) mathematically.
* wtf/CheckedArithmetic.h:
2021-06-17 Alex Christensen <achristensen@webkit.org>
Add assertion in RunLoop::dispatch
https://bugs.webkit.org/show_bug.cgi?id=227154
<rdar://79243769>
Reviewed by Geoff Garen.
This should help us find what is scheduling null functions.
* wtf/RunLoop.cpp:
(WTF::RunLoop::dispatch):
(WTF::RunLoop::dispatchAfter):
2021-06-17 Ben Nham <nham@apple.com>
Remove Mac-specific CPUTime functions
https://bugs.webkit.org/show_bug.cgi?id=227109
Reviewed by Yusuke Suzuki.
There's no reason for the Mac-specific CPU time functions to exist, since getrusage and
clock_gettime work fine on Mac. It's actually slightly more efficient to use the POSIX calls
since getrusage returns CPU time for both current and terminated threads in a single
syscall, while using task_info requires two syscalls to do the same thing.
* WTF.xcodeproj/project.pbxproj:
* wtf/PlatformGTK.cmake:
* wtf/PlatformJSCOnly.cmake:
* wtf/PlatformPlayStation.cmake:
* wtf/PlatformWPE.cmake:
* wtf/cocoa/CPUTimeCocoa.cpp: Removed.
* wtf/posix/CPUTimePOSIX.cpp: Renamed from Source/WTF/wtf/unix/CPUTimeUnix.cpp.
2021-06-17 Tim Horton <timothy_horton@apple.com>
Adopt WKHoverGestureRecognizer
https://bugs.webkit.org/show_bug.cgi?id=227116
<rdar://79442027>
Reviewed by Wenson Hsieh.
* wtf/PlatformEnableCocoa.h:
2021-06-16 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Disable JITCage on macOS until we evaluate performance throughly
https://bugs.webkit.org/show_bug.cgi?id=227104
Reviewed by Mark Lam.
This patch disables JITCage on macOS until we evaluate performance throughly.
* wtf/PlatformEnable.h:
2021-06-16 Alicia Boya García <aboya@igalia.com>
[WTF] DataMutex: Assert on double locking on the same thread
https://bugs.webkit.org/show_bug.cgi?id=227069
Reviewed by Xabier Rodriguez-Calvar.
DataMutex used to use OwnerAwareLock to track what thread is holding
the mutex and emit assertion errors if a thread is found attempting to
lock a mutex held by that same thread. This turns deadlocks into
runtime errors.
OwnerAwareLock was removed when DataMutex got clang thread safety
annotations. This patch reintroduces the same logic, while keeping
thread-safety annotations.
This fixes WTF_DataMutex.DoubleLockDeathTest, which tested this
functionality and was previously regressed.
* wtf/DataMutex.h:
2021-06-06 Darin Adler <darin@apple.com>
Delete some recently-obsoleted files
https://bugs.webkit.org/show_bug.cgi?id=226705
Reviewed by Chris Dumez.
* wtf/CMakeLists.txt: Removed Optional.h.
* wtf/Optional.h: Removed.
Check for "xn--" in any subdomain when parsing URL hosts https://bugs.webkit.org/show_bug.cgi?id=226912 Reviewed by Darin Adler. LayoutTests/imported/w3c: * web-platform-tests/url/a-element-expected.txt: * web-platform-tests/url/a-element-xhtml-expected.txt: * web-platform-tests/url/failure-expected.txt: * web-platform-tests/url/resources/urltestdata.json: * web-platform-tests/url/toascii.window-expected.txt: * web-platform-tests/url/url-constructor-expected.txt: Source/WTF: We have a fast path that doesn't call uidna_nameToASCII if the host is already ASCII. We need to check if the host is properly-punycode-encoded if it starts with "xn--" but we also need to check if any subdomain starts with "xn--" (not just the first one). In order to not regress tests, I needed to also take the fix I did in r256629 and apply it to all use of uidna_nameToASCII. * wtf/URL.cpp: (WTF::appendEncodedHostname): * wtf/URLHelpers.cpp: (WTF::URLHelpers::mapHostName): * wtf/URLParser.cpp: (WTF::URLParser::domainToASCII): (WTF::URLParser::subdomainStartsWithXNDashDash): (WTF::URLParser::parseHostAndPort): (WTF::URLParser::startsWithXNDashDash): Deleted. * wtf/URLParser.h: Tools: * TestWebKitAPI/Tests/WTF/URLParser.cpp: (TestWebKitAPI::TEST_F): These tests used to hit UIDNA_ERROR_LABEL_TOO_LONG which is allowed now. * TestWebKitAPI/Tests/WTF/cocoa/URLExtras.mm: (TestWebKitAPI::TEST): This test, from r262171, needs to verify that non-ASCII characters are not truncated to ASCII values when converting to NSURL. It used to use an invalid URL that had a host that ended in U+FE63 (SMALL HYPHEN-MINUS) which would fail because of UIDNA_ERROR_TRAILING_HYPHEN. Now that trailing hyphens are allowed, we end in U+0661 and U+06F1 which fail because of UIDNA_ERROR_BIDI which makes this test still verify the non-truncated values of an invalid host converted to an NSURL. LayoutTests: * fast/dom/DOMURL/parsing-expected.txt: * fast/dom/DOMURL/parsing.html: Update the test I added in r236527 to reflect this relaxation. This matches the behavior of Chrome Canary. Canonical link: https://commits.webkit.org/238822@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278879 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-15 16:59:15 +00:00
2021-06-15 Alex Christensen <achristensen@webkit.org>
Check for "xn--" in any subdomain when parsing URL hosts
https://bugs.webkit.org/show_bug.cgi?id=226912
Reviewed by Darin Adler.
We have a fast path that doesn't call uidna_nameToASCII if the host is already ASCII.
We need to check if the host is properly-punycode-encoded if it starts with "xn--"
but we also need to check if any subdomain starts with "xn--" (not just the first one).
In order to not regress tests, I needed to also take the fix I did in r256629 and apply it to all use of uidna_nameToASCII.
* wtf/URL.cpp:
(WTF::appendEncodedHostname):
* wtf/URLHelpers.cpp:
(WTF::URLHelpers::mapHostName):
* wtf/URLParser.cpp:
(WTF::URLParser::domainToASCII):
(WTF::URLParser::subdomainStartsWithXNDashDash):
(WTF::URLParser::parseHostAndPort):
(WTF::URLParser::startsWithXNDashDash): Deleted.
* wtf/URLParser.h:
2021-06-15 Michael Catanzaro <mcatanzaro@gnome.org>
-Warray-bounds warning in Packed.h
https://bugs.webkit.org/show_bug.cgi?id=226557
<rdar://problem/79103658>
Reviewed by Darin Adler.
* wtf/Bitmap.h:
(WTF::WordType>::clear): Use the newly-introduced IGNORE_ARRAY_BOUNDS_WARNINGS macros
instead of vanilla IGNORE_WARNINGS.
* wtf/Compiler.h: Add new IGNORE_ARRAY_BOUNDS_WARNINGS_[BEGIN,END] macros, since this
warning is now suppressed in several different places.
* wtf/Packed.h: Suppress the warning. Also, add a static_assert for safety.
[Cocoa] Harden WebAuthn process by restricting to browser-entitled processes https://bugs.webkit.org/show_bug.cgi?id=226772 <rdar://problem/74721877> Reviewed by Darin Adler. Source/WebKit: We should ensure that any process attempting to launch the WebAuthn XPC service is entitled as a full web browser. We should also ensure that the process requesting WebAuthn operations over WebKit CoreIPC is the WebContent process. Tested by existing WebAuthn tests. * Platform/Logging.h: Add WebAuthn category. * Shared/Cocoa/DefaultWebBrowserChecks.mm: (WebKit::isInWebKitChildProcess): Recognize 'com.apple.WebKit.WebAuthn' as a WebKit sub-process. * UIProcess/Cocoa/WebProcessProxyCocoa.mm: (WebKit::WebProcessProxy::hasCorrectPACEntitlement): Added. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::getWebAuthnProcessConnection): Add a new MESSAGE_CHECK that the process requesting a WebAuthn process connection is a WebContent process. * UIProcess/WebProcessProxy.h: * WebAuthnProcess/WebAuthnProcess.cpp: (WebKit::WebAuthnProcess::platformInitializeWebAuthnProcess): Add some logging. * WebAuthnProcess/WebAuthnProcess.h: * WebAuthnProcess/ios/WebAuthnProcessIOS.mm: (WebKit::WebAuthnProcess::platformInitializeWebAuthnProcess): Ensure that the application invoking the WebAuthn XPC service is entitled as a default web browser. * WebAuthnProcess/mac/WebAuthnProcessMac.mm: (WebKit::WebAuthnProcess::platformInitializeWebAuthnProcess): Stub. * WebProcess/WebProcess.cpp: (WebKit::getWebAuthnProcessConnection): (WebKit::WebProcess::ensureWebAuthnProcessConnection): Source/WTF: Add a new entitlement utility that returns the String value of a given entitlement for the process with the provided audit token. * wtf/cocoa/Entitlements.h: * wtf/cocoa/Entitlements.mm: (WTF::hasEntitlementValue): * wtf/PlatformHave.h: Add item for PAC shared region feature. Canonical link: https://commits.webkit.org/238820@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278877 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-15 16:46:14 +00:00
2021-06-15 Brent Fulgham <bfulgham@apple.com>
[Cocoa] Harden WebAuthn process by restricting to browser-entitled processes
https://bugs.webkit.org/show_bug.cgi?id=226772
<rdar://problem/74721877>
Reviewed by Darin Adler.
Add a new entitlement utility that returns the String value of a given entitlement for
the process with the provided audit token.
* wtf/cocoa/Entitlements.h:
* wtf/cocoa/Entitlements.mm:
(WTF::hasEntitlementValue):
* wtf/PlatformHave.h: Add item for PAC shared region feature.
2021-06-14 Per Arne <pvollan@apple.com>
[iOS] Sync Accessibility preferences
https://bugs.webkit.org/show_bug.cgi?id=226738
<rdar://77922839>
Reviewed by Brent Fulgham.
Enable Per-App Accessibility preferences on iOS.
* wtf/PlatformHave.h:
2021-06-12 Wenson Hsieh <wenson_hsieh@apple.com>
Number pad button is missing its image when tapping on <input type=tel> in watchOS 8
https://bugs.webkit.org/show_bug.cgi?id=226955
Reviewed by Darin Adler.
Add compile-time flags to guard the presence of `PUICQuickboardController` and `PUICButtonTypePill`.
* wtf/PlatformHave.h:
Add WeakHashMap https://bugs.webkit.org/show_bug.cgi?id=226872 Reviewed by Geoffrey Garen. Source/WTF: Added WeakHashMap which deletes entries during rehashing and amortized over time (based on the number of read & write accesses done on a given WeakHashMap instance). * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/WeakHashMap.h: Added. (WTF::WeakHashMap): Added. (WTF::WeakHashMap::PeekKeyValuePairTraits): Added. (WTF::WeakHashMap::PeekType): Added. (WTF::WeakHashMap::PeekPtrType): Added. Unlike a regular HashMap, we need to fake the iterator pointer value with this struct since key-value pair doesn't exist in HashTable itself as it stores Ref<WeakRefImpl> instead. (WTF::WeakHashMap::WeakHashMapIteratorBase): Added. Has a bunch of helper functions so that WeakHashMapIterator and WeakHashMapConstIterator can share the code. (WTF::WeakHashMap::WeakHashMapIterator): Added. (WTF::WeakHashMap::WeakHashMapConstIterator): Added. (WTF::WeakHashMap::AddResult): Added. (WTF::WeakHashMap::begin): Added. (WTF::WeakHashMap::end): Added. (WTF::WeakHashMap::add): Added. (WTF::WeakHashMap::set): Added. (WTF::WeakHashMap::find): Added. (WTF::WeakHashMap::contains): Added. (WTF::WeakHashMap::get): Added. (WTF::WeakHashMap::remove): Added. (WTF::WeakHashMap::removeIf): Added. (WTF::WeakHashMap::clear): Added. (WTF::WeakHashMap::capacity): Added. (WTF::WeakHashMap::isEmptyIgnoringNullReferences): Added. This is akin to WeakHashSet::computesEmpty. Per prior discussion, we intend to rename WeakHashSet's version to this name as well for clarity. Note that this function will clear the hash table completely if the map is semantically empty but HashTable contains null references as keys. (WTF::WeakHashMap::hasNullReferences): Added. Triggers amortized cleanup based on the number of iterations performed. If there are no null references, it resets m_operationCountSinceLastCleanup. (WTF::WeakHashMap::computeSize): Added. (WTF::WeakHashMap::removeNullReferences): Added. Since WeakHashMap doesn't eagerly delete the value when the key goes away, this function should be called when values held onto by WeakRefImpl with the nullptr back pointer should be deleted en masse. (WTF::WeakHashMap::checkConsistency): Added. (WTF::WeakHashMap::makeKeyImpl): Added. (WTF::WeakHashMap::keyImplIfExists): Added. * wtf/WeakPtr.h: Tools: Added unit tests for WeakHashMap. * TestWebKitAPI/Tests/WTF/WeakPtr.cpp: (TestWebKitAPI::computeSizeOfWeakHashSet): Deleted the unused variant. (WTF_WeakPtr.WeakHashSetExpansion): Deleted the superflous for loop. (TestWebKitAPI::computeSizeOfWeakHashMap): Added. (TestWebKitAPI::ValueObject): Added. (TestWebKitAPI::ValueObject::create): (TestWebKitAPI::ValueObject::~ValueObject): (TestWebKitAPI::ValueObject::ValueObject): (WTF_WeakPtr.WeakHashMapBasic): Added. (WTF_WeakPtr.WeakHashMapConstObjects): Added. (WTF_WeakPtr.WeakHashMapExpansion): Added. (WTF_WeakPtr.WeakHashMapRemoveNullReferences): Added. (TestWebKitAPI::collectKeyValuePairsUsingIterators): Added. (WTF_WeakPtr.WeakHashMapIterators): Added. (WTF_WeakPtr.WeakHashMapAmortizedCleanup): Added. Canonical link: https://commits.webkit.org/238760@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278803 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-12 01:42:09 +00:00
2021-06-11 Ryosuke Niwa <rniwa@webkit.org>
Add WeakHashMap
https://bugs.webkit.org/show_bug.cgi?id=226872
Reviewed by Geoffrey Garen.
Added WeakHashMap which deletes entries during rehashing and amortized over time (based on
the number of read & write accesses done on a given WeakHashMap instance).
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/WeakHashMap.h: Added.
(WTF::WeakHashMap): Added.
(WTF::WeakHashMap::PeekKeyValuePairTraits): Added.
(WTF::WeakHashMap::PeekType): Added.
(WTF::WeakHashMap::PeekPtrType): Added. Unlike a regular HashMap, we need to fake the iterator
pointer value with this struct since key-value pair doesn't exist in HashTable itself as it stores
Ref<WeakRefImpl> instead.
(WTF::WeakHashMap::WeakHashMapIteratorBase): Added. Has a bunch of helper functions so that
WeakHashMapIterator and WeakHashMapConstIterator can share the code.
(WTF::WeakHashMap::WeakHashMapIterator): Added.
(WTF::WeakHashMap::WeakHashMapConstIterator): Added.
(WTF::WeakHashMap::AddResult): Added.
(WTF::WeakHashMap::begin): Added.
(WTF::WeakHashMap::end): Added.
(WTF::WeakHashMap::add): Added.
(WTF::WeakHashMap::set): Added.
(WTF::WeakHashMap::find): Added.
(WTF::WeakHashMap::contains): Added.
(WTF::WeakHashMap::get): Added.
(WTF::WeakHashMap::remove): Added.
(WTF::WeakHashMap::removeIf): Added.
(WTF::WeakHashMap::clear): Added.
(WTF::WeakHashMap::capacity): Added.
(WTF::WeakHashMap::isEmptyIgnoringNullReferences): Added. This is akin to WeakHashSet::computesEmpty.
Per prior discussion, we intend to rename WeakHashSet's version to this name as well for clarity.
Note that this function will clear the hash table completely if the map is semantically empty
but HashTable contains null references as keys.
(WTF::WeakHashMap::hasNullReferences): Added. Triggers amortized cleanup based on the number
of iterations performed. If there are no null references, it resets m_operationCountSinceLastCleanup.
(WTF::WeakHashMap::computeSize): Added.
(WTF::WeakHashMap::removeNullReferences): Added. Since WeakHashMap doesn't eagerly delete the value
when the key goes away, this function should be called when values held onto by WeakRefImpl with
the nullptr back pointer should be deleted en masse.
(WTF::WeakHashMap::checkConsistency): Added.
(WTF::WeakHashMap::makeKeyImpl): Added.
(WTF::WeakHashMap::keyImplIfExists): Added.
* wtf/WeakPtr.h:
[Monterey] Support building WebKit https://bugs.webkit.org/show_bug.cgi?id=226846 <rdar://problem/79095148> Reviewed by Tim Horton. Source/WebCore: Covered by exisiting tests. * testing/Internals.cpp: (WebCore::Internals::installImageOverlay): Explicitly define second arugment to avoid 'missing field' compilation error. Source/WebCore/PAL: * pal/spi/cocoa/CryptoKitCBridgingSPI.h: Add RSA BSSA declarations. * pal/spi/mac/QuickLookMacSPI.h: Add Image Analysis declarations. Source/WebKit: * Platform/cocoa/TextRecognitionUtilities.mm: Import VisionKitSPI.h. * Platform/spi/Cocoa/VisionKitSPI.h: Added. * UIProcess/API/Cocoa/WKBrowsingContextController.mm: (setUpPageLoaderClient): Allow deprecated declarations. (setUpPagePolicyClient): Ditto. * UIProcess/API/Cocoa/WKConnection.mm: (setUpClient): Allow deprecated declarations. * UIProcess/API/Cocoa/WKProcessGroup.mm: (setUpConnectionClient): Allow deprecated declarations. (setUpInjectedBundleClient): Ditto. (setUpHistoryClient): Ditto. * UIProcess/API/Cocoa/WKWebViewTesting.mm: (-[WKWebView _createMediaSessionCoordinatorForTesting:completionHandler:]): Explicitly define second arugment to avoid 'missing field' compilation error. * UIProcess/Cocoa/WebViewImpl.mm: Import VisionKitSPI.h. * UIProcess/ios/WKContentViewInteraction.mm: Ditto. * WebKit.xcodeproj/project.pbxproj: Ditto. Source/WTF: * wtf/PlatformHave.h: Add HAVE(VK_IMAGE_ANALYSIS). * wtf/spi/cocoa/SecuritySPI.h: Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: Add CoreCryptoSPI.h. * TestWebKitAPI/Tests/WebCore/cocoa/CoreCryptoSPI.h: Added. * TestWebKitAPI/Tests/WebCore/cocoa/PrivateClickMeasurementCocoa.mm: Import CoreCryptoSPI.h. * TestWebKitAPI/Tests/WebKitCocoa/EventAttribution.mm: Ditto. Canonical link: https://commits.webkit.org/238737@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278780 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-11 20:44:21 +00:00
2021-06-11 Jonathan Bedard <jbedard@apple.com>
[Monterey] Support building WebKit
https://bugs.webkit.org/show_bug.cgi?id=226846
<rdar://problem/79095148>
Reviewed by Tim Horton.
* wtf/PlatformHave.h: Add HAVE(VK_IMAGE_ANALYSIS).
* wtf/spi/cocoa/SecuritySPI.h:
2021-06-09 Chris Dumez <cdumez@apple.com>
Avoid some calls to StringView::toString() / StringView::toStringWithoutCopying()
https://bugs.webkit.org/show_bug.cgi?id=226803
Reviewed by Darin Adler.
Add support to TextStream for printing a StringView directly, without having to convert
it to a String first.
* wtf/text/TextStream.cpp:
(WTF::TextStream::operator<<):
* wtf/text/TextStream.h:
2021-06-09 Alicia Boya García <aboya@igalia.com>
[WTF][GStreamer] Add RAII lockers for 3rd party locks
https://bugs.webkit.org/show_bug.cgi?id=225650
Reviewed by Xabier Rodriguez-Calvar.
This patch introduces WTF::ExternalLocker, which allows to lock 3rd
party mutexes in a RAII fashion, very similar to WTF::Locker.
This is used also in WebCore to provide RAII lockers for GStreamer.
* wtf/Locker.h:
(WTF::unlockFunction):
2021-06-08 Alex Christensen <achristensen@webkit.org>
Move PrivacyStance code from WebKitAdditions
https://bugs.webkit.org/show_bug.cgi?id=226774
Reviewed by Jer Noble.
* wtf/PlatformHave.h:
Use access instead of stat in some filesystem functions https://bugs.webkit.org/show_bug.cgi?id=226667 Reviewed by Chris Dumez. We are spending a bit more time in WTF::FileSystemImpl functions after the move to std::filesystem (https://bugs.webkit.org/show_bug.cgi?id=225255). In particular, several std::filesystem functions (like the ones called by fileExists and makeAllDirectories) prefer to use stat() over access() for file existence checks. Since our sandbox has a fast path for access(path, F_OK) but not for stat, we ended up spending more time in sandbox evaluation in the kernel after the move to std::filesystem. Note that the two checks don't do exactly the same thing. access(path, F_OK) only checks for path existence, while stat(path) additionally fetches metadata, which requires checking the file-read-metadata permission. But in practice our code was written to be fine with just checking for existence. To work around this, I've re-introduced some of the old WTF::FileSystemImpl functions from FileSystemPosix.cpp. They are the ones that are called by NetworkCache, which seems to be the biggest consumer of these functions. The rest of the functions are still implemented using std::filesystem. * wtf/FileSystem.cpp: (WTF::FileSystemImpl::fileExists): (WTF::FileSystemImpl::deleteFile): (WTF::FileSystemImpl::makeAllDirectories): (WTF::FileSystemImpl::pathByAppendingComponent): (WTF::FileSystemImpl::pathByAppendingComponents): * wtf/PlatformEnableCocoa.h: * wtf/posix/FileSystemPOSIX.cpp: (WTF::FileSystemImpl::fileExists): (WTF::FileSystemImpl::deleteFile): (WTF::FileSystemImpl::makeAllDirectories): (WTF::FileSystemImpl::pathByAppendingComponent): (WTF::FileSystemImpl::pathByAppendingComponents): Canonical link: https://commits.webkit.org/238623@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278641 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-09 02:26:34 +00:00
2021-06-08 Ben Nham <nham@apple.com>
Use access instead of stat in some filesystem functions
https://bugs.webkit.org/show_bug.cgi?id=226667
Reviewed by Chris Dumez.
We are spending a bit more time in WTF::FileSystemImpl functions after the move to
std::filesystem (https://bugs.webkit.org/show_bug.cgi?id=225255). In particular, several
std::filesystem functions (like the ones called by fileExists and makeAllDirectories) prefer
to use stat() over access() for file existence checks. Since our sandbox has a fast path for
access(path, F_OK) but not for stat, we ended up spending more time in sandbox evaluation in
the kernel after the move to std::filesystem.
Note that the two checks don't do exactly the same thing. access(path, F_OK) only checks for
path existence, while stat(path) additionally fetches metadata, which requires checking the
file-read-metadata permission. But in practice our code was written to be fine with just
checking for existence.
To work around this, I've re-introduced some of the old WTF::FileSystemImpl functions from
FileSystemPosix.cpp. They are the ones that are called by NetworkCache, which seems to be
the biggest consumer of these functions. The rest of the functions are still implemented
using std::filesystem.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::fileExists):
(WTF::FileSystemImpl::deleteFile):
(WTF::FileSystemImpl::makeAllDirectories):
(WTF::FileSystemImpl::pathByAppendingComponent):
(WTF::FileSystemImpl::pathByAppendingComponents):
* wtf/PlatformEnableCocoa.h:
* wtf/posix/FileSystemPOSIX.cpp:
(WTF::FileSystemImpl::fileExists):
(WTF::FileSystemImpl::deleteFile):
(WTF::FileSystemImpl::makeAllDirectories):
(WTF::FileSystemImpl::pathByAppendingComponent):
(WTF::FileSystemImpl::pathByAppendingComponents):
[Payment Request] upstream new features https://bugs.webkit.org/show_bug.cgi?id=226740 <rdar://problem/78963132> Reviewed by Andy Estes. Source/WebCore: - recurring line items (`HAVE_PASSKIT_RECURRING_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_RECURRING_LINE_ITEM`) - deferred line items (`HAVE_PASSKIT_DEFERRED_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_DEFERRED_LINE_ITEM`) - estimated shipping dates (`HAVE_PASSKIT_SHIPPING_METHOD_DATE_COMPONENTS_RANGE` and `ENABLE_APPLE_PAY_SHIPPING_METHOD_DATE_COMPONENTS_RANGE`) - coupon code entry (`HAVE_PASSKIT_COUPON_CODE` and `ENABLE_APPLE_PAY_COUPON_CODE`) - shipped vs in-store pickup (`HAVE_PASSKIT_SHIPPING_CONTACT_EDITING_MODE` and `ENABLE_APPLE_PAY_SHIPPING_CONTACT_EDITING_MODE`) Tests: http/tests/paymentrequest/ApplePayModifier-additionalLineItems.https.html http/tests/paymentrequest/ApplePayModifier-additionalShippingMethods.https.html http/tests/paymentrequest/ApplePayModifier-total.https.html http/tests/paymentrequest/paymentmethodchange-couponCode.https.html http/tests/paymentrequest/paymentrequest-couponCode.https.html http/tests/paymentrequest/paymentrequest-shippingContactEditingMode.https.html http/tests/paymentrequest/paymentrequest-supportsCouponCode.https.html * Modules/applepay/ApplePayCouponCodeUpdate.idl: Copied from Source/WebCore/Modules/applepay/ApplePayPaymentMethodModeUpdate.idl. * Modules/applepay/ApplePayCouponCodeUpdate.h: Renamed from Source/WebCore/Modules/applepay/ApplePayPaymentMethodModeUpdate.h. (WebCore::ApplePayCouponCodeUpdate::encode const): (WebCore::ApplePayCouponCodeUpdate::decode): Object used to update the payment request via `ApplePaySession.prototype.completeCouponCodeChange` when responding to the user modifying the coupon code. * Modules/applepay/ApplePayErrorCode.idl: * Modules/applepay/ApplePayErrorCode.h: Add `"couponCodeInvalid"` and `"couponCodeExpired"`. * Modules/applepay/ApplePayLineItem.idl: * Modules/applepay/ApplePayLineItem.h: (WebCore::ApplePayLineItem::encode const): (WebCore::ApplePayLineItem::decode): * Modules/applepay/ApplePayPaymentTiming.idl: Added. * Modules/applepay/ApplePayPaymentTiming.h: Added. * Modules/applepay/ApplePayRecurringPaymentDateUnit.idl: Added. * Modules/applepay/ApplePayRecurringPaymentDateUnit.h: Added. Add members that indicate whether this line item is immediate, recurring, or deferred. Depending on that timing, additional members are added for further configuration (e.g. the start and/or end date of a recurring payment, it's frequency, etc.). * Modules/applepay/ApplePayShippingMethod.idl: * Modules/applepay/ApplePayShippingMethod.h: (WebCore::ApplePayShippingMethod::encode const): (WebCore::ApplePayShippingMethod::decode): * Modules/applepay/ApplePayDateComponentsRange.idl: Added. * Modules/applepay/ApplePayDateComponentsRange.h: Added. (WebCore::ApplePayDateComponentsRange::encode const): (WebCore::ApplePayDateComponentsRange::decode): * Modules/applepay/ApplePayDateComponents.idl: Added. * Modules/applepay/ApplePayDateComponents.h: Added. (WebCore::ApplePayDateComponents::encode const): (WebCore::ApplePayDateComponents::decode): Add members that can be used to indicate the estimated shipping dates for this shipping method. * Modules/applepay/ApplePayRequestBase.idl: * Modules/applepay/ApplePayRequestBase.h: * Modules/applepay/ApplePayRequestBase.cpp: (WebCore::convertAndValidate): * Modules/applepay/ApplePaySessionPaymentRequest.h: (WebCore::ApplePaySessionPaymentRequest::supportsCouponCode const): Added. (WebCore::ApplePaySessionPaymentRequest::setSupportsCouponCode): Added. (WebCore::ApplePaySessionPaymentRequest::couponCode const): Added. (WebCore::ApplePaySessionPaymentRequest::setCouponCode): Added. (WebCore::ApplePaySessionPaymentRequest::shippingContactEditingMode const): Added. (WebCore::ApplePaySessionPaymentRequest::setShippingContactEditingMode): Added. * Modules/applepay/ApplePayShippingContactEditingMode.idl: Added. * Modules/applepay/ApplePayShippingContactEditingMode.h: Added. Add members that indicate: - whether this payment request supports a coupon code at all - the initial coupon code (assuming the above) - whether this payment request allows editing the shipping contact (i.e. in-store pickup does not) * dom/EventNames.h: * dom/EventNames.in: * Modules/applepay/ApplePayCouponCodeChangedEvent.idl: Added. * Modules/applepay/ApplePayCouponCodeChangedEvent.h: Added. * Modules/applepay/ApplePayCouponCodeChangedEvent.cpp: Added. (WebCore::ApplePayCouponCodeChangedEvent::ApplePayCouponCodeChangedEvent): (WebCore::ApplePayCouponCodeChangedEvent::eventInterface const): Add a `"couponcodechange"` event that is dispatched whenever the user modifies the coupon code for an `ApplePaySession`. * Modules/applepay/ApplePayCouponCodeDetails.idl: Copied from Source/WebCore/Modules/applepay/ApplePayPaymentMethodModeDetails.idl. * Modules/applepay/ApplePayCouponCodeDetails.h: Copied from Source/WebCore/Modules/applepay/ApplePayPaymentMethodModeUpdate.idl. Used as the `object methodData` when a `PaymentMethodChangeEvent` is dispatched for a `PaymentRequest`. * Modules/applepay/ApplePaySession.idl: * Modules/applepay/ApplePaySession.h: * Modules/applepay/ApplePaySession.cpp: (WebCore::convertAndValidate): (WebCore::ApplePaySession::completeCouponCodeChange): Added. (WebCore::ApplePaySession::didChangeCouponCode): Renamed from `WebCore::ApplePaySession::didChangePaymentMethodMode`. (WebCore::ApplePaySession::canSuspendWithoutCanceling const): (WebCore::ApplePaySession::canBegin const): (WebCore::ApplePaySession::canAbort const): (WebCore::ApplePaySession::canCancel const): (WebCore::ApplePaySession::canCompleteShippingMethodSelection const): (WebCore::ApplePaySession::canCompleteShippingContactSelection const): (WebCore::ApplePaySession::canCompletePaymentMethodSelection const): (WebCore::ApplePaySession::canCompleteCouponCodeChange const): Renamed from `WebCore::ApplePaySession::canCompletePaymentMethodModeChange const`. (WebCore::ApplePaySession::canCompletePayment const): (WebCore::ApplePaySession::isFinalState const): * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h: * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp: (WebCore::ApplePayPaymentHandler::paymentMethodUpdated): (WebCore::ApplePayPaymentHandler::didChangeCouponCode): Renamed from `WebCore::ApplePayPaymentHandler::didChangePaymentMethodMode`. Add methods for JS to call and state logic to handle coupon code changes. * Modules/applepay/PaymentCoordinator.h: * Modules/applepay/PaymentCoordinator.cpp: (WebCore::PaymentCoordinator::completeCouponCodeChange): Renamed from `WebCore::PaymentCoordinator::completePaymentMethodModeChange`. (WebCore::PaymentCoordinator::didChangeCouponCode): Renamed from `WebCore::PaymentCoordinator::didChangePaymentMethodMode`. * Modules/applepay/PaymentCoordinatorClient.h: * loader/EmptyClients.cpp: (WebCore::EmptyPaymentCoordinatorClient::completeCouponCodeChange): Renamed from `WebCore::EmptyPaymentCoordinatorClient::completePaymentMethodModeChange`. Plumbing up to WebKit. * Modules/applepay/cocoa/PaymentSummaryItemsCocoa.mm: (WebCore::toDate): Added. (WebCore::toCalendarUnit): Added. (WebCore::toPKPaymentSummaryItem): Convert WebCore objects to PassKit objects. * testing/MockPaymentCoordinator.idl: * testing/MockPaymentCoordinator.h: * testing/MockPaymentCoordinator.cpp: (WebCore::MockPaymentCoordinator::showPaymentUI): (WebCore::MockPaymentCoordinator::completeCouponCodeChange): Renamed from `WebCore::MockPaymentCoordinator::completePaymentMethodModeChange`. (WebCore::MockPaymentCoordinator::changeCouponCode): Added. * Modules/applepay/cocoa/PaymentAPIVersionCocoa.mm: (WebCore::PaymentAPIVersion::current): * Modules/applepay/PaymentHeaders.h: * Modules/applepay/PaymentSession.h: * Modules/applepay/ApplePayLineItemData.idl: Removed. * Modules/applepay/ApplePayLineItemData.h: Removed. * Modules/applepay/ApplePayShippingMethodData.idl: Removed. * Modules/applepay/ApplePayShippingMethodData.h: Removed. Remove unnecessary base types after r275169. * PlatformMac.cmake: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: Source/WebCore/PAL: - recurring line items (`HAVE_PASSKIT_RECURRING_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_RECURRING_LINE_ITEM`) - deferred line items (`HAVE_PASSKIT_DEFERRED_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_DEFERRED_LINE_ITEM`) - estimated shipping dates (`HAVE_PASSKIT_SHIPPING_METHOD_DATE_COMPONENTS_RANGE` and `ENABLE_APPLE_PAY_SHIPPING_METHOD_DATE_COMPONENTS_RANGE`) - coupon code entry (`HAVE_PASSKIT_COUPON_CODE` and `ENABLE_APPLE_PAY_COUPON_CODE`) - shipped vs in-store pickup (`HAVE_PASSKIT_SHIPPING_CONTACT_EDITING_MODE` and `ENABLE_APPLE_PAY_SHIPPING_CONTACT_EDITING_MODE`) * pal/cocoa/PassKitSoftLink.h: * pal/cocoa/PassKitSoftLink.mm: * pal/spi/cocoa/PassKitSPI.h: Source/WebKit: - recurring line items (`HAVE_PASSKIT_RECURRING_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_RECURRING_LINE_ITEM`) - deferred line items (`HAVE_PASSKIT_DEFERRED_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_DEFERRED_LINE_ITEM`) - estimated shipping dates (`HAVE_PASSKIT_SHIPPING_METHOD_DATE_COMPONENTS_RANGE` and `ENABLE_APPLE_PAY_SHIPPING_METHOD_DATE_COMPONENTS_RANGE`) - coupon code entry (`HAVE_PASSKIT_COUPON_CODE` and `ENABLE_APPLE_PAY_COUPON_CODE`) - shipped vs in-store pickup (`HAVE_PASSKIT_SHIPPING_CONTACT_EDITING_MODE` and `ENABLE_APPLE_PAY_SHIPPING_CONTACT_EDITING_MODE`) * Platform/cocoa/PaymentAuthorizationViewController.mm: (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didChangeCouponCode:handler:]): Added. * Platform/ios/PaymentAuthorizationController.mm: (-[WKPaymentAuthorizationControllerDelegate paymentAuthorizationController:didChangeCouponCode:handler:]): Added. * Platform/cocoa/PaymentAuthorizationPresenter.h: * Platform/cocoa/PaymentAuthorizationPresenter.mm: (WebKit::toPKPaymentErrorCode): (WebKit::PaymentAuthorizationPresenter::completeCouponCodeChange): Renamed from `WebKit::PaymentAuthorizationPresenter::completePaymentMethodModeChange`. * Platform/cocoa/WKPaymentAuthorizationDelegate.h: * Platform/cocoa/WKPaymentAuthorizationDelegate.mm: (-[WKPaymentAuthorizationDelegate completeCouponCodeChange:]): Added. (toDateComponents): Added. (toDateComponentsRange): Added. (toShippingMethod): (-[WKPaymentAuthorizationDelegate _didChangeCouponCode:completion:]): Added. Add plumbing from/to PassKit for coupon code changes. * Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in: * Shared/ApplePay/WebPaymentCoordinatorProxy.h: * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp: (WebKit::WebPaymentCoordinatorProxy::completeCouponCodeChange): Renamed from `WebKit::WebPaymentCoordinatorProxy::completePaymentMethodModeChange`. (WebKit::WebPaymentCoordinatorProxy::presenterDidChangeCouponCode): Renamed from `WebKit::WebPaymentCoordinatorProxy::presenterDidChangePaymentMethodMode`. (WebKit::WebPaymentCoordinatorProxy::canBegin const): (WebKit::WebPaymentCoordinatorProxy::canCancel const): (WebKit::WebPaymentCoordinatorProxy::canCompletePayment const): (WebKit::WebPaymentCoordinatorProxy::canAbort const): * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toNSDateComponents): Added. (WebKit::toPKDateComponentsRange): Added. (WebKit::toPKShippingMethod): (WebKit::toPKShippingContactEditingMode): Added. (WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest): (WebKit::WebPaymentCoordinatorProxy::platformCompleteCouponCodeChange): Renamed from `WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodModeChange`. Convert PassKit objects to/from WebCore objects. * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder<WebCore::ApplePaySessionPaymentRequest>::encode): (IPC::ArgumentCoder<WebCore::ApplePaySessionPaymentRequest>::decode): * WebProcess/ApplePay/WebPaymentCoordinator.messages.in: * WebProcess/ApplePay/WebPaymentCoordinator.h: * WebProcess/ApplePay/WebPaymentCoordinator.cpp: (WebKit::WebPaymentCoordinator::completeCouponCodeChange): Renamed from `WebKit::WebPaymentCoordinator::completePaymentMethodModeChange`. (WebKit::WebPaymentCoordinator::didChangeCouponCode): Renamed from `WebKit::WebPaymentCoordinator::didChangePaymentMethodMode`. Plumbing into/from WebCore. Source/WebKitLegacy/mac: - recurring line items (`HAVE_PASSKIT_RECURRING_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_RECURRING_LINE_ITEM`) - deferred line items (`HAVE_PASSKIT_DEFERRED_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_DEFERRED_LINE_ITEM`) - estimated shipping dates (`HAVE_PASSKIT_SHIPPING_METHOD_DATE_COMPONENTS_RANGE` and `ENABLE_APPLE_PAY_SHIPPING_METHOD_DATE_COMPONENTS_RANGE`) - coupon code entry (`HAVE_PASSKIT_COUPON_CODE` and `ENABLE_APPLE_PAY_COUPON_CODE`) - shipped vs in-store pickup (`HAVE_PASSKIT_SHIPPING_CONTACT_EDITING_MODE` and `ENABLE_APPLE_PAY_SHIPPING_CONTACT_EDITING_MODE`) * WebCoreSupport/WebPaymentCoordinatorClient.h: * WebCoreSupport/WebPaymentCoordinatorClient.mm: (WebPaymentCoordinatorClient::completeCouponCodeChange): Renamed from `WebPaymentCoordinatorClient::completePaymentMethodModeChange`. Source/WTF: - recurring line items (`HAVE_PASSKIT_RECURRING_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_RECURRING_LINE_ITEM`) - deferred line items (`HAVE_PASSKIT_DEFERRED_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_DEFERRED_LINE_ITEM`) - estimated shipping dates (`HAVE_PASSKIT_SHIPPING_METHOD_DATE_COMPONENTS_RANGE` and `ENABLE_APPLE_PAY_SHIPPING_METHOD_DATE_COMPONENTS_RANGE`) - coupon code entry (`HAVE_PASSKIT_COUPON_CODE` and `ENABLE_APPLE_PAY_COUPON_CODE`) - shipped vs in-store pickup (`HAVE_PASSKIT_SHIPPING_CONTACT_EDITING_MODE` and `ENABLE_APPLE_PAY_SHIPPING_CONTACT_EDITING_MODE`) * wtf/PlatformHave.h: * wtf/PlatformEnableCocoa.h: LayoutTests: * http/tests/paymentrequest/ApplePayModifier-additionalLineItems.https.html: Added. * http/tests/paymentrequest/ApplePayModifier-additionalLineItems.https-expected.txt: Added. * http/tests/paymentrequest/ApplePayModifier-additionalShippingMethods.https.html: Added. * http/tests/paymentrequest/ApplePayModifier-additionalShippingMethods.https-expected.txt: Added. * http/tests/paymentrequest/ApplePayModifier-total.https.html: Added. * http/tests/paymentrequest/ApplePayModifier-total.https-expected.txt: Added. * http/tests/paymentrequest/paymentmethodchange-couponCode.https.html: Added. * http/tests/paymentrequest/paymentmethodchange-couponCode.https-expected.txt: Added. * http/tests/paymentrequest/paymentrequest-couponCode.https.html: Added. * http/tests/paymentrequest/paymentrequest-couponCode.https-expected.txt: Added. * http/tests/paymentrequest/paymentrequest-shippingContactEditingMode.https.html: Added. * http/tests/paymentrequest/paymentrequest-shippingContactEditingMode.https-expected.txt: Added. * http/tests/paymentrequest/paymentrequest-supportsCouponCode.https.html: Added. * http/tests/paymentrequest/paymentrequest-supportsCouponCode.https-expected.txt: Added. * http/tests/ssl/applepay/ApplePayError-expected.txt: * platform/ios-wk2/TestExpectations: * platform/mac-wk2/TestExpectations: Canonical link: https://commits.webkit.org/238613@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278630 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-08 22:15:18 +00:00
2021-06-08 Devin Rousso <drousso@apple.com>
[Payment Request] upstream new features
https://bugs.webkit.org/show_bug.cgi?id=226740
<rdar://problem/78963132>
Reviewed by Andy Estes.
- recurring line items (`HAVE_PASSKIT_RECURRING_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_RECURRING_LINE_ITEM`)
- deferred line items (`HAVE_PASSKIT_DEFERRED_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_DEFERRED_LINE_ITEM`)
- estimated shipping dates (`HAVE_PASSKIT_SHIPPING_METHOD_DATE_COMPONENTS_RANGE` and `ENABLE_APPLE_PAY_SHIPPING_METHOD_DATE_COMPONENTS_RANGE`)
- coupon code entry (`HAVE_PASSKIT_COUPON_CODE` and `ENABLE_APPLE_PAY_COUPON_CODE`)
- shipped vs in-store pickup (`HAVE_PASSKIT_SHIPPING_CONTACT_EDITING_MODE` and `ENABLE_APPLE_PAY_SHIPPING_CONTACT_EDITING_MODE`)
* wtf/PlatformHave.h:
* wtf/PlatformEnableCocoa.h:
Reduce use of reinterpret_cast<> in the codebase https://bugs.webkit.org/show_bug.cgi?id=226743 Reviewed by Darin Adler. Source/WebCore: * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp: (WebCore::CDMSessionClearKey::generateKeyRequest): * Modules/fetch/FetchBody.cpp: (WebCore::FetchBody::take): * Modules/fetch/FetchBodyConsumer.cpp: (WebCore::FetchBodyConsumer::resolve): (WebCore::FetchBodyConsumer::takeAsBlob): (WebCore::FetchBodyConsumer::takeAsText): * Modules/mediastream/RTCDataChannelRemoteHandler.cpp: (WebCore::RTCDataChannelRemoteHandler::readyToSend): (WebCore::RTCDataChannelRemoteHandler::sendStringData): (WebCore::RTCDataChannelRemoteHandler::sendRawData): * Modules/webaudio/MediaStreamAudioSourceGStreamer.cpp: (WebCore::copyBusData): * Modules/webauthn/AuthenticatorResponseData.h: (WebCore::encodeArrayBuffer): (WebCore::decodeArrayBuffer): * Modules/websockets/WebSocketChannel.cpp: (WebCore::WebSocketChannel::startClosingHandshake): (WebCore::WebSocketChannel::processOutgoingFrameQueue): * Modules/websockets/WebSocketHandshake.cpp: (WebCore::WebSocketHandshake::getExpectedWebSocketAccept): (WebCore::headerHasValidHTTPVersion): * bindings/js/ScriptBufferSourceProvider.h: * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneDeserializer::readString): * contentextensions/SerializedNFA.cpp: (WebCore::ContentExtensions::SerializedNFA::pointerAtOffsetInFile const): * dom/Node.cpp: (WebCore::hashPointer): * dom/TextEncoder.cpp: (WebCore::TextEncoder::encode const): * dom/TextEncoderStreamEncoder.cpp: (WebCore::TextEncoderStreamEncoder::flush): * editing/cocoa/WebContentReaderCocoa.mm: (WebCore::sanitizeMarkupWithArchive): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::texImageArrayBufferViewHelper): * inspector/DOMPatchSupport.cpp: (WebCore::addStringToSHA1): * loader/TextResourceDecoder.cpp: (WebCore::TextResourceDecoder::textFromUTF8): * loader/cache/CachedScript.cpp: (WebCore::CachedScript::script): * page/cocoa/ResourceUsageOverlayCocoa.mm: (WebCore::showText): * platform/SharedBufferChunkReader.cpp: (WebCore::SharedBufferChunkReader::nextChunk): * platform/cf/SharedBufferCF.cpp: (WebCore::SharedBuffer::createCFData const): * platform/generic/KeyedEncoderGeneric.cpp: (WebCore::KeyedEncoderGeneric::encodeString): * platform/graphics/GraphicsContextGL.cpp: (WebCore::GraphicsContextGL::packImageData): * platform/graphics/ImageBufferBackend.cpp: (WebCore::ImageBufferBackend::getPixelBuffer const): (WebCore::ImageBufferBackend::putPixelBuffer): * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: (WebCore::InbandTextTrackPrivateAVF::processNativeSamples): * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp: (WebCore::CDMSessionAVFoundationCF::generateKeyRequest): (WebCore::CDMSessionAVFoundationCF::update): * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp: (WebCore::InbandTextTrackPrivateAVCF::readNativeSampleBuffer): * platform/graphics/displaylists/DisplayListItemBuffer.cpp: (WebCore::DisplayList::ItemBuffer::createItemBuffer): * platform/graphics/displaylists/DisplayListIterator.cpp: (WebCore::DisplayList::DisplayList::Iterator::updateCurrentItem): * platform/image-decoders/gif/GIFImageReader.h: (GIFImageReader::data const): * platform/mac/SSLKeyGeneratorMac.mm: (WebCore::signedPublicKeyAndChallengeString): * platform/mediastream/RealtimeMediaSourceCenter.cpp: (WebCore::addStringToSHA1): * platform/network/FormDataBuilder.cpp: (WebCore::FormDataBuilder::encodeStringAsFormData): * platform/network/SocketStreamHandle.cpp: (WebCore::SocketStreamHandle::sendHandshake): * platform/network/cf/ResourceRequestCFNet.cpp: (WebCore::ResourceRequest::doUpdatePlatformRequest): * platform/network/cf/ResourceRequestCFNet.h: (WebCore::httpHeaderValueUsingSuitableEncoding): * platform/network/cf/SocketStreamHandleImplCFNet.cpp: (WebCore::SocketStreamHandleImpl::platformSendInternal): * platform/network/curl/CurlCacheEntry.cpp: (WebCore::CurlCacheEntry::generateBaseFilename): * platform/sql/SQLiteStatement.cpp: (WebCore::SQLiteStatement::columnBlobView): * testing/MockCDMFactory.cpp: (WebCore::MockCDM::sanitizeResponse const): Source/WebDriver: * socket/HTTPParser.cpp: (WebDriver::HTTPParser::readLine): * socket/SessionHostSocket.cpp: (WebDriver::SessionHost::sendWebInspectorEvent): Source/WebKit: * GPUProcess/media/RemoteMediaPlayerProxy.cpp: (WebKit::RemoteMediaPlayerProxy::mediaPlayerInitializationDataEncountered): * GPUProcess/media/RemoteTextTrackProxy.cpp: (WebKit::RemoteTextTrackProxy::addDataCue): * GPUProcess/webrtc/RemoteMediaRecorder.cpp: (WebKit::RemoteMediaRecorder::fetchData): * NetworkProcess/cache/NetworkCacheDataCurl.cpp: (WebKit::NetworkCache::Data::apply const): * NetworkProcess/cache/NetworkCacheKey.cpp: (WebKit::NetworkCache::hashString): * NetworkProcess/soup/WebKitDirectoryInputStream.cpp: (webkitDirectoryInputStreamRead): * Platform/IPC/ArgumentCoders.cpp: (IPC::ArgumentCoder<CString>::encode): (IPC::ArgumentCoder<String>::encode): * Shared/API/c/cf/WKStringCF.mm: (WKStringCopyCFString): * Shared/API/c/cf/WKURLCF.mm: (WKURLCopyCFURL): * Shared/ShareableResource.cpp: (WebKit::ShareableResource::wrapInSharedBuffer): * Shared/SharedDisplayListHandle.h: (WebKit::SharedDisplayListHandle::data const): * Shared/WebCompiledContentRuleList.cpp: (WebKit::WebCompiledContentRuleList::conditionsApplyOnlyToDomain const): * UIProcess/API/APIWebAuthenticationAssertionResponse.cpp: (API::WebAuthenticationAssertionResponse::userHandle const): * UIProcess/API/C/WKPage.cpp: (dataFrom): * UIProcess/Cocoa/SOAuthorization/RedirectSOAuthorizationSession.mm: (WebKit::RedirectSOAuthorizationSession::completeInternal): * UIProcess/Inspector/socket/RemoteInspectorClient.cpp: (WebKit::RemoteInspectorClient::sendWebInspectorEvent): * WebProcess/Network/WebSocketChannel.cpp: (WebKit::WebSocketChannel::createMessageQueue): (WebKit::WebSocketChannel::didReceiveText): * WebProcess/Network/webrtc/RTCDataChannelRemoteManager.cpp: (WebKit::RTCDataChannelRemoteManager::sendData): (WebKit::RTCDataChannelRemoteManager::RemoteSourceConnection::didReceiveStringData): * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp: (WebKit::NetscapePluginStream::sendJavaScriptStream): Source/WTF: * wtf/CryptographicallyRandomNumber.cpp: * wtf/FastMalloc.h: (WTF::FastAllocator::allocate): * wtf/SHA1.h: (WTF::SHA1::addBytes): * wtf/StackCheck.h: (WTF::StackCheck::Scope::Scope): (WTF::StackCheck::StackCheck): * wtf/URLHelpers.cpp: (WTF::URLHelpers::userVisibleURL): * wtf/URLParser.cpp: (WTF::URLParser::formURLDecode): * wtf/cf/URLCF.cpp: (WTF::URL::createCFURL const): * wtf/cocoa/URLCocoa.mm: (WTF::URL::createCFURL const): * wtf/persistence/PersistentCoders.cpp: (WTF::Persistence::Coder<CString>::encode): (WTF::Persistence::Coder<String>::encode): * wtf/text/CString.h: * wtf/text/WTFString.cpp: (WTF::String::latin1 const): * wtf/text/cf/StringImplCF.cpp: (WTF::StringImpl::createCFString): Canonical link: https://commits.webkit.org/238604@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278619 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-08 17:35:15 +00:00
2021-06-08 Chris Dumez <cdumez@apple.com>
Reduce use of reinterpret_cast<> in the codebase
https://bugs.webkit.org/show_bug.cgi?id=226743
Reviewed by Darin Adler.
* wtf/CryptographicallyRandomNumber.cpp:
* wtf/FastMalloc.h:
(WTF::FastAllocator::allocate):
* wtf/SHA1.h:
(WTF::SHA1::addBytes):
* wtf/StackCheck.h:
(WTF::StackCheck::Scope::Scope):
(WTF::StackCheck::StackCheck):
* wtf/URLHelpers.cpp:
(WTF::URLHelpers::userVisibleURL):
* wtf/URLParser.cpp:
(WTF::URLParser::formURLDecode):
* wtf/cf/URLCF.cpp:
(WTF::URL::createCFURL const):
* wtf/cocoa/URLCocoa.mm:
(WTF::URL::createCFURL const):
* wtf/persistence/PersistentCoders.cpp:
(WTF::Persistence::Coder<CString>::encode):
(WTF::Persistence::Coder<String>::encode):
* wtf/text/CString.h:
* wtf/text/WTFString.cpp:
(WTF::String::latin1 const):
* wtf/text/cf/StringImplCF.cpp:
(WTF::StringImpl::createCFString):
[Modern Media Controls] upstream new features https://bugs.webkit.org/show_bug.cgi?id=226736 <rdar://problem/78957464> Reviewed by Eric Carlson. Source/WebCore: - bring the "Audio"/"Languages" tracks menu to iOS - add a new "Playback Speed" menu in the overflow menu on iOS and macOS - add support for showing the most relevant `<track kind="chapters">` in the overflow menu on iOS and macOS Tests: media/modern-media-controls/overflow-button/overflow-button.html media/modern-media-controls/overflow-support/chapters.html media/modern-media-controls/overflow-support/playback-speed.html * Modules/mediacontrols/MediaControlsHost.cpp: (WebCore::MediaControlsHost::showMediaControlsContextMenu): * Modules/modern-media-controls/media/overflow-support.js: (OverflowSupport.prototype.get mediaEvents): (OverflowSupport.prototype.get tracksToMonitor): (OverflowSupport.prototype.syncControl): * en.lproj/Localizable.strings: * rendering/RenderTheme.h: (WebCore::RenderTheme::mediaControlsScripts): * rendering/RenderThemeAdwaita.cpp: (WebCore::RenderThemeAdwaita::mediaControlsScripts): * rendering/RenderThemeAdwaita.h: * rendering/RenderThemeCocoa.h: * rendering/RenderThemeCocoa.mm: (WebCore::RenderThemeCocoa::purgeCaches): (WebCore::RenderThemeCocoa::mediaControlsScripts): * rendering/RenderThemeWin.h: * rendering/RenderThemeWin.cpp: (WebCore::RenderThemeWin::mediaControlsScripts): Drop the "additional script" and lower the inline capacity of the `Vector`. * testing/Internals.idl: * testing/Internals.h: * testing/Internals.cpp: (WebCore::Internals::setMediaControlsHidePlaybackRates): Added. * html/HTMLMediaElement.h: * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::setMediaControlsHidePlaybackRates): Added. Since Playback Rates is always shown, provide a way for tests to turn it off. Source/WTF: - bring the "Audio"/"Languages" tracks menu to iOS - add a new "Playback Speed" menu on iOS and macOS in the overflow menu - add support for showing the most relevant `<track kind="chapters">` in the overflow menu * wtf/PlatformEnableCocoa.h: LayoutTests: * media/modern-media-controls/overflow-button/overflow-button.html: Added. * media/modern-media-controls/overflow-button/overflow-button-expected.txt: Added. * media/modern-media-controls/overflow-support/chapters.html: Added. * media/modern-media-controls/overflow-support/chapters-expected.txt: Added. * media/modern-media-controls/overflow-support/playback-speed.html: Added. * media/modern-media-controls/overflow-support/playback-speed-expected.txt: Added. * TestExpectations: * platform/mac-wk2/TestExpectations: Canonical link: https://commits.webkit.org/238603@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278618 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-08 17:27:33 +00:00
2021-06-08 Devin Rousso <drousso@apple.com>
[Modern Media Controls] upstream new features
https://bugs.webkit.org/show_bug.cgi?id=226736
<rdar://problem/78957464>
Reviewed by Eric Carlson.
- bring the "Audio"/"Languages" tracks menu to iOS
- add a new "Playback Speed" menu on iOS and macOS in the overflow menu
- add support for showing the most relevant `<track kind="chapters">` in the overflow menu
* wtf/PlatformEnableCocoa.h:
2021-06-08 Sam Weinig <weinig@apple.com>
Add copy of std::span so that we can use it pre-moving to c++20
https://bugs.webkit.org/show_bug.cgi?id=226351
Reviewed by Alex Christensen.
Imports a copy of Tristan Brindle's Boost licensed implementation of std::span
from 5d8d366eca918d0ed3d2d196cbeae6abfd874736 of https://github.com/tcbrindle/span.
It has been further modified to rename tcb::span to WTF::Span.
* LICENSE_1_0-Boost.txt: Added.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/Span.h: Added.
2021-06-07 Alex Christensen <achristensen@webkit.org>
Adopt SecTrustGetCertificateAtIndex replacement where available
https://bugs.webkit.org/show_bug.cgi?id=225893
Reviewed by Chris Dumez.
rdar://74752046 introduced a new way to access the same thing.
* wtf/PlatformHave.h:
Drop legacy MainThreadTaskQueue & EventLoopTaskQueue classes https://bugs.webkit.org/show_bug.cgi?id=226734 Reviewed by Ryosuke Niwa. Source/WebCore: Drop legacy MainThreadTaskQueue & EventLoopTaskQueue classes. Code that was using MainThreadTaskQueue is now calling callOnMainThread() directly. Call that was using EventLoopTaskQueue is now using the HTML event loop directly. If said code needed to cancel tasks or check if a previously scheduled task is still pending, it now relies on WTF::CancellableTask / WTF::TaskCancellationGroup to do so. * Headers.cmake: * Modules/encryptedmedia/MediaKeySystemAccess.cpp: * WebCore.xcodeproj/project.pbxproj: * animation/DocumentTimelinesController.cpp: (WebCore::DocumentTimelinesController::cacheCurrentTime): (WebCore::DocumentTimelinesController::maybeClearCachedCurrentTime): * animation/DocumentTimelinesController.h: * dom/ActiveDOMObject.h: * dom/Document.h: * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::HTMLMediaElement): (WebCore::HTMLMediaElement::~HTMLMediaElement): (WebCore::HTMLMediaElement::scheduleNextSourceChild): (WebCore::HTMLMediaElement::scheduleCheckPlaybackTargetCompatability): (WebCore::HTMLMediaElement::seekWithTolerance): (WebCore::HTMLMediaElement::setVolume): (WebCore::HTMLMediaElement::scheduleConfigureTextTracks): (WebCore::HTMLMediaElement::scheduleMediaEngineWasUpdated): (WebCore::HTMLMediaElement::scheduleUpdatePlayState): (WebCore::HTMLMediaElement::cancelPendingTasks): (WebCore::HTMLMediaElement::clearMediaPlayer): (WebCore::HTMLMediaElement::closeTaskQueues): (WebCore::HTMLMediaElement::suspend): (WebCore::HTMLMediaElement::resume): (WebCore::HTMLMediaElement::virtualHasPendingActivity const): (WebCore::HTMLMediaElement::markCaptionAndSubtitleTracksAsUnconfigured): (WebCore::HTMLMediaElement::mediaPlayerBufferedTimeRangesChanged): (WebCore::HTMLMediaElement::scheduleUpdateMediaState): (WebCore::HTMLMediaElement::playbackControlsManagerBehaviorRestrictionsTimerFired): * html/HTMLMediaElement.h: * platform/GenericTaskQueue.h: Removed. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (-[WebCoreAVFMovieObserver metadataLoaded]): (-[WebCoreAVFMovieObserver didEnd:]): (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]): (-[WebCoreAVFMovieObserver legibleOutput:didOutputAttributedStrings:nativeSampleBuffers:forItemTime:]): (-[WebCoreAVFMovieObserver outputSequenceWasFlushed:]): (-[WebCoreAVFMovieObserver metadataOutput:didOutputTimedMetadataGroups:fromPlayerItemTrack:]): (-[WebCoreAVFMovieObserver metadataCollector:didCollectDateRangeMetadataGroups:indexesOfNewGroups:indexesOfModifiedGroups:]): (-[WebCoreAVFLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]): (-[WebCoreAVFLoaderDelegate resourceLoader:didCancelLoadingRequest:]): * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC): (WebCore::SourceBufferPrivateAVFObjC::didParseInitializationData): (WebCore::SourceBufferPrivateAVFObjC::abort): * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.h: Source/WTF: We recently introduced the WTF::CancellableTask in order to be able to cancel a pending task in the event loop, and/or check if the task is still pending. It worked great as a replacement for EventLoopDeferrableTask. However, it was insufficient as a replacement for task queues (such as MainThreadTaskQueue & EventLoopTaskQueue) since there was no convenient way to cancel a group of tasks. To address this, I am introducing WTF::TaskCancellationGroup. Whenever one needs to create a CancellableTask, it now needs to provide a TaskCancellationGroup. Several CancellableTask objects can share the same TaskCancellationGroup. Code now now schedule one or more CancellableTasks on the event loop and hold on to a TaskCancellationGroup. If they need to cancel those tasks, they can simply call cancel() on the TaskCancellationGroup. They can also check if previously scheduled tasks are still pending via TaskCancellationGroup::hasPendingTask(). * wtf/CancellableTask.h: (WTF::TaskCancellationGroup::TaskCancellationGroup): (WTF::TaskCancellationGroup::cancel): (WTF::TaskCancellationGroup::hasPendingTask const): (WTF::TaskCancellationGroup::Impl::cancel): (WTF::TaskCancellationGroup::Impl::hasPendingTask const): (WTF::TaskCancellationGroup::Handle::isCancelled const): (WTF::TaskCancellationGroup::Handle::Handle): (WTF::TaskCancellationGroup::createHandle): (WTF::CancellableTask::CancellableTask): (WTF::CancellableTask::operator()): * wtf/WeakPtr.h: (WTF::WeakPtrFactory::weakPtrCount const): Canonical link: https://commits.webkit.org/238574@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278580 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-08 00:29:50 +00:00
2021-06-07 Chris Dumez <cdumez@apple.com>
Drop legacy MainThreadTaskQueue & EventLoopTaskQueue classes
https://bugs.webkit.org/show_bug.cgi?id=226734
Reviewed by Ryosuke Niwa.
We recently introduced the WTF::CancellableTask in order to be able to cancel
a pending task in the event loop, and/or check if the task is still pending.
It worked great as a replacement for EventLoopDeferrableTask. However, it was
insufficient as a replacement for task queues (such as MainThreadTaskQueue &
EventLoopTaskQueue) since there was no convenient way to cancel a group of
tasks. To address this, I am introducing WTF::TaskCancellationGroup. Whenever one
needs to create a CancellableTask, it now needs to provide a TaskCancellationGroup.
Several CancellableTask objects can share the same TaskCancellationGroup. Code now
now schedule one or more CancellableTasks on the event loop and hold on
to a TaskCancellationGroup. If they need to cancel those tasks, they can simply
call cancel() on the TaskCancellationGroup. They can also check if previously
scheduled tasks are still pending via TaskCancellationGroup::hasPendingTask().
* wtf/CancellableTask.h:
(WTF::TaskCancellationGroup::TaskCancellationGroup):
(WTF::TaskCancellationGroup::cancel):
(WTF::TaskCancellationGroup::hasPendingTask const):
(WTF::TaskCancellationGroup::Impl::cancel):
(WTF::TaskCancellationGroup::Impl::hasPendingTask const):
(WTF::TaskCancellationGroup::Handle::isCancelled const):
(WTF::TaskCancellationGroup::Handle::Handle):
(WTF::TaskCancellationGroup::createHandle):
(WTF::CancellableTask::CancellableTask):
(WTF::CancellableTask::operator()):
* wtf/WeakPtr.h:
(WTF::WeakPtrFactory::weakPtrCount const):
Upstream WebKit support for Live Text https://bugs.webkit.org/show_bug.cgi?id=226706 <rdar://problem/78933684> Reviewed by Tim Horton. Source/WebCore: Upstream WebKit support for the family of "live text" and visual intelligence features from WebKitAdditions. This encompasses the following features on macOS 12 and iOS 15: - Text selection and interaction in images. - Data detectors in images. - Visual search (Look Up) via context menu in images. To do this, we rename the IMAGE_EXTRACTION feature flag (and any other similar symbol names that reference "image extraction" in some capacity) to their real names in macOS and iOS: - "Text recognition", in code that supports automatic OCR and data detectors in images. - "Look Up", in code that references the context menu action to invoke visual search. - "Visual Search", in code that manages QuickLook integration for invoking visual search. - "Image analysis", in code that directly integrates with VKImageAnalyzer and VKImageAnalyzerRequest. Tests: fast/images/text-recognition/basic-image-overlay.html fast/images/text-recognition/click-link-with-image-overlay.html fast/images/text-recognition/image-overlay-creation-is-idempotent.html fast/images/text-recognition/image-overlay-in-image-with-zero-font-size.html fast/images/text-recognition/image-overlay-with-selection-styles.html fast/images/text-recognition/ios/coalesce-selection-rects-in-image-overlay.html fast/images/text-recognition/ios/reselect-word-in-image-overlay.html fast/images/text-recognition/ios/select-word-in-image-overlay-inside-link.html fast/images/text-recognition/ios/select-word-in-image-overlay.html fast/images/text-recognition/ios/selection-rects-in-image-overlay.html fast/images/text-recognition/mac/copy-image-overlay-text-with-context-menu.html fast/images/text-recognition/mac/image-overlay-text-disables-app-highlight-menu-items.html fast/images/text-recognition/mac/select-image-overlay-in-link-with-mouse-drag.html fast/images/text-recognition/mac/select-image-overlay-with-mouse-drag-2.html fast/images/text-recognition/mac/select-image-overlay-with-mouse-drag-does-not-fire-click.html fast/images/text-recognition/mac/select-image-overlay-with-mouse-drag.html fast/images/text-recognition/mac/select-rotated-transparent-image-overlay.html fast/images/text-recognition/mac/select-word-in-draggable-image-overlay.html fast/images/text-recognition/mac/select-word-in-transparent-image-overlay.html * WebCore.xcodeproj/project.pbxproj: * editing/cocoa/DataDetection.h: * editing/cocoa/DataDetection.mm: (WebCore::DataDetection::createElementForImageOverlay): * en.lproj/Localizable.strings: * html/HTMLElement.cpp: (WebCore::HTMLElement::updateWithTextRecognitionResult): (WebCore::HTMLElement::updateWithImageExtractionResult): Deleted. * html/HTMLElement.h: * page/ChromeClient.h: (WebCore::ChromeClient::requestTextRecognition): (WebCore::ChromeClient::requestImageExtraction): Deleted. * page/ContextMenuController.cpp: (WebCore::ContextMenuController::contextMenuItemSelected): (WebCore::ContextMenuController::populate): (WebCore::ContextMenuController::checkOrEnableIfNeeded const): * page/EventHandler.cpp: (WebCore::EventHandler::EventHandler): (WebCore::EventHandler::clear): (WebCore::EventHandler::mouseMoved): (WebCore::EventHandler::updateMouseEventTargetNode): (WebCore::EventHandler::m_textRecognitionHoverTimerFired): (WebCore::EventHandler::imageExtractionTimerFired): Deleted. * page/EventHandler.h: * page/Quirks.cpp: * page/Quirks.h: * platform/ContextMenuItem.cpp: (WebCore::isValidContextMenuAction): * platform/ContextMenuItem.h: * platform/LocalizedStrings.h: * platform/TextRecognitionResult.h: Renamed from Source/WebCore/platform/ImageExtractionResult.h. Rename the following: - ImageExtractionResult => TextRecognitionResult - ImageExtractionTextData => TextRecognitionWordData - ImageExtractionLineData => TextRecognitionLineData - ImageExtractionDataDetectorInfo => TextRecognitionDataDetector (WebCore::TextRecognitionWordData::TextRecognitionWordData): (WebCore::TextRecognitionWordData::encode const): (WebCore::TextRecognitionWordData::decode): (WebCore::TextRecognitionLineData::TextRecognitionLineData): (WebCore::TextRecognitionDataDetector::TextRecognitionDataDetector): (WebCore::TextRecognitionLineData::encode const): (WebCore::TextRecognitionLineData::decode): (WebCore::TextRecognitionResult::isEmpty const): (WebCore::TextRecognitionResult::encode const): (WebCore::TextRecognitionResult::decode): * platform/cocoa/LocalizedStringsCocoa.mm: (WebCore::contextMenuItemTagLookUpImage): (WebCore::contextMenuItemTagRevealImage): Deleted. * testing/Internals.cpp: (WebCore::makeDataForLine): (WebCore::Internals::installImageOverlay): Source/WebKit: See WebCore/ChangeLog for more details. * Platform/cocoa/ImageExtractionUtilities.mm: Removed. * Platform/cocoa/TextRecognitionUtilities.h: Renamed from Source/WebKit/Platform/cocoa/ImageExtractionUtilities.h. * Platform/cocoa/TextRecognitionUtilities.mm: Added. Rename ImageExtractionUtilities to TextRecognitionUtilities. (WebKit::floatQuad): (WebKit::floatQuads): (WebKit::makeTextRecognitionResult): (WebKit::isLiveTextEnabled): * Shared/API/c/WKSharedAPICast.h: (WebKit::toAPI): (WebKit::toImpl): * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder<WebCore::TextRecognitionDataDetector>::encodePlatformData): (IPC::ArgumentCoder<WebCore::TextRecognitionDataDetector>::decodePlatformData): (IPC::ArgumentCoder<WebCore::ImageExtractionDataDetectorInfo>::encodePlatformData): Deleted. (IPC::ArgumentCoder<WebCore::ImageExtractionDataDetectorInfo>::decodePlatformData): Deleted. * Shared/TextRecognitionUpdateResult.h: Renamed from Source/WebKit/Shared/ImageExtractionUpdateResult.h. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder<TextRecognitionDataDetector>::encode): (IPC::ArgumentCoder<TextRecognitionDataDetector>::decode): (IPC::ArgumentCoder<ImageExtractionDataDetectorInfo>::encode): Deleted. (IPC::ArgumentCoder<ImageExtractionDataDetectorInfo>::decode): Deleted. * Shared/WebCoreArgumentCoders.h: * SourcesCocoa.txt: * UIProcess/API/Cocoa/_WKElementAction.mm: (+[_WKElementAction _elementActionWithType:customTitle:assistant:]): (+[_WKElementAction imageForElementActionType:]): Note that we need to keep the _WKElementActionTypeRevealImage SPI symbol, to avoid breaking MobileMail. * UIProcess/Cocoa/WebPageProxyCocoa.mm: (WebKit::WebPageProxy::handleContextMenuLookUpImage): (WebKit::WebPageProxy::handleContextMenuRevealImage): Deleted. Rename `handleContextMenuRevealImage` to `handleContextMenuLookUpImage`. * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::ensureImageAnalyzer): (WebKit::createImageAnalysisRequest): (WebKit::WebViewImpl::requestTextRecognition): (WebKit::WebViewImpl::computeHasVisualSearchResults): Rename `computeCanRevealImage` to `computeHasVisualSearchResults`. (WebKit::WebViewImpl::acceptsPreviewPanelControl): * UIProcess/PageClient.h: (WebKit::PageClient::requestTextRecognition): (WebKit::PageClient::computeHasVisualSearchResults): (WebKit::PageClient::requestImageExtraction): Deleted. (WebKit::PageClient::computeCanRevealImage): Deleted. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::contextMenuItemSelected): (WebKit::WebPageProxy::requestTextRecognition): (WebKit::WebPageProxy::computeHasVisualSearchResults): (WebKit::WebPageProxy::updateWithTextRecognitionResult): (WebKit::WebPageProxy::requestImageExtraction): Deleted. (WebKit::WebPageProxy::computeCanRevealImage): Deleted. (WebKit::WebPageProxy::updateWithImageExtractionResult): Deleted. Rename `updateWithImageExtractionResult` to `updateWithTextRecognitionResult`. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::requestTextRecognition): (WebKit::PageClientImpl::requestImageExtraction): Deleted. Rename `requestImageExtraction` to `requestTextRecognition`. * UIProcess/ios/WKActionSheetAssistant.h: * UIProcess/ios/WKActionSheetAssistant.mm: (-[WKActionSheetAssistant defaultActionsForLinkSheet:]): (-[WKActionSheetAssistant defaultActionsForImageSheet:]): (-[WKActionSheetAssistant handleElementActionWithType:element:needsInteraction:]): * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setUpInteraction]): (-[WKContentView cleanUpInteraction]): (-[WKContentView deferringGestures]): (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]): (-[WKContentView gestureRecognizer:shouldRequireFailureOfGestureRecognizer:]): (-[WKContentView gestureRecognizer:shouldBeRequiredToFailByGestureRecognizer:]): (-[WKContentView hasSelectablePositionAtPoint:]): (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]): (-[WKContentView canPerformActionForWebView:withSender:]): (-[WKContentView targetForAction:withSender:]): (-[WKContentView _didStartProvisionalLoadForMainFrame]): (-[WKContentView shouldDeferGestureDueToImageAnalysis:]): (-[WKContentView deferringGestureRecognizer:shouldDeferOtherGestureRecognizer:]): (-[WKContentView _dragInteraction:prepareForSession:completion:]): (-[WKContentView _endImageAnalysisGestureDeferral:]): (-[WKContentView _doAfterPendingImageAnalysis:]): (-[WKContentView _invokeAllActionsToPerformAfterPendingImageAnalysis:]): (-[WKContentView presentVisualSearchPreviewControllerForImage:imageURL:title:imageBounds:appearanceActions:]): (-[WKContentView previewController:frameForPreviewItem:inSourceView:]): (-[WKContentView previewController:transitionImageForPreviewItem:contentRect:]): (-[WKContentView previewControllerDidDismiss:]): (-[WKContentView numberOfPreviewItemsInPreviewController:]): (-[WKContentView previewController:previewItemAtIndex:]): (-[WKContentView provideDataForItem:]): (-[WKContentView actionSheetAssistant:shouldIncludeShowTextActionForElement:]): (-[WKContentView actionSheetAssistant:showTextForImage:imageURL:title:imageBounds:]): (-[WKContentView actionSheetAssistant:shouldIncludeLookUpImageActionForElement:]): (-[WKContentView actionSheetAssistant:lookUpImage:imageURL:title:imageBounds:]): (-[WKContentView imageAnalyzer]): (-[WKContentView hasPendingImageAnalysisRequest]): (-[WKContentView _setUpImageAnalysis]): (-[WKContentView _tearDownImageAnalysis]): (-[WKContentView _cancelImageAnalysis]): (-[WKContentView createImageAnalysisRequest:image:imageURL:]): (-[WKContentView createImageAnalysisRequest:image:]): (-[WKContentView validateImageAnalysisRequestIdentifier:]): (-[WKContentView requestTextRecognition:imageData:completionHandler:]): (-[WKContentView imageAnalysisGestureDidBegin:]): (-[WKContentView imageAnalysisGestureDidFail:]): (-[WKContentView imageAnalysisGestureDidTimeOut:]): (-[WKContentView _insertTextFromCameraForWebView:]): (-[WKContentView captureTextFromCameraForWebView:]): (-[WKContentView _contextMenuInteraction:configurationForMenuAtLocation:completion:]): (-[WKContentView continueContextMenuInteraction:]): (-[WKContentView contextMenuInteraction:willEndForConfiguration:animator:]): (-[WKContentView shouldDeferGestureDueToImageExtraction:]): Deleted. (-[WKContentView _endImageExtractionGestureDeferral:]): Deleted. (-[WKContentView _doAfterPendingImageExtraction:]): Deleted. (-[WKContentView _invokeAllActionsToPerformAfterPendingImageExtraction:]): Deleted. * UIProcess/ios/WKImageAnalysisGestureRecognizer.h: Renamed from Source/WebKit/UIProcess/ios/WKImageExtractionGestureRecognizer.h. * UIProcess/ios/WKImageAnalysisGestureRecognizer.mm: Renamed from Source/WebKit/UIProcess/ios/WKImageExtractionGestureRecognizer.mm. (-[WKImageAnalysisGestureRecognizer initWithImageAnalysisGestureDelegate:]): (-[WKImageAnalysisGestureRecognizer setState:]): Rename WKImageExtractionGestureRecognizer to WKImageAnalysisGestureRecognizer (along with all adjacent classes). * UIProcess/mac/PageClientImplMac.h: * UIProcess/mac/PageClientImplMac.mm: (WebKit::PageClientImpl::requestTextRecognition): (WebKit::PageClientImpl::computeHasVisualSearchResults): (WebKit::PageClientImpl::requestImageExtraction): Deleted. (WebKit::PageClientImpl::computeCanRevealImage): Deleted. * UIProcess/mac/WKVisualSearchPreviewController.h: Renamed from Source/WebKit/UIProcess/mac/WKImageExtractionPreviewController.h. * UIProcess/mac/WKVisualSearchPreviewController.mm: Renamed from Source/WebKit/UIProcess/mac/WKImageExtractionPreviewController.mm. (-[WKVisualSearchPreviewController initWithPage:imageData:title:imageURL:]): (-[WKVisualSearchPreviewController beginControl:]): (-[WKVisualSearchPreviewController endControl:]): (-[WKVisualSearchPreviewController closePanelIfNecessary]): (-[WKVisualSearchPreviewController isControlling:]): (-[WKVisualSearchPreviewController provideDataForItem:]): (-[WKVisualSearchPreviewController numberOfPreviewItemsInPreviewPanel:]): (-[WKVisualSearchPreviewController previewPanel:previewItemAtIndex:]): (-[WKVisualSearchPreviewController previewPanel:initialActivityForItem:]): Rename `WKImageExtractionPreviewController` to `WKVisualSearchPreviewController`. * UIProcess/mac/WebContextMenuProxyMac.mm: (WebKit::menuItemIdentifier): (WebKit::WebContextMenuProxyMac::getContextMenuFromItems): * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::beginPreviewPanelControl): (WebKit::WebPageProxy::endPreviewPanelControl): (WebKit::WebPageProxy::closeSharedPreviewPanelIfNecessary): (WebKit::WebPageProxy::showImageInVisualSearchPreviewPanel): * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::requestTextRecognition): (WebKit::WebChromeClient::requestImageExtraction): Deleted. * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didCommitLoad): (WebKit::WebPage::requestTextRecognition): (WebKit::WebPage::updateWithTextRecognitionResult): (WebKit::WebPage::requestImageExtraction): Deleted. (WebKit::WebPage::updateWithImageExtractionResult): Deleted. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: Source/WebKitLegacy/mac: * WebView/WebHTMLView.mm: Replace IMAGE_EXTRACTION with IMAGE_ANALYSIS. Source/WTF: * wtf/PlatformEnableCocoa.h: Move the feature flag out of WebKitAdditions and into OpenSource as IMAGE_ANALYSIS. Tools: Replace IMAGE_EXTRACTION with IMAGE_ANALYSIS. * TestWebKitAPI/Tests/WebKit/InjectedBundleHitTest.mm: * TestWebKitAPI/Tests/WebKitCocoa/DragAndDropTests.mm: * TestWebKitAPI/Tests/WebKitCocoa/FindInPage.mm: * TestWebKitAPI/Tests/WebKitCocoa/WKContentViewEditingActions.mm: * TestWebKitAPI/Tests/mac/ImmediateActionTests.mm: LayoutTests: Rename `fast/images/image-extraction` to `fast/images/text-recognition`. * TestExpectations: * fast/images/text-recognition/basic-image-overlay-expected-mismatch.html: Renamed from LayoutTests/fast/images/image-extraction/basic-image-overlay-expected-mismatch.html. * fast/images/text-recognition/basic-image-overlay.html: Renamed from LayoutTests/fast/images/image-extraction/basic-image-overlay.html. * fast/images/text-recognition/click-link-with-image-overlay-expected.txt: Renamed from LayoutTests/fast/images/image-extraction/click-link-with-image-overlay-expected.txt. * fast/images/text-recognition/click-link-with-image-overlay.html: Renamed from LayoutTests/fast/images/image-extraction/click-link-with-image-overlay.html. * fast/images/text-recognition/image-overlay-creation-is-idempotent-expected.txt: Renamed from LayoutTests/fast/images/image-extraction/image-overlay-creation-is-idempotent-expected.txt. * fast/images/text-recognition/image-overlay-creation-is-idempotent.html: Renamed from LayoutTests/fast/images/image-extraction/image-overlay-creation-is-idempotent.html. * fast/images/text-recognition/image-overlay-in-image-with-zero-font-size-expected-mismatch.html: Renamed from LayoutTests/fast/images/image-extraction/image-overlay-in-image-with-zero-font-size-expected-mismatch.html. * fast/images/text-recognition/image-overlay-in-image-with-zero-font-size.html: Renamed from LayoutTests/fast/images/image-extraction/image-overlay-in-image-with-zero-font-size.html. * fast/images/text-recognition/image-overlay-with-selection-styles-expected.html: Renamed from LayoutTests/fast/images/image-extraction/image-overlay-with-selection-styles-expected.html. * fast/images/text-recognition/image-overlay-with-selection-styles.html: Renamed from LayoutTests/fast/images/image-extraction/image-overlay-with-selection-styles.html. * fast/images/text-recognition/ios/coalesce-selection-rects-in-image-overlay-expected.txt: Renamed from LayoutTests/fast/images/image-extraction/ios/coalesce-selection-rects-in-image-overlay-expected.txt. * fast/images/text-recognition/ios/coalesce-selection-rects-in-image-overlay.html: Renamed from LayoutTests/fast/images/image-extraction/ios/coalesce-selection-rects-in-image-overlay.html. * fast/images/text-recognition/ios/reselect-word-in-image-overlay-expected.txt: Renamed from LayoutTests/fast/images/image-extraction/ios/reselect-word-in-image-overlay-expected.txt. * fast/images/text-recognition/ios/reselect-word-in-image-overlay.html: Renamed from LayoutTests/fast/images/image-extraction/ios/reselect-word-in-image-overlay.html. * fast/images/text-recognition/ios/select-word-in-image-overlay-expected.txt: Renamed from LayoutTests/fast/images/image-extraction/ios/select-word-in-image-overlay-expected.txt. * fast/images/text-recognition/ios/select-word-in-image-overlay-inside-link-expected.txt: Renamed from LayoutTests/fast/images/image-extraction/ios/select-word-in-image-overlay-inside-link-expected.txt. * fast/images/text-recognition/ios/select-word-in-image-overlay-inside-link.html: Renamed from LayoutTests/fast/images/image-extraction/ios/select-word-in-image-overlay-inside-link.html. * fast/images/text-recognition/ios/select-word-in-image-overlay.html: Renamed from LayoutTests/fast/images/image-extraction/ios/select-word-in-image-overlay.html. * fast/images/text-recognition/ios/selection-rects-in-image-overlay-expected.txt: Renamed from LayoutTests/fast/images/image-extraction/ios/selection-rects-in-image-overlay-expected.txt. * fast/images/text-recognition/ios/selection-rects-in-image-overlay.html: Renamed from LayoutTests/fast/images/image-extraction/ios/selection-rects-in-image-overlay.html. * fast/images/text-recognition/mac/copy-image-overlay-text-with-context-menu-expected.txt: Renamed from LayoutTests/fast/images/image-extraction/mac/copy-image-overlay-text-with-context-menu-expected.txt. * fast/images/text-recognition/mac/copy-image-overlay-text-with-context-menu.html: Renamed from LayoutTests/fast/images/image-extraction/mac/copy-image-overlay-text-with-context-menu.html. * fast/images/text-recognition/mac/image-overlay-text-disables-app-highlight-menu-items-expected.txt: Renamed from LayoutTests/fast/images/image-extraction/mac/image-overlay-text-disables-app-highlight-menu-items-expected.txt. * fast/images/text-recognition/mac/image-overlay-text-disables-app-highlight-menu-items.html: Renamed from LayoutTests/fast/images/image-extraction/mac/image-overlay-text-disables-app-highlight-menu-items.html. * fast/images/text-recognition/mac/select-image-overlay-in-link-with-mouse-drag-expected.txt: Renamed from LayoutTests/fast/images/image-extraction/mac/select-image-overlay-in-link-with-mouse-drag-expected.txt. * fast/images/text-recognition/mac/select-image-overlay-in-link-with-mouse-drag.html: Renamed from LayoutTests/fast/images/image-extraction/mac/select-image-overlay-in-link-with-mouse-drag.html. * fast/images/text-recognition/mac/select-image-overlay-with-mouse-drag-2-expected.html: Renamed from LayoutTests/fast/images/image-extraction/mac/select-image-overlay-with-mouse-drag-2-expected.html. * fast/images/text-recognition/mac/select-image-overlay-with-mouse-drag-2.html: Renamed from LayoutTests/fast/images/image-extraction/mac/select-image-overlay-with-mouse-drag-2.html. * fast/images/text-recognition/mac/select-image-overlay-with-mouse-drag-does-not-fire-click-expected.txt: Renamed from LayoutTests/fast/images/image-extraction/mac/select-image-overlay-with-mouse-drag-does-not-fire-click-expected.txt. * fast/images/text-recognition/mac/select-image-overlay-with-mouse-drag-does-not-fire-click.html: Renamed from LayoutTests/fast/images/image-extraction/mac/select-image-overlay-with-mouse-drag-does-not-fire-click.html. * fast/images/text-recognition/mac/select-image-overlay-with-mouse-drag-expected-mismatch.html: Renamed from LayoutTests/fast/images/image-extraction/mac/select-image-overlay-with-mouse-drag-expected-mismatch.html. * fast/images/text-recognition/mac/select-image-overlay-with-mouse-drag.html: Renamed from LayoutTests/fast/images/image-extraction/mac/select-image-overlay-with-mouse-drag.html. * fast/images/text-recognition/mac/select-rotated-transparent-image-overlay-expected.html: Renamed from LayoutTests/fast/images/image-extraction/mac/select-rotated-transparent-image-overlay-expected.html. * fast/images/text-recognition/mac/select-rotated-transparent-image-overlay.html: Renamed from LayoutTests/fast/images/image-extraction/mac/select-rotated-transparent-image-overlay.html. * fast/images/text-recognition/mac/select-word-in-draggable-image-overlay-expected-mismatch.html: Renamed from LayoutTests/fast/images/image-extraction/mac/select-word-in-draggable-image-overlay-expected-mismatch.html. * fast/images/text-recognition/mac/select-word-in-draggable-image-overlay.html: Renamed from LayoutTests/fast/images/image-extraction/mac/select-word-in-draggable-image-overlay.html. * fast/images/text-recognition/mac/select-word-in-transparent-image-overlay-expected-mismatch.html: Renamed from LayoutTests/fast/images/image-extraction/mac/select-word-in-transparent-image-overlay-expected-mismatch.html. * fast/images/text-recognition/mac/select-word-in-transparent-image-overlay.html: Renamed from LayoutTests/fast/images/image-extraction/mac/select-word-in-transparent-image-overlay.html. Canonical link: https://commits.webkit.org/238571@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278575 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-07 22:11:29 +00:00
2021-06-07 Wenson Hsieh <wenson_hsieh@apple.com>
Upstream WebKit support for Live Text
https://bugs.webkit.org/show_bug.cgi?id=226706
<rdar://problem/78933684>
Reviewed by Tim Horton.
* wtf/PlatformEnableCocoa.h:
Move the feature flag out of WebKitAdditions and into OpenSource as IMAGE_ANALYSIS.
2021-06-07 Alicia Boya García <aboya@igalia.com>
[WTF][GStreamer] Fix clang TSA warnings in WTF::DataMutex
https://bugs.webkit.org/show_bug.cgi?id=226719
Reviewed by Xabier Rodriguez-Calvar.
Fix the remaning clang thread safety warnings in WTF::DataMutex.
The goal of this patch is to reduce the number of warnings in the
GStreamer codebase. Whether DataMutex should be deprecated in favor of
Locker with the clang TSA annotations is outside of the scope of this
patch.
* wtf/DataMutex.h:
2021-06-07 Alicia Boya García <aboya@igalia.com>
[GStreamer] Remove spurious assert in WTF::DataMutex
https://bugs.webkit.org/show_bug.cgi?id=226714
Reviewed by Michael Catanzaro.
Remove DATA_MUTEX_CHECK(!mutex().isHeld()); from the DataMutexLocker
constructor, introduced in r278248.
Trying to lock a currently held mutex is not an error condition that
should crash the process, it will just wait for its turn to lock it.
* wtf/DataMutex.h:
Stop using legacy EventLoopDeferrableTask https://bugs.webkit.org/show_bug.cgi?id=226700 Reviewed by Darin Adler. Source/WebCore: Stop using legacy EventLoopDeferrableTask and drop the class entirely. Call sites are now using the HTML event loop directly and using WTF::CancellableTask to wrap the task they schedule. This achieves the same result as EventLoopDeferrableTask but is more lightweight and flexible. * animation/DocumentTimelinesController.cpp: (WebCore::DocumentTimelinesController::DocumentTimelinesController): (WebCore::DocumentTimelinesController::detachFromDocument): (WebCore::DocumentTimelinesController::cacheCurrentTime): * animation/DocumentTimelinesController.h: * dom/ActiveDOMObject.h: * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::HTMLMediaElement): (WebCore::HTMLMediaElement::~HTMLMediaElement): (WebCore::HTMLMediaElement::scheduleCheckPlaybackTargetCompatability): (WebCore::HTMLMediaElement::seekWithTolerance): (WebCore::HTMLMediaElement::setVolume): (WebCore::HTMLMediaElement::scheduleConfigureTextTracks): (WebCore::HTMLMediaElement::scheduleMediaEngineWasUpdated): (WebCore::HTMLMediaElement::scheduleUpdatePlayState): (WebCore::HTMLMediaElement::cancelPendingTasks): (WebCore::HTMLMediaElement::closeTaskQueues): (WebCore::HTMLMediaElement::suspend): (WebCore::HTMLMediaElement::resume): (WebCore::HTMLMediaElement::markCaptionAndSubtitleTracksAsUnconfigured): (WebCore::HTMLMediaElement::mediaPlayerBufferedTimeRangesChanged): (WebCore::HTMLMediaElement::scheduleUpdateMediaState): (WebCore::HTMLMediaElement::playbackControlsManagerBehaviorRestrictionsTimerFired): * html/HTMLMediaElement.h: * platform/DeferrableTask.h: Source/WTF: Introduce new WTF::CancellableTask type which is a wrapper around a WTF::Function. It can create a handle for the task and this handle can be used to check if the task is still pending and to cancel it. This is useful when scheduling tasks in the event loop for example as there are cases where we need to know if a task we scheduled is still pending (to avoid double scheduling) or where we need to cancel a previously scheduled task. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/CancellableTask.h: Added. (WTF::CancellableTask::CancellableTask): (WTF::CancellableTask::operator()): (WTF::CancellableTask::isPending const): (WTF::CancellableTask::cancel): (WTF::CancellableTask::Handle::Handle): (WTF::CancellableTask::Handle::isPending const): (WTF::CancellableTask::Handle::cancel): (WTF::CancellableTask::createHandle): Canonical link: https://commits.webkit.org/238541@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278543 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-07 04:22:38 +00:00
2021-06-06 Chris Dumez <cdumez@apple.com>
Stop using legacy EventLoopDeferrableTask
https://bugs.webkit.org/show_bug.cgi?id=226700
Reviewed by Darin Adler.
Introduce new WTF::CancellableTask type which is a wrapper around a WTF::Function.
It can create a handle for the task and this handle can be used to check if the
task is still pending and to cancel it. This is useful when scheduling tasks in the
event loop for example as there are cases where we need to know if a task we
scheduled is still pending (to avoid double scheduling) or where we need to cancel
a previously scheduled task.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/CancellableTask.h: Added.
(WTF::CancellableTask::CancellableTask):
(WTF::CancellableTask::operator()):
(WTF::CancellableTask::isPending const):
(WTF::CancellableTask::cancel):
(WTF::CancellableTask::Handle::Handle):
(WTF::CancellableTask::Handle::isPending const):
(WTF::CancellableTask::Handle::cancel):
(WTF::CancellableTask::createHandle):
FileSystem::readFromFile() should return data as `void*` https://bugs.webkit.org/show_bug.cgi?id=226671 Reviewed by Darin Adler. FileSystem::readFromFile() should return data as `void*` instead of `char*`. This is more flexible and consistent with FileSystem::writeToFile(). Source/JavaScriptCore: * inspector/remote/socket/RemoteInspectorSocket.cpp: (Inspector::RemoteInspector::backendCommands const): Source/WebCore: * platform/FileHandle.cpp: (WebCore::FileHandle::read): * platform/FileStream.cpp: (WebCore::FileStream::read): * platform/FileStream.h: * platform/network/BlobResourceHandle.cpp: (WebCore::BlobResourceHandle::readSync): (WebCore::BlobResourceHandle::readDataSync): (WebCore::BlobResourceHandle::readFileSync): (WebCore::BlobResourceHandle::notifyReceiveData): * platform/network/BlobResourceHandle.h: * platform/network/curl/CurlCacheEntry.cpp: (WebCore::CurlCacheEntry::readCachedData): (WebCore::CurlCacheEntry::loadResponseHeaders): (WebCore::CurlCacheEntry::loadFileToBuffer): * platform/network/curl/CurlCacheEntry.h: * rendering/RenderThemeWin.cpp: (WebCore::fillBufferWithContentsOfFile): (WebCore::RenderThemeWin::stringWithContentsOfFile): Source/WebKit: * NetworkProcess/cache/NetworkCacheIOChannelCurl.cpp: (WebKit::NetworkCache::IOChannel::read): * Shared/PersistencyUtils.cpp: (WebKit::createForFile): Source/WTF: * wtf/FileSystem.cpp: (WTF::FileSystemImpl::appendFileContentsToFileHandle): (WTF::FileSystemImpl::readOrMakeSalt): * wtf/FileSystem.h: * wtf/glib/FileSystemGlib.cpp: (WTF::FileSystemImpl::readFromFile): * wtf/posix/FileSystemPOSIX.cpp: (WTF::FileSystemImpl::readFromFile): * wtf/win/FileSystemWin.cpp: (WTF::FileSystemImpl::readFromFile): Tools: * TestWebKitAPI/Tests/WebCore/FileMonitor.cpp: (TestWebKitAPI::readContentsOfFile): Canonical link: https://commits.webkit.org/238520@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278521 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-05 04:47:23 +00:00
2021-06-04 Chris Dumez <cdumez@apple.com>
FileSystem::readFromFile() should return data as `void*`
https://bugs.webkit.org/show_bug.cgi?id=226671
Reviewed by Darin Adler.
FileSystem::readFromFile() should return data as `void*` instead of `char*`. This is more flexible and
consistent with FileSystem::writeToFile().
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::appendFileContentsToFileHandle):
(WTF::FileSystemImpl::readOrMakeSalt):
* wtf/FileSystem.h:
* wtf/glib/FileSystemGlib.cpp:
(WTF::FileSystemImpl::readFromFile):
* wtf/posix/FileSystemPOSIX.cpp:
(WTF::FileSystemImpl::readFromFile):
* wtf/win/FileSystemWin.cpp:
(WTF::FileSystemImpl::readFromFile):
Implement off-by-default experimental feature for PerformanceResourceTiming.transferSize, encodedBodySize, and decodedBodySize https://bugs.webkit.org/show_bug.cgi?id=226629 Reviewed by Brady Eidson. LayoutTests/imported/w3c: * web-platform-tests/navigation-timing/nav2_test_attributes_exist-expected.txt: * web-platform-tests/navigation-timing/nav2_test_attributes_values-expected.txt: * web-platform-tests/navigation-timing/secure_connection_start_non_zero.https-expected.txt: * web-platform-tests/navigation-timing/test_document_onload-expected.txt: * web-platform-tests/resource-timing/TAO-case-insensitive-null-opaque-origin.sub-expected.txt: * web-platform-tests/resource-timing/TAO-crossorigin-port.sub-expected.txt: * web-platform-tests/resource-timing/TAO-null-opaque-origin.sub-expected.txt: This apparent regression is actually just uncovering an existing failure. The test expects the sum of many values to not be equal to zero. It used to be adding undefined to many 0 values, which returned undefined, which is not equal to zero. Now it's adding 0's and getting 0 which correctly indicates that we are not exposing timing values where we should. * web-platform-tests/resource-timing/cors-preflight.any-expected.txt: * web-platform-tests/resource-timing/cors-preflight.any.worker-expected.txt: * web-platform-tests/resource-timing/idlharness.any-expected.txt: * web-platform-tests/resource-timing/idlharness.any.worker-expected.txt: * web-platform-tests/resource-timing/resource-timing-level1.sub-expected.txt: * web-platform-tests/resource-timing/resource_connection_reuse-expected.txt: * web-platform-tests/resource-timing/resource_connection_reuse.https-expected.txt: * web-platform-tests/resource-timing/single-entry-per-resource-expected.txt: * web-platform-tests/resource-timing/test_resource_timing.https-expected.txt: * web-platform-tests/service-workers/service-worker/resource-timing-cross-origin.https-expected.txt: Source/WebCore: The tests for TAO are entangled with the tests for these properties. Having an implementation helps see what is still broken. Covered by web platform tests. * page/PerformanceResourceTiming.cpp: (WebCore::PerformanceResourceTiming::transferSize const): (WebCore::PerformanceResourceTiming::encodedBodySize const): (WebCore::PerformanceResourceTiming::decodedBodySize const): * page/PerformanceResourceTiming.h: * page/PerformanceResourceTiming.idl: Source/WebKit: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]): Source/WTF: * Scripts/Preferences/WebPreferencesExperimental.yaml: LayoutTests: * performance-api/resource-timing-apis-expected.txt: * platform/mac/imported/w3c/web-platform-tests/resource-timing/test_resource_timing-expected.txt: Removed. Canonical link: https://commits.webkit.org/238495@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278477 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-04 18:35:42 +00:00
2021-06-04 Alex Christensen <achristensen@webkit.org>
Implement off-by-default experimental feature for PerformanceResourceTiming.transferSize, encodedBodySize, and decodedBodySize
https://bugs.webkit.org/show_bug.cgi?id=226629
Reviewed by Brady Eidson.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
2021-06-04 Devin Rousso <drousso@apple.com>
Add a way to prefix output of `WTFReportBacktrace` to make log filtering easier
https://bugs.webkit.org/show_bug.cgi?id=226390
Reviewed by Megan Gardner.
Often times while debugging I add `WTFLogAlways("<DR> ...")` to various places as indicators
that "logic has reached here". This is especially useful when debugging iOS as unlike macOS
there's no console output from `run-safari`, meaning that I have to use system logging,
which is often a deluge of unrelated information. Having "<DR>" as a prefix makes filtering
through the system logging trivial as I can ignore logs that don't have it. Unfortunately,
`WTFReportBacktrace` does not have a way to add this prefix, so it becomes much harder to
find in the logs. This patch enables adding a prefix to each line of `WTFReportBacktrace`
via a new function `WTFReportBactraceWithPrefix`.
* wtf/Assertions.h:
* wtf/Assertions.cpp:
(WTFReportBacktraceWithPrefix): Added.
(WTFPrintBacktraceWithPrefix): Added.
* wtf/StackTrace.h:
(WTF::StackTrace::StackTrace):
* wtf/StackTrace.cpp:
(WTF::StackTrace::dump const):
2021-06-04 Michael Catanzaro <mcatanzaro@gnome.org>
Fix more GCC warnings
https://bugs.webkit.org/show_bug.cgi?id=226193
Reviewed by Adrian Perez de Castro.
Add missing static_cast<void*> required to suppress GCC's -Wclass-memaccess warning when
intentionally not running constructors/destructors. There's already a static_assert to
ensure this is safe, which is better than usual for us.
* wtf/SmallSet.h:
2021-06-03 Chris Dumez <cdumez@apple.com>
Unreviewed build fix after r277881.
Fix warning about unused function.
* wtf/cocoa/FileSystemCocoa.mm:
REGRESSION(r277744): Broke build on s390x mainframes https://bugs.webkit.org/show_bug.cgi?id=226497 Patch by Michael Catanzaro <mcatanzaro@gnome.org> on 2021-06-03 Reviewed by Darin Adler. The problem is we have a template defined in a C++ source file, used by multiple source files. This is not valid C++, so let's split the templates defined in StringBuilder.cpp out into a new StringBuilderInternals.h that we can #include in both StringBuilder.cpp and StringBuilderJSON.cpp. Ideally we would move the template defined in StringBuilderJSON.cpp as well, and then eliminate StringBuilderJSON.cpp since there would only be one function left. But that file has an MPL license. It's easier to leave it be to keep the license situation simpler. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/text/StringBuilder.cpp: (WTF::StringBuilder::expandedCapacity): (WTF::expandedCapacity): Deleted. (WTF::StringBuilder::allocateBuffer): Deleted. (WTF::StringBuilder::extendBufferForAppending): Deleted. (WTF::StringBuilder::extendBufferForAppendingSlowCase): Deleted. * wtf/text/StringBuilder.h: * wtf/text/StringBuilderInternals.h: Added. (WTF::StringBuilder::allocateBuffer): (WTF::StringBuilder::reallocateBuffer): (WTF::StringBuilder::extendBufferForAppending): (WTF::StringBuilder::extendBufferForAppendingSlowCase): * wtf/text/StringBuilderJSON.cpp: Canonical link: https://commits.webkit.org/238429@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278404 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-03 13:10:38 +00:00
2021-06-03 Michael Catanzaro <mcatanzaro@gnome.org>
REGRESSION(r277744): Broke build on s390x mainframes
https://bugs.webkit.org/show_bug.cgi?id=226497
Reviewed by Darin Adler.
The problem is we have a template defined in a C++ source file, used by multiple source
files. This is not valid C++, so let's split the templates defined in StringBuilder.cpp out
into a new StringBuilderInternals.h that we can #include in both StringBuilder.cpp and
StringBuilderJSON.cpp.
Ideally we would move the template defined in StringBuilderJSON.cpp as well, and then
eliminate StringBuilderJSON.cpp since there would only be one function left. But that file
has an MPL license. It's easier to leave it be to keep the license situation simpler.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/text/StringBuilder.cpp:
(WTF::StringBuilder::expandedCapacity):
(WTF::expandedCapacity): Deleted.
(WTF::StringBuilder::allocateBuffer): Deleted.
(WTF::StringBuilder::extendBufferForAppending): Deleted.
(WTF::StringBuilder::extendBufferForAppendingSlowCase): Deleted.
* wtf/text/StringBuilder.h:
* wtf/text/StringBuilderInternals.h: Added.
(WTF::StringBuilder::allocateBuffer):
(WTF::StringBuilder::reallocateBuffer):
(WTF::StringBuilder::extendBufferForAppending):
(WTF::StringBuilder::extendBufferForAppendingSlowCase):
* wtf/text/StringBuilderJSON.cpp:
2021-06-02 Chris Dumez <cdumez@apple.com>
Drop WTF::Vector overloads taking index as Checked<size_t>
https://bugs.webkit.org/show_bug.cgi?id=226553
Reviewed by Geoffrey Garen.
Drop WTF::Vector overloads taking index as Checked<size_t>. They are no longer needed now that
Checked<size_t> can implicitly get converted to size_t (r278338).
* wtf/Vector.h:
(WTF::Vector::at const):
(WTF::Vector::operator[] const):
2021-06-02 Chris Dumez <cdumez@apple.com>
Drop Checked::safeGet()
https://bugs.webkit.org/show_bug.cgi?id=226537
Reviewed by Geoffrey Garen.
Drop Checked::safeGet() and replace with uses of Checked::operator T() or Checked::value().
safeGet() is a bit akward, having both a return value and an out-parameter.
* wtf/CheckedArithmetic.h:
(WTF::Checked::value const):
(WTF::operator+):
(WTF::operator-):
(WTF::operator*):
(WTF::operator/):
2021-06-02 Antti Koivisto <antti@apple.com>
Style::Scope should use CheckedPtr
https://bugs.webkit.org/show_bug.cgi?id=226530
Reviewed by Sam Weinig.
* wtf/CMakeLists.txt:
Use Checked aliases instead of Checked<T, RecordOverflow> https://bugs.webkit.org/show_bug.cgi?id=226535 Reviewed by Keith Miller. Source/JavaScriptCore: * dfg/DFGAbstractInterpreterInlines.h: (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects): * ftl/FTLOperations.cpp: (JSC::FTL::JSC_DEFINE_JIT_OPERATION): * runtime/JSArray.cpp: (JSC::JSArray::appendMemcpy): (JSC::JSArray::unshiftCountWithAnyIndexingType): * runtime/JSStringJoiner.cpp: (JSC::JSStringJoiner::joinedLength const): * runtime/JSStringJoiner.h: * runtime/StringPrototype.cpp: (JSC::jsSpliceSubstringsWithSeparators): * wasm/WasmFormat.cpp: (JSC::Wasm::Segment::create): * wasm/WasmOperations.cpp: (JSC::Wasm::JSC_DEFINE_JIT_OPERATION): * wasm/WasmTable.cpp: (JSC::Wasm::Table::grow): * yarr/YarrInterpreter.cpp: (JSC::Yarr::ByteCompiler::emitDisjunction): * yarr/YarrParser.h: (JSC::Yarr::Parser::consumeNumber): * yarr/YarrPattern.cpp: Source/WebCore: * html/ImageData.cpp: (WebCore::computeDataSize): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::validateTexFuncData): (WebCore::WebGLRenderingContextBase::validateCompressedTexFuncData): * platform/graphics/GraphicsContextGL.cpp: (WebCore::GraphicsContextGL::computeImageSizeInBytes): * platform/graphics/IntRect.cpp: (WebCore::IntRect::isValid const): * platform/graphics/PixelBuffer.cpp: (WebCore::PixelBuffer::computeBufferSize): * platform/graphics/PixelBuffer.h: * platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.cpp: (WebCore::ISOFairPlayStreamingKeyRequestInfoBox::parse): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::updateBackdropFilters): * platform/graphics/cg/ImageBufferCGBitmapBackend.cpp: (WebCore::ImageBufferCGBitmapBackend::calculateSafeBackendSize): * platform/graphics/win/Direct2DUtilities.cpp: (WebCore::Direct2D::createDirect2DImageSurfaceWithData): * platform/graphics/win/ImageBufferDirect2DBackend.cpp: (WebCore::ImageBufferDirect2DBackend::copyNativeImage const): (WebCore::ImageBufferDirect2DBackend::compatibleBitmap): Source/WebKit: * Shared/ShareableBitmap.cpp: (WebKit::ShareableBitmap::numBytesForSize): * Shared/ShareableBitmap.h: * Shared/cairo/ShareableBitmapCairo.cpp: (WebKit::ShareableBitmap::calculateBytesPerRow): (WebKit::ShareableBitmap::calculateBytesPerPixel): * Shared/cg/ShareableBitmapCG.cpp: (WebKit::ShareableBitmap::calculateBytesPerRow): (WebKit::ShareableBitmap::calculateBytesPerPixel): * Shared/win/ShareableBitmapDirect2D.cpp: (WebKit::ShareableBitmap::calculateBytesPerRow): (WebKit::ShareableBitmap::calculateBytesPerPixel): * UIProcess/mac/TextCheckerMac.mm: (WebKit::TextChecker::updateSpellingUIWithGrammarString): * WebProcess/GPU/graphics/ImageBufferShareableBitmapBackend.cpp: (WebKit::ImageBufferShareableBitmapBackend::calculateSafeBackendSize): Source/WTF: * wtf/URLHelpers.cpp: (WTF::URLHelpers::userVisibleURL): * wtf/URLParser.cpp: (WTF::URLParser::parseIPv4Piece): * wtf/cocoa/NSURLExtras.mm: (WTF::dataWithUserTypedString): * wtf/glib/SocketConnection.cpp: (WTF::SocketConnection::sendMessage): Canonical link: https://commits.webkit.org/238383@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278351 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-02 15:42:27 +00:00
2021-06-02 Chris Dumez <cdumez@apple.com>
Use Checked aliases instead of Checked<T, RecordOverflow>
https://bugs.webkit.org/show_bug.cgi?id=226535
Reviewed by Keith Miller.
* wtf/URLHelpers.cpp:
(WTF::URLHelpers::userVisibleURL):
* wtf/URLParser.cpp:
(WTF::URLParser::parseIPv4Piece):
* wtf/cocoa/NSURLExtras.mm:
(WTF::dataWithUserTypedString):
* wtf/glib/SocketConnection.cpp:
(WTF::SocketConnection::sendMessage):
Add CheckedPtr https://bugs.webkit.org/show_bug.cgi?id=226158 Reviewed by Antti Koivisto. Source/WTF: This patch introduces a new type of smart pointer, CheckedPtr, which behaves like RefPtr and let each object keep track of pointers pointing to the object. Unlike CheckedPtr, the purpose of this internal counter is to release assert that there is no outstanding pointer at the time of destruction instead of keeping the object alive when there is one. * WTF.xcodeproj/project.pbxproj: * wtf/CheckedPtr.h: Added. (WTF::CheckedPtr): Added. (WTF::CheckedPtr::CheckedPtr): Added. (WTF::CheckedPtr::~CheckedPtr): Added. (WTF::CheckedPtr::isHashTableDeletedValue const): Added. (WTF::CheckedPtr::operator UnspecifiedBoolType const): Added. (WTF::CheckedPtr::operator! const): Added. (WTF::CheckedPtr::get const): Added. (WTF::CheckedPtr::get): Added. (WTF::CheckedPtr::operator* const): Added. (WTF::CheckedPtr::operator*): Added. (WTF::CheckedPtr::operator-> const): Added. (WTF::CheckedPtr::operator->): Added. (WTF::CheckedPtr::operator== const): Added. (WTF::CheckedPtr::operator=): Added. (WTF::CheckedPtr::unspecifiedBoolTypeInstance const): Added. (WTF::CheckedPtr::refIfNotNull): Added. (WTF::CheckedPtr::derefIfNotNull): Added. (WTF::makeCheckedPtr): Added. (WTF::is): Added. (WTF::CanMakeCheckedPtr): Added. (WTF::CanMakeCheckedPtr::~CanMakeCheckedPtr): Added. Release assert that m_ptrCount is 0. (WTF::CanMakeCheckedPtr::ptrCount const): Added. (WTF::CanMakeCheckedPtr::incrementPtrCount): Added. (WTF::CanMakeCheckedPtr::decrementPtrCount): Added. Note that we don't do anything when m_ptrCount becomes 0 unlike RefPtr. (WTF::HashTraits<CheckedPtr<P>>): Added. (WTF::HashTraits<CheckedPtr<P>>::emptyValue): Added. (WTF::HashTraits<CheckedPtr<P>>::peek): Added. (WTF::HashTraits<CheckedPtr<P>>::customDeleteBucket): Added. Tools: Added basic tests. * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/CheckedPtr.cpp: Added. (TestWebKitAPI::CheckedObject): Added. (TestWebKitAPI::DerivedCheckedObject): Added. (WTF_CheckedPtr.Basic): (WTF_CheckedPtr.DerivedClass): (WTF_CheckedPtr.HashSet): Canonical link: https://commits.webkit.org/238376@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278344 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-02 08:43:13 +00:00
2021-05-23 Ryosuke Niwa <rniwa@webkit.org>
Add CheckedPtr
https://bugs.webkit.org/show_bug.cgi?id=226158
Reviewed by Antti Koivisto.
This patch introduces a new type of smart pointer, CheckedPtr, which behaves like RefPtr and
let each object keep track of pointers pointing to the object. Unlike CheckedPtr, the purpose of
this internal counter is to release assert that there is no outstanding pointer at the time
of destruction instead of keeping the object alive when there is one.
* WTF.xcodeproj/project.pbxproj:
* wtf/CheckedPtr.h: Added.
(WTF::CheckedPtr): Added.
(WTF::CheckedPtr::CheckedPtr): Added.
(WTF::CheckedPtr::~CheckedPtr): Added.
(WTF::CheckedPtr::isHashTableDeletedValue const): Added.
(WTF::CheckedPtr::operator UnspecifiedBoolType const): Added.
(WTF::CheckedPtr::operator! const): Added.
(WTF::CheckedPtr::get const): Added.
(WTF::CheckedPtr::get): Added.
(WTF::CheckedPtr::operator* const): Added.
(WTF::CheckedPtr::operator*): Added.
(WTF::CheckedPtr::operator-> const): Added.
(WTF::CheckedPtr::operator->): Added.
(WTF::CheckedPtr::operator== const): Added.
(WTF::CheckedPtr::operator=): Added.
(WTF::CheckedPtr::unspecifiedBoolTypeInstance const): Added.
(WTF::CheckedPtr::refIfNotNull): Added.
(WTF::CheckedPtr::derefIfNotNull): Added.
(WTF::makeCheckedPtr): Added.
(WTF::is): Added.
(WTF::CanMakeCheckedPtr): Added.
(WTF::CanMakeCheckedPtr::~CanMakeCheckedPtr): Added. Release assert that m_ptrCount is 0.
(WTF::CanMakeCheckedPtr::ptrCount const): Added.
(WTF::CanMakeCheckedPtr::incrementPtrCount): Added.
(WTF::CanMakeCheckedPtr::decrementPtrCount): Added. Note that we don't do anything when m_ptrCount
becomes 0 unlike RefPtr.
(WTF::HashTraits<CheckedPtr<P>>): Added.
(WTF::HashTraits<CheckedPtr<P>>::emptyValue): Added.
(WTF::HashTraits<CheckedPtr<P>>::peek): Added.
(WTF::HashTraits<CheckedPtr<P>>::customDeleteBucket): Added.
Remove <wtf/Optional.h> https://bugs.webkit.org/show_bug.cgi?id=226437 Reviewed by Chris Dumez. Source/JavaScriptCore: * <many files>: Remove include of <wtf/Optional.h>. * inspector/scripts/codegen/generate_cpp_backend_dispatcher_header.py: (CppBackendDispatcherHeaderGenerator._generate_secondary_header_includes): Don't generate an include of wtf/Optional.h; including WTFString.h takes care of this anyway. * inspector/scripts/codegen/generate_cpp_frontend_dispatcher_header.py: (CppFrontendDispatcherHeaderGenerator._generate_secondary_header_includes): Ditto. * inspector/scripts/codegen/generate_cpp_protocol_types_header.py: (CppProtocolTypesHeaderGenerator._generate_secondary_header_includes): Ditto. * inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py: (CppProtocolTypesImplementationGenerator.generate_output): Generate an include of <optional> instead of <wtf/Optional.h>. * inspector/scripts/tests/expected/*: Regenerate. Source/WebCore: * <many files>: Removed include of <wtf/Optional.h>. * platform/graphics/Font.h: Tweaked style a bit. * Modules/geolocation/GeolocationClient.h: Added include of <optional>. * Modules/mediastream/DoubleRange.h: Ditto. * Modules/mediastream/LongRange.h: Ditto. * Modules/webauthn/AuthenticationExtensionsClientOutputs.h: Ditto. * css/CSSToLengthConversionData.h: Ditto. * css/DOMMatrix2DInit.h: Ditto. * dom/AddEventListenerOptions.h: Ditto. * dom/DeviceMotionData.h: Ditto. * dom/DeviceOrientationData.h: Ditto. * dom/SuccessOr.h: Ditto. * html/DateTimeFieldsState.h: Ditto. * html/ImageBitmapOptions.h: Ditto. * html/canvas/PredefinedColorSpace.h: Ditto. * layout/LayoutPhase.h: Ditto. * layout/MarginTypes.h: Ditto. * loader/ResourceLoadNotifier.h: Ditto. * page/RuntimeEnabledFeatures.h: Ditto. * page/ScrollOptions.h: Ditto. * platform/MediaCapabilitiesInfo.h: Ditto. * platform/cocoa/SystemBattery.h: Ditto. * platform/graphics/DecodingOptions.h: Ditto. * platform/graphics/DestinationColorSpace.h: Ditto. * platform/graphics/DisplayRefreshMonitorClient.h: Ditto. * platform/graphics/FloatLine.h: Ditto. * platform/graphics/gpu/GPURequestAdapterOptions.h: Ditto. * platform/graphics/x11/PlatformDisplayX11.h: Ditto. * platform/ios/SelectionGeometry.h: Ditto. * platform/mac/NSScrollerImpDetails.h: Ditto. * platform/network/DNS.h: Ditto. * platform/text/EncodingTables.h: Ditto. * platform/text/TextCodecCJK.h: Ditto. * platform/text/TextCodecUTF16.h: Ditto. * platform/text/TextFlags.h: Ditto. Source/WebCore/PAL: * pal/SessionID.h: Include <optional>. * pal/crypto/gcrypt/Utilities.h: Ditto. * pal/crypto/tasn1/Utilities.cpp: Removed include of <wtf/Optional.h>. Source/WebDriver: * SessionHost.h: Removed include of <wtf/Optional.h>. Source/WebKit: * <many files>: Removed include of <wtf/Optional.h>. Source/WebKitLegacy/mac: * DOM/DOMRangeInternal.h: Added import of <optional>. * WebView/WebGeolocationPosition.mm: Removed import of <wtf/Optional.h>. * WebView/WebGeolocationPositionInternal.h: Added import of <optional>. Source/WTF: * <many files>: Removed include of <wtf/Optional.h>. * WTF.xcodeproj/project.pbxproj: Removed Optional.h. * wtf/Markable.h: Added include of <optional>. * wtf/OptionSet.h: Ditto. * wtf/Optional.h: Emptied this file. On the Windows build system, we can't seem to build successfully without an empty file here. The copied forwarding header seems to linger even if we remove the original. Until we fix the Windows build system, if we want to support incremental builds, we need to keep this empty file around. * wtf/PrintStream.h: Added include of <optional>. * wtf/Seconds.h: Ditto. * wtf/StackTrace.h: Ditto. * wtf/StdLibExtras.h: Moved the valueOrCompute function here from Optional.h. Re-sorted the "using" at the bottom of the file. * wtf/URLHelpers.h: Added include of <optional>. * wtf/Vector.h: Ditto. Tools: * <many files>: Removed include of <wtf/Optional.h>. Canonical link: https://commits.webkit.org/238372@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278340 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-02 06:45:51 +00:00
2021-06-01 Darin Adler <darin@apple.com>
Remove <wtf/Optional.h>
https://bugs.webkit.org/show_bug.cgi?id=226437
Reviewed by Chris Dumez.
* <many files>: Removed include of <wtf/Optional.h>.
* WTF.xcodeproj/project.pbxproj: Removed Optional.h.
* wtf/Markable.h: Added include of <optional>.
* wtf/OptionSet.h: Ditto.
* wtf/Optional.h: Emptied this file. On the Windows build system, we can't
seem to build successfully without an empty file here. The copied forwarding
header seems to linger even if we remove the original. Until we fix the
Windows build system, if we want to support incremental builds, we need
to keep this empty file around.
* wtf/PrintStream.h: Added include of <optional>.
* wtf/Seconds.h: Ditto.
* wtf/StackTrace.h: Ditto.
* wtf/StdLibExtras.h: Moved the valueOrCompute function here from Optional.h.
Re-sorted the "using" at the bottom of the file.
* wtf/URLHelpers.h: Added include of <optional>.
* wtf/Vector.h: Ditto.
Rename Checked::unsafeGet() to Checked::value() https://bugs.webkit.org/show_bug.cgi?id=226514 Reviewed by Darin Adler. Rename Checked::unsafeGet() to Checked::value(). The "unsafeGet" naming is confusing as this function isn't really unsafe since it will crash if the value has overflowed. Also add an `operator T()` to implicitly convert a Checked to its underlying type without needing to call value(). Source/JavaScriptCore: * b3/B3Const32Value.cpp: (JSC::B3::Const32Value::checkAddConstant const): (JSC::B3::Const32Value::checkSubConstant const): (JSC::B3::Const32Value::checkMulConstant const): * b3/B3Const64Value.cpp: (JSC::B3::Const64Value::checkAddConstant const): (JSC::B3::Const64Value::checkSubConstant const): (JSC::B3::Const64Value::checkMulConstant const): * bytecompiler/BytecodeGenerator.h: (JSC::FinallyContext::numberOfBreaksOrContinues const): * dfg/DFGConstantFoldingPhase.cpp: (JSC::DFG::ConstantFoldingPhase::foldConstants): * dfg/DFGOperations.cpp: (JSC::DFG::JSC_DEFINE_JIT_OPERATION): * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::compileNewArrayWithSpread): (JSC::FTL::DFG::LowerDFGToB3::compileSpread): (JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargsSpread): (JSC::FTL::DFG::LowerDFGToB3::compileForwardVarargsWithSpread): * ftl/FTLOperations.cpp: (JSC::FTL::JSC_DEFINE_JIT_OPERATION): * heap/Heap.cpp: (JSC::Heap::deprecatedReportExtraMemorySlowCase): (JSC::Heap::extraMemorySize): (JSC::Heap::updateAllocationLimits): (JSC::Heap::reportExtraMemoryVisited): * heap/SlotVisitor.cpp: (JSC::SlotVisitor::propagateExternalMemoryVisitedIfNecessary): * runtime/ArgList.cpp: (JSC::MarkedArgumentBuffer::slowEnsureCapacity): (JSC::MarkedArgumentBuffer::expandCapacity): * runtime/ArrayPrototype.cpp: (JSC::concatAppendOne): (JSC::JSC_DEFINE_HOST_FUNCTION): * runtime/CommonSlowPaths.cpp: (JSC::JSC_DEFINE_COMMON_SLOW_PATH): * runtime/DirectArguments.h: * runtime/HashMapImpl.h: (JSC::HashMapBuffer::allocationSize): (JSC::HashMapImpl::HashMapImpl): * runtime/HashMapImplInlines.h: (JSC::nextCapacity): (JSC::HashMapImpl<HashMapBucketType>::finishCreation): * runtime/JSBigInt.cpp: (JSC::JSBigInt::parseInt): * runtime/JSImmutableButterfly.h: (JSC::JSImmutableButterfly::tryCreate): * runtime/JSLexicalEnvironment.h: (JSC::JSLexicalEnvironment::offsetOfVariable): (JSC::JSLexicalEnvironment::allocationSizeForScopeSize): * runtime/JSObject.h: * runtime/JSPropertyNameEnumerator.cpp: (JSC::JSPropertyNameEnumerator::create): * runtime/JSString.h: * runtime/ScopedArguments.cpp: (JSC::ScopedArguments::createUninitialized): * runtime/StringPrototype.cpp: (JSC::jsSpliceSubstrings): (JSC::jsSpliceSubstringsWithSeparators): * runtime/StructureChain.cpp: (JSC::StructureChain::create): * runtime/VM.h: (JSC::ScratchBuffer::allocationSize): * runtime/WeakMapImpl.h: (JSC::WeakMapBuffer::allocationSize): * wasm/WasmAirIRGenerator.cpp: (JSC::Wasm::AirIRGenerator::AirIRGenerator): (JSC::Wasm::AirIRGenerator::emitCallPatchpoint): * wasm/WasmB3IRGenerator.cpp: (JSC::Wasm::B3IRGenerator::B3IRGenerator): * wasm/WasmInstance.cpp: * wasm/WasmInstance.h: (JSC::Wasm::Instance::allocationSize): * wasm/WasmLLIntGenerator.cpp: (JSC::Wasm::LLIntGenerator::push): (JSC::Wasm::LLIntGenerator::getDropKeepCount): (JSC::Wasm::LLIntGenerator::walkExpressionStack): (JSC::Wasm::LLIntGenerator::finalize): (JSC::Wasm::LLIntGenerator::callInformationForCaller): (JSC::Wasm::LLIntGenerator::addLoop): (JSC::Wasm::LLIntGenerator::addTopLevel): (JSC::Wasm::LLIntGenerator::addBlock): (JSC::Wasm::LLIntGenerator::addIf): (JSC::Wasm::LLIntGenerator::addElseToUnreachable): * wasm/WasmSignature.h: (JSC::Wasm::Signature::allocatedSize): * wasm/WasmStreamingParser.cpp: (JSC::Wasm::StreamingParser::addBytes): * wasm/WasmTable.cpp: (JSC::Wasm::Table::Table): (JSC::Wasm::Table::grow): (JSC::Wasm::FuncRefTable::FuncRefTable): * yarr/YarrInterpreter.cpp: (JSC::Yarr::Interpreter::DisjunctionContext::allocationSize): (JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::allocationSize): (JSC::Yarr::Interpreter::allocParenthesesDisjunctionContext): (JSC::Yarr::ByteCompiler::atomCharacterClass): (JSC::Yarr::ByteCompiler::atomBackReference): (JSC::Yarr::ByteCompiler::atomParentheticalAssertionEnd): (JSC::Yarr::ByteCompiler::atomParenthesesSubpatternEnd): (JSC::Yarr::ByteCompiler::atomParenthesesOnceEnd): (JSC::Yarr::ByteCompiler::atomParenthesesTerminalEnd): (JSC::Yarr::ByteCompiler::emitDisjunction): * yarr/YarrInterpreter.h: (JSC::Yarr::ByteTerm::ByteTerm): (JSC::Yarr::ByteTerm::CheckInput): (JSC::Yarr::ByteTerm::UncheckInput): * yarr/YarrJIT.cpp: * yarr/YarrParser.h: (JSC::Yarr::Parser::consumeNumber): * yarr/YarrPattern.cpp: (JSC::Yarr::PatternTerm::dumpQuantifier): Source/WebCore: * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneDeserializer::readTerminal): * dom/TextEncoderStreamEncoder.cpp: (WebCore::TextEncoderStreamEncoder::encode): * editing/markup.cpp: (WebCore::StyledMarkupAccumulator::takeResults): * html/FileInputType.cpp: (WebCore::FileInputType::saveFormControlState const): * html/ImageData.cpp: (WebCore::ImageData::create): (WebCore::ImageData::createUninitialized): * html/MediaElementSession.cpp: (WebCore::isElementRectMostlyInMainFrame): * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::sliceArrayBufferView): (WebCore::WebGL2RenderingContext::copyBufferSubData): (WebCore::WebGL2RenderingContext::getBufferSubData): (WebCore::WebGL2RenderingContext::validateClearBuffer): * html/canvas/WebGLBuffer.cpp: (WebCore::WebGLBuffer::associateBufferSubDataImpl): (WebCore::WebGLBuffer::associateCopyBufferSubData): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::clip2D): (WebCore::WebGLRenderingContextBase::validateDrawArrays): (WebCore::WebGLRenderingContextBase::validateDrawElements): (WebCore::WebGLRenderingContextBase::validateTexFuncData): (WebCore::WebGLRenderingContextBase::validateCompressedTexFuncData): (WebCore::WebGLRenderingContextBase::validateSimulatedVertexAttrib0): * html/canvas/WebGLRenderingContextBase.h: (WebCore::WebGLRenderingContextBase::validateTexImageSubRectangle): (WebCore::WebGLRenderingContextBase::checkedAddAndMultiply): * page/FrameView.h: (WebCore::FrameView::incrementVisuallyNonEmptyPixelCount): * page/History.cpp: (WebCore::History::stateObjectAdded): * platform/audio/AudioArray.h: (WebCore::AudioArray::resize): * platform/audio/cocoa/AudioFileReaderCocoa.cpp: (WebCore::tryCreateAudioBufferList): * platform/audio/cocoa/CARingBuffer.cpp: (WebCore::CARingBuffer::adoptStorage): (WebCore::CARingBuffer::initializeAfterAllocation): (WebCore::CARingBuffer::allocate): * platform/audio/cocoa/WebAudioBufferList.cpp: (WebCore::WebAudioBufferList::WebAudioBufferList): * platform/graphics/FormatConverter.h: (WebCore::FormatConverter::FormatConverter): * platform/graphics/GraphicsContextGL.cpp: (WebCore::GraphicsContextGL::computeImageSizeInBytes): * platform/graphics/ImageBackingStore.h: (WebCore::ImageBackingStore::setSize): (WebCore::ImageBackingStore::clear): * platform/graphics/ImageBufferBackend.cpp: (WebCore::ImageBufferBackend::calculateMemoryCost): * platform/graphics/ImageFrame.h: (WebCore::ImageFrame::frameBytes const): * platform/graphics/ImageSource.cpp: (WebCore::ImageSource::maximumSubsamplingLevel): * platform/graphics/PixelBuffer.cpp: (WebCore::PixelBuffer::tryCreateForDecoding): (WebCore::PixelBuffer::tryCreate): * platform/graphics/PixelBuffer.h: (WebCore::PixelBuffer::encode const): (WebCore::PixelBuffer::decode): * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm: (WebCore::ImageDecoderAVFObjC::frameBytesAtIndex const): * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm: (WebCore::MediaSampleAVFObjC::setByteRangeOffset): (WebCore::MediaSampleAVFObjC::byteRangeForAttachment const): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::updateBackdropFilters): * platform/graphics/ca/LayerPool.cpp: (WebCore::LayerPool::backingStoreBytesForSize): * platform/graphics/cg/GraphicsContextGLCG.cpp: (WebCore::GraphicsContextGLImageExtractor::extractImage): * platform/graphics/cg/ImageBufferCGBackend.cpp: (WebCore::ImageBufferCGBackend::calculateBytesPerRow): * platform/graphics/cg/ImageDecoderCG.cpp: (WebCore::ImageDecoderCG::frameBytesAtIndex const): * platform/graphics/cocoa/SourceBufferParser.cpp: (WebCore::SourceBufferParser::Segment::read const): * platform/graphics/filters/FEColorMatrix.cpp: (WebCore::effectApplyAccelerated): * platform/graphics/filters/FEGaussianBlur.cpp: (WebCore::FEGaussianBlur::platformApplySoftware): * platform/graphics/filters/FETurbulence.cpp: (WebCore::FETurbulence::platformApplySoftware): * platform/graphics/filters/FilterEffect.cpp: (WebCore::FilterEffect::unmultipliedResult): (WebCore::FilterEffect::premultipliedResult): (WebCore::copyPremultiplyingAlpha): (WebCore::copyUnpremultiplyingAlpha): * platform/graphics/gpu/cocoa/GPUBindGroupAllocatorMetal.mm: (WebCore::GPUBindGroupAllocator::allocateAndSetEncoders): (WebCore::GPUBindGroupAllocator::reallocate): * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm: (WebCore::GPUCommandBuffer::copyBufferToBuffer): * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm: (WebCore::GPURenderPassEncoder::drawIndexed): * platform/graphics/gstreamer/ImageDecoderGStreamer.cpp: (WebCore::ImageDecoderGStreamer::frameBytesAtIndex const): * platform/graphics/nicosia/NicosiaBuffer.cpp: (Nicosia::Buffer::Buffer): * platform/graphics/win/Direct2DUtilities.cpp: (WebCore::Direct2D::createDirect2DImageSurfaceWithData): * platform/graphics/win/ImageBufferDirect2DBackend.cpp: (WebCore::ImageBufferDirect2DBackend::compatibleBitmap): * platform/graphics/win/ImageDecoderDirect2D.cpp: (WebCore::ImageDecoderDirect2D::frameBytesAtIndex const): * platform/image-decoders/ScalableImageDecoder.cpp: (WebCore::ScalableImageDecoder::frameBytesAtIndex const): * platform/image-decoders/jpeg2000/JPEG2000ImageDecoder.cpp: (WebCore::sycc444ToRGB): (WebCore::sycc422ToRGB): (WebCore::sycc420ToRGB): * platform/ios/LegacyTileLayerPool.mm: (WebCore::LegacyTileLayerPool::bytesBackingLayerWithPixelSize): * platform/text/TextCodecUTF16.cpp: (WebCore::TextCodecUTF16::encode const): * platform/text/TextCodecUTF8.cpp: (WebCore::TextCodecUTF8::encodeUTF8): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::requiresCompositingForCanvas const): * rendering/shapes/Shape.cpp: (WebCore::Shape::createRasterShape): * storage/StorageMap.cpp: (WebCore::StorageMap::setItem): * xml/XSLStyleSheetLibxslt.cpp: (WebCore::XSLStyleSheet::parseString): * xml/XSLTProcessorLibxslt.cpp: (WebCore::xsltParamArrayFromParameterMap): * xml/parser/CharacterReferenceParserInlines.h: (WebCore::consumeCharacterReference): Source/WebKit: * GPUProcess/graphics/RemoteRenderingBackend.cpp: (WebKit::RemoteRenderingBackend::nextDestinationImageBufferAfterApplyingDisplayLists): * NetworkProcess/WebStorage/LocalStorageDatabase.cpp: (WebKit::LocalStorageDatabase::setItem): * NetworkProcess/cache/CacheStorageEngineCache.cpp: (WebKit::CacheStorage::Cache::put): * Platform/IPC/ArgumentCoders.h: * Platform/IPC/cocoa/ConnectionCocoa.mm: (IPC::Connection::sendOutgoingMessage): (IPC::createMessageDecoder): * Platform/IPC/cocoa/MachMessage.cpp: (IPC::MachMessage::create): * Shared/ShareableBitmap.cpp: (WebKit::ShareableBitmap::Handle::encode const): (WebKit::ShareableBitmap::create): (WebKit::ShareableBitmap::createShareable): * Shared/ShareableBitmap.h: (WebKit::ShareableBitmap::bytesPerRow const): (WebKit::ShareableBitmap::sizeInBytes const): * Shared/ShareableResource.cpp: (WebKit::ShareableResource::create): * Shared/cg/ShareableBitmapCG.cpp: (WebKit::ShareableBitmap::calculateBytesPerRow): (WebKit::ShareableBitmap::createGraphicsContext): (WebKit::ShareableBitmap::createCGImage const): * Shared/mac/MediaFormatReader/MediaFormatReader.cpp: (WebKit::MediaFormatReader::copyTrackArray): * Shared/mac/MediaFormatReader/MediaSampleCursor.cpp: (WebKit::MediaSampleCursor::copySampleLocation const): * WebProcess/GPU/graphics/DisplayListWriterHandle.cpp: (WebKit::DisplayListWriterHandle::advance): * WebProcess/GPU/graphics/ImageBufferShareableBitmapBackend.cpp: (WebKit::ImageBufferShareableBitmapBackend::calculateBytesPerRow): * WebProcess/GPU/media/RemoteImageDecoderAVF.cpp: (WebKit::RemoteImageDecoderAVF::frameBytesAtIndex const): * WebProcess/Network/WebSocketChannel.cpp: (WebKit::WebSocketChannel::increaseBufferedAmount): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::requestEvasionRectsAboveSelection): (WebKit::WebPage::updateSelectionWithDelta): Source/WTF: * wtf/CheckedArithmetic.h: (WTF::Checked::operator! const): (WTF::Checked::operator bool const): (WTF::Checked::operator T const): (WTF::Checked::value const): (WTF::Checked::operator==): (WTF::Checked::operator< const): (WTF::Checked::operator<= const): (WTF::Checked::operator> const): (WTF::Checked::operator>= const): * wtf/ConcurrentBuffer.h: * wtf/FastMalloc.cpp: (WTF::fastCalloc): (WTF::tryFastCalloc): * wtf/Gigacage.cpp: (Gigacage::tryMallocArray): * wtf/URLHelpers.cpp: (WTF::URLHelpers::userVisibleURL): * wtf/URLParser.cpp: (WTF::URLParser::parseIPv4Piece): * wtf/UniqueArray.h: * wtf/cocoa/NSURLExtras.mm: (WTF::dataWithUserTypedString): * wtf/glib/SocketConnection.cpp: (WTF::SocketConnection::readMessage): (WTF::SocketConnection::sendMessage): * wtf/text/CString.cpp: (WTF::CStringBuffer::createUninitialized): * wtf/text/StringBuffer.h: (WTF::StringBuffer::StringBuffer): * wtf/text/StringBuilderJSON.cpp: (WTF::StringBuilder::appendQuotedJSONString): * wtf/text/StringConcatenate.h: (WTF::tryMakeStringFromAdapters): * wtf/text/StringImpl.h: (WTF::StringImpl::allocationSize): * wtf/text/StringToIntegerConversion.h: (WTF::parseInteger): Tools: * TestWebKitAPI/Tests/WTF/CheckedArithmeticOperations.cpp: (TestWebKitAPI::CheckedArithmeticTester::run): (TestWebKitAPI::AllowMixedSignednessTest::run): (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebCore/IntRectTests.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebCore/IntSizeTests.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/238371@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278338 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-02 05:21:13 +00:00
2021-06-01 Chris Dumez <cdumez@apple.com>
Rename Checked::unsafeGet() to Checked::value()
https://bugs.webkit.org/show_bug.cgi?id=226514
Reviewed by Darin Adler.
Rename Checked::unsafeGet() to Checked::value(). The "unsafeGet" naming is confusing as this
function isn't really unsafe since it will crash if the value has overflowed. Also add an
`operator T()` to implicitly convert a Checked to its underlying type without needing to
call value().
* wtf/CheckedArithmetic.h:
(WTF::Checked::operator! const):
(WTF::Checked::operator bool const):
(WTF::Checked::operator T const):
(WTF::Checked::value const):
(WTF::Checked::operator==):
(WTF::Checked::operator< const):
(WTF::Checked::operator<= const):
(WTF::Checked::operator> const):
(WTF::Checked::operator>= const):
* wtf/ConcurrentBuffer.h:
* wtf/FastMalloc.cpp:
(WTF::fastCalloc):
(WTF::tryFastCalloc):
* wtf/Gigacage.cpp:
(Gigacage::tryMallocArray):
* wtf/URLHelpers.cpp:
(WTF::URLHelpers::userVisibleURL):
* wtf/URLParser.cpp:
(WTF::URLParser::parseIPv4Piece):
* wtf/UniqueArray.h:
* wtf/cocoa/NSURLExtras.mm:
(WTF::dataWithUserTypedString):
* wtf/glib/SocketConnection.cpp:
(WTF::SocketConnection::readMessage):
(WTF::SocketConnection::sendMessage):
* wtf/text/CString.cpp:
(WTF::CStringBuffer::createUninitialized):
* wtf/text/StringBuffer.h:
(WTF::StringBuffer::StringBuffer):
* wtf/text/StringBuilderJSON.cpp:
(WTF::StringBuilder::appendQuotedJSONString):
* wtf/text/StringConcatenate.h:
(WTF::tryMakeStringFromAdapters):
* wtf/text/StringImpl.h:
(WTF::StringImpl::allocationSize):
* wtf/text/StringToIntegerConversion.h:
(WTF::parseInteger):
2021-06-01 Chris Dumez <cdumez@apple.com>
Unreviewed build fix after r277881.
Silence unused parameter warnings.
* wtf/cocoa/FileSystemCocoa.mm:
(WTF::FileSystemImpl::setAllowsMaterializingDatalessFiles):
(WTF::FileSystemImpl::allowsMaterializingDatalessFiles): Deleted.
(WTF::FileSystemImpl::isSafeToUseMemoryMapForPath): Deleted.
(WTF::FileSystemImpl::makeSafeToUseMemoryMapForPath): Deleted.
2021-06-01 Adrian Perez de Castro <aperez@igalia.com>
[WPE][GTK] Support building against uClibc
https://bugs.webkit.org/show_bug.cgi?id=226244
Reviewed by Michael Catanzaro.
* wtf/PlatformRegisters.h: Use the <sys/ucontext.h> header instead of
<ucontext.h>, which is enough to gain access to the type definitions
for CPU registers and is available on every libc. On the other hand,
uClibc does not have <ucontext.h>, so this fixes the build in that
case.
2021-05-30 Chris Dumez <cdumez@apple.com>
Drop UncheckedCondition / UncheckedLock
https://bugs.webkit.org/show_bug.cgi?id=226432
Reviewed by Darin Adler.
Drop UncheckedCondition / UncheckedLock now that the whole codebase has been ported to
Condition / Lock, which support Clang thread safety analysis.
* wtf/Condition.h:
* wtf/Forward.h:
* wtf/Lock.cpp:
(WTF::Lock::lockSlow):
(WTF::Lock::unlockSlow):
(WTF::Lock::unlockFairlySlow):
(WTF::Lock::safepointSlow):
* wtf/Lock.h:
(WTF::assertIsHeld):
(WTF::WTF_ASSERTS_ACQUIRED_LOCK):
Remove WTF::Optional synonym for std::optional, using that class template directly instead https://bugs.webkit.org/show_bug.cgi?id=226433 Reviewed by Chris Dumez. Source/JavaScriptCore: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. * inspector/scripts/codegen/generate_objc_protocol_types_implementation.py: (ObjCProtocolTypesImplementationGenerator._generate_init_method_for_payload): Use auto instead of Optional<>. Also use * instead of value() and nest the definition of the local inside an if statement in the case where it's an optional. * inspector/scripts/tests/expected/*: Regenerated these results. Source/WebCore: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebCore/PAL: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebDriver: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebKit: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. * Scripts/webkit/tests: Regenerated expected results, by running the command "python Scripts/webkit/messages_unittest.py -r". (How am I supposed to know to do that?) Source/WebKitLegacy/ios: * WebCoreSupport/WebChromeClientIOS.h: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebKitLegacy/mac: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebKitLegacy/win: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WTF: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. * wtf/Optional.h: Remove WTF::Optional. Tools: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Canonical link: https://commits.webkit.org/238290@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278253 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-30 16:11:40 +00:00
2021-05-30 Darin Adler <darin@apple.com>
Remove WTF::Optional synonym for std::optional, using that class template directly instead
https://bugs.webkit.org/show_bug.cgi?id=226433
Reviewed by Chris Dumez.
* <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>.
* wtf/Optional.h: Remove WTF::Optional.
2021-05-29 Chris Dumez <cdumez@apple.com>
Stop using UncheckedLock in JSC::VMInspector
https://bugs.webkit.org/show_bug.cgi?id=226427
Reviewed by Mark Lam.
Add Lock::tryLockWithTimeout(), similar to tryLock() but gives up after a
specified timeout. This used to be implemented in VMInspector but I think
Lock is a better place for it.
* wtf/Lock.cpp:
(WTF::Lock::tryLockWithTimeout):
* wtf/Lock.h:
Adopt clang thread safety annotations in WTF::DataMutex https://bugs.webkit.org/show_bug.cgi?id=226431 Reviewed by Darin Adler. Source/WebCore: Update code base due to DataMutex API changes. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::performTaskAtMediaTime): (WebCore::MediaPlayerPrivateGStreamer::triggerRepaint): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (webKitWebSrcConstructed): (webKitWebSrcGetProperty): (webKitWebSrcSetContext): (webKitWebSrcCreate): (webKitWebSrcMakeRequest): (webKitWebSrcStop): (webKitWebSrcGetSize): (webKitWebSrcIsSeekable): (webKitWebSrcDoSeek): (webKitWebSrcQuery): (webKitWebSrcUnLock): (webKitWebSrcUnLockStop): (webKitWebSrcSetMediaPlayer): (webKitSrcPassedCORSAccessCheck): (CachedResourceStreamingClient::responseReceived): (CachedResourceStreamingClient::dataReceived): (CachedResourceStreamingClient::accessControlCheckFailed): (CachedResourceStreamingClient::loadFailed): (CachedResourceStreamingClient::loadFinished): (webKitSrcWouldTaintOrigin): * platform/graphics/gstreamer/mse/MediaSourceTrackGStreamer.cpp: (WebCore::MediaSourceTrackGStreamer::isReadyForMoreSamples): (WebCore::MediaSourceTrackGStreamer::notifyWhenReadyForMoreSamples): (WebCore::MediaSourceTrackGStreamer::enqueueObject): (WebCore::MediaSourceTrackGStreamer::clearQueue): * platform/graphics/gstreamer/mse/MediaSourceTrackGStreamer.h: * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp: (webKitMediaSrcActivateMode): (webKitMediaSrcPadLinked): (webKitMediaSrcLoop): (webKitMediaSrcStreamFlush): Source/WTF: Adopt clang thread safety annotations in WTF::DataMutex. This allows us to stop using UncheckedCondition in a few places. * wtf/DataMutex.h: (WTF::DataMutex::DataMutex): Tools: Update API test due to DataMutex API changes. * TestWebKitAPI/Tests/WTF/DataMutex.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/238285@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278248 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-30 05:22:59 +00:00
2021-05-29 Chris Dumez <cdumez@apple.com>
Adopt clang thread safety annotations in WTF::DataMutex
https://bugs.webkit.org/show_bug.cgi?id=226431
Reviewed by Darin Adler.
Adopt clang thread safety annotations in WTF::DataMutex. This allows us to
stop using UncheckedCondition in a few places.
* wtf/DataMutex.h:
(WTF::DataMutex::DataMutex):
Clients of optional should use has_value instead of relying on hasValue macro https://bugs.webkit.org/show_bug.cgi?id=226395 Reviewed by Chris Dumez. Source/JavaScriptCore: * bytecompiler/NodesCodegen.cpp: (JSC::RegExpNode::emitBytecode): Don't use hasValue. Source/WebCore: In some files we are touching, moved from Optional to std::optional, but doing that consistently in files we are not otherwise modifying is out of scope here. In some places, use has_value instead of hasValue. In others, improved further by not using has_value explicitly when it's clearer to do so. Wasn't 100% consistent about that, but did aim to cover 100% of the hasValue call sites. * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::create): Don't use hasValue. * Modules/webxr/WebXRFrame.cpp: (WebCore::WebXRFrame::getViewerPose): Ditto. (WebCore::WebXRFrame::getPose): Ditto. * Modules/webxr/WebXRGamepad.cpp: (WebCore::WebXRGamepad::WebXRGamepad): Ditto. * Modules/webxr/WebXRInputSource.cpp: (WebCore::WebXRInputSource::requiresInputSourceChange): Use has_value. * bindings/js/DOMPromiseProxy.h: (WebCore::DOMPromiseProxy<IDLType>::isFulfilled const): Ditto. (WebCore::DOMPromiseProxy<IDLUndefined>::isFulfilled const): Ditto. (WebCore::DOMPromiseProxyWithResolveCallback<IDLType>::isFulfilled const): Ditto. * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneDeserializer::readTerminal): Ditto. * css/CSSFontFaceSet.cpp: (WebCore::CSSFontFaceSet::addToFacesLookupTable): Removed unneeded double check of optional value. !x and !x.has_value() check the same thing. (WebCore::CSSFontFaceSet::remove): Ditto. (WebCore::CSSFontFaceSet::fontFace): Simplified code with extra local variables to use an idiom that does not use hasValue. Since using *, ->, or value() on an optional already asserts, there is no need to explicitly assert in the caller. * css/CSSGradientValue.cpp: (WebCore::GradientStop::isSpecified const): Use has_value. * css/CSSSegmentedFontFace.cpp: (WebCore::CSSSegmentedFontFace::fontRanges): Removed unneeded calls to hasValue. * css/FontFace.cpp: (WebCore::FontFace::family const): Use has_value. (WebCore::FontFace::style const): Ditto. (WebCore::FontFace::weight const): Ditto. (WebCore::FontFace::stretch const): Ditto. (WebCore::FontFace::unicodeRange const): Ditto. (WebCore::FontFace::featureSettings const): Ditto. (WebCore::FontFace::display const): Ditto. * css/parser/CSSSelectorParser.cpp: (WebCore::consumeANPlusB): Ditto. * display/css/DisplayStyle.h: Ditto. * dom/DataTransferItemList.h: Ditto. * dom/Document.cpp: (WebCore::Document::updateHighlightPositions): Ditto. * dom/EventTarget.cpp: (WebCore::EventTarget::addEventListener): Ditto. * editing/AlternativeTextController.cpp: (WebCore::AlternativeTextController::hasPendingCorrection const): Ditto. * editing/ApplyStyleCommand.cpp: (WebCore::ApplyStyleCommand::applyInlineStyle): Don't call hasValue. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::captionDisplayMode): Ditto. * html/ImageBitmap.h: Ditto. * inspector/agents/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::setScreenSizeOverride): Use has_value. * layout/LayoutPhase.cpp: (WebCore::Layout::PhaseScope::PhaseScope): Ditto. * layout/formattingContexts/inline/InlineContentBreaker.cpp: (WebCore::Layout::InlineContentBreaker::tryBreakingTextRun const): Ditto. * layout/formattingContexts/inline/InlineLine.h: Ditto. * loader/CrossOriginPreflightResultCache.cpp: (WebCore::parseAccessControlMaxAge): Ditto. * page/EventHandler.cpp: (WebCore::EventHandler::defaultWheelEventHandler): Ditto. * page/ios/ContentChangeObserver.cpp: (WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope): Ditto. * page/scrolling/ScrollSnapOffsetsInfo.cpp: (WebCore::closestSnapOffsetWithInfoAndAxis): Ditto. * platform/ScrollController.cpp: (WebCore::ScrollController::adjustScrollDestination): Don't use hasValue. * platform/cocoa/SystemBattery.mm: (WebCore::systemHasBattery): Use has_value. (WebCore::systemHasAC): Use has_value. * platform/graphics/Gradient.h: Ditto. * platform/graphics/ImageSource.h: Ditto. * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::wouldTaintOrigin const): Changed idiom to not use hasValue. * platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp: (setGLContext): Do not use hasValue. * platform/graphics/gstreamer/GStreamerRegistryScanner.cpp: (WebCore::GStreamerRegistryScanner::ElementFactories::hasElementForMediaType const): Ditto. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::playbackPosition const): Ditto. (WebCore::MediaPlayerPrivateGStreamer::performTaskAtMediaTime): Ditto. (WebCore::MediaPlayerPrivateGStreamer::triggerRepaint): Ditto. * platform/graphics/gstreamer/eme/CDMProxyThunder.cpp: (WebCore::CDMProxyThunder::getDecryptionSession const): Use has_value. * platform/graphics/gstreamer/eme/CDMThunder.cpp: (WebCore::ParsedResponseMessage::hasType const): Use has_value. (WebCore::CDMInstanceSessionThunder::cdmInstanceThunder const): Use a pointer for the erturn value instead of Optional<&>. This hasn't compiled since we switched to std::optional so I suspect this code is not compiled by EWS or the buildbot. * platform/graphics/gstreamer/eme/CDMThunder.h: Updated to match above. * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::AppendPipeline::parseDemuxerSrcPadCaps): Use value_or. (WebCore::AppendPipeline::appsinkCapsChanged): Do not use has_value. * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: (WebCore::MediaPlayerPrivateGStreamerMSE::trackDetected): Ditto. * platform/graphics/transforms/TransformState.h: Use has_value. * platform/ios/VideoFullscreenInterfaceAVKit.mm: (WebCore::supportsPictureInPicture): Ditto. * platform/mac/NSScrollerImpDetails.mm: (WebCore::ScrollerStyle::recommendedScrollerStyle): Ditto. * platform/network/ResourceRequestBase.cpp: (WebCore::ResourceRequestBase::isSystemPreview const): Ditto. * platform/xr/openxr/OpenXRInputSource.cpp: (PlatformXR::OpenXRInputSource::getInputSource const): Ditto. * rendering/EventRegion.h: Ditto. * rendering/GridTrackSizingAlgorithm.h: Remove unnecessary assertion, since the * operator already does the assertion. * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::canComputePercentageFlexBasis): Use has_value. * rendering/RenderListItem.cpp: (WebCore::RenderListItem::setExplicitValue): Ditto. * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::systemFocusRingColor): Ditto. * rendering/updating/RenderTreeBuilder.cpp: (WebCore::RenderTreeBuilder::removeAnonymousWrappersForInlineChildrenIfNeeded): Ditto. * svg/SVGSVGElement.cpp: (WebCore::SVGSVGElement::createSVGTransformFromMatrix): Changed idiom to not call hasValue. * svg/SVGTransform.h: Ditto. * testing/WebFakeXRDevice.cpp: (WebCore::WebFakeXRDevice::setViews): Ditto. Source/WebDriver: * socket/SessionHostSocket.cpp: (WebDriver::SessionHost::isConnected const): Use has_value. Source/WebKit: * Platform/IPC/ArgumentCoders.h: Use std::optional; there was no hasValue in here and I edited it by mistake, but we want to do this eventually. * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: Removed using namespace WebCore. (IPC::ArgumentCoder<Ref<WebCore::Font>>::decodePlatformData): Use has_value. * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm: (WebKit::XPCServiceInitializerDelegate::getClientSDKVersion): Ditto. * Shared/WebCoreArgumentCoders.cpp: (IPC::decodeImage): Changed idiom to not call hasValue. (IPC::ArgumentCoder<Ref<Font>>::decode): Ditto. * Shared/mac/MediaFormatReader/MediaFormatReader.cpp: (WebKit::MediaFormatReader::finishParsing): Use has_value. (WebKit::MediaFormatReader::copyProperty): Ditto. (WebKit::MediaFormatReader::copyTrackArray): Ditto. * Shared/win/WebCoreArgumentCodersWin.cpp: (IPC::ArgumentCoder<Ref<Font>>::decodePlatformData): Do not call hasValue. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration encodeWithCoder:]): Changed idiom to not use hasValue. * UIProcess/API/glib/InputMethodFilter.cpp: (WebKit::InputMethodFilter::setState): Use has_value. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::AutomationCommandError::toProtocolString): Changed idiom to not use hasValue. * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::determineDataOwner const): Use has_value. * UIProcess/Inspector/socket/RemoteInspectorClient.cpp: (WebKit::RemoteInspectorClient::sendWebInspectorEvent): Changed idiom to not use hasValue. * UIProcess/glib/UserMediaPermissionRequestManagerProxyGLib.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::platformValidateUserMediaRequestConstraints): Ditto. * WebProcess/GPU/media/MediaSourcePrivateRemote.cpp: (WebKit::MediaSourcePrivateRemote::addSourceBuffer): Use has_value. * WebProcess/WebPage/Cocoa/WebPageCocoa.mm: (WebKit::WebPage::platformDidReceiveLoadParameters): Ditto. * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::notifyPreferencesChanged): Changed idiom to not call hasValue. Source/WTF: * wtf/Hasher.h: Use has_value. * wtf/Optional.h: Remove hasValue macro. Not needed any more, but also a bit dangerous because of how widespread the use of hasValue is for things other than WTF::Optional. Tools: * TestWebKitAPI/Tests/WebCore/CBORReaderTest.cpp: Use has_value. * TestWebKitAPI/Tests/WebCore/CBORWriterTest.cpp: Ditto. * TestWebKitAPI/Tests/WebKitGLib/TestWebKitPolicyClient.cpp: Ditto. * TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebView.cpp: (AudioRenderingWebViewTest::handleStart): Ditto. * WebKitTestRunner/GeolocationProviderMock.cpp: (WTR::GeolocationProviderMock::setPosition): Ditto. * WebKitTestRunner/cocoa/TestRunnerWKWebView.mm: (-[TestRunnerWKWebView canPerformAction:withSender:]): Ditto. Canonical link: https://commits.webkit.org/238281@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278244 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-29 22:08:56 +00:00
2021-05-28 Darin Adler <darin@apple.com>
Clients of optional should use has_value instead of relying on hasValue macro
https://bugs.webkit.org/show_bug.cgi?id=226395
Reviewed by Chris Dumez.
* wtf/Hasher.h: Use has_value.
* wtf/Optional.h: Remove hasValue macro. Not needed any more, but also a bit
dangerous because of how widespread the use of hasValue is for things other
than WTF::Optional.
2021-05-28 Alex Christensen <achristensen@webkit.org>
Punycode encode U+0BE6 when not in context of other Tamil characters
https://bugs.webkit.org/show_bug.cgi?id=226409
<rdar://78160926>
Reviewed by Tim Horton.
It has quite legitimate use, so we don't want to always punycode encode it,
but when used in the context of non-Tamil characters we want to punycode encode it.
* wtf/URLHelpers.cpp:
(WTF::URLHelpers::isLookalikeCharacterOfScriptType<USCRIPT_ARMENIAN>):
(WTF::URLHelpers::isLookalikeCharacterOfScriptType<USCRIPT_TAMIL>):
(WTF::URLHelpers::isOfScriptType):
(WTF::URLHelpers::isLookalikeSequence):
(WTF::URLHelpers::isLookalikeCharacter):
(WTF::URLHelpers::isArmenianLookalikeCharacter): Deleted.
(WTF::URLHelpers::isArmenianScriptCharacter): Deleted.
(WTF::URLHelpers::isArmenianLookalikeSequence): Deleted.
2021-05-28 Chris Dumez <cdumez@apple.com>
Stop using UncheckedLock in WTF::MetaAllocator
https://bugs.webkit.org/show_bug.cgi?id=226396
Reviewed by Darin Adler.
Stop using UncheckedLock in WTF::MetaAllocator, as it is being phased out in favor on Lock,
which supports Clang thread safety analysis.
* wtf/MetaAllocator.cpp:
(WTF::MetaAllocator::release):
(WTF::MetaAllocator::MetaAllocator):
(WTF::MetaAllocator::allocate):
(WTF::MetaAllocator::currentStatistics):
* wtf/MetaAllocator.h:
2021-05-28 Robin Morisset <rmorisset@apple.com>
Fix LikelyDenseUnsignedIntegerSet::clear()
https://bugs.webkit.org/show_bug.cgi?id=226388
Reviewed by Mark Lam.
There are two problems with it:
1) It calls BitVector::clearAll(), which does not free any memory.
Instead, it should call BitVector::~BitVector(), then do a placement new of a fresh BitVector (to get it back to its inline condition)
2) More problematically, it changes m_size before calling isBitVector() which relies crucially on the value of m_size.
So it is going to believe that it is in BitVector mode even when it is actually in HashSet mode.
* wtf/LikelyDenseUnsignedIntegerSet.h:
(WTF::LikelyDenseUnsignedIntegerSet::clear):
Add stub implementation of CA separated portal bits for GraphicsLayer https://bugs.webkit.org/show_bug.cgi?id=226343 Reviewed by Simon Fraser. Source/WebCore: Plumbs isSeparatedPortal and isDescendentOfSeparatedPortal bits through GraphicsLayer. Renames setSeparated to setIsSeparated for consistency. Currently unused, but getting the bits in is big enough that its helpful to land on its own. * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::GraphicsLayer): * platform/graphics/GraphicsLayer.h: (WebCore::GraphicsLayer::isIsSeparated const): (WebCore::GraphicsLayer::setIsSeparated): (WebCore::GraphicsLayer::isSeparatedPortal const): (WebCore::GraphicsLayer::setIsSeparatedPortal): (WebCore::GraphicsLayer::isDescendentOfSeparatedPortal const): (WebCore::GraphicsLayer::setIsDescendentOfSeparatedPortal): (WebCore::GraphicsLayer::isSeparated const): Deleted. (WebCore::GraphicsLayer::setSeparated): Deleted. * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::setIsSeparated): (WebCore::GraphicsLayerCA::setIsSeparatedPortal): (WebCore::GraphicsLayerCA::setIsDescendentOfSeparatedPortal): (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): (WebCore::GraphicsLayerCA::updateIsSeparated): (WebCore::GraphicsLayerCA::updateIsSeparatedPortal): (WebCore::GraphicsLayerCA::updateIsDescendentOfSeparatedPortal): (WebCore::GraphicsLayerCA::setSeparated): Deleted. (WebCore::GraphicsLayerCA::updateSeparated): Deleted. * platform/graphics/ca/GraphicsLayerCA.h: * platform/graphics/ca/PlatformCALayer.h: * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h: * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: (WebCore::PlatformCALayerCocoa::setIsSeparated): (WebCore::PlatformCALayerCocoa::isSeparatedPortal const): (WebCore::PlatformCALayerCocoa::setIsSeparatedPortal): (WebCore::PlatformCALayerCocoa::isDescendentOfSeparatedPortal const): (WebCore::PlatformCALayerCocoa::setIsDescendentOfSeparatedPortal): (WebCore::PlatformCALayerCocoa::setSeparated): Deleted. * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateGeometry): Source/WebKit: Plumbs isSeparatedPortal and isDescendentOfSeparatedPortal bits through GraphicsLayer. Renames setSeparated to setIsSeparated for consistency. Currently unused, but getting the bits in is big enough that its helpful to land on its own. * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm: (WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToLayer): * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h: * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm: (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties): (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode const): (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode): (WebKit::dumpChangedLayers): (WebKit::RemoteLayerTreeTransaction::RemoteLayerTreeTransaction): Deleted. (WebKit::RemoteLayerTreeTransaction::~RemoteLayerTreeTransaction): Deleted. * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::setIsSeparated): (WebKit::PlatformCALayerRemote::isSeparatedPortal const): (WebKit::PlatformCALayerRemote::setIsSeparatedPortal): (WebKit::PlatformCALayerRemote::isDescendentOfSeparatedPortal const): (WebKit::PlatformCALayerRemote::setIsDescendentOfSeparatedPortal): (WebKit::PlatformCALayerRemote::setSeparated): Deleted. * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h: Source/WTF: * wtf/PlatformHave.h: Add HAVE_CORE_ANIMATION_SEPARATED_PORTALS. Canonical link: https://commits.webkit.org/238256@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278217 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-28 18:54:27 +00:00
2021-05-28 Sam Weinig <weinig@apple.com>
Add stub implementation of CA separated portal bits for GraphicsLayer
https://bugs.webkit.org/show_bug.cgi?id=226343
Reviewed by Simon Fraser.
* wtf/PlatformHave.h: Add HAVE_CORE_ANIMATION_SEPARATED_PORTALS.
2021-05-28 Chris Dumez <cdumez@apple.com>
Unreviewed build fix after r277881.
Deal with IOPOL_TYPE_VFS_MATERIALIZE_DATALESS_FILES potentially not being defined on
older OSes.
* wtf/cocoa/FileSystemCocoa.mm:
(WTF::FileSystemImpl::setAllowsMaterializingDatalessFiles):
(WTF::FileSystemImpl::allowsMaterializingDatalessFiles):
2021-05-28 Chris Dumez <cdumez@apple.com>
Unreviewed build fix after r277881.
Add missing header include.
* wtf/cocoa/FileSystemCocoa.mm:
2021-05-27 Said Abou-Hallawa <said@apple.com>
Values of keySplines control points must all be in the range 0 to 1
https://bugs.webkit.org/show_bug.cgi?id=226336
Reviewed by Sam Weinig.
* wtf/MathExtras.h:
(isInRange):
There are a least couple of implementations of this function in WebCore.
The next step is to remove the redundant code in WebCore and use this one.
AirAllocateStackByGraphColoring should use the optimized interference graphs from AirAllocateRegistersByGraphColoring https://bugs.webkit.org/show_bug.cgi?id=226258 Reviewed by Phil Pizlo. Source/JavaScriptCore: The main change in this patch is that AirAllocateStackByGraphColoring is now using the optimized datastructures in wtf/InterferenceGraph.h. This required templating most of it over the interference graph used (Small/Large/Huge), but I tried keeping some common parts out of the templated class to minimize the impact on compile times and binary size. A consequence of that change is that coalescableMoves and remappedStackSlots now store indices instead of direct pointers to StackSlots, resulting in a memory reduction of about 3x as well. Another consequence is that I had to slightly alter the way that coalescing works: instead of carefully removing the interference edges of the killed slot, we simply use mayClear() which is not guaranteed to remove anything. I believe that this is sound, because every subsequent access to m_interference checks whether a slot has been coalesced first, so dropping these edges is purely a memory saving, but has no logical effect. The new code was tested in a few ways: - running on JetStream2 with asan - running on JetStream2 with TEST_OPTIMIZED_INTERFERENCE_GRAPH - running on JetStream2 and logging the frame sizes at the end of this phase, and comparing to the results of doing the same on ToT (same average frame size) The two functions where this code had the largest memory footprint in JetStream2 were both in tsf-wasm. One has 751 stack slots, and had an interference graph of 2.1MB and a coalescableMoves vector of 440kB The other has 673 stack slots, and had an interference graph of 1.9MB and a coalescableMoves vector of 421kB. With this patch, they respectively use 79kB+146kB and 67kB+140kB The effect on the rest of JetStream2 is less likely to matter as few functions used more than a few dozens of kB in this phase, but in percentages are just as huge. More importantly (and the reason I wrote this patch in the first place), I checked mruby-wasm.aotoki.dev which with a few other pages forced us to lower Options::maximumTmpsForGraphColoring because of jetsams. It has two massive functions that reach this phase if I increase Options::maximumTmpsForGraphColoring: - about 6k stack slots -> 215MB + 6MB (interference graph + coalescableMoves) - about 9k stack slots -> 395MB + 4MB After this patch, they respectively use 4.5MB+2MB and 9MB+1.5MB, or roughly a 40x improvement. Combined with the recent improvements to the register allocator, I hope to be able to increase Options::maximumTmpsForGraphColoring soon (in a different patch for easier bisection if either cause a perf regression). This would be helpful, since its lowering cratered our performance on some other wasm application by 8x. In terms of compile times, this patch lowered the time spent in AllocateStackByGraphColoring over the course of a run of JetStream2 from roughly 350ms to roughly 270ms. This is almost certainly negligible, but at least it guarantees that it did not regress. * b3/air/AirAllocateRegistersByGraphColoring.cpp: * b3/air/AirAllocateStackByGraphColoring.cpp: (JSC::B3::Air::allocateStackByGraphColoring): Source/WTF: I moved the interference graphs datastructures from AirAllocateRegistersByGraphColoring to their own wtf/InterferenceGraph.h file. There are three of them: - SmallInterferenceGraph, best for n < 400 - LargeInterferenceGraph, for n < 2**16 - HugeInterferenceGraph, for n up to 2**32 I also added "Iterable" versions of them, that have an operator[] method whose result you can iterate on to get all the indices which interfere with a given index. SmallIterableInterferenceGraph is the same as the non-iterable version, but the Large and Huge versions are a bit slower than their counterparts and use 2x memory. All of these were tested by running JetStream2 with the TEST_OPTIMIZED_INTERFERENCE_GRAPH set to 1. This flag makes the optimized datastructures run in parallel with a reference implementation, and their results are checked for equality on every method call. There is one small difference allowed: iteration is not guaranteed to go through elements in the same order. I also added a clear() method to LikelyDenseUnsignedIntegerSet, and added the NotNull flag to its various uses of placement new. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/HashSet.h: (WTF::W>::memoryUse const): * wtf/InterferenceGraph.h: Added. (WTF::InterferenceBitVector::contains): (WTF::InterferenceBitVector::addAndReturnIsNewEntry): (WTF::InterferenceBitVector::add): (WTF::InterferenceBitVector::clear): (WTF::InterferenceBitVector::mayClear): (WTF::InterferenceBitVector::setMaxIndex): (WTF::InterferenceBitVector::forEach): (WTF::InterferenceBitVector::size const): (WTF::InterferenceBitVector::memoryUse const): (WTF::InterferenceBitVector::dumpMemoryUseInKB const): (WTF::InterferenceBitVector::Iterable::iterator::operator++): (WTF::InterferenceBitVector::Iterable::iterator::operator* const): (WTF::InterferenceBitVector::Iterable::iterator::operator== const): (WTF::InterferenceBitVector::Iterable::iterator::operator!= const): (WTF::InterferenceBitVector::Iterable::begin const): (WTF::InterferenceBitVector::Iterable::end const): (WTF::InterferenceBitVector::operator[] const): (WTF::InterferenceBitVector::index const): (WTF::InterferenceVector::contains): (WTF::InterferenceVector::addAndReturnIsNewEntry): (WTF::InterferenceVector::add): (WTF::InterferenceVector::clear): (WTF::InterferenceVector::mayClear): (WTF::InterferenceVector::setMaxIndex): (WTF::InterferenceVector::forEach): (WTF::InterferenceVector::size const): (WTF::InterferenceVector::memoryUse const): (WTF::InterferenceVector::dumpMemoryUseInKB const): (WTF::InterferenceVector::Iterable::begin const): (WTF::InterferenceVector::Iterable::end const): (WTF::InterferenceVector::operator[] const): (WTF::UndirectedEdgesDuplicatingAdapter::contains): (WTF::UndirectedEdgesDuplicatingAdapter::addAndReturnIsNewEntry): (WTF::UndirectedEdgesDuplicatingAdapter::add): (WTF::UndirectedEdgesDuplicatingAdapter::clear): (WTF::UndirectedEdgesDuplicatingAdapter::mayClear): (WTF::UndirectedEdgesDuplicatingAdapter::setMaxIndex): (WTF::UndirectedEdgesDuplicatingAdapter::forEach): (WTF::UndirectedEdgesDuplicatingAdapter::size const): (WTF::UndirectedEdgesDuplicatingAdapter::memoryUse const): (WTF::UndirectedEdgesDuplicatingAdapter::dumpMemoryUseInKB const): (WTF::UndirectedEdgesDuplicatingAdapter::operator[] const): (WTF::UndirectedEdgesDedupAdapter::contains): (WTF::UndirectedEdgesDedupAdapter::addAndReturnIsNewEntry): (WTF::UndirectedEdgesDedupAdapter::add): (WTF::UndirectedEdgesDedupAdapter::clear): (WTF::UndirectedEdgesDedupAdapter::mayClear): (WTF::UndirectedEdgesDedupAdapter::setMaxIndex): (WTF::UndirectedEdgesDedupAdapter::forEach): (WTF::UndirectedEdgesDedupAdapter::size const): (WTF::UndirectedEdgesDedupAdapter::memoryUse const): (WTF::UndirectedEdgesDedupAdapter::dumpMemoryUseInKB const): (WTF::InterferenceHashSet::contains): (WTF::InterferenceHashSet::addAndReturnIsNewEntry): (WTF::InterferenceHashSet::add): (WTF::InterferenceHashSet::clear): (WTF::InterferenceHashSet::setMaxIndex): (WTF::InterferenceHashSet::forEach): (WTF::InterferenceHashSet::size const): (WTF::InterferenceHashSet::memoryUse const): (WTF::InterferenceHashSet::dumpMemoryUseInKB const): (WTF::InstrumentedInterferenceGraph::contains): (WTF::InstrumentedInterferenceGraph::addAndReturnIsNewEntry): (WTF::InstrumentedInterferenceGraph::add): (WTF::InstrumentedInterferenceGraph::clear): (WTF::InstrumentedInterferenceGraph::mayClear): (WTF::InstrumentedInterferenceGraph::setMaxIndex): (WTF::InstrumentedInterferenceGraph::forEach): (WTF::InstrumentedInterferenceGraph::size const): (WTF::InstrumentedInterferenceGraph::memoryUse const): (WTF::InstrumentedInterferenceGraph::dumpMemoryUseInKB const): (WTF::InstrumentedIterableInterferenceGraph::Iterable::Iterable): (WTF::InstrumentedIterableInterferenceGraph::Iterable::begin const): (WTF::InstrumentedIterableInterferenceGraph::Iterable::end const): (WTF::InstrumentedIterableInterferenceGraph::operator[] const): * wtf/LikelyDenseUnsignedIntegerSet.h: (WTF::LikelyDenseUnsignedIntegerSet::LikelyDenseUnsignedIntegerSet): (WTF::LikelyDenseUnsignedIntegerSet::clear): (WTF::LikelyDenseUnsignedIntegerSet::add): (WTF::LikelyDenseUnsignedIntegerSet::estimateHashSetSize): (WTF::LikelyDenseUnsignedIntegerSet::transitionToHashSet): (WTF::LikelyDenseUnsignedIntegerSet::transitionToBitVector): Canonical link: https://commits.webkit.org/238229@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278186 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-28 02:08:19 +00:00
2021-05-27 Robin Morisset <rmorisset@apple.com>
AirAllocateStackByGraphColoring should use the optimized interference graphs from AirAllocateRegistersByGraphColoring
https://bugs.webkit.org/show_bug.cgi?id=226258
Reviewed by Phil Pizlo.
I moved the interference graphs datastructures from AirAllocateRegistersByGraphColoring to their own wtf/InterferenceGraph.h file.
There are three of them:
- SmallInterferenceGraph, best for n < 400
- LargeInterferenceGraph, for n < 2**16
- HugeInterferenceGraph, for n up to 2**32
I also added "Iterable" versions of them, that have an operator[] method whose result you can iterate on to get all the indices which interfere with a given index.
SmallIterableInterferenceGraph is the same as the non-iterable version, but the Large and Huge versions are a bit slower than their counterparts and use 2x memory.
All of these were tested by running JetStream2 with the TEST_OPTIMIZED_INTERFERENCE_GRAPH set to 1.
This flag makes the optimized datastructures run in parallel with a reference implementation, and their results are checked for equality on every method call.
There is one small difference allowed: iteration is not guaranteed to go through elements in the same order.
I also added a clear() method to LikelyDenseUnsignedIntegerSet, and added the NotNull flag to its various uses of placement new.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/HashSet.h:
(WTF::W>::memoryUse const):
* wtf/InterferenceGraph.h: Added.
(WTF::InterferenceBitVector::contains):
(WTF::InterferenceBitVector::addAndReturnIsNewEntry):
(WTF::InterferenceBitVector::add):
(WTF::InterferenceBitVector::clear):
(WTF::InterferenceBitVector::mayClear):
(WTF::InterferenceBitVector::setMaxIndex):
(WTF::InterferenceBitVector::forEach):
(WTF::InterferenceBitVector::size const):
(WTF::InterferenceBitVector::memoryUse const):
(WTF::InterferenceBitVector::dumpMemoryUseInKB const):
(WTF::InterferenceBitVector::Iterable::iterator::operator++):
(WTF::InterferenceBitVector::Iterable::iterator::operator* const):
(WTF::InterferenceBitVector::Iterable::iterator::operator== const):
(WTF::InterferenceBitVector::Iterable::iterator::operator!= const):
(WTF::InterferenceBitVector::Iterable::begin const):
(WTF::InterferenceBitVector::Iterable::end const):
(WTF::InterferenceBitVector::operator[] const):
(WTF::InterferenceBitVector::index const):
(WTF::InterferenceVector::contains):
(WTF::InterferenceVector::addAndReturnIsNewEntry):
(WTF::InterferenceVector::add):
(WTF::InterferenceVector::clear):
(WTF::InterferenceVector::mayClear):
(WTF::InterferenceVector::setMaxIndex):
(WTF::InterferenceVector::forEach):
(WTF::InterferenceVector::size const):
(WTF::InterferenceVector::memoryUse const):
(WTF::InterferenceVector::dumpMemoryUseInKB const):
(WTF::InterferenceVector::Iterable::begin const):
(WTF::InterferenceVector::Iterable::end const):
(WTF::InterferenceVector::operator[] const):
(WTF::UndirectedEdgesDuplicatingAdapter::contains):
(WTF::UndirectedEdgesDuplicatingAdapter::addAndReturnIsNewEntry):
(WTF::UndirectedEdgesDuplicatingAdapter::add):
(WTF::UndirectedEdgesDuplicatingAdapter::clear):
(WTF::UndirectedEdgesDuplicatingAdapter::mayClear):
(WTF::UndirectedEdgesDuplicatingAdapter::setMaxIndex):
(WTF::UndirectedEdgesDuplicatingAdapter::forEach):
(WTF::UndirectedEdgesDuplicatingAdapter::size const):
(WTF::UndirectedEdgesDuplicatingAdapter::memoryUse const):
(WTF::UndirectedEdgesDuplicatingAdapter::dumpMemoryUseInKB const):
(WTF::UndirectedEdgesDuplicatingAdapter::operator[] const):
(WTF::UndirectedEdgesDedupAdapter::contains):
(WTF::UndirectedEdgesDedupAdapter::addAndReturnIsNewEntry):
(WTF::UndirectedEdgesDedupAdapter::add):
(WTF::UndirectedEdgesDedupAdapter::clear):
(WTF::UndirectedEdgesDedupAdapter::mayClear):
(WTF::UndirectedEdgesDedupAdapter::setMaxIndex):
(WTF::UndirectedEdgesDedupAdapter::forEach):
(WTF::UndirectedEdgesDedupAdapter::size const):
(WTF::UndirectedEdgesDedupAdapter::memoryUse const):
(WTF::UndirectedEdgesDedupAdapter::dumpMemoryUseInKB const):
(WTF::InterferenceHashSet::contains):
(WTF::InterferenceHashSet::addAndReturnIsNewEntry):
(WTF::InterferenceHashSet::add):
(WTF::InterferenceHashSet::clear):
(WTF::InterferenceHashSet::setMaxIndex):
(WTF::InterferenceHashSet::forEach):
(WTF::InterferenceHashSet::size const):
(WTF::InterferenceHashSet::memoryUse const):
(WTF::InterferenceHashSet::dumpMemoryUseInKB const):
(WTF::InstrumentedInterferenceGraph::contains):
(WTF::InstrumentedInterferenceGraph::addAndReturnIsNewEntry):
(WTF::InstrumentedInterferenceGraph::add):
(WTF::InstrumentedInterferenceGraph::clear):
(WTF::InstrumentedInterferenceGraph::mayClear):
(WTF::InstrumentedInterferenceGraph::setMaxIndex):
(WTF::InstrumentedInterferenceGraph::forEach):
(WTF::InstrumentedInterferenceGraph::size const):
(WTF::InstrumentedInterferenceGraph::memoryUse const):
(WTF::InstrumentedInterferenceGraph::dumpMemoryUseInKB const):
(WTF::InstrumentedIterableInterferenceGraph::Iterable::Iterable):
(WTF::InstrumentedIterableInterferenceGraph::Iterable::begin const):
(WTF::InstrumentedIterableInterferenceGraph::Iterable::end const):
(WTF::InstrumentedIterableInterferenceGraph::operator[] const):
* wtf/LikelyDenseUnsignedIntegerSet.h:
(WTF::LikelyDenseUnsignedIntegerSet::LikelyDenseUnsignedIntegerSet):
(WTF::LikelyDenseUnsignedIntegerSet::clear):
(WTF::LikelyDenseUnsignedIntegerSet::add):
(WTF::LikelyDenseUnsignedIntegerSet::estimateHashSetSize):
(WTF::LikelyDenseUnsignedIntegerSet::transitionToHashSet):
(WTF::LikelyDenseUnsignedIntegerSet::transitionToBitVector):
Next step toward using std::optional directly instead of through WTF::Optional typedef https://bugs.webkit.org/show_bug.cgi?id=226280 Reviewed by Chris Dumez. Source/JavaScriptCore: * <many files>: Accept the renaming done by do-webcore-rename. * yarr/YarrSyntaxChecker.cpp: Since the style checker complained about this file, tweaked style to make it happy after the renaming done by do-webcore-rename, and also hand-updated Optional to std::optional as long as we were touching it. Source/WebCore: * <many files>: Accept the renaming done by do-webcore-rename. * Modules/webauthn/fido/DeviceRequestConverter.h: Since style checker complained about the names of some arguments, fixed them, and also hand-updated Optional to std::optional as long as we were touching it. * loader/EmptyClients.cpp: Since style checker complained about the mix of WEBCORE_EXPORT and inlined functions, moved them out of line, and also hand-updated Optional to std::optional as long as we were touching it. Also removed is<EmptyFrameLoaderClient>(). * loader/EmptyFrameLoaderClient.h: Ditto. Source/WebCore/PAL: * <many files>: Accept the renaming done by do-webcore-rename. Source/WebDriver: * <many files>: Accept the renaming done by do-webcore-rename. Source/WebKit: * <many files>: Accept the renaming done by do-webcore-rename. Source/WebKitLegacy: * Storage/StorageTracker.cpp: (WebKit::StorageTracker::diskUsageForOrigin): Accept the renaming done by do-webcore-rename. Source/WebKitLegacy/mac: * <many files>: Accept the renaming done by do-webcore-rename. Source/WebKitLegacy/win: * <many files>: Accept the renaming done by do-webcore-rename. Source/WTF: * <many files>: Accept the renaming done by do-webcore-rename. * wtf/Optional.h: Remove WTF::nullopt_t and WTF::makeOptional. * wtf/URLHelpers.cpp: (WTF::URLHelpers::mapHostName): Convert from nullopt to std::nullopt. Tools: * Scripts/do-webcore-rename: Use script to rename valueOr, WTF::nullopt, WTF::nullopt_t, WTF::Optional, WTF::makeOptional, and makeOptional. Other renamings can't necessarily be done by the script and so will be done in later passes. * <many files>: Accept the renaming done by do-webcore-rename. Canonical link: https://commits.webkit.org/238228@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278185 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-28 01:26:23 +00:00
2021-05-27 Darin Adler <darin@apple.com>
Next step toward using std::optional directly instead of through WTF::Optional typedef
https://bugs.webkit.org/show_bug.cgi?id=226280
Reviewed by Chris Dumez.
* <many files>: Accept the renaming done by do-webcore-rename.
* wtf/Optional.h: Remove WTF::nullopt_t and WTF::makeOptional.
* wtf/URLHelpers.cpp:
(WTF::URLHelpers::mapHostName): Convert from nullopt to std::nullopt.
2021-05-27 Sihui Liu <sihui_liu@apple.com>
Abandon pending tasks on background thread when WebIDBServer is closed
https://bugs.webkit.org/show_bug.cgi?id=226295
Reviewed by Chris Dumez.
Make the wait end with either a new message or queue being killed.
* wtf/CrossThreadQueue.h:
(WTF::CrossThreadQueue<DataType>::waitForMessage):
* wtf/CrossThreadTask.h:
(WTF::CrossThreadTask::operator bool const):
* wtf/CrossThreadTaskHandler.cpp:
(WTF::CrossThreadTaskHandler::taskRunLoop):
2021-05-27 Don Olmstead <don.olmstead@sony.com>
[CMake] Add check for timingsafe_bcmp
https://bugs.webkit.org/show_bug.cgi?id=226347
Reviewed by Chris Dumez.
Use HAVE(TIMINGSAFE_BCMP) in CryptographicUtilities code. Set its value in PlatformHave for
platforms not using CMake.
* wtf/CryptographicUtilities.cpp:
* wtf/CryptographicUtilities.h:
* wtf/PlatformHave.h:
2021-05-27 Mikhail R. Gadelha <mikhail.ramalho@gmail.com>
Increase NumberToStringBuffer to account for negative number
https://bugs.webkit.org/show_bug.cgi?id=226014
Reviewed by Robin Morisset.
In r250389, NumberToStringBuffer length was increased from 96 to 123 because:
<21 digits> + decimal point + <100 digits> + null char = 123.
however,
a = -100000000000000000000
a.toFixed(100)
is a valid conversion and it is 124 chars long, because of the "-" sign.
So this patch increases the length of NumberToStringBuffer to 124 and adds new
test cases.
Reviewed by Ryosuke Niwa.
* wtf/dtoa.h:
2021-05-27 Alex Christensen <achristensen@webkit.org>
Revert r277344
https://bugs.webkit.org/show_bug.cgi?id=225602
<rdar://78411776>
* wtf/PlatformHave.h:
2021-05-27 Devin Rousso <drousso@apple.com>
Use `NSLocale` SPI for comparing language identifiers instead of string comparison
https://bugs.webkit.org/show_bug.cgi?id=226252
Reviewed by Wenson Hsieh.
The existing `indexOfBestMatchingLanguageInList` logic uses (sub)string comparison of BCP47
language tags (e.g. looking for a `'-'` and comparing the substring before and after in the
input language and each item in the language list). While this does work for some languages,
it's really not the correct way to compare BCP47 language tags. Additionally, it basically
ignores the text after the first `'-'`, unless there's an exact match with the input
language. This leads to `"zh-CN"` and `"zh-HK"` being considered a (not exact) match, which
isn't ideal.
* wtf/Language.cpp:
* wtf/cocoa/LanguageCocoa.mm:
(WTF::indexOfBestMatchingLanguageInList): Added.
* wtf/spi/cocoa/NSLocaleSPI.h:
Prevent sbix glyphs from being rendered in the GPU process https://bugs.webkit.org/show_bug.cgi?id=226159 <rdar://77231959> Reviewed by Darin Adler. Source/WebCore: When GPUP canvas is enabled, the display list recorder handles sbix glyphs by recording drawImage calls. This means that during display list replay, we should not have any sbix glyphs in a DrawGlyphs display list item. This patch checks for such glyphs (like we already do for SVG glyphs) and returns early if they're found. Manually tested. No new tests, since we'd need to add some way inject sbix glyph IDs into display list items. * platform/graphics/Font.h: (WebCore::Font::ComplexColorFormatGlyphs::hasRelevantTables const): (WebCore::Font::ComplexColorFormatGlyphs::bitForInitialized): (WebCore::Font::ComplexColorFormatGlyphs::bitForValue): (WebCore::Font::ComplexColorFormatGlyphs::bitsRequiredForGlyphCount): (WebCore::Font::ComplexColorFormatGlyphs::ComplexColorFormatGlyphs): * platform/graphics/coretext/FontCascadeCoreText.cpp: (WebCore::FontCascade::drawGlyphs): Call new function that checks for SVG and sbix glyph presence. Change release assertion to debug assertion to avoid unnecessarily crashing the GPUP, and instead return early in the presence of these glyphs. * platform/graphics/coretext/FontCoreText.cpp: (WebCore::Font::otSVGTable const): (WebCore::Font::ComplexColorFormatGlyphs::createWithNoRelevantTables): (WebCore::Font::ComplexColorFormatGlyphs::createWithRelevantTablesAndGlyphCount): (WebCore::Font::ComplexColorFormatGlyphs::hasValueFor const): (WebCore::Font::ComplexColorFormatGlyphs::get const): (WebCore::Font::ComplexColorFormatGlyphs::set): (WebCore::Font::hasComplexColorFormatTables const): (WebCore::Font::glyphsWithComplexColorFormat const): (WebCore::Font::glyphHasComplexColorFormat const): (WebCore::Font::findOTSVGGlyphs const): (WebCore::Font::hasAnyComplexColorFormatGlyphs const): New function to check if a list of glyph IDs has any that would be inappropriate to render in the GPU process. Since calling the CoreText function that allows us to check if an sbix glyph exists would be too expensive to call for every drawGlyphs call, we lazily cache (in a BitVector) the presence of sbix and SVG images for glyph IDs we check. Source/WebCore/PAL: * pal/spi/cf/CoreTextSPI.h: Add declaration for an SPI that lets us infer whether a glyph has an sbix image. Source/WTF: * wtf/PlatformHave.h: Add HAVE_CORE_TEXT_SBIX_IMAGE_SIZE_FUNCTIONS. Canonical link: https://commits.webkit.org/238195@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278151 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-27 06:42:52 +00:00
2021-05-26 Cameron McCormack <heycam@apple.com>
Prevent sbix glyphs from being rendered in the GPU process
https://bugs.webkit.org/show_bug.cgi?id=226159
<rdar://77231959>
Reviewed by Darin Adler.
* wtf/PlatformHave.h: Add HAVE_CORE_TEXT_SBIX_IMAGE_SIZE_FUNCTIONS.
Leverage the new Vector(const T*, size_t) constructor https://bugs.webkit.org/show_bug.cgi?id=226304 Reviewed by Darin Adler. Leverage the new Vector(const T*, size_t) constructor in existing code. Source/JavaScriptCore: * wasm/WasmStreamingParser.cpp: (JSC::Wasm::StreamingParser::consume): Source/WebCore: * Modules/fetch/FetchBodyConsumer.cpp: (WebCore::blobFromData): * Modules/indexeddb/IDBGetResult.cpp: (WebCore::IDBGetResult::dataFromBuffer): * Modules/webauthn/WebAuthenticationUtils.cpp: (WebCore::convertBytesToVector): * Modules/webauthn/fido/DeviceResponseConverter.cpp: (fido::decodeResponseMap): * Modules/webauthn/fido/FidoHidPacket.cpp: (fido::FidoHidInitPacket::createFromSerializedData): (fido::FidoHidContinuationPacket::createFromSerializedData): * Modules/webauthn/fido/Pin.cpp: (fido::pin::encodeCOSEPublicKey): * Modules/webauthn/fido/U2fResponseConverter.cpp: (fido::WebCore::extractECPublicKeyFromU2fRegistrationResponse): (fido::WebCore::extractCredentialIdFromU2fRegistrationResponse): (fido::WebCore::createFidoAttestationStatementFromU2fRegisterResponse): (fido::readU2fSignResponse): * Modules/websockets/WebSocketChannel.cpp: (WebCore::WebSocketChannel::enqueueRawFrame): * crypto/SubtleCrypto.cpp: (WebCore::toKeyData): (WebCore::copyToVector): * crypto/gcrypt/CryptoKeyECGCrypt.cpp: (WebCore::CryptoKeyEC::platformAddFieldElements const): * crypto/mac/CryptoKeyECMac.cpp: (WebCore::CryptoKeyEC::platformImportPkcs8): * crypto/mac/SerializedCryptoKeyWrapMac.mm: (WebCore::vectorFromNSData): * crypto/openssl/CryptoAlgorithmAES_GCMOpenSSL.cpp: (WebCore::cryptDecrypt): * fileapi/Blob.cpp: (WebCore::Blob::Blob): * platform/graphics/ImageBackingStore.h: (WebCore::ImageBackingStore::ImageBackingStore): * platform/graphics/cairo/ImageBufferUtilitiesCairo.cpp: (WebCore::data): * platform/graphics/gstreamer/GStreamerCommon.cpp: (WebCore::GstMappedBuffer::createVector const): * platform/graphics/gstreamer/eme/CDMProxyClearKey.cpp: (WebCore::CDMProxyClearKey::cencSetDecryptionKey): * platform/mediarecorder/MediaRecorderPrivateMock.cpp: (WebCore::MediaRecorderPrivateMock::fetchData): * platform/network/FormData.cpp: (WebCore::FormDataElement::isolatedCopy const): (WebCore::FormData::appendData): * platform/network/curl/OpenSSLHelper.cpp: (OpenSSL::BIO::getDataAsVector const): * testing/Internals.cpp: (WebCore::Internals::deserializeBuffer const): * xml/parser/XMLDocumentParserLibxml2.cpp: (WebCore::openFunc): Source/WebCore/PAL: * pal/crypto/gcrypt/CryptoDigestGCrypt.cpp: (PAL::CryptoDigest::computeHash): Source/WebKit: * Platform/IPC/ArrayReference.h: (IPC::ArrayReference::vector const): * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm: (vectorFromNSData): * UIProcess/API/glib/IconDatabase.cpp: (WebKit::IconDatabase::setIconForPageURL): * UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.mm: (WebKit::WebCore::convertBytesToVector): * UIProcess/Inspector/WebInspectorUIExtensionControllerProxy.cpp: (WebKit::WebInspectorUIExtensionControllerProxy::evaluateScriptForExtension): * UIProcess/WebAuthentication/Cocoa/HidConnection.mm: (WebKit::reportReceived): * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm: (WebKit::LocalAuthenticatorInternal::toVector): (WebKit::LocalAuthenticatorInternal::aaguidVector): * UIProcess/WebAuthentication/Cocoa/NfcConnection.mm: (WebKit::NfcConnection::transact const): * UIProcess/WebURLSchemeTask.cpp: (WebKit::WebURLSchemeTask::didComplete): * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp: (WebKit::WebURLSchemeTaskProxy::didReceiveData): Source/WTF: * wtf/text/WTFString.cpp: (asciiDebug): Canonical link: https://commits.webkit.org/238190@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278146 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-27 03:17:27 +00:00
2021-05-26 Chris Dumez <cdumez@apple.com>
Leverage the new Vector(const T*, size_t) constructor
https://bugs.webkit.org/show_bug.cgi?id=226304
Reviewed by Darin Adler.
Leverage the new Vector(const T*, size_t) constructor in existing code.
* wtf/text/WTFString.cpp:
(asciiDebug):
2021-05-26 Chris Dumez <cdumez@apple.com>
Use timingsafe_bcmp() in WTF::constantTimeMemcmp() when available
https://bugs.webkit.org/show_bug.cgi?id=226294
<rdar://problem/78542643>
Reviewed by Darin Adler.
Follow-up to r278140 to address post-landing feedback.
* wtf/CryptographicUtilities.cpp:
(WTF::constantTimeMemcmp):
* wtf/CryptographicUtilities.h:
(WTF::constantTimeMemcmp):
2021-05-26 Chris Dumez <cdumez@apple.com>
Use timingsafe_bcmp() in WTF::constantTimeMemcmp() when available
https://bugs.webkit.org/show_bug.cgi?id=226294
Reviewed by Alex Christensen.
Use timingsafe_bcmp() in WTF::constantTimeMemcmp() when available (iOS, macOS, FreeBSD, OpenBSD),
instead of our own custom implementation.
* wtf/CryptographicUtilities.cpp:
(WTF::constantTimeMemcmp):
2021-05-26 Chris Dumez <cdumez@apple.com>
[Hardening] Have the Ref<> destructor null out its pointer
https://bugs.webkit.org/show_bug.cgi?id=226293
<rdar://problem/78532149>
Reviewed by Geoffrey Garen.
* wtf/Ref.h:
(WTF::Ref::~Ref):
2021-05-26 Alex Christensen <achristensen@webkit.org>
URL path setter messes up UTF-8 encoding after ?
https://bugs.webkit.org/show_bug.cgi?id=226136
Reviewed by Chris Dumez.
escapePathWithoutCopying needs to tell percentEncodeCharacters to percent encode all non-ASCII characters in the output of UTF-8 encoding
in addition to ? and #. Otherwise, we take the output of UTF-8 encoding and append each code unit to the input of URL parsing as if it were Latin-1.
This matches Chrome, Firefox, and reason.
Covered by a newly passing WPT test.
Other callers of percentEncodeCharacters use functions that already encode all non-ASCII characters.
* wtf/URL.cpp:
(WTF::escapePathWithoutCopying):
2021-05-26 Chris Dumez <cdumez@apple.com>
Stop using UncheckedLock in WTF::AutomaticThread
https://bugs.webkit.org/show_bug.cgi?id=226255
Reviewed by Keith Miller.
Stop using UncheckedLock in WTF::AutomaticThread as it is being phased out in favor of
Lock, which supports Clang thread safety analysis.
* wtf/AutomaticThread.cpp:
(WTF::AutomaticThreadCondition::wait):
(WTF::AutomaticThreadCondition::waitFor):
(WTF::AutomaticThread::AutomaticThread):
* wtf/AutomaticThread.h:
* wtf/ParallelHelperPool.cpp:
(WTF::ParallelHelperClient::~ParallelHelperClient):
(WTF::ParallelHelperClient::finish):
(WTF::ParallelHelperClient::finishWithLock):
(WTF::ParallelHelperPool::ParallelHelperPool):
* wtf/ParallelHelperPool.h:
(WTF::ParallelHelperPool::numberOfThreads const):
* wtf/WorkerPool.cpp:
(WTF::WorkerPool::WorkerPool):
* wtf/WorkerPool.h:
2021-05-25 Chris Dumez <cdumez@apple.com>
Use UncheckedLock less in JavaScriptCore
https://bugs.webkit.org/show_bug.cgi?id=226212
Reviewed by Saam Barati.
Add support for unlockEarly() to Locker<Lock> specialization, for consistency
with the generic Locker.
* wtf/Lock.h:
[Modern Media Controls] REGRESSION(r254389) media controls needs the full list of language preferences for ordering tracks https://bugs.webkit.org/show_bug.cgi?id=226038 Reviewed by Myles C. Maxfield and Eric Carlson. Source/JavaScriptCore: Media controls need access to the full list of language preferences in order to properly sort/order the list of tracks in the controls UI. For example, if a `<video>` has subtitles for English, Spanish, and French, and the user has English (default) and French (alternate) configured in the Language & Region view of System Preferences on macOS, WebKit should order the subtitles list English, French, and then Spanish. * shell/playstation/TestShell.cpp: (preTest): Instead of propagating the override, just clear it out. Source/WebCore: Media controls need access to the full list of language preferences in order to properly sort/order the list of tracks in the controls UI. For example, if a `<video>` has subtitles for English, Spanish, and French, and the user has English (default) and French (alternate) configured in the Language & Region view of System Preferences on macOS, WebKit should order the subtitles list English, French, and then Spanish. Test: media/modern-media-controls/tracks-support/sorted-by-user-preferred-languages.html * page/CaptionUserPreferences.cpp: (WebCore::CaptionUserPreferences::preferredLanguages const): (WebCore::CaptionUserPreferences::textTrackSelectionScore const): (WebCore::CaptionUserPreferences::primaryAudioTrackLanguageOverride const): * page/CaptionUserPreferencesMediaAF.cpp: (WebCore::CaptionUserPreferencesMediaAF::preferredLanguages const): (WebCore::buildDisplayStringForTrackBase): (WebCore::trackDisplayName): (WebCore::textTrackCompare): * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm: (WebCore::MediaSelectionGroupAVFObjC::updateOptions): * bindings/js/JSDOMWindowBase.cpp: * bindings/js/JSWorkerGlobalScopeBase.cpp: * bindings/js/JSWorkletGlobalScopeBase.cpp: Wrap `defaultLanguage` in a lambda since it now has a parameter. * platform/LocalizedStrings.h: * platform/LocalizedStrings.cpp: (WebCore::captionsTextTrackKindDisplayName): Added. (WebCore::descriptionsTextTrackKindDisplayName): Added. (WebCore::chaptersTextTrackKindDisplayName): Added. (WebCore::metadataTextTrackKindDisplayName): Added. (WebCore::closedCaptionKindTrackDisplayName): Added. (WebCore::sdhTrackKindDisplayName): Added. (WebCore::easyReaderKindDisplayName): Added. (WebCore::forcedTrackKindDisplayName): Added. Move the logic added in r277797 from `buildDisplayStringForTrackBase` to `trackDisplayName` and only perform it if the text track display name doesn't already contain the display name for the text track kind (e.g. if the `label` is "English Captions" don't add "Captions", but do if the `label` is only "English"). Source/WTF: Media controls need access to the full list of language preferences in order to properly sort/order the list of tracks in the controls UI. For example, if a `<video>` has subtitles for English, Spanish, and French, and the user has English (default) and French (alternate) configured in the Language & Region view of System Preferences on macOS, WebKit should order the subtitles list English, French, and then Spanish. * wtf/Language.h: * wtf/Language.cpp: (WTF::cachedFullPlatformPreferredLanguages): Added. (WTF::cachedMinimizedPlatformPreferredLanguages): Added. (WTF::languageDidChange): (WTF::defaultLanguage): (WTF::userPreferredLanguages): (WTF::platformLanguageDidChange): Deleted. Move the caching in `wtf/cf/LanguageCF.cpp` to `wtf/Language.cpp` so that all platforms can benefit from caching the result of `platformUserPreferredLanguages`. * wtf/cf/LanguageCF.cpp: (WTF::platformUserPreferredLanguages): (WTF::platformLanguageDidChange): Deleted. * wtf/playstation/LanguagePlayStation.cpp: (WTF::platformUserPreferredLanguages): * wtf/spi/cocoa/NSLocaleSPI.h: * wtf/unix/LanguageUnix.cpp: (WTF::platformUserPreferredLanguages): * wtf/win/LanguageWin.cpp: (WTF::platformUserPreferredLanguages): Add `WTF::ShouldMinimizeLanguages` that controls whether `WTF::minimizedPreferredLanguages` is called. Since the result is cached, create separate `Vector<String>` for each enum value. LayoutTests: * media/modern-media-controls/tracks-support/sorted-by-user-preferred-languages.html: Added. * media/modern-media-controls/tracks-support/sorted-by-user-preferred-languages-expected.txt: Added. * media/content/lorem-ipsum.vtt: Added. Canonical link: https://commits.webkit.org/238145@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278064 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-26 00:15:02 +00:00
2021-05-25 Devin Rousso <drousso@apple.com>
[Modern Media Controls] REGRESSION(r254389) media controls needs the full list of language preferences for ordering tracks
https://bugs.webkit.org/show_bug.cgi?id=226038
Reviewed by Myles C. Maxfield and Eric Carlson.
Media controls need access to the full list of language preferences in order to properly
sort/order the list of tracks in the controls UI. For example, if a `<video>` has subtitles
for English, Spanish, and French, and the user has English (default) and French (alternate)
configured in the Language & Region view of System Preferences on macOS, WebKit should order
the subtitles list English, French, and then Spanish.
* wtf/Language.h:
* wtf/Language.cpp:
(WTF::cachedFullPlatformPreferredLanguages): Added.
(WTF::cachedMinimizedPlatformPreferredLanguages): Added.
(WTF::languageDidChange):
(WTF::defaultLanguage):
(WTF::userPreferredLanguages):
(WTF::platformLanguageDidChange): Deleted.
Move the caching in `wtf/cf/LanguageCF.cpp` to `wtf/Language.cpp` so that all platforms can
benefit from caching the result of `platformUserPreferredLanguages`.
* wtf/cf/LanguageCF.cpp:
(WTF::platformUserPreferredLanguages):
(WTF::platformLanguageDidChange): Deleted.
* wtf/playstation/LanguagePlayStation.cpp:
(WTF::platformUserPreferredLanguages):
* wtf/spi/cocoa/NSLocaleSPI.h:
* wtf/unix/LanguageUnix.cpp:
(WTF::platformUserPreferredLanguages):
* wtf/win/LanguageWin.cpp:
(WTF::platformUserPreferredLanguages):
Add `WTF::ShouldMinimizeLanguages` that controls whether `WTF::minimizedPreferredLanguages`
is called. Since the result is cached, create separate `Vector<String>` for each enum value.
Stop using UncheckedLock in html/canvas https://bugs.webkit.org/show_bug.cgi?id=226186 Reviewed by Darin Adler. Source/WebCore: Stop using UncheckedLock in html/canvas. This is a step towards phasing out UncheckedLock, in favor of the checked Lock. Technically, the code still doesn't do much thread-safety analysis after this change. It is very difficult to adopt thread-safety analysis here because the call sites don't always lock (there are cases where no locking is needed). It is also hard to get a reference to the various locks to make WTF_REQUIRES_LOCK() work. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::deleteVertexArray): * html/canvas/WebGLContextGroup.cpp: (WebCore::WebGLContextGroup::objectGraphLockForAContext): * html/canvas/WebGLContextGroup.h: * html/canvas/WebGLContextObject.cpp: (WebCore::WebGLContextObject::objectGraphLockForContext): * html/canvas/WebGLContextObject.h: * html/canvas/WebGLObject.h: * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::objectGraphLock): * html/canvas/WebGLRenderingContextBase.h: * html/canvas/WebGLSharedObject.cpp: (WebCore::WebGLSharedObject::objectGraphLockForContext): * html/canvas/WebGLSharedObject.h: Source/WTF: Allow converting a Locker<Lock> to an AbstractLocker type. This allows porting code from UncheckedLock to Lock even if said code is passing the Locker<Lock> as parameter around as an AbstractLocker. This is very common in JSC and in html/canvas. Also make DropLockForScope work with Locker<Lock> to help port code over. * wtf/Lock.h: Canonical link: https://commits.webkit.org/238141@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278057 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-25 23:19:19 +00:00
2021-05-25 Chris Dumez <cdumez@apple.com>
Stop using UncheckedLock in html/canvas
https://bugs.webkit.org/show_bug.cgi?id=226186
Reviewed by Darin Adler.
Allow converting a Locker<Lock> to an AbstractLocker type. This allows porting
code from UncheckedLock to Lock even if said code is passing the Locker<Lock>
as parameter around as an AbstractLocker. This is very common in JSC and in
html/canvas.
Also make DropLockForScope work with Locker<Lock> to help port code over.
* wtf/Lock.h:
Switch from WTF::Optional to std::optional https://bugs.webkit.org/show_bug.cgi?id=211674 Reviewed by Chris Dumez. Source/JavaScriptCore: * runtime/IntlCollator.cpp: (JSC::IntlCollator::initializeCollator): Use JSObject* instead of Optional<JSObject&>. * runtime/IntlDateTimeFormat.cpp: (JSC::toDateTimeOptionsAnyDate): Ditto. (JSC::IntlDateTimeFormat::initializeDateTimeFormat): Ditto. * runtime/IntlDisplayNames.cpp: (JSC::IntlDisplayNames::initializeDisplayNames): Ditto. * runtime/IntlListFormat.cpp: (JSC::IntlListFormat::initializeListFormat): Ditto. * runtime/IntlLocale.cpp: (JSC::IntlLocale::initializeLocale): Ditto. * runtime/IntlNumberFormat.cpp: (JSC::IntlNumberFormat::initializeNumberFormat): Ditto. * runtime/IntlNumberFormat.h: Ditto. * runtime/IntlNumberFormatInlines.h: (JSC::setNumberFormatDigitOptions): Ditto. * runtime/IntlObject.cpp: (JSC::intlBooleanOption): Ditto. (JSC::intlStringOption): Ditto. (JSC::intlNumberOption): Ditto. (JSC::supportedLocales): Ditto. * runtime/IntlObject.h: Ditto. * runtime/IntlObjectInlines.h: (JSC::intlOption): Ditto. (JSC::intlGetOptionsObject): Ditto. (JSC::intlCoerceOptionsToObject): Ditto. * runtime/IntlPluralRules.cpp: (JSC::IntlPluralRules::initializePluralRules): Ditto. * runtime/IntlPluralRules.h: Ditto. * runtime/IntlRelativeTimeFormat.cpp: (JSC::IntlRelativeTimeFormat::initializeRelativeTimeFormat): Ditto. * runtime/IntlSegmenter.cpp: (JSC::IntlSegmenter::initializeSegmenter): Ditto. Source/WebCore: * platform/graphics/VP9Utilities.h: Tweaked coding style a bit. Added missing operator!= because std::optional's operator!= relies on that, while WTF::Optional's operator!= relied on operator==. * platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp: (Encoders::definition): Use a pointer instead of Optional<&>. * testing/Internals.cpp: (WebCore::Internals::setVP9ScreenSizeAndScaleForTesting): Use a form of construction for ScreenDataOverrides that works with both WTF::Optional and std::optional. Something about way the old code used WTF::makeOptional was not compatible with std::make_optional, but it was easy to make it more straightforward and not even have to use a "make" function. Source/WebKit: * Platform/IPC/ArgumentCoder.h: (IPC::ArgumentCoder::decode): Add a WTFMove. Turns out this was not needed to get compiling with std::optional, but it's a good idea for performance. This is one of those cases where it looks like the return value optimization would work, but it doesn't because the return value doesn't exactly match the local variable's type. * Shared/TouchBarMenuData.h: Remove some overzealous use of explicit that was preventing some files from compiling with the stricter std::optional constructor rules, while it did not prevent compiling with WTF::Optional. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::switchToBrowsingContext): Removed an unused lambda capture and local variable. Not clear how this is related to std::optional, but showed up as a compiler warning. Source/WTF: * wtf/Forward.h: Remove Optional forward declaration. Also include Optional.h, just for now. Need to remove this once we do the global rename. * wtf/Optional.h: Replaced the entire WTF::Optional implementation with a WTF::Optional "using" that makes it a synonym for std::optional. WTF::nullopt being a synonym for std::nullopt and WTF::nullopt_t being a synonym for std::nullopt_t. Also included functions so that WTF::makeOptional calls std::make_optional and kept the WTF extension named valueOrCompute. Need to remove these once we do the global rename, and likely just get rid of valueOrCompute, and then delete this entire header. * wtf/Seconds.h: Added an include of FastMalloc.h, since it's no longer pulled in because of including Optional.h. * wtf/persistence/PersistentCoder.h: Use Forward.h for now instead of forward-declaring WTF::optional. Tools: * Scripts/webkitpy/style/checker.py: Removed exceptions from the WTF::Optional style rule for WebRTC. * Scripts/webkitpy/style/checkers/cpp.py: Removed check_wtf_optional. * Scripts/webkitpy/style/checkers/cpp_unittest.py: Removed test_wtf_optional. * TestWebKitAPI/CMakeLists.txt: Removed Optional.cpp. * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: Ditto. * TestWebKitAPI/Tests/WTF/Optional.cpp: Removed. * TestWebKitAPI/Tests/WTF/cf/RetainPtr.cpp: Updated test to not rely on non-standard aspects of moving from an optional. Instead check the retain count to make sure we have moved successfully. * TestWebKitAPI/Tests/WTF/ns/RetainPtr.mm: Ditto. Canonical link: https://commits.webkit.org/238131@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278035 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-25 19:35:15 +00:00
2021-05-24 Darin Adler <darin@apple.com>
Switch from WTF::Optional to std::optional
https://bugs.webkit.org/show_bug.cgi?id=211674
Reviewed by Chris Dumez.
* wtf/Forward.h: Remove Optional forward declaration.
Also include Optional.h, just for now. Need to remove this once
we do the global rename.
* wtf/Optional.h: Replaced the entire WTF::Optional implementation
with a WTF::Optional "using" that makes it a synonym for std::optional.
WTF::nullopt being a synonym for std::nullopt and WTF::nullopt_t
being a synonym for std::nullopt_t. Also included functions so
that WTF::makeOptional calls std::make_optional and kept the
WTF extension named valueOrCompute. Need to remove these once we
do the global rename, and likely just get rid of valueOrCompute, and
then delete this entire header.
* wtf/Seconds.h: Added an include of FastMalloc.h, since it's no
longer pulled in because of including Optional.h.
* wtf/persistence/PersistentCoder.h: Use Forward.h for now instead of
forward-declaring WTF::optional.
2021-05-25 Per Arne Vollan <pvollan@apple.com>
[AppleWin] JSC fails to build
https://bugs.webkit.org/show_bug.cgi?id=226225
<rdar://78330435>
Reviewed by Brent Fulgham.
Speculative build fix for missing script to generate unified sources. Make sure the WTF scripts directory exists before
copying the script there, and add a CMake log message to help further debugging if this is not the correct fix.
* wtf/CMakeLists.txt:
[PlayStation] Implement FileSystem without std::filesystem https://bugs.webkit.org/show_bug.cgi?id=226197 Reviewed by Chris Dumez. .: Expose the result of the check for <filesystem> support as HAVE_STD_FILESYSTEM. * Source/cmake/OptionsCommon.cmake: Source/WTF: The PlayStation 4 doesn't have support in its SDK for std::filesystem so backport the functions jettisoned from FileSystemPOSIX and add them to a FileSystemPlayStation.cpp. The ordering matches the contents of FileSystem.cpp. Most of the functions ported to std::filesystem were just moved over as is from the commit prior to r276879. Minor changes to the function signatures made when required. The fileTypePotentiallyFollowingSymLinks function was created from the previous behavior of fileMetadataUsingFunction and toFileMetataType. The hardLinkCount was created from looking at the behavior hardLinkCount replaced in r277446. * wtf/FileSystem.cpp: * wtf/PlatformHave.h: * wtf/PlatformPlayStation.cmake: * wtf/StdFilesystem.h: * wtf/playstation/FileSystemPlayStation.cpp: Added. (WTF::FileSystemImpl::fileTypePotentiallyFollowingSymLinks): (WTF::FileSystemImpl::fileExists): (WTF::FileSystemImpl::deleteFile): (WTF::FileSystemImpl::deleteEmptyDirectory): (WTF::FileSystemImpl::moveFile): (WTF::FileSystemImpl::fileSize): (WTF::FileSystemImpl::makeAllDirectories): (WTF::FileSystemImpl::volumeFreeSpace): (WTF::FileSystemImpl::createSymbolicLink): (WTF::FileSystemImpl::hardLink): (WTF::FileSystemImpl::hardLinkOrCopyFile): (WTF::FileSystemImpl::hardLinkCount): (WTF::FileSystemImpl::deleteNonEmptyDirectory): (WTF::FileSystemImpl::fileModificationTime): (WTF::FileSystemImpl::updateFileModificationTime): (WTF::FileSystemImpl::isHiddenFile): (WTF::FileSystemImpl::fileType): (WTF::FileSystemImpl::fileTypeFollowingSymlinks): (WTF::FileSystemImpl::pathFileName): (WTF::FileSystemImpl::parentPath): (WTF::FileSystemImpl::realPath): (WTF::FileSystemImpl::pathByAppendingComponent): (WTF::FileSystemImpl::pathByAppendingComponents): (WTF::FileSystemImpl::listDirectory): Canonical link: https://commits.webkit.org/238124@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278027 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-25 17:34:01 +00:00
2021-05-25 Don Olmstead <don.olmstead@sony.com>
[PlayStation] Implement FileSystem without std::filesystem
https://bugs.webkit.org/show_bug.cgi?id=226197
Reviewed by Chris Dumez.
The PlayStation 4 doesn't have support in its SDK for std::filesystem so backport the
functions jettisoned from FileSystemPOSIX and add them to a FileSystemPlayStation.cpp.
The ordering matches the contents of FileSystem.cpp.
Most of the functions ported to std::filesystem were just moved over as is from the commit
prior to r276879. Minor changes to the function signatures made when required.
The fileTypePotentiallyFollowingSymLinks function was created from the previous behavior
of fileMetadataUsingFunction and toFileMetataType.
The hardLinkCount was created from looking at the behavior hardLinkCount replaced in
r277446.
* wtf/FileSystem.cpp:
* wtf/PlatformHave.h:
* wtf/PlatformPlayStation.cmake:
* wtf/StdFilesystem.h:
* wtf/playstation/FileSystemPlayStation.cpp: Added.
(WTF::FileSystemImpl::fileTypePotentiallyFollowingSymLinks):
(WTF::FileSystemImpl::fileExists):
(WTF::FileSystemImpl::deleteFile):
(WTF::FileSystemImpl::deleteEmptyDirectory):
(WTF::FileSystemImpl::moveFile):
(WTF::FileSystemImpl::fileSize):
(WTF::FileSystemImpl::makeAllDirectories):
(WTF::FileSystemImpl::volumeFreeSpace):
(WTF::FileSystemImpl::createSymbolicLink):
(WTF::FileSystemImpl::hardLink):
(WTF::FileSystemImpl::hardLinkOrCopyFile):
(WTF::FileSystemImpl::hardLinkCount):
(WTF::FileSystemImpl::deleteNonEmptyDirectory):
(WTF::FileSystemImpl::fileModificationTime):
(WTF::FileSystemImpl::updateFileModificationTime):
(WTF::FileSystemImpl::isHiddenFile):
(WTF::FileSystemImpl::fileType):
(WTF::FileSystemImpl::fileTypeFollowingSymlinks):
(WTF::FileSystemImpl::pathFileName):
(WTF::FileSystemImpl::parentPath):
(WTF::FileSystemImpl::realPath):
(WTF::FileSystemImpl::pathByAppendingComponent):
(WTF::FileSystemImpl::pathByAppendingComponents):
(WTF::FileSystemImpl::listDirectory):
2021-05-24 Chris Dumez <cdumez@apple.com>
Stop using UncheckedLock in WTF::RecursiveLock
https://bugs.webkit.org/show_bug.cgi?id=226206
Reviewed by Sam Weinig.
Stop using UncheckedLock in WTF::RecursiveLock and use a regular Lock instead.
This is a step towards phasing out UncheckedLock.
Note that despite this change, RecursiveLock still doesn't benefit from
Clang thread safety analysis. Its functions do conditional locking / unlocking
which are not currently supported by analysis. Even if they were, we'd need
a template specialization for RecursiveLockAdapter<Lock> since
RecursiveLockAdapter may wrap other types of Lock which do not support analysis.
* wtf/RecursiveLockAdapter.h:
Remove StringBuilder::appendLiteral https://bugs.webkit.org/show_bug.cgi?id=226137 Reviewed by Chris Dumez. Source/JavaScriptCore: * API/tests/PingPongStackOverflowTest.cpp: (PingPongStackOverflowObject_hasInstance): Use append instead of appendLiteral. * bindings/ScriptFunctionCall.cpp: (Deprecated::ScriptCallArgumentHandler::appendArgument): Remove unnecessary cast from const char* to String, which defeats optimization and has no benefit. * bytecompiler/NodesCodegen.cpp: (JSC::ArrayPatternNode::toString const): Use append instead of appendLiteral. (JSC::RestParameterNode::toString const): Ditto. * heap/HeapSnapshotBuilder.cpp: (JSC::HeapSnapshotBuilder::json): Use append instead of appendLiteral. Removed unnecesary use of appendQuotedJSONString to append the result of snapshotTypeToString and edgeTypeToString, which return a const char* that never contains characters that require special quoting consideration, so can be appended efficiently with the normal append function. * inspector/agents/InspectorAuditAgent.cpp: (Inspector::InspectorAuditAgent::run): Use makeString instead of StringBuilder. * inspector/agents/InspectorConsoleAgent.cpp: Use auto for the result of makeString. * jsc.cpp: Use appned instead of appendLiteral. * parser/ParserArena.cpp: (JSC::IdentifierArena::makePrivateIdentifier): Use auto for the result of makeString. * runtime/ConsoleClient.cpp: (JSC::ConsoleClient::printConsoleMessage): Use append instead of appendLiteral. Also use variadic append when practical for better efficiency. (JSC::ConsoleClient::printConsoleMessageWithArguments): Ditto. * runtime/DateConversion.cpp: (JSC::formatDateTime): Ditto. * runtime/ErrorInstance.cpp: (JSC::ErrorInstance::sanitizedToString): Use makeString instead of StringBuilder. * runtime/ExceptionHelpers.cpp: (JSC::notAFunctionSourceAppender): Use append instead of appendLiteral. * runtime/IntlDateTimeFormat.cpp: (JSC::IntlDateTimeFormat::initializeDateTimeFormat): Ditto. * runtime/IntlNumberFormat.cpp: (JSC::IntlNumberFormat::initializeNumberFormat): Ditto. * runtime/JSCustomGetterFunction.cpp: (JSC::JSCustomGetterFunction::create): Use auto and cut down on reference count churn by using passing the StringImpl to makeString. * runtime/JSCustomSetterFunction.cpp: (JSC::JSCustomSetterFunction::create): Ditto. * runtime/JSGlobalObjectFunctions.cpp: Use more const and use variadic append for better efficiency. * runtime/JSONObject.cpp: (JSC::Stringifier::appendStringifiedValue): Use append instead of appendLiteral. (JSC::Stringifier::Holder::appendNextProperty): Ditto. * runtime/JSStringJoiner.h: Deleted unused appendLiteral function. Unrelated to StringBuilder::appendLiteral, but dead code. * runtime/Options.cpp: (JSC::Options::dumpOption): Use append instead of appendLiteral. * runtime/RegExpPrototype.cpp: (JSC::appendLineTerminatorEscape<UChar>): Ditto. * runtime/SamplingProfiler.cpp: (JSC::SamplingProfiler::reportTopFunctions): Use auto for the result of makeString. (JSC::SamplingProfiler::reportTopBytecodes): Ditto. * runtime/TypeProfiler.cpp: (JSC::TypeProfiler::typeInformationForExpressionAtOffset): Use append instead of appendLiteral. * runtime/TypeSet.cpp: (JSC::TypeSet::dumpTypes const): Use append instead of appendLiteral. (JSC::TypeSet::toJSONString const): Ditto. (JSC::StructureShape::propertyHash): Ditto. (JSC::StructureShape::toJSONString const): Ditto. Source/WebCore: * Modules/fetch/FetchBodyConsumer.cpp: (WebCore::packageFormData): Use auto for the result of makeString. * Modules/indexeddb/IDBKeyData.cpp: (WebCore::IDBKeyData::loggingString const): Use append instead of appendLiteral. * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord): Use auto for the result of makeString. * Modules/indexeddb/server/SQLiteIDBCursor.cpp: (WebCore::IDBServer::buildPreIndexStatement): Use makeString instead of StringBuilder. (WebCore::IDBServer::buildIndexStatement): Ditto. (WebCore::IDBServer::buildObjectStoreStatement): Ditto. * Modules/websockets/WebSocket.cpp: (WebCore::encodeProtocolString): Use append instead of appendLiteral. * Modules/websockets/WebSocketExtensionDispatcher.cpp: (WebCore::WebSocketExtensionDispatcher::appendAcceptedExtension): Ditto. * Modules/websockets/WebSocketHandshake.cpp: (WebCore::WebSocketHandshake::clientHandshakeMessage const): Use makeString instead of StringBuilder. (WebCore::WebSocketHandshake::clientHandshakeRequest const): Tweak to match the function above more closely, and use ASCIILiteral. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (formatForDebugger): Use makeString instead of StringBuilder. * contentextensions/CombinedURLFilters.cpp: (WebCore::ContentExtensions::prefixTreeVertexToString): Use append instead of appendLiteral. * css/CSSBasicShapes.cpp: (WebCore::buildCircleString): Ditto. (WebCore::buildEllipseString): Ditto. (WebCore::buildPathString): Ditto. (WebCore::buildPolygonString): Ditto. (WebCore::buildInsetString): Ditto. * css/CSSGradientValue.cpp: (WebCore::CSSLinearGradientValue::customCSSText const): Ditto. (WebCore::CSSRadialGradientValue::customCSSText const): Ditto. (WebCore::CSSConicGradientValue::customCSSText const): Ditto. * css/CSSGridIntegerRepeatValue.cpp: (WebCore::CSSGridIntegerRepeatValue::customCSSText const): Use makeString instead of StringBuilder. * css/CSSImageSetValue.cpp: (WebCore::CSSImageSetValue::customCSSText const): Use append instead of appendLiteral. * css/CSSImportRule.cpp: (WebCore::CSSImportRule::cssText const): Use makeString instead of StringBuilder. * css/CSSKeyframeRule.cpp: (WebCore::StyleRuleKeyframe::cssText const): Ditto. * css/CSSKeyframesRule.cpp: (WebCore::CSSKeyframesRule::cssText const): Use variadic append. * css/CSSLineBoxContainValue.cpp: (WebCore::CSSLineBoxContainValue::customCSSText const): Use append instead of appendLiteral. * css/CSSNamespaceRule.cpp: (WebCore::CSSNamespaceRule::cssText const): Ditto. * css/CSSPageRule.cpp: (WebCore::CSSPageRule::cssText const): Use makeString instead of StringBuilder. * css/CSSPaintImageValue.cpp: (WebCore::CSSPaintImageValue::customCSSText const): Ditto. * css/CSSPrimitiveValue.cpp: (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText const): Use append instead of appendLiteral. * css/CSSSelector.cpp: (WebCore::appendLangArgumentList): Use variadic append. (WebCore::CSSSelector::selectorText const): Ditto. Also use append instead of appendLiteral and make some improvements to cut down on allocations a little. * css/CSSSelectorList.cpp: (WebCore::CSSSelectorList::buildSelectorsText const): Use append instead of appendLiteral. * css/CSSStyleSheet.cpp: (WebCore::CSSStyleSheet::CSSStyleSheet): Moved more of the data member initialization to the class definition. (WebCore::CSSStyleSheet::addRule): Use makeString instead of StringBuilder. * css/CSSStyleSheet.h: Moved initialization here. * css/CSSTimingFunctionValue.cpp: (WebCore::CSSStepsTimingFunctionValue::customCSSText const): Use makeString instead of StringBuilder. (WebCore::CSSSpringTimingFunctionValue::customCSSText const): Ditto. * css/MediaList.cpp: (WebCore::MediaQuerySet::mediaText const): Use append instead of appendLiteral. * css/MediaQuery.cpp: (WebCore::MediaQuery::serialize const): Ditto. * css/MediaQueryExpression.cpp: (WebCore::MediaQueryExpression::serialize const): Use makeString instead of StringBuilder. * css/StyleProperties.cpp: (WebCore::StyleProperties::getLayeredShorthandValue const): Use append instead of appendLiteral. * css/parser/CSSParserToken.cpp: (WebCore::CSSParserToken::serialize const): Removed a lot of unnecessary braces. Use variadic append and append instead of appendLiteral. * dom/Document.cpp: (WebCore::Document::initSecurityContext): Use auto for the result of makeString. * dom/Element.cpp: (WebCore::appendAttributes): Use variadic append and append instead of appendLiteral. * dom/SecurityContext.cpp: (WebCore::SecurityContext::parseSandboxPolicy): Ditto. * editing/HTMLInterchange.cpp: (WebCore::convertHTMLTextToInterchangeFormat): Ditto. * editing/TextIterator.cpp: (WebCore::createSearcher): Use auto for the result of makeString. * editing/markup.cpp: (WebCore::StyledMarkupAccumulator::appendStyleNodeOpenTag): Use append instead of appendLiteral. (WebCore::StyledMarkupAccumulator::appendStartTag): Ditto. (WebCore::urlToMarkup): Ditto. * html/FormController.cpp: (WebCore::recordFormStructure): Ditto. * html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::reportValidity): Use auto for the result of makeString. * html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::validateInteractively): Ditto. * html/HTMLImageElement.cpp: (WebCore::HTMLImageElement::completeURLsInAttributeValue const): Use append insteaed of appendLiteral. * html/MediaElementSession.cpp: (WebCore::restrictionNames): Use auto for the result of makeString. * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::getUniformLocation): Ditto. * html/parser/HTMLTreeBuilder.cpp: (WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::takeRemaining): Ditto. * html/parser/XSSAuditorDelegate.cpp: (WebCore::buildConsoleError): Use makeString instead of StringBuilder. * html/track/TextTrackCue.cpp: (WebCore::TextTrackCue::rebuildDisplayTree): Ditto. * inspector/InspectorFrontendAPIDispatcher.cpp: (WebCore::expressionForEvaluatingCommand): Use append instead of appendLiteral. * inspector/InspectorOverlay.cpp: (WebCore::InspectorOverlay::drawElementTitle): Use auto for the result of makeString. * inspector/InspectorStyleSheet.cpp: (WebCore::InspectorStyleSheet::addRule): Use append instead of appendLiteral. * inspector/agents/InspectorApplicationCacheAgent.cpp: (WebCore::InspectorApplicationCacheAgent::buildObjectForApplicationCacheResource): Use makeString instead of StringBuilder. * inspector/agents/WebConsoleAgent.cpp: (WebCore::WebConsoleAgent::didReceiveResponse): Use auto for the result of makeString. (WebCore::WebConsoleAgent::didFailLoading): Ditto. * loader/MixedContentChecker.cpp: (WebCore::logWarning): Ditto (WebCore::MixedContentChecker::checkFormForMixedContent): Ditto * loader/PrivateClickMeasurement.cpp: (WebCore::makeValidURL): Added. Used for various cases below that all construct URLs in the same way with the same kinds of checks. Use makeString here instead of StringBuilder. (WebCore::attributionReportURL): Call makeValidURL. (WebCore::PrivateClickMeasurement::tokenSignatureURL const): Ditto. (WebCore::PrivateClickMeasurement::tokenPublicKeyURL const): Ditto. * loader/ResourceLoadStatistics.cpp: (WebCore::appendBoolean): Use append instead of appendLiteral. (WebCore::appendHashSet): Ditto. (WebCore::appendNavigatorAPIOptionSet): Ditto. (WebCore::appendScreenAPIOptionSet): Ditto. (WebCore::ResourceLoadStatistics::toString const): Ditto. * loader/WorkerThreadableLoader.cpp: (WebCore::WorkerThreadableLoader::loadResourceSynchronously): Use auto for the result of makeString. * page/DOMWindow.cpp: (WebCore::DOMWindow::postMessage): Ditto. * page/Frame.cpp: (WebCore::createRegExpForLabels): Use append instead of appendLiteral. Also tweak coding style a bit. * page/FrameView.cpp: (WebCore::FrameView::logMockScrollAnimatorMessage const): Use makeString instead of StringBuilder. * page/PageSerializer.cpp: (WebCore::PageSerializer::SerializerMarkupAccumulator::appendStartTag): Use append instead of appendLiteral. (WebCore::PageSerializer::serializeCSSStyleSheet): Ditto. (WebCore::PageSerializer::urlForBlankFrame): Use auto for the result of makeString. * page/PerformanceLoggingClient.cpp: (WebCore::PerformanceLoggingClient::synchronousScrollingReasonsAsString): Use makeString instead of StringBuilder. * page/cocoa/ResourceUsageOverlayCocoa.mm: (WebCore::ResourceUsageOverlay::platformDraw): Use auto for the result of makeString. * page/csp/ContentSecurityPolicy.cpp: (WebCore::consoleMessageForViolation): Use makeString instsead of StringBuilder. (WebCore::ContentSecurityPolicy::allowRunningOrDisplayingInsecureContent): Ditto. (WebCore::ContentSecurityPolicy::reportInvalidDirectiveValueCharacter const): Get rid of local variable for result of makeString. (WebCore::ContentSecurityPolicy::reportInvalidPathCharacter const): Ditto. (WebCore::ContentSecurityPolicy::reportInvalidSourceExpression const): Ditto. * page/csp/ContentSecurityPolicyDirectiveList.cpp: (WebCore::ContentSecurityPolicyDirectiveList::create): Get rid of local variable for result of makeString. * page/scrolling/ScrollingCoordinator.cpp: (WebCore::ScrollingCoordinator::synchronousScrollingReasonsAsText): Use makeString instead of StringBulder. * platform/Decimal.cpp: (WebCore::Decimal::toString const): Use append instead of appendLiteral. * platform/animation/TimingFunction.cpp: (WebCore::TimingFunction::createFromCSSText): Use makeString instead of StringBuilder. * platform/audio/HRTFElevation.cpp: (WebCore::HRTFElevation::calculateKernelsForAzimuthElevation): Use auto for the result of makeString. * platform/glib/UserAgentGLib.cpp: (WebCore::buildUserAgentString): Use append instead of appendLiteral. * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: (WebCore::InbandTextTrackPrivateAVF::processCueAttributes): Use append instead of appendLiteral. * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::recursiveCommitChanges): Got rid of local variable for result of makeString. (WebCore::GraphicsLayerCA::appendToUncommittedAnimations): Use auto for result of makeString. * platform/graphics/ca/TileController.cpp: (WebCore::TileController::tileRevalidationTimerFired): Update to use OptionSet. * platform/graphics/ca/TileGrid.cpp: (WebCore::validationPolicyAsString): Use OptionSet. (WebCore::TileGrid::setNeedsDisplayInRect): Use auto for iterator and range-based for loop. (WebCore::TileGrid::updateTileLayerProperties): Ditto. (WebCore::TileGrid::blankPixelCount const): Ditto. (WebCore::TileGrid::removeTiles): Use HashCountedSet. (WebCore::TileGrid::revalidateTiles): Use OptionSet. (WebCore::TileGrid::retainedTileBackingStoreMemory const): Use ranged-based for loop. (WebCore::TileGrid::drawTileMapContents const): Use range-based for loop and use writeIntegerToBuffer instead of String::number. (WebCore::TileGrid::platformCALayerRepaintCount const): Use HashCountedSet. (WebCore::TileGrid::platformCALayerIncrementRepaintCount): Ditto. This cuts us down from 3 hash table lookups to 1. (WebCore::TileGrid::removeUnparentedTilesNow): Removed local variable to make code a little tighter. * platform/graphics/ca/TileGrid.h: Use OptionSet and HashCountedSet. Removed some type names. * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm: (WebCore::PlatformCAFilters::setFiltersOnLayer): Use auto for reuslt of makeString. * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::drawText): Ditto. * platform/mock/ScrollAnimatorMock.cpp: (WebCore::ScrollAnimatorMock::scrollbarPrefix const): Added helper function for use below. (WebCore::ScrollAnimatorMock::mouseEnteredScrollbar const): Use makeString instead of StringBuilder. (WebCore::ScrollAnimatorMock::mouseExitedScrollbar const): Ditto. (WebCore::ScrollAnimatorMock::mouseIsDownInScrollbar const): Ditto. * platform/mock/ScrollAnimatorMock.h: Ditto. * platform/network/ProxyServer.cpp: (WebCore::appendProxyServerString): Use append instead of appendLiteral. (WebCore::toString): Ditto. * platform/network/ResourceResponseBase.cpp: (WebCore::ResourceResponseBase::sanitizeSuggestedFilename): Get rid of local variable with result of maekString in it. * platform/playstation/UserAgentPlayStation.cpp: (WebCore::platformForUAString): Deleted. No need for a global variable to hold the result of something called only once. (WebCore::platformVersionForUAString): Ditto. (WebCore::buildUserAgentString): Deleted. (WebCore::standardUserAgentStatic): Moved the logic from buildUserAgentString here, using makeString instead of StringBuilder. * platform/sql/SQLiteDatabase.cpp: (WebCore::SQLiteDatabase::open): Use auto for result of makeString. * platform/sql/SQLiteFileSystem.cpp: (WebCore::SQLiteFileSystem::deleteDatabaseFile): Ditto. * platform/text/DateTimeFormat.cpp: (WebCore::DateTimeFormat::quoteAndAppendLiteral): Use append instead of appendLiteral and StringView::substring instead of String::substring. * platform/win/ClipboardUtilitiesWin.cpp: (WebCore::replaceNewlinesWithWindowsStyleNewlines): Use append instead of appendLiteral. * platform/win/UserAgentWin.cpp: (WebCore::standardUserAgent): Use makeString instead of StringBuildeer. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::name const): Ditto. (WebCore::RenderLayer::debugDescription const): Ditto. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::logLayerInfo): Use append instead of appendLiteral. * rendering/RenderTreeAsText.cpp: (WebCore::quoteAndEscapeNonPrintables): Ditto. (WebCore::nodePosition): Ditto. * svg/SVGPathStringBuilder.cpp: (WebCore::SVGPathStringBuilder::moveTo): Ditto. (WebCore::SVGPathStringBuilder::lineTo): Ditto. (WebCore::SVGPathStringBuilder::lineToHorizontal): Ditto. (WebCore::SVGPathStringBuilder::lineToVertical): Ditto. (WebCore::SVGPathStringBuilder::curveToCubic): Ditto. (WebCore::SVGPathStringBuilder::curveToCubicSmooth): Ditto. (WebCore::SVGPathStringBuilder::curveToQuadratic): Ditto. (WebCore::SVGPathStringBuilder::curveToQuadraticSmooth): Ditto. (WebCore::SVGPathStringBuilder::arcTo): Ditto. (WebCore::SVGPathStringBuilder::closePath): Ditto. * testing/Internals.cpp: (WebCore::Internals::dumpMarkerRects): Ditto. (WebCore::appendOffsets): (WebCore::Internals::scrollSnapOffsets): Ditto. * workers/WorkerScriptLoader.cpp: (WebCore::WorkerScriptLoader::validateWorkerResponse): Use auto for reuslt of makeString. Source/WebKit: * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::ResourceLoadStatisticsDatabaseStore::ensureAndMakeDomainList): Use append instead of appendLiteral. (WebKit::domainsToString): Ditto. (WebKit::buildList): Ditto. (WebKit::ResourceLoadStatisticsDatabaseStore::findNotVeryPrevalentResources): Ditto. (WebKit::ResourceLoadStatisticsDatabaseStore::dumpResourceLoadStatistics): Ditto. (WebKit::appendBoolean): Ditto. (WebKit::appendNextEntry): Ditto. (WebKit::ResourceLoadStatisticsDatabaseStore::appendSubStatisticList const): Ditto. (WebKit::ResourceLoadStatisticsDatabaseStore::resourceToString const): Ditto. (WebKit::ResourceLoadStatisticsDatabaseStore::attributionToString): Ditto. (WebKit::ResourceLoadStatisticsDatabaseStore::privateClickMeasurementToString): Ditto. * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp: (WebKit::ResourceLoadStatisticsMemoryStore::dumpResourceLoadStatistics): Ditto. * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp: Ditto. (WebKit::domainsToString): Ditto. * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::create): Moved this here from the header. (WebKit::WebResourceLoadStatisticsStore::ThirdPartyDataForSpecificFirstParty::toString const): Ditto. (WebKit::WebResourceLoadStatisticsStore::ThirdPartyDataForSpecificFirstParty::encode const): Ditto. (WebKit::WebResourceLoadStatisticsStore::ThirdPartyDataForSpecificFirstParty::decode): Ditto. (WebKit::WebResourceLoadStatisticsStore::ThirdPartyDataForSpecificFirstParty::operator== const): Ditto. (WebKit::WebResourceLoadStatisticsStore::ThirdPartyData::toString const): Ditto. (WebKit::WebResourceLoadStatisticsStore::ThirdPartyData::encode const): Ditto. (WebKit::WebResourceLoadStatisticsStore::ThirdPartyData::decode): Ditto. (WebKit::WebResourceLoadStatisticsStore::ThirdPartyData::operator< const): Ditto. * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: Moved member functions of the nested structures into the implementation file and fixed the indentation of the structures to indicate the nesting. * NetworkProcess/NetworkLoadChecker.cpp: (WebKit::NetworkLoadChecker::continueCheckingRequest): Do not use a local variable for the reuslt of makeString. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::newTestingSession): Ditto. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::dumpContentsToFile): Use append instead of appendLiteral * NetworkProcess/cache/NetworkCacheEntry.cpp: (WebKit::NetworkCache::Entry::asJSON const): Ditto. * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::makeVersionedDirectoryPath): Do not use a local variable for the result of makeString. * NetworkProcess/soup/NetworkProcessSoup.cpp: (WebKit::buildAcceptLanguages): Use append instead of appendLiteral. * NetworkProcess/soup/WebSocketTaskSoup.cpp: (WebKit::WebSocketTask::acceptedExtensions const): Ditto. * NetworkProcess/webrtc/NetworkMDNSRegister.cpp: (WebKit::NetworkMDNSRegister::registerMDNSName): Use auto for the result of makeString. * Shared/WebMemorySampler.cpp: (WebKit::WebMemorySampler::writeHeaders): Ditto. * Shared/mac/AuxiliaryProcessMac.mm: (WebKit::initializeSandboxParameters): Do not use a local variable for the result of makeString. Also, take advantage of the support for concatenating an NSString instead of converting it to a WTF::String. * Shared/mac/WebMemorySampler.mac.mm: (WebKit::WebMemorySampler::sampleWebKit const): Use ASCIILiteral and remove explicit conversion to String. * UIProcess/API/glib/WebKitWebView.cpp: (webkitWebViewRunJavaScriptCallback): Use append instead of appendLiteral. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::fileCanBeAcceptedForUpload): Use auto for result of makeString. * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp: Use makeString instead of StringBuilder. * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::requestStorageSpace): Use auto for result of makeString. * UIProcess/WebBackForwardList.cpp: (WebKit::WebBackForwardList::loggingString): Use append instead of appendLiteral. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::processDidFinishLaunching): Use auto for result of makeString. (WebKit::WebProcessPool::startMemorySampler): Ditto. * WebProcess/WebPage/WebPage.cpp: (WebKit::dumpHistoryItem): Use append instead of appendLiteral. (WebKit::WebPage::getContentsAsString): Ditto. Source/WebKitLegacy: * WebCoreSupport/NetworkStorageSessionMap.cpp: (NetworkStorageSessionMap::switchToNewTestingSession): Do not use local for return value of makeString. Source/WebKitLegacy/mac: * WebView/WebHTMLRepresentation.mm: (regExpForLabels): Use append instead of appendLiteral. Also imrpove local variable names a bit. Source/WebKitLegacy/win: * AccessibleBase.cpp: (AccessibleBase::get_accKeyboardShortcut): Use append instead of appnedLiteral. * WebView.cpp: Ditto. Source/WTF: The optimization done by appendLiteral has minimal value and is something we can do without. It does not cut down the number of allocations, which is the main cost of the StringBuilder class. Getting rid of the differently named appendLiteral improves the design of the StringBuilder class for callers. Our goal is to get as close as possible to a single append function. If we decide we need an optimization for literals, we can come up with a different way that is compatible with append. For example, we could assume that any char array is a literal and check that at compile time in StringConcatenate; that optimization would work for both makeString and StringBuilder. Or we could use a strategy like ASCIILiteral. * wtf/FileSystem.cpp: (WTF::FileSystemImpl::encodeForFileName): Streamline logic, and use variadic append to make this more efficient. * wtf/JSONValues.cpp: (WTF::JSONImpl::Value::escapeString): Use append instead of appendLiteral. (WTF::JSONImpl::Value::writeJSON const): Ditto. * wtf/Logger.h: (WTF::Logger::log): Use auto for result of makeString. (WTF::Logger::logVerbose): Ditto. * wtf/MediaTime.cpp: (WTF::MediaTime::toString const): Use makeString instead of StringBuilder. * wtf/text/IntegerToStringConversion.h: Made lengthOfIntegerAsString a constexpr function so we can use it to compute the required size of arrays for conversion. Added using for both lengthOfIntegerAsString and writeIntegerToBuffer so we can use them without the WTF prefix as is customary for functions in WTF. * wtf/text/StringBuilder.h: (WTF::StringBuilder::appendLiteral): Deleted. * wtf/text/StringConcatenate.h: Added support for appending StringImpl&, StringImpl*, AtomStringImpl&, and AtomStringImpl*. Tools: * TestWebKitAPI/Tests/WTF/StringBuilder.cpp: Use append instead of appendLiteral. * TestWebKitAPI/Tests/WebCore/FileMonitor.cpp: (TestWebKitAPI::createCommand): Use makeString instead of StringBuilder. * TestWebKitAPI/Tests/WebCore/Logging.cpp: (TestWebKitAPI::TEST_F): Made lots of fixes to code inside #if TEST_OUTPUT, which hasn't compiled in a long time. Still not 100% there, but closer. * TestWebKitAPI/Tests/WebCore/TextCodec.cpp: (TestWebKitAPI::testDecode): Use append instead of appendLiteral. * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp: (WTR::AccessibilityUIElement::helpText const): Ditto. Canonical link: https://commits.webkit.org/238091@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277967 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-24 21:51:47 +00:00
2021-05-24 Darin Adler <darin@apple.com>
Remove StringBuilder::appendLiteral
https://bugs.webkit.org/show_bug.cgi?id=226137
Reviewed by Chris Dumez.
The optimization done by appendLiteral has minimal value and is something we
can do without. It does not cut down the number of allocations, which is the
main cost of the StringBuilder class. Getting rid of the differently named
appendLiteral improves the design of the StringBuilder class for callers.
Our goal is to get as close as possible to a single append function.
If we decide we need an optimization for literals, we can come up with a
different way that is compatible with append. For example, we could assume
that any char array is a literal and check that at compile time in
StringConcatenate; that optimization would work for both makeString and
StringBuilder. Or we could use a strategy like ASCIILiteral.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::encodeForFileName): Streamline logic,
and use variadic append to make this more efficient.
* wtf/JSONValues.cpp:
(WTF::JSONImpl::Value::escapeString): Use append instead
of appendLiteral.
(WTF::JSONImpl::Value::writeJSON const): Ditto.
* wtf/Logger.h:
(WTF::Logger::log): Use auto for result of makeString.
(WTF::Logger::logVerbose): Ditto.
* wtf/MediaTime.cpp:
(WTF::MediaTime::toString const): Use makeString instead of StringBuilder.
* wtf/text/IntegerToStringConversion.h:
Made lengthOfIntegerAsString a constexpr function so we can use it to
compute the required size of arrays for conversion. Added using for both
lengthOfIntegerAsString and writeIntegerToBuffer so we can use them without
the WTF prefix as is customary for functions in WTF.
* wtf/text/StringBuilder.h:
(WTF::StringBuilder::appendLiteral): Deleted.
* wtf/text/StringConcatenate.h: Added support for appending StringImpl&,
StringImpl*, AtomStringImpl&, and AtomStringImpl*.
2021-05-24 Keith Miller <keith_miller@apple.com>
Unreviewed, revert r276610 because it causes a 1% PLT regression.
* wtf/Bag.h:
Drop CheckedLock / CheckedCondition aliases https://bugs.webkit.org/show_bug.cgi?id=226176 Reviewed by Kate Cheney. Drop CheckedLock / CheckedCondition aliases now that they are the default. Source/JavaScriptCore: * API/JSVirtualMachine.mm: * API/glib/JSCVirtualMachine.cpp: * assembler/PerfLog.h: * assembler/testmasm.cpp: * bytecode/StructureStubInfo.h: * bytecode/SuperSampler.cpp: * dfg/DFGCommon.cpp: * dfg/DFGCommonData.cpp: * dfg/DFGPlan.h: * dfg/DFGThreadData.h: * dfg/DFGWorklist.cpp: (JSC::DFG::Worklist::Worklist): * dfg/DFGWorklist.h: * disassembler/Disassembler.cpp: * dynbench.cpp: * heap/BlockDirectory.cpp: (JSC::BlockDirectory::parallelNotEmptyBlockSource): * heap/BlockDirectory.h: (JSC::BlockDirectory::bitvectorLock): * heap/CodeBlockSet.h: (JSC::CodeBlockSet::getLock): * heap/Heap.cpp: (JSC::Heap::Heap): * heap/Heap.h: * heap/IsoSubspacePerVM.h: * heap/MarkedSpace.h: (JSC::MarkedSpace::directoryLock): * heap/MarkingConstraintSolver.h: * heap/SlotVisitor.cpp: (JSC::SlotVisitor::donateKnownParallel): * heap/SlotVisitor.h: * inspector/remote/socket/RemoteInspectorConnectionClient.h: * inspector/remote/socket/RemoteInspectorSocketEndpoint.h: * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::getLock const): (JSC::dumpJITMemory): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocatorBase::getLock const): * jit/JITWorklist.cpp: (JSC::JITWorklist::JITWorklist): * jit/JITWorklist.h: * jsc.cpp: * profiler/ProfilerDatabase.h: * runtime/ConcurrentJSLock.h: * runtime/DeferredWorkTimer.h: * runtime/JSLock.h: * runtime/SamplingProfiler.cpp: (JSC::FrameWalker::FrameWalker): (JSC::CFrameWalker::CFrameWalker): (JSC::SamplingProfiler::takeSample): * runtime/SamplingProfiler.h: (JSC::SamplingProfiler::getLock): * runtime/VM.h: * runtime/VMTraps.cpp: (JSC::VMTraps::invalidateCodeBlocksOnStack): (JSC::VMTraps::VMTraps): * runtime/VMTraps.h: * tools/FunctionOverrides.h: * tools/VMInspector.cpp: (JSC::ensureIsSafeToLock): * tools/VMInspector.h: (JSC::VMInspector::getLock): * wasm/WasmCalleeRegistry.h: (JSC::Wasm::CalleeRegistry::getLock): * wasm/WasmPlan.h: * wasm/WasmStreamingCompiler.h: * wasm/WasmThunks.h: * wasm/WasmWorklist.cpp: (JSC::Wasm::Worklist::Worklist): * wasm/WasmWorklist.h: Source/WebCore: * Modules/indexeddb/IDBObjectStore.h: * Modules/indexeddb/IDBTransaction.h: * Modules/indexeddb/client/IDBConnectionProxy.h: * Modules/indexeddb/server/IDBSerializationContext.cpp: * Modules/indexeddb/server/IDBServer.cpp: * Modules/mediastream/RTCDataChannel.cpp: * Modules/mediastream/RTCRtpSFrameTransformer.h: * Modules/mediastream/RTCRtpScriptTransform.h: * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h: * Modules/mediastream/libwebrtc/LibWebRTCRtpTransformBackend.h: * Modules/speech/SpeechRecognitionCaptureSourceImpl.h: * Modules/webaudio/AudioParamTimeline.h: * Modules/webaudio/MediaElementAudioSourceNode.h: * Modules/webdatabase/Database.cpp: * Modules/webdatabase/Database.h: * Modules/webdatabase/DatabaseManager.h: * Modules/webdatabase/DatabaseTask.h: * Modules/webdatabase/DatabaseThread.h: * Modules/webdatabase/DatabaseTracker.cpp: (WebCore::DatabaseTracker::openDatabaseMutex): * Modules/webdatabase/DatabaseTracker.h: * Modules/webdatabase/OriginLock.cpp: * Modules/webdatabase/SQLCallbackWrapper.h: * Modules/webdatabase/SQLTransaction.h: * Modules/webgpu/WebGPUDevice.cpp: (WebCore::WebGPUDevice::instancesLock): * Modules/webgpu/WebGPUDevice.h: * Modules/webgpu/WebGPUPipeline.cpp: (WebCore::WebGPUPipeline::instancesLock): * Modules/webgpu/WebGPUPipeline.h: * Modules/websockets/WebSocket.cpp: (WebCore::WebSocket::allActiveWebSocketsLock): * Modules/websockets/WebSocket.h: * accessibility/isolatedtree/AXIsolatedTree.cpp: * accessibility/isolatedtree/AXIsolatedTree.h: * bindings/js/JSDOMGlobalObject.h: * bridge/objc/WebScriptObject.mm: * crypto/CryptoAlgorithmRegistry.h: * dom/MessagePort.cpp: * dom/Node.cpp: * dom/ScriptExecutionContext.cpp: * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::createMediaPlayer): * html/canvas/CanvasRenderingContext.cpp: (WebCore::CanvasRenderingContext::instancesLock): * html/canvas/CanvasRenderingContext.h: * html/canvas/WebGLContextGroup.cpp: (WebCore::WebGLContextGroup::objectGraphLockForAContext): * html/canvas/WebGLContextGroup.h: * html/canvas/WebGLContextObject.cpp: (WebCore::WebGLContextObject::objectGraphLockForContext): * html/canvas/WebGLContextObject.h: * html/canvas/WebGLObject.h: * html/canvas/WebGLProgram.cpp: (WebCore::WebGLProgram::instancesLock): * html/canvas/WebGLProgram.h: * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::objectGraphLock): * html/canvas/WebGLRenderingContextBase.h: * html/canvas/WebGLSharedObject.cpp: (WebCore::WebGLSharedObject::objectGraphLockForContext): * html/canvas/WebGLSharedObject.h: * inspector/agents/WebHeapAgent.cpp: * page/ResourceUsageThread.h: * page/SecurityPolicy.cpp: * page/WheelEventTestMonitor.h: * page/scrolling/ScrollingTree.h: (WebCore::ScrollingTree::WTF_RETURNS_LOCK): * page/scrolling/ScrollingTreeLatchingController.h: * page/scrolling/ThreadedScrollingTree.h: (WebCore::ThreadedScrollingTree::WTF_RETURNS_LOCK): * page/scrolling/mac/ScrollingTreeMac.h: * platform/AbortableTaskQueue.h: * platform/GenericTaskQueue.cpp: * platform/GenericTaskQueue.h: * platform/LegacySchemeRegistry.cpp: * platform/audio/AudioDestination.h: * platform/audio/HRTFDatabaseLoader.h: * platform/audio/ReverbConvolver.cpp: (WebCore::ReverbConvolver::backgroundThreadEntry): * platform/audio/cocoa/AudioDestinationCocoa.h: * platform/audio/gstreamer/AudioSourceProviderGStreamer.h: * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp: * platform/audio/mac/FFTFrameMac.cpp: * platform/encryptedmedia/CDMProxy.h: * platform/graphics/MediaPlayer.cpp: * platform/graphics/ShadowBlur.cpp: (WebCore::ScratchBuffer::lock): (WebCore::ShadowBlur::drawRectShadowWithTiling): (WebCore::ShadowBlur::drawInsetShadowWithTiling): * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h: * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h: * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: * platform/graphics/cg/IOSurfacePool.h: * platform/graphics/cg/SubimageCacheWithTimer.h: * platform/graphics/cocoa/FontCacheCoreText.cpp: * platform/graphics/gstreamer/ImageDecoderGStreamer.h: * platform/graphics/gstreamer/MainThreadNotifier.h: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: * platform/graphics/gstreamer/VideoSinkGStreamer.cpp: * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp: * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h: (WebCore::TextureMapperPlatformLayerProxy::WTF_RETURNS_LOCK): * platform/image-decoders/ScalableImageDecoder.h: * platform/ios/QuickLook.mm: * platform/ios/WebSQLiteDatabaseTrackerClient.mm: * platform/ios/wak/WebCoreThreadRun.cpp: * platform/mediarecorder/MediaRecorderPrivateMock.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/RealtimeOutgoingAudioSource.h: * platform/mediastream/RealtimeOutgoingVideoSource.h: * platform/mediastream/cocoa/AudioMediaStreamTrackRendererUnit.h: * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.h: * platform/network/cf/LoaderRunLoopCF.cpp: (WebCore::loaderRunLoop): * platform/network/cocoa/WebCoreNSURLSession.mm: * platform/network/mac/UTIUtilities.mm: * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h: * platform/sql/SQLiteDatabase.cpp: * platform/sql/SQLiteDatabase.h: * platform/sql/SQLiteDatabaseTracker.cpp: * platform/text/TextEncodingRegistry.cpp: * storage/StorageQuotaManager.h: * workers/WorkerGlobalScope.cpp: * workers/WorkerOrWorkletScriptController.h: * workers/WorkerOrWorkletThread.cpp: (WebCore::WorkerOrWorkletThread::workerOrWorkletThreadsLock): * workers/WorkerOrWorkletThread.h: * worklets/PaintWorkletGlobalScope.h: Source/WebKit: * GPUProcess/graphics/RemoteGraphicsContextGL.cpp: (WebKit::RemoteGraphicsContextGL::paintPixelBufferToImageBuffer): * GPUProcess/webrtc/LibWebRTCCodecsProxy.h: * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.h: * NetworkProcess/IndexedDB/WebIDBServer.cpp: * NetworkProcess/NetworkProcess.h: * NetworkProcess/WebStorage/StorageManagerSet.h: * NetworkProcess/cache/NetworkCacheStorage.cpp: * NetworkProcess/cocoa/LaunchServicesDatabaseObserver.h: * NetworkProcess/glib/DNSCache.h: * Platform/IPC/Connection.cpp: * Platform/IPC/Connection.h: * Platform/IPC/StreamConnectionWorkQueue.h: * Platform/IPC/StreamServerConnection.h: * Shared/BlockingResponseMap.h: * Shared/Cocoa/XPCEndpointClient.h: * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h: * Shared/mac/MediaFormatReader/MediaFormatReader.h: * Shared/mac/MediaFormatReader/MediaSampleCursor.h: * Shared/mac/MediaFormatReader/MediaTrackReader.h: * UIProcess/API/glib/IconDatabase.h: * UIProcess/WebURLSchemeTask.h: * UIProcess/mac/DisplayLink.h: * UIProcess/mac/WKPrintingView.mm: (-[WKPrintingView knowsPageRange:]): * WebProcess/GPU/graphics/RemoteImageBufferProxy.h: * WebProcess/GPU/webrtc/LibWebRTCCodecs.h: * WebProcess/Network/WebSocketStream.cpp: * WebProcess/Plugins/PluginProcessConnectionManager.h: * WebProcess/WebPage/EventDispatcher.h: * WebProcess/WebPage/ViewUpdateDispatcher.h: Source/WebKitLegacy: * Storage/StorageAreaSync.h: Source/WebKitLegacy/mac: * DOM/DOMInternal.mm: Source/WTF: * WTF.xcodeproj/project.pbxproj: * wtf/Assertions.cpp: * wtf/AutomaticThread.cpp: (WTF::AutomaticThreadCondition::wait): (WTF::AutomaticThreadCondition::waitFor): (WTF::AutomaticThread::AutomaticThread): * wtf/AutomaticThread.h: * wtf/CMakeLists.txt: * wtf/CheckedCondition.h: Removed. * wtf/CheckedLock.h: Removed. * wtf/Condition.h: * wtf/CrossThreadQueue.h: * wtf/CrossThreadTaskHandler.h: * wtf/CryptographicallyRandomNumber.cpp: * wtf/FastMalloc.cpp: * wtf/Forward.h: * wtf/Language.cpp: * wtf/Lock.cpp: (WTF::UncheckedLock::lockSlow): (WTF::UncheckedLock::unlockSlow): (WTF::UncheckedLock::unlockFairlySlow): (WTF::UncheckedLock::safepointSlow): * wtf/Lock.h: (WTF::WTF_ASSERTS_ACQUIRED_LOCK): * wtf/Logger.cpp: * wtf/Logger.h: (WTF::Logger::WTF_RETURNS_LOCK): * wtf/MessageQueue.h: * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::release): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): * wtf/MetaAllocator.h: * wtf/OSLogPrintStream.h: * wtf/ParallelHelperPool.cpp: (WTF::ParallelHelperPool::ParallelHelperPool): * wtf/ParallelHelperPool.h: * wtf/ParallelJobsGeneric.h: * wtf/ParallelVectorIterator.h: * wtf/ReadWriteLock.h: * wtf/RecursiveLockAdapter.h: * wtf/RunLoop.h: * wtf/SynchronizedFixedQueue.h: * wtf/Threading.cpp: (WTF::Thread::allThreadsLock): * wtf/Threading.h: * wtf/TimingScope.cpp: * wtf/URL.cpp: * wtf/WTFSemaphore.h: * wtf/WorkQueue.cpp: (WTF::WorkQueue::concurrentApply): * wtf/WorkerPool.cpp: (WTF::WorkerPool::WorkerPool): * wtf/WorkerPool.h: * wtf/cf/LanguageCF.cpp: * wtf/text/AtomStringImpl.cpp: (WTF::AtomStringTableLocker::AtomStringTableLocker): * wtf/text/StringView.cpp: * wtf/threads/BinarySemaphore.h: * wtf/unicode/icu/CollatorICU.cpp: Tools: * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/CheckedConditionTest.cpp: Removed. * TestWebKitAPI/Tests/WTF/CheckedLockTest.cpp: Removed. * TestWebKitAPI/Tests/WTF/Condition.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WTF/Lock.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: * WebKitTestRunner/InjectedBundle/AccessibilityController.cpp: (WTR::AXThread::createThreadIfNeeded): Canonical link: https://commits.webkit.org/238085@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277958 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-24 18:29:01 +00:00
2021-05-24 Chris Dumez <cdumez@apple.com>
Drop CheckedLock / CheckedCondition aliases
https://bugs.webkit.org/show_bug.cgi?id=226176
Reviewed by Kate Cheney.
Drop CheckedLock / CheckedCondition aliases now that they are the default.
* WTF.xcodeproj/project.pbxproj:
* wtf/Assertions.cpp:
* wtf/AutomaticThread.cpp:
(WTF::AutomaticThreadCondition::wait):
(WTF::AutomaticThreadCondition::waitFor):
(WTF::AutomaticThread::AutomaticThread):
* wtf/AutomaticThread.h:
* wtf/CMakeLists.txt:
* wtf/CheckedCondition.h: Removed.
* wtf/CheckedLock.h: Removed.
* wtf/Condition.h:
* wtf/CrossThreadQueue.h:
* wtf/CrossThreadTaskHandler.h:
* wtf/CryptographicallyRandomNumber.cpp:
* wtf/FastMalloc.cpp:
* wtf/Forward.h:
* wtf/Language.cpp:
* wtf/Lock.cpp:
(WTF::UncheckedLock::lockSlow):
(WTF::UncheckedLock::unlockSlow):
(WTF::UncheckedLock::unlockFairlySlow):
(WTF::UncheckedLock::safepointSlow):
* wtf/Lock.h:
(WTF::WTF_ASSERTS_ACQUIRED_LOCK):
* wtf/Logger.cpp:
* wtf/Logger.h:
(WTF::Logger::WTF_RETURNS_LOCK):
* wtf/MessageQueue.h:
* wtf/MetaAllocator.cpp:
(WTF::MetaAllocator::release):
(WTF::MetaAllocator::MetaAllocator):
(WTF::MetaAllocator::allocate):
(WTF::MetaAllocator::currentStatistics):
* wtf/MetaAllocator.h:
* wtf/OSLogPrintStream.h:
* wtf/ParallelHelperPool.cpp:
(WTF::ParallelHelperPool::ParallelHelperPool):
* wtf/ParallelHelperPool.h:
* wtf/ParallelJobsGeneric.h:
* wtf/ParallelVectorIterator.h:
* wtf/ReadWriteLock.h:
* wtf/RecursiveLockAdapter.h:
* wtf/RunLoop.h:
* wtf/SynchronizedFixedQueue.h:
* wtf/Threading.cpp:
(WTF::Thread::allThreadsLock):
* wtf/Threading.h:
* wtf/TimingScope.cpp:
* wtf/URL.cpp:
* wtf/WTFSemaphore.h:
* wtf/WorkQueue.cpp:
(WTF::WorkQueue::concurrentApply):
* wtf/WorkerPool.cpp:
(WTF::WorkerPool::WorkerPool):
* wtf/WorkerPool.h:
* wtf/cf/LanguageCF.cpp:
* wtf/text/AtomStringImpl.cpp:
(WTF::AtomStringTableLocker::AtomStringTableLocker):
* wtf/text/StringView.cpp:
* wtf/threads/BinarySemaphore.h:
* wtf/unicode/icu/CollatorICU.cpp:
Make CheckedLock the default Lock https://bugs.webkit.org/show_bug.cgi?id=226157 Reviewed by Darin Adler. Make CheckedLock the default Lock so that we get more benefits from Clang Thread Safety Analysis. Note that CheckedLock 100% relies on the existing Source/JavaScriptCore: Lock implementation and merely adds the clang anotations for thread safety. That this patch does is: 1. Rename the Lock class to UncheckedLock 2. Rename the CheckedLock class to Lock 3. Rename the Condition class to UncheckedCondition 4. Rename the CheckedCondition class to Condition 5. Update the types of certain variables from Lock / Condition to UncheckedLock / UncheckedCondition if I got a build failure. Build failures are usually caused by the following facts: - Locker<CheckedLock> doesn't subclass AbstractLocker which a lot of JSC code passes as argument - Locker<CheckedLock> has no move constructor - Locker<CheckedLock> cannot be constructed from a lock pointer, only a reference For now, CheckedLock and CheckedCondition remain as aliases to Lock and Condition, in their respective CheckedLock.h / CheckedCondition.h headers. I will drop them in a follow-up to reduce patch size. I will also follow-up to try and get rid of as much usage of UncheckedLock and UncheckedCondition as possible. I did not try very hard in this patch to reduce patch size. * assembler/testmasm.cpp: * dfg/DFGCommon.cpp: * dfg/DFGThreadData.h: * dfg/DFGWorklist.cpp: (JSC::DFG::Worklist::Worklist): * dfg/DFGWorklist.h: * dynbench.cpp: * heap/BlockDirectory.h: (JSC::BlockDirectory::bitvectorLock): * heap/CodeBlockSet.h: (JSC::CodeBlockSet::getLock): * heap/Heap.cpp: (JSC::Heap::Heap): * heap/Heap.h: * heap/MarkedSpace.h: (JSC::MarkedSpace::directoryLock): * heap/MarkingConstraintSolver.h: * heap/SlotVisitor.cpp: (JSC::SlotVisitor::donateKnownParallel): * heap/SlotVisitor.h: * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::getLock const): (JSC::dumpJITMemory): * jit/ExecutableAllocator.h: (JSC::ExecutableAllocatorBase::getLock const): * jit/JITWorklist.cpp: (JSC::JITWorklist::JITWorklist): * jit/JITWorklist.h: * jsc.cpp: * profiler/ProfilerDatabase.h: * runtime/ConcurrentJSLock.h: * runtime/DeferredWorkTimer.h: * runtime/JSLock.h: * runtime/SamplingProfiler.cpp: (JSC::FrameWalker::FrameWalker): (JSC::CFrameWalker::CFrameWalker): (JSC::SamplingProfiler::takeSample): * runtime/SamplingProfiler.h: (JSC::SamplingProfiler::getLock): * runtime/VM.h: * runtime/VMTraps.cpp: (JSC::VMTraps::invalidateCodeBlocksOnStack): (JSC::VMTraps::VMTraps): * runtime/VMTraps.h: * tools/FunctionOverrides.h: * tools/VMInspector.cpp: (JSC::ensureIsSafeToLock): * tools/VMInspector.h: (JSC::VMInspector::getLock): * wasm/WasmCalleeRegistry.h: (JSC::Wasm::CalleeRegistry::getLock): * wasm/WasmPlan.h: * wasm/WasmStreamingCompiler.h: * wasm/WasmThunks.h: * wasm/WasmWorklist.cpp: (JSC::Wasm::Worklist::Worklist): * wasm/WasmWorklist.h: Source/WebCore: Lock implementation and merely adds the clang anotations for thread safety. That this patch does is: 1. Rename the Lock class to UncheckedLock 2. Rename the CheckedLock class to Lock 3. Rename the Condition class to UncheckedCondition 4. Rename the CheckedCondition class to Condition 5. Update the types of certain variables from Lock / Condition to UncheckedLock / UncheckedCondition if I got a build failure. Build failures are usually caused by the following facts: - Locker<CheckedLock> doesn't subclass AbstractLocker which a lot of JSC code passes as argument - Locker<CheckedLock> has no move constructor - Locker<CheckedLock> cannot be constructed from a lock pointer, only a reference For now, CheckedLock and CheckedCondition remain as aliases to Lock and Condition, in their respective CheckedLock.h / CheckedCondition.h headers. I will drop them in a follow-up to reduce patch size. I will also follow-up to try and get rid of as much usage of UncheckedLock and UncheckedCondition as possible. I did not try very hard in this patch to reduce patch size. * Modules/indexeddb/server/IDBServer.cpp: * Modules/webaudio/MediaElementAudioSourceNode.h: * Modules/webdatabase/OriginLock.cpp: * bindings/js/JSDOMGlobalObject.h: * dom/Node.cpp: * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::createMediaPlayer): * html/canvas/WebGLContextGroup.cpp: (WebCore::WebGLContextGroup::objectGraphLockForAContext): * html/canvas/WebGLContextGroup.h: * html/canvas/WebGLContextObject.cpp: (WebCore::WebGLContextObject::objectGraphLockForContext): * html/canvas/WebGLContextObject.h: * html/canvas/WebGLObject.h: * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::objectGraphLock): * html/canvas/WebGLRenderingContextBase.h: * html/canvas/WebGLSharedObject.cpp: (WebCore::WebGLSharedObject::objectGraphLockForContext): * html/canvas/WebGLSharedObject.h: * page/scrolling/mac/ScrollingTreeMac.h: * platform/audio/ReverbConvolver.cpp: (WebCore::ReverbConvolver::backgroundThreadEntry): * platform/graphics/ShadowBlur.cpp: (WebCore::ScratchBuffer::lock): (WebCore::ShadowBlur::drawRectShadowWithTiling): (WebCore::ShadowBlur::drawInsetShadowWithTiling): * platform/graphics/gstreamer/VideoSinkGStreamer.cpp: * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: Source/WebKit: Lock implementation and merely adds the clang anotations for thread safety. That this patch does is: 1. Rename the Lock class to UncheckedLock 2. Rename the CheckedLock class to Lock 3. Rename the Condition class to UncheckedCondition 4. Rename the CheckedCondition class to Condition 5. Update the types of certain variables from Lock / Condition to UncheckedLock / UncheckedCondition if I got a build failure. Build failures are usually caused by the following facts: - Locker<CheckedLock> doesn't subclass AbstractLocker which a lot of JSC code passes as argument - Locker<CheckedLock> has no move constructor - Locker<CheckedLock> cannot be constructed from a lock pointer, only a reference For now, CheckedLock and CheckedCondition remain as aliases to Lock and Condition, in their respective CheckedLock.h / CheckedCondition.h headers. I will drop them in a follow-up to reduce patch size. I will also follow-up to try and get rid of as much usage of UncheckedLock and UncheckedCondition as possible. I did not try very hard in this patch to reduce patch size. * GPUProcess/graphics/RemoteGraphicsContextGL.cpp: (WebKit::RemoteGraphicsContextGL::paintPixelBufferToImageBuffer): * NetworkProcess/IndexedDB/WebIDBServer.cpp: * UIProcess/API/glib/IconDatabase.h: * UIProcess/mac/WKPrintingView.mm: (-[WKPrintingView knowsPageRange:]): Source/WTF: Lock implementation and merely adds the clang anotations for thread safety. That this patch does is: 1. Rename the Lock class to UncheckedLock 2. Rename the CheckedLock class to Lock 3. Rename the Condition class to UncheckedCondition 4. Rename the CheckedCondition class to Condition 5. Update the types of certain variables from Lock / Condition to UncheckedLock / UncheckedCondition if I got a build failure. Build failures are usually caused by the following facts: - Locker<CheckedLock> doesn't subclass AbstractLocker which a lot of JSC code passes as argument - Locker<CheckedLock> has no move constructor - Locker<CheckedLock> cannot be constructed from a lock pointer, only a reference For now, CheckedLock and CheckedCondition remain as aliases to Lock and Condition, in their respective CheckedLock.h / CheckedCondition.h headers. I will drop them in a follow-up to reduce patch size. I will also follow-up to try and get rid of as much usage of UncheckedLock and UncheckedCondition as possible. I did not try very hard in this patch to reduce patch size. * wtf/AutomaticThread.cpp: (WTF::AutomaticThreadCondition::wait): (WTF::AutomaticThreadCondition::waitFor): (WTF::AutomaticThread::AutomaticThread): * wtf/AutomaticThread.h: * wtf/CheckedCondition.h: * wtf/CheckedLock.h: * wtf/Condition.h: * wtf/Lock.cpp: (WTF::UncheckedLock::lockSlow): (WTF::UncheckedLock::unlockSlow): (WTF::UncheckedLock::unlockFairlySlow): (WTF::UncheckedLock::safepointSlow): * wtf/Lock.h: (WTF::WTF_ASSERTS_ACQUIRED_LOCK): * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::release): (WTF::MetaAllocator::MetaAllocator): (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): * wtf/MetaAllocator.h: * wtf/ParallelHelperPool.cpp: (WTF::ParallelHelperPool::ParallelHelperPool): * wtf/ParallelHelperPool.h: * wtf/RecursiveLockAdapter.h: * wtf/WorkerPool.cpp: (WTF::WorkerPool::WorkerPool): * wtf/WorkerPool.h: Tools: Lock implementation and merely adds the clang anotations for thread safety. That this patch does is: 1. Rename the Lock class to UncheckedLock 2. Rename the CheckedLock class to Lock 3. Rename the Condition class to UncheckedCondition 4. Rename the CheckedCondition class to Condition 5. Update the types of certain variables from Lock / Condition to UncheckedLock / UncheckedCondition if I got a build failure. Build failures are usually caused by the following facts: - Locker<CheckedLock> doesn't subclass AbstractLocker which a lot of JSC code passes as argument - Locker<CheckedLock> has no move constructor - Locker<CheckedLock> cannot be constructed from a lock pointer, only a reference For now, CheckedLock and CheckedCondition remain as aliases to Lock and Condition, in their respective CheckedLock.h / CheckedCondition.h headers. I will drop them in a follow-up to reduce patch size. I will also follow-up to try and get rid of as much usage of UncheckedLock and UncheckedCondition as possible. I did not try very hard in this patch to reduce patch size. * TestWebKitAPI/Tests/WTF/CheckedConditionTest.cpp: * TestWebKitAPI/Tests/WTF/Condition.cpp: * TestWebKitAPI/Tests/WTF/MetaAllocator.cpp: * WebKitTestRunner/InjectedBundle/AccessibilityController.cpp: (WTR::AXThread::createThreadIfNeeded): Canonical link: https://commits.webkit.org/238070@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277943 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-24 05:37:41 +00:00
2021-05-23 Chris Dumez <cdumez@apple.com>
Make CheckedLock the default Lock
https://bugs.webkit.org/show_bug.cgi?id=226157
Reviewed by Darin Adler.
Make CheckedLock the default Lock so that we get more benefits from Clang
Thread Safety Analysis. Note that CheckedLock 100% relies on the existing
Lock implementation and merely adds the clang anotations for thread
safety.
That this patch does is:
1. Rename the Lock class to UncheckedLock
2. Rename the CheckedLock class to Lock
3. Rename the Condition class to UncheckedCondition
4. Rename the CheckedCondition class to Condition
5. Update the types of certain variables from Lock / Condition to
UncheckedLock / UncheckedCondition if I got a build failure. Build
failures are usually caused by the following facts:
- Locker<CheckedLock> doesn't subclass AbstractLocker which a lot of
JSC code passes as argument
- Locker<CheckedLock> has no move constructor
- Locker<CheckedLock> cannot be constructed from a lock pointer, only
a reference
For now, CheckedLock and CheckedCondition remain as aliases to Lock and
Condition, in their respective CheckedLock.h / CheckedCondition.h headers.
I will drop them in a follow-up to reduce patch size.
I will also follow-up to try and get rid of as much usage of UncheckedLock
and UncheckedCondition as possible. I did not try very hard in this patch
to reduce patch size.
* wtf/AutomaticThread.cpp:
(WTF::AutomaticThreadCondition::wait):
(WTF::AutomaticThreadCondition::waitFor):
(WTF::AutomaticThread::AutomaticThread):
* wtf/AutomaticThread.h:
* wtf/CheckedCondition.h:
* wtf/CheckedLock.h:
* wtf/Condition.h:
* wtf/Lock.cpp:
(WTF::UncheckedLock::lockSlow):
(WTF::UncheckedLock::unlockSlow):
(WTF::UncheckedLock::unlockFairlySlow):
(WTF::UncheckedLock::safepointSlow):
* wtf/Lock.h:
(WTF::WTF_ASSERTS_ACQUIRED_LOCK):
* wtf/MetaAllocator.cpp:
(WTF::MetaAllocator::release):
(WTF::MetaAllocator::MetaAllocator):
(WTF::MetaAllocator::allocate):
(WTF::MetaAllocator::currentStatistics):
* wtf/MetaAllocator.h:
* wtf/ParallelHelperPool.cpp:
(WTF::ParallelHelperPool::ParallelHelperPool):
* wtf/ParallelHelperPool.h:
* wtf/RecursiveLockAdapter.h:
* wtf/WorkerPool.cpp:
(WTF::WorkerPool::WorkerPool):
* wtf/WorkerPool.h:
2021-05-23 Mark Lam <mark.lam@apple.com>
Remove ENABLE(MASM_PROBE) flag.
https://bugs.webkit.org/show_bug.cgi?id=226154
Reviewed by Yusuke Suzuki.
The MacroAssembler::probe() mechanism is now available on all supported platforms.
There's no longer a need for the ENABLE(MASM_PROBE) flag.
* wtf/PlatformEnable.h:
Drop WTF::tryHoldLock() as it is incompatible with Clang Thread Safety Analysis https://bugs.webkit.org/show_bug.cgi?id=226145 Reviewed by Darin Adler. Drop WTF::tryHoldLock() as it is incompatible with Clang Thread Safety Analysis. Instead, use the following pattern which is supported: ``` if (lock.tryLock()) { Locker locker { AdoptLock, lock }; // ... } ``` Source/JavaScriptCore: * heap/Heap.cpp: (JSC::Heap::resumeThePeriphery): * runtime/VMTraps.cpp: (JSC::VMTraps::tryInstallTrapBreakpoints): Source/WebCore: * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::process): * Modules/webaudio/AudioWorkletNode.cpp: (WebCore::AudioWorkletNode::process): * Modules/webaudio/ConvolverNode.cpp: (WebCore::ConvolverNode::process): * Modules/webaudio/MediaElementAudioSourceNode.cpp: (WebCore::MediaElementAudioSourceNode::process): * Modules/webaudio/MediaStreamAudioSourceNode.cpp: (WebCore::MediaStreamAudioSourceNode::process): * Modules/webaudio/OscillatorNode.cpp: (WebCore::OscillatorNode::process): * Modules/webaudio/PannerNode.cpp: (WebCore::PannerNode::process): * Modules/webaudio/ScriptProcessorNode.cpp: (WebCore::ScriptProcessorNode::process): * Modules/webaudio/WaveShaperProcessor.cpp: (WebCore::WaveShaperProcessor::process): * platform/audio/ReverbConvolver.cpp: (WebCore::ReverbConvolver::process): * platform/graphics/ShadowBlur.cpp: (WebCore::ScratchBuffer::purgeTimerFired): (WebCore::ShadowBlur::drawRectShadowWithTiling): (WebCore::ShadowBlur::drawInsetShadowWithTiling): * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm: (WebCore::AudioSourceProviderAVFObjC::provideInput): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample): * platform/mediastream/mac/WebAudioSourceProviderCocoa.mm: (WebCore::WebAudioSourceProviderCocoa::provideInput): * workers/WorkerOrWorkletThread.cpp: (WebCore::WorkerOrWorkletThread::stop): Source/WTF: * wtf/CheckedLock.h: * wtf/Lock.h: * wtf/Locker.h: (WTF::Locker::Locker): Canonical link: https://commits.webkit.org/238062@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277932 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-23 19:55:32 +00:00
2021-05-23 Chris Dumez <cdumez@apple.com>
Drop WTF::tryHoldLock() as it is incompatible with Clang Thread Safety Analysis
https://bugs.webkit.org/show_bug.cgi?id=226145
Reviewed by Darin Adler.
Drop WTF::tryHoldLock() as it is incompatible with Clang Thread Safety Analysis.
Instead, use the following pattern which is supported:
```
if (lock.tryLock()) {
Locker locker { AdoptLock, lock };
// ...
}
```
* wtf/CheckedLock.h:
* wtf/Lock.h:
* wtf/Locker.h:
(WTF::Locker::Locker):
2021-05-23 Mark Lam <mark.lam@apple.com>
Build fix for JSCOnly-Linux-AArch64 bot.
Not reviewed.
* wtf/Vector.h:
(WTF::Malloc>::expandCapacity):
(WTF::Malloc>::reserveCapacity):
(WTF::Malloc>::constructAndAppendSlowCase):
Adopt CheckedLock in more places https://bugs.webkit.org/show_bug.cgi?id=226138 Reviewed by Darin Adler. Adopt CheckedLock in more places to benefit from Clang Thread Safety Analysis. Source/WebCore: * Modules/webdatabase/Database.cpp: (WebCore::Database::performClose): (WebCore::Database::scheduleTransaction): (WebCore::Database::inProgressTransactionCompleted): (WebCore::Database::hasPendingTransaction): (WebCore::Database::runTransaction): * Modules/webdatabase/Database.h: (WebCore::Database::WTF_GUARDED_BY_LOCK): * Modules/webdatabase/DatabaseManager.cpp: (WebCore::DatabaseManager::addProposedDatabase): (WebCore::DatabaseManager::removeProposedDatabase): (WebCore::DatabaseManager::fullPathForDatabase): (WebCore::DatabaseManager::detailsForNameAndOrigin): * Modules/webdatabase/DatabaseManager.h: * Modules/webdatabase/DatabaseThread.cpp: (WebCore::DatabaseThread::databaseThread): (WebCore::DatabaseThread::recordDatabaseOpen): (WebCore::DatabaseThread::recordDatabaseClosed): (WebCore::DatabaseThread::hasPendingDatabaseActivity const): * Modules/webdatabase/DatabaseThread.h: * Modules/webdatabase/SQLCallbackWrapper.h: (WebCore::SQLCallbackWrapper::clear): (WebCore::SQLCallbackWrapper::unwrap): * Modules/webdatabase/SQLTransaction.cpp: (WebCore::SQLTransaction::enqueueStatement): (WebCore::SQLTransaction::checkAndHandleClosedDatabase): (WebCore::SQLTransaction::getNextStatement): * Modules/webdatabase/SQLTransaction.h: * Modules/webdatabase/SQLTransactionBackend.cpp: (WebCore::SQLTransactionBackend::doCleanup): * accessibility/isolatedtree/AXIsolatedTree.h: (WebCore::AXIsolatedTree::WTF_GUARDED_BY_LOCK): * platform/AbortableTaskQueue.h: * platform/audio/cocoa/AudioDestinationCocoa.cpp: (WebCore::AudioDestinationCocoa::render): * platform/audio/cocoa/AudioDestinationCocoa.h: * platform/audio/gstreamer/AudioDestinationGStreamer.h: * platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp: (WebCore::AudioSourceProviderGStreamer::provideInput): (WebCore::AudioSourceProviderGStreamer::handleSample): (WebCore::AudioSourceProviderGStreamer::clearAdapters): * platform/audio/gstreamer/AudioSourceProviderGStreamer.h: * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp: (webKitWebAudioSrcRenderIteration): * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: (WebCore::AVFWrapper::addToMap): (WebCore::AVFWrapper::removeFromMap const): (WebCore::AVFWrapper::avfWrapperForCallbackContext): (WebCore::AVFWrapper::periodicTimeObserverCallback): (WebCore::AVFWrapper::processNotification): (WebCore::AVFWrapper::loadPlayableCompletionCallback): (WebCore::AVFWrapper::loadMetadataCompletionCallback): (WebCore::AVFWrapper::seekCompletedCallback): (WebCore::AVFWrapper::processCue): (WebCore::AVFWrapper::legibleOutputCallback): (WebCore::AVFWrapper::processShouldWaitForLoadingOfResource): (WebCore::AVFWrapper::resourceLoaderShouldWaitForLoadingOfRequestedResource): Source/WebKit: * Platform/IPC/Connection.cpp: (IPC::Connection::SyncMessageState::enqueueMatchingMessages): (IPC::Connection::SyncMessageState::processIncomingMessage): (IPC::Connection::SyncMessageState::dispatchMessages): (IPC::Connection::SyncMessageState::dispatchMessagesAndResetDidScheduleDispatchMessagesForConnection): Source/WTF: * wtf/Assertions.cpp: * wtf/TimingScope.cpp: * wtf/threads/BinarySemaphore.cpp: (WTF::BinarySemaphore::waitUntil): * wtf/threads/BinarySemaphore.h: Canonical link: https://commits.webkit.org/238055@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277922 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-22 21:40:04 +00:00
2021-05-22 Chris Dumez <cdumez@apple.com>
Adopt CheckedLock in more places
https://bugs.webkit.org/show_bug.cgi?id=226138
Reviewed by Darin Adler.
Adopt CheckedLock in more places to benefit from Clang Thread Safety Analysis.
* wtf/Assertions.cpp:
* wtf/TimingScope.cpp:
* wtf/threads/BinarySemaphore.cpp:
(WTF::BinarySemaphore::waitUntil):
* wtf/threads/BinarySemaphore.h:
Replace LockHolder with Locker in local variables https://bugs.webkit.org/show_bug.cgi?id=226133 Reviewed by Darin Adler. Replace LockHolder with Locker in local variables. It is shorter and it allows switching the lock type more easily since the compiler with deduce the lock type T for Locker<T>. Source/JavaScriptCore: * API/JSCallbackObject.h: (JSC::JSCallbackObjectData::JSPrivatePropertyMap::setPrivateProperty): (JSC::JSCallbackObjectData::JSPrivatePropertyMap::deletePrivateProperty): (JSC::JSCallbackObjectData::JSPrivatePropertyMap::visitChildren): * API/JSValue.mm: (handerForStructTag): * API/tests/testapi.cpp: (testCAPIViaCpp): * assembler/testmasm.cpp: (JSC::run): * b3/air/testair.cpp: * b3/testb3_1.cpp: (run): * bytecode/DirectEvalCodeCache.cpp: (JSC::DirectEvalCodeCache::setSlow): (JSC::DirectEvalCodeCache::clear): (JSC::DirectEvalCodeCache::visitAggregateImpl): * bytecode/SuperSampler.cpp: (JSC::initializeSuperSampler): (JSC::resetSuperSamplerState): (JSC::printSuperSamplerState): (JSC::enableSuperSampler): (JSC::disableSuperSampler): * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::invalidate): (JSC::DFG::CommonData::~CommonData): (JSC::DFG::CommonData::installVMTrapBreakpoints): (JSC::DFG::codeBlockForVMTrapPC): * dfg/DFGPlan.cpp: (JSC::DFG::Plan::cleanMustHandleValuesIfNecessary): * dfg/DFGWorklist.cpp: (JSC::DFG::Worklist::~Worklist): (JSC::DFG::Worklist::finishCreation): (JSC::DFG::Worklist::isActiveForVM const): (JSC::DFG::Worklist::enqueue): (JSC::DFG::Worklist::compilationState): (JSC::DFG::Worklist::waitUntilAllPlansForVMAreReady): (JSC::DFG::Worklist::removeAllReadyPlansForVM): (JSC::DFG::Worklist::completeAllReadyPlansForVM): (JSC::DFG::Worklist::visitWeakReferences): (JSC::DFG::Worklist::removeDeadPlans): (JSC::DFG::Worklist::removeNonCompilingPlansForVM): (JSC::DFG::Worklist::queueLength): (JSC::DFG::Worklist::dump const): (JSC::DFG::Worklist::setNumberOfThreads): * dfg/DFGWorklistInlines.h: (JSC::DFG::Worklist::iterateCodeBlocksForGC): * disassembler/Disassembler.cpp: * heap/BlockDirectory.cpp: (JSC::BlockDirectory::addBlock): * heap/CodeBlockSetInlines.h: (JSC::CodeBlockSet::iterateCurrentlyExecuting): * heap/ConservativeRoots.cpp: (JSC::ConservativeRoots::add): * heap/Heap.cpp: (JSC::Heap::Heap): (JSC::Heap::lastChanceToFinalize): (JSC::Heap::collectAsync): (JSC::Heap::runBeginPhase): (JSC::Heap::waitForCollector): (JSC::Heap::requestCollection): (JSC::Heap::notifyIsSafeToCollect): * heap/SlotVisitor.cpp: (JSC::SlotVisitor::didReachTermination): * inspector/agents/InspectorScriptProfilerAgent.cpp: (Inspector::InspectorScriptProfilerAgent::startTracking): (Inspector::InspectorScriptProfilerAgent::trackingComplete): (Inspector::InspectorScriptProfilerAgent::stopSamplingWhenDisconnecting): * inspector/remote/RemoteConnectionToTarget.cpp: (Inspector::RemoteConnectionToTarget::setup): (Inspector::RemoteConnectionToTarget::sendMessageToTarget): (Inspector::RemoteConnectionToTarget::close): (Inspector::RemoteConnectionToTarget::targetClosed): * inspector/remote/RemoteInspector.cpp: (Inspector::RemoteInspector::registerTarget): (Inspector::RemoteInspector::unregisterTarget): (Inspector::RemoteInspector::updateTarget): (Inspector::RemoteInspector::updateClientCapabilities): (Inspector::RemoteInspector::setClient): (Inspector::RemoteInspector::setupFailed): (Inspector::RemoteInspector::setupCompleted): (Inspector::RemoteInspector::stop): * inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm: (Inspector::RemoteTargetHandleRunSourceGlobal): (Inspector::RemoteTargetQueueTaskOnGlobalQueue): (Inspector::RemoteTargetHandleRunSourceWithInfo): (Inspector::RemoteConnectionToTarget::setup): (Inspector::RemoteConnectionToTarget::targetClosed): (Inspector::RemoteConnectionToTarget::close): (Inspector::RemoteConnectionToTarget::sendMessageToTarget): (Inspector::RemoteConnectionToTarget::queueTaskOnPrivateRunLoop): * inspector/remote/cocoa/RemoteInspectorCocoa.mm: (Inspector::RemoteInspector::updateAutomaticInspectionCandidate): (Inspector::RemoteInspector::sendMessageToRemote): (Inspector::RemoteInspector::start): (Inspector::RemoteInspector::setupXPCConnectionIfNeeded): (Inspector::RemoteInspector::setParentProcessInformation): (Inspector::RemoteInspector::xpcConnectionReceivedMessage): (Inspector::RemoteInspector::xpcConnectionFailed): (Inspector::RemoteInspector::pushListingsSoon): (Inspector::RemoteInspector::receivedIndicateMessage): (Inspector::RemoteInspector::receivedProxyApplicationSetupMessage): * inspector/remote/cocoa/RemoteInspectorXPCConnection.mm: (Inspector::RemoteInspectorXPCConnection::close): (Inspector::RemoteInspectorXPCConnection::closeFromMessage): (Inspector::RemoteInspectorXPCConnection::deserializeMessage): (Inspector::RemoteInspectorXPCConnection::handleEvent): * inspector/remote/glib/RemoteInspectorGlib.cpp: (Inspector::RemoteInspector::start): (Inspector::RemoteInspector::setupConnection): (Inspector::RemoteInspector::pushListingsSoon): (Inspector::RemoteInspector::sendMessageToRemote): (Inspector::RemoteInspector::receivedGetTargetListMessage): (Inspector::RemoteInspector::receivedDataMessage): (Inspector::RemoteInspector::receivedCloseMessage): (Inspector::RemoteInspector::setup): * inspector/remote/socket/RemoteInspectorConnectionClient.cpp: (Inspector::RemoteInspectorConnectionClient::didReceive): * inspector/remote/socket/RemoteInspectorSocket.cpp: (Inspector::RemoteInspector::didClose): (Inspector::RemoteInspector::start): (Inspector::RemoteInspector::pushListingsSoon): (Inspector::RemoteInspector::setup): (Inspector::RemoteInspector::setupInspectorClient): (Inspector::RemoteInspector::frontendDidClose): (Inspector::RemoteInspector::sendMessageToBackend): (Inspector::RemoteInspector::startAutomationSession): * inspector/remote/socket/RemoteInspectorSocketEndpoint.cpp: (Inspector::RemoteInspectorSocketEndpoint::listenInet): (Inspector::RemoteInspectorSocketEndpoint::isListening): (Inspector::RemoteInspectorSocketEndpoint::workerThread): (Inspector::RemoteInspectorSocketEndpoint::createClient): (Inspector::RemoteInspectorSocketEndpoint::disconnect): (Inspector::RemoteInspectorSocketEndpoint::invalidateClient): (Inspector::RemoteInspectorSocketEndpoint::invalidateListener): (Inspector::RemoteInspectorSocketEndpoint::getPort const): (Inspector::RemoteInspectorSocketEndpoint::recvIfEnabled): (Inspector::RemoteInspectorSocketEndpoint::sendIfEnabled): (Inspector::RemoteInspectorSocketEndpoint::send): (Inspector::RemoteInspectorSocketEndpoint::acceptInetSocketIfEnabled): * interpreter/CLoopStack.cpp: (JSC::CLoopStack::addToCommittedByteCount): (JSC::CLoopStack::committedByteCount): * jit/ExecutableAllocator.cpp: (JSC::dumpJITMemory): * jit/ICStats.cpp: (JSC::ICStats::ICStats): (JSC::ICStats::~ICStats): * jit/JITThunks.cpp: (JSC::JITThunks::ctiStub): (JSC::JITThunks::existingCTIStub): (JSC::JITThunks::ctiSlowPathFunctionStub): * jit/JITWorklist.cpp: (JSC::JITWorklist::Plan::compileInThread): (JSC::JITWorklist::Plan::isFinishedCompiling): (JSC::JITWorklist::JITWorklist): (JSC::JITWorklist::completeAllForVM): (JSC::JITWorklist::poll): (JSC::JITWorklist::compileLater): (JSC::JITWorklist::finalizePlans): * parser/SourceProvider.cpp: (JSC::SourceProvider::getID): * profiler/ProfilerDatabase.cpp: (JSC::Profiler::Database::ensureBytecodesFor): (JSC::Profiler::Database::notifyDestruction): (JSC::Profiler::Database::addCompilation): (JSC::Profiler::Database::logEvent): (JSC::Profiler::Database::addDatabaseToAtExit): (JSC::Profiler::Database::removeDatabaseFromAtExit): (JSC::Profiler::Database::removeFirstAtExitDatabase): * profiler/ProfilerUID.cpp: (JSC::Profiler::UID::create): * runtime/DeferredWorkTimer.cpp: (JSC::DeferredWorkTimer::scheduleWorkSoon): (JSC::DeferredWorkTimer::didResumeScriptExecutionOwner): * runtime/SamplingProfiler.cpp: (JSC::SamplingProfiler::timerLoop): (JSC::SamplingProfiler::shutdown): (JSC::SamplingProfiler::start): (JSC::SamplingProfiler::noticeCurrentThreadAsJSCExecutionThread): (JSC::SamplingProfiler::noticeJSLockAcquisition): (JSC::SamplingProfiler::noticeVMEntry): (JSC::SamplingProfiler::registerForReportAtExit): * runtime/Watchdog.cpp: (JSC::Watchdog::startTimer): (JSC::Watchdog::willDestroyVM): * tools/VMInspector.cpp: (JSC::VMInspector::isValidExecutableMemory): * wasm/WasmBBQPlan.cpp: (JSC::Wasm::BBQPlan::work): * wasm/WasmEntryPlan.cpp: (JSC::Wasm::EntryPlan::ThreadCountHolder::ThreadCountHolder): (JSC::Wasm::EntryPlan::ThreadCountHolder::~ThreadCountHolder): * wasm/WasmOMGPlan.cpp: (JSC::Wasm::OMGPlan::work): * wasm/WasmPlan.cpp: (JSC::Wasm::Plan::addCompletionTask): (JSC::Wasm::Plan::waitForCompletion): (JSC::Wasm::Plan::tryRemoveContextAndCancelIfLast): * wasm/WasmSignature.cpp: (JSC::Wasm::SignatureInformation::signatureFor): (JSC::Wasm::SignatureInformation::tryCleanup): * wasm/WasmWorklist.cpp: (JSC::Wasm::Worklist::enqueue): (JSC::Wasm::Worklist::completePlanSynchronously): (JSC::Wasm::Worklist::stopAllPlansForContext): (JSC::Wasm::Worklist::Worklist): (JSC::Wasm::Worklist::~Worklist): Source/WebCore: * Modules/webaudio/AsyncAudioDecoder.cpp: (WebCore::AsyncAudioDecoder::AsyncAudioDecoder): (WebCore::AsyncAudioDecoder::runLoop): * Modules/webdatabase/Database.cpp: (WebCore::Database::performClose): (WebCore::Database::inProgressTransactionCompleted): (WebCore::Database::hasPendingTransaction): (WebCore::Database::runTransaction): * Modules/webdatabase/DatabaseThread.cpp: (WebCore::DatabaseThread::start): (WebCore::DatabaseThread::databaseThread): (WebCore::DatabaseThread::recordDatabaseOpen): (WebCore::DatabaseThread::recordDatabaseClosed): (WebCore::DatabaseThread::hasPendingDatabaseActivity const): * Modules/webdatabase/DatabaseTracker.cpp: (WebCore::DatabaseTracker::canEstablishDatabase): (WebCore::DatabaseTracker::retryCanEstablishDatabase): (WebCore::DatabaseTracker::maximumSize): (WebCore::DatabaseTracker::fullPathForDatabase): (WebCore::DatabaseTracker::origins): (WebCore::DatabaseTracker::databaseNames): (WebCore::DatabaseTracker::detailsForNameAndOrigin): (WebCore::DatabaseTracker::setDatabaseDetails): (WebCore::DatabaseTracker::doneCreatingDatabase): (WebCore::DatabaseTracker::openDatabases): (WebCore::DatabaseTracker::addOpenDatabase): (WebCore::DatabaseTracker::removeOpenDatabase): (WebCore::DatabaseTracker::originLockFor): (WebCore::DatabaseTracker::quota): (WebCore::DatabaseTracker::setQuota): (WebCore::DatabaseTracker::deleteOrigin): (WebCore::DatabaseTracker::deleteDatabase): (WebCore::DatabaseTracker::deleteDatabaseFile): (WebCore::DatabaseTracker::removeDeletedOpenedDatabases): * Modules/webdatabase/SQLCallbackWrapper.h: (WebCore::SQLCallbackWrapper::clear): (WebCore::SQLCallbackWrapper::unwrap): * Modules/webdatabase/SQLTransaction.cpp: (WebCore::SQLTransaction::enqueueStatement): (WebCore::SQLTransaction::checkAndHandleClosedDatabase): (WebCore::SQLTransaction::getNextStatement): * Modules/webdatabase/SQLTransactionBackend.cpp: (WebCore::SQLTransactionBackend::doCleanup): * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::clear): (WebCore::AXIsolatedTree::generateSubtree): (WebCore::AXIsolatedTree::createSubtree): (WebCore::AXIsolatedTree::updateNode): (WebCore::AXIsolatedTree::updateNodeProperty): (WebCore::AXIsolatedTree::updateChildren): (WebCore::AXIsolatedTree::focusedNode): (WebCore::AXIsolatedTree::rootNode): (WebCore::AXIsolatedTree::setFocusedNodeID): (WebCore::AXIsolatedTree::removeNode): (WebCore::AXIsolatedTree::removeSubtree): (WebCore::AXIsolatedTree::applyPendingChanges): * page/scrolling/mac/ScrollingTreeMac.mm: (ScrollingTreeMac::scrollingNodeForPoint): (ScrollingTreeMac::eventListenerRegionTypesForPoint const): * platform/AbortableTaskQueue.h: * platform/audio/cocoa/CARingBuffer.cpp: (WebCore::CARingBufferStorageVector::flush): (WebCore::CARingBufferStorageVector::setCurrentFrameBounds): * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: (WebCore::AVFWrapper::addToMap): (WebCore::AVFWrapper::removeFromMap const): (WebCore::AVFWrapper::periodicTimeObserverCallback): (WebCore::AVFWrapper::processNotification): (WebCore::AVFWrapper::loadPlayableCompletionCallback): (WebCore::AVFWrapper::loadMetadataCompletionCallback): (WebCore::AVFWrapper::seekCompletedCallback): (WebCore::AVFWrapper::processCue): (WebCore::AVFWrapper::legibleOutputCallback): (WebCore::AVFWrapper::processShouldWaitForLoadingOfResource): (WebCore::AVFWrapper::resourceLoaderShouldWaitForLoadingOfRequestedResource): * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm: (-[WebCoreSharedBufferResourceLoaderDelegate setExpectedContentSize:]): (-[WebCoreSharedBufferResourceLoaderDelegate updateData:complete:]): (-[WebCoreSharedBufferResourceLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]): (-[WebCoreSharedBufferResourceLoaderDelegate resourceLoader:didCancelLoadingRequest:]): (WebCore::ImageDecoderAVFObjC::setTrack): (WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex): * platform/graphics/gstreamer/ImageDecoderGStreamer.cpp: (WebCore::ImageDecoderGStreamer::createFrameImageAtIndex): * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp: (WebCore::InbandTextTrackPrivateGStreamer::handleSample): (WebCore::InbandTextTrackPrivateGStreamer::notifyTrackOfSample): * platform/graphics/gstreamer/MainThreadNotifier.h: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::parseInitDataFromProtectionMessage): (WebCore::MediaPlayerPrivateGStreamer::handleProtectionEvent): * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp: (WebCore::TrackPrivateBaseGStreamer::tagsChanged): (WebCore::TrackPrivateBaseGStreamer::notifyTrackOfTagsChanged): * platform/graphics/gstreamer/VideoSinkGStreamer.cpp: (VideoRenderRequestScheduler::start): (VideoRenderRequestScheduler::stop): (VideoRenderRequestScheduler::drain): (VideoRenderRequestScheduler::requestRender): * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: (transformInPlace): (sinkEventHandler): (webKitMediaCommonEncryptionDecryptIsFlushing): (setContext): * platform/graphics/nicosia/NicosiaBuffer.cpp: (Nicosia::Buffer::beginPainting): (Nicosia::Buffer::completePainting): (Nicosia::Buffer::waitUntilPaintingComplete): * platform/graphics/nicosia/NicosiaPlatformLayer.h: (Nicosia::PlatformLayer::setSceneIntegration): (Nicosia::PlatformLayer::createUpdateScope): (Nicosia::CompositionLayer::updateState): (Nicosia::CompositionLayer::flushState): (Nicosia::CompositionLayer::commitState): (Nicosia::CompositionLayer::accessPending): (Nicosia::CompositionLayer::accessCommitted): * platform/graphics/nicosia/NicosiaScene.h: (Nicosia::Scene::accessState): * platform/graphics/nicosia/NicosiaSceneIntegration.cpp: (Nicosia::SceneIntegration::setClient): (Nicosia::SceneIntegration::invalidate): (Nicosia::SceneIntegration::requestUpdate): * platform/graphics/nicosia/texmap/NicosiaBackingStoreTextureMapperImpl.cpp: (Nicosia::BackingStoreTextureMapperImpl::flushUpdate): (Nicosia::BackingStoreTextureMapperImpl::takeUpdate): * platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.cpp: (Nicosia::ContentLayerTextureMapperImpl::~ContentLayerTextureMapperImpl): (Nicosia::ContentLayerTextureMapperImpl::invalidateClient): (Nicosia::ContentLayerTextureMapperImpl::flushUpdate): (Nicosia::ContentLayerTextureMapperImpl::swapBuffersIfNeeded): * platform/graphics/nicosia/texmap/NicosiaImageBackingTextureMapperImpl.cpp: (Nicosia::ImageBackingTextureMapperImpl::flushUpdate): (Nicosia::ImageBackingTextureMapperImpl::takeUpdate): * platform/graphics/texmap/TextureMapperGCGLPlatformLayer.cpp: (WebCore::TextureMapperGCGLPlatformLayer::swapBuffersIfNeeded): * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp: (WebCore::MediaPlayerPrivateMediaFoundation::load): (WebCore::MediaPlayerPrivateMediaFoundation::naturalSize const): (WebCore::MediaPlayerPrivateMediaFoundation::addListener): (WebCore::MediaPlayerPrivateMediaFoundation::removeListener): (WebCore::MediaPlayerPrivateMediaFoundation::notifyDeleted): (WebCore::MediaPlayerPrivateMediaFoundation::setNaturalSize): (WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::Invoke): (WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::onMediaPlayerDeleted): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::OnClockStart): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::OnClockStop): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::OnClockPause): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::OnClockRestart): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::OnClockSetRate): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::ProcessMessage): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetCurrentMediaType): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::InitServicePointers): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::ReleaseServicePointers): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetVideoWindow): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetVideoWindow): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetVideoPosition): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetVideoPosition): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::RepaintVideo): (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::getSample): (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::returnSample): (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::areSamplesPending): (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::initialize): (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::clear): (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::stopScheduler): (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::scheduleSample): (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::processSamplesInQueue): (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::processSample): (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::schedulerThreadProcPrivate): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::setVideoWindow): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::setDestinationRect): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::createVideoSamples): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::checkDeviceState): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::presentSample): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::createD3DDevice): * platform/image-decoders/ScalableImageDecoder.cpp: (WebCore::ScalableImageDecoder::frameIsCompleteAtIndex const): (WebCore::ScalableImageDecoder::frameHasAlphaAtIndex const): (WebCore::ScalableImageDecoder::frameBytesAtIndex const): (WebCore::ScalableImageDecoder::frameDurationAtIndex const): (WebCore::ScalableImageDecoder::createFrameImageAtIndex): * platform/image-decoders/ScalableImageDecoder.h: * platform/ios/LegacyTileCache.mm: (WebCore::LegacyTileCache::setTilesOpaque): (WebCore::LegacyTileCache::doLayoutTiles): (WebCore::LegacyTileCache::setCurrentScale): (WebCore::LegacyTileCache::commitScaleChange): (WebCore::LegacyTileCache::layoutTilesNow): (WebCore::LegacyTileCache::layoutTilesNowForRect): (WebCore::LegacyTileCache::removeAllNonVisibleTiles): (WebCore::LegacyTileCache::removeAllTiles): (WebCore::LegacyTileCache::removeForegroundTiles): (WebCore::LegacyTileCache::setContentReplacementImage): (WebCore::LegacyTileCache::contentReplacementImage const): (WebCore::LegacyTileCache::tileCreationTimerFired): (WebCore::LegacyTileCache::setNeedsDisplayInRect): (WebCore::LegacyTileCache::updateTilingMode): (WebCore::LegacyTileCache::setTilingMode): (WebCore::LegacyTileCache::doPendingRepaints): (WebCore::LegacyTileCache::flushSavedDisplayRects): (WebCore::LegacyTileCache::prepareToDraw): * platform/ios/LegacyTileLayerPool.mm: (WebCore::LegacyTileLayerPool::addLayer): (WebCore::LegacyTileLayerPool::takeLayerWithSize): (WebCore::LegacyTileLayerPool::setCapacity): (WebCore::LegacyTileLayerPool::prune): (WebCore::LegacyTileLayerPool::drain): * platform/ios/wak/WAKWindow.mm: (-[WAKWindow setExposedScrollViewRect:]): (-[WAKWindow exposedScrollViewRect]): * platform/ios/wak/WebCoreThread.mm: (RunWebThread): (StartWebThread): * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp: (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::audioSamplesAvailable): (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData): * platform/network/cf/FormDataStreamCFNet.cpp: (WebCore::openNextStream): (WebCore::formFinalize): (WebCore::formClose): * platform/network/curl/CurlRequest.cpp: (WebCore::CurlRequest::setRequestPaused): (WebCore::CurlRequest::setCallbackPaused): (WebCore::CurlRequest::pausedStatusChanged): (WebCore::CurlRequest::enableDownloadToFile): (WebCore::CurlRequest::getDownloadedFilePath): (WebCore::CurlRequest::writeDataToDownloadFileIfEnabled): (WebCore::CurlRequest::closeDownloadFile): (WebCore::CurlRequest::cleanupDownloadFile): * platform/network/curl/CurlSSLHandle.cpp: (WebCore::CurlSSLHandle::allowAnyHTTPSCertificatesForHost): (WebCore::CurlSSLHandle::canIgnoreAnyHTTPSCertificatesForHost const): (WebCore::CurlSSLHandle::setClientCertificateInfo): (WebCore::CurlSSLHandle::getSSLClientCertificate const): * platform/sql/SQLiteDatabase.cpp: (WebCore::SQLiteDatabase::close): (WebCore::SQLiteDatabase::maximumSize): (WebCore::SQLiteDatabase::setMaximumSize): (WebCore::SQLiteDatabase::pageSize): (WebCore::SQLiteDatabase::freeSpaceSize): (WebCore::SQLiteDatabase::totalSize): (WebCore::SQLiteDatabase::runIncrementalVacuumCommand): (WebCore::SQLiteDatabase::interrupt): (WebCore::SQLiteDatabase::setAuthorizer): (WebCore::constructAndPrepareStatement): * platform/sql/SQLiteStatement.cpp: (WebCore::SQLiteStatement::step): Source/WebKit: * NetworkProcess/IndexedDB/WebIDBServer.cpp: (WebKit::m_closeCallback): (WebKit::WebIDBServer::getOrigins): (WebKit::WebIDBServer::closeAndDeleteDatabasesModifiedSince): (WebKit::WebIDBServer::closeAndDeleteDatabasesForOrigins): (WebKit::WebIDBServer::renameOrigin): (WebKit::WebIDBServer::openDatabase): (WebKit::WebIDBServer::deleteDatabase): (WebKit::WebIDBServer::abortTransaction): (WebKit::WebIDBServer::commitTransaction): (WebKit::WebIDBServer::didFinishHandlingVersionChangeTransaction): (WebKit::WebIDBServer::createObjectStore): (WebKit::WebIDBServer::deleteObjectStore): (WebKit::WebIDBServer::renameObjectStore): (WebKit::WebIDBServer::clearObjectStore): (WebKit::WebIDBServer::createIndex): (WebKit::WebIDBServer::deleteIndex): (WebKit::WebIDBServer::renameIndex): (WebKit::WebIDBServer::putOrAdd): (WebKit::WebIDBServer::getRecord): (WebKit::WebIDBServer::getAllRecords): (WebKit::WebIDBServer::getCount): (WebKit::WebIDBServer::deleteRecord): (WebKit::WebIDBServer::openCursor): (WebKit::WebIDBServer::iterateCursor): (WebKit::WebIDBServer::establishTransaction): (WebKit::WebIDBServer::databaseConnectionPendingClose): (WebKit::WebIDBServer::databaseConnectionClosed): (WebKit::WebIDBServer::abortOpenAndUpgradeNeeded): (WebKit::WebIDBServer::didFireVersionChangeEvent): (WebKit::WebIDBServer::openDBRequestCancelled): (WebKit::WebIDBServer::getAllDatabaseNamesAndVersions): (WebKit::WebIDBServer::addConnection): (WebKit::WebIDBServer::removeConnection): (WebKit::WebIDBServer::close): * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::writeSizeFile): (WebKit::CacheStorage::Engine::readSizeFile): (WebKit::CacheStorage::Engine::clearAllCachesFromDisk): (WebKit::CacheStorage::Engine::deleteNonEmptyDirectoryOnBackgroundThread): * NetworkProcess/glib/DNSCache.cpp: (WebKit::DNSCache::lookup): (WebKit::DNSCache::update): (WebKit::DNSCache::removeExpiredResponsesFired): (WebKit::DNSCache::clear): * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp: (WebKit::CompositingRunLoop::suspend): (WebKit::CompositingRunLoop::resume): (WebKit::CompositingRunLoop::scheduleUpdate): (WebKit::CompositingRunLoop::stopUpdates): (WebKit::CompositingRunLoop::updateTimerFired): * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::m_displayRefreshMonitor): (WebKit::ThreadedCompositor::setScaleFactor): (WebKit::ThreadedCompositor::setScrollPosition): (WebKit::ThreadedCompositor::setViewportSize): (WebKit::ThreadedCompositor::renderLayerTree): (WebKit::ThreadedCompositor::sceneUpdateFinished): (WebKit::ThreadedCompositor::updateSceneState): * UIProcess/API/glib/IconDatabase.cpp: (WebKit::IconDatabase::populatePageURLToIconURLMap): (WebKit::IconDatabase::clearLoadedIconsTimerFired): (WebKit::IconDatabase::checkIconURLAndSetPageURLIfNeeded): (WebKit::IconDatabase::loadIconForPageURL): (WebKit::IconDatabase::iconURLForPageURL): (WebKit::IconDatabase::setIconForPageURL): (WebKit::IconDatabase::clear): Source/WebKitLegacy: * Storage/InProcessIDBServer.cpp: (InProcessIDBServer::InProcessIDBServer): (InProcessIDBServer::deleteDatabase): (InProcessIDBServer::openDatabase): (InProcessIDBServer::abortTransaction): (InProcessIDBServer::commitTransaction): (InProcessIDBServer::didFinishHandlingVersionChangeTransaction): (InProcessIDBServer::createObjectStore): (InProcessIDBServer::deleteObjectStore): (InProcessIDBServer::renameObjectStore): (InProcessIDBServer::clearObjectStore): (InProcessIDBServer::createIndex): (InProcessIDBServer::deleteIndex): (InProcessIDBServer::renameIndex): (InProcessIDBServer::putOrAdd): (InProcessIDBServer::getRecord): (InProcessIDBServer::getAllRecords): (InProcessIDBServer::getCount): (InProcessIDBServer::deleteRecord): (InProcessIDBServer::openCursor): (InProcessIDBServer::iterateCursor): (InProcessIDBServer::establishTransaction): (InProcessIDBServer::databaseConnectionPendingClose): (InProcessIDBServer::databaseConnectionClosed): (InProcessIDBServer::abortOpenAndUpgradeNeeded): (InProcessIDBServer::didFireVersionChangeEvent): (InProcessIDBServer::openDBRequestCancelled): (InProcessIDBServer::getAllDatabaseNamesAndVersions): (InProcessIDBServer::closeAndDeleteDatabasesModifiedSince): * Storage/StorageAreaSync.cpp: (WebKit::StorageAreaSync::syncTimerFired): (WebKit::StorageAreaSync::performSync): * Storage/StorageTracker.cpp: (WebKit::StorageTracker::finishedImportingOriginIdentifiers): (WebKit::StorageTracker::syncImportOriginIdentifiers): (WebKit::StorageTracker::syncFileSystemAndTrackerDatabase): (WebKit::StorageTracker::setOriginDetails): (WebKit::StorageTracker::syncSetOriginDetails): (WebKit::StorageTracker::origins): (WebKit::StorageTracker::deleteAllOrigins): (WebKit::StorageTracker::syncDeleteAllOrigins): (WebKit::StorageTracker::deleteOrigin): (WebKit::StorageTracker::syncDeleteOrigin): (WebKit::StorageTracker::canDeleteOrigin): (WebKit::StorageTracker::cancelDeletingOrigin): (WebKit::StorageTracker::diskUsageForOrigin): Source/WebKitLegacy/mac: * WebView/WebView.mm: (-[WebView _synchronizeCustomFixedPositionLayoutRect]): (-[WebView _setCustomFixedPositionLayoutRectInWebThread:synchronize:]): (-[WebView _setCustomFixedPositionLayoutRect:]): (-[WebView _fetchCustomFixedPositionLayoutRect:]): Source/WebKitLegacy/win: * Plugins/PluginMainThreadScheduler.cpp: (WebCore::PluginMainThreadScheduler::scheduleCall): (WebCore::PluginMainThreadScheduler::registerPlugin): (WebCore::PluginMainThreadScheduler::unregisterPlugin): (WebCore::PluginMainThreadScheduler::dispatchCallsForPlugin): Source/WTF: * benchmarks/LockSpeedTest.cpp: * wtf/AutomaticThread.cpp: (WTF::AutomaticThread::~AutomaticThread): (WTF::AutomaticThread::join): (WTF::AutomaticThread::start): * wtf/AutomaticThread.h: * wtf/MetaAllocator.cpp: (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): * wtf/ParallelHelperPool.cpp: (WTF::ParallelHelperClient::ParallelHelperClient): (WTF::ParallelHelperClient::~ParallelHelperClient): (WTF::ParallelHelperClient::setTask): (WTF::ParallelHelperClient::finish): (WTF::ParallelHelperClient::doSomeHelping): (WTF::ParallelHelperClient::runTask): (WTF::ParallelHelperPool::~ParallelHelperPool): (WTF::ParallelHelperPool::ensureThreads): (WTF::ParallelHelperPool::doSomeHelping): * wtf/Seconds.cpp: (WTF::sleep): * wtf/TimeWithDynamicClockType.cpp: (WTF::sleep): * wtf/WorkerPool.cpp: (WTF::WorkerPool::WorkerPool): (WTF::WorkerPool::~WorkerPool): (WTF::WorkerPool::postTask): * wtf/posix/ThreadingPOSIX.cpp: (WTF::Thread::suspend): (WTF::Thread::resume): (WTF::Thread::getRegisters): * wtf/win/DbgHelperWin.cpp: (WTF::DbgHelper::SymFromAddress): * wtf/win/ThreadingWin.cpp: (WTF::Thread::suspend): (WTF::Thread::resume): (WTF::Thread::getRegisters): Tools: * TestWebKitAPI/Tests/WTF/WorkQueue.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WTF/glib/WorkQueueGLib.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebCore/AbortableTaskQueue.cpp: (TestWebKitAPI::DeterministicScheduler::ThreadContext::waitMyTurn): (TestWebKitAPI::DeterministicScheduler::ThreadContext::yieldToThread): Canonical link: https://commits.webkit.org/238053@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-22 16:49:42 +00:00
2021-05-22 Chris Dumez <cdumez@apple.com>
Replace LockHolder with Locker in local variables
https://bugs.webkit.org/show_bug.cgi?id=226133
Reviewed by Darin Adler.
Replace LockHolder with Locker in local variables. It is shorter and it allows switching the lock
type more easily since the compiler with deduce the lock type T for Locker<T>.
* benchmarks/LockSpeedTest.cpp:
* wtf/AutomaticThread.cpp:
(WTF::AutomaticThread::~AutomaticThread):
(WTF::AutomaticThread::join):
(WTF::AutomaticThread::start):
* wtf/AutomaticThread.h:
* wtf/MetaAllocator.cpp:
(WTF::MetaAllocatorHandle::shrink):
(WTF::MetaAllocator::addFreshFreeSpace):
(WTF::MetaAllocator::debugFreeSpaceSize):
* wtf/ParallelHelperPool.cpp:
(WTF::ParallelHelperClient::ParallelHelperClient):
(WTF::ParallelHelperClient::~ParallelHelperClient):
(WTF::ParallelHelperClient::setTask):
(WTF::ParallelHelperClient::finish):
(WTF::ParallelHelperClient::doSomeHelping):
(WTF::ParallelHelperClient::runTask):
(WTF::ParallelHelperPool::~ParallelHelperPool):
(WTF::ParallelHelperPool::ensureThreads):
(WTF::ParallelHelperPool::doSomeHelping):
* wtf/Seconds.cpp:
(WTF::sleep):
* wtf/TimeWithDynamicClockType.cpp:
(WTF::sleep):
* wtf/WorkerPool.cpp:
(WTF::WorkerPool::WorkerPool):
(WTF::WorkerPool::~WorkerPool):
(WTF::WorkerPool::postTask):
* wtf/posix/ThreadingPOSIX.cpp:
(WTF::Thread::suspend):
(WTF::Thread::resume):
(WTF::Thread::getRegisters):
* wtf/win/DbgHelperWin.cpp:
(WTF::DbgHelper::SymFromAddress):
* wtf/win/ThreadingWin.cpp:
(WTF::Thread::suspend):
(WTF::Thread::resume):
(WTF::Thread::getRegisters):
2021-05-22 Commit Queue <commit-queue@webkit.org>
Unreviewed, reverting r277913.
https://bugs.webkit.org/show_bug.cgi?id=226140
Caused multiple layout-test crash on mac debug queues
Reverted changeset:
"Replace LockHolder with Locker in local variables"
https://bugs.webkit.org/show_bug.cgi?id=226133
https://trac.webkit.org/changeset/277913
2021-05-21 Chris Dumez <cdumez@apple.com>
Remove WTF::holdLock() / WTF::holdLockIf()
https://bugs.webkit.org/show_bug.cgi?id=226135
Reviewed by Darin Adler.
Remove WTF::holdLock() / WTF::holdLockIf() because they are not compatible with
Clang Thread Safety Analysis. All call sites have been converted to use the Locker
constructor directly.
* wtf/Locker.h:
Replace LockHolder with Locker in local variables https://bugs.webkit.org/show_bug.cgi?id=226133 Reviewed by Darin Adler. Replace LockHolder with Locker in local variables. It is shorter and it allows switching the lock type more easily since the compiler with deduce the lock type T for Locker<T>. Source/JavaScriptCore: * API/JSCallbackObject.h: (JSC::JSCallbackObjectData::JSPrivatePropertyMap::setPrivateProperty): (JSC::JSCallbackObjectData::JSPrivatePropertyMap::deletePrivateProperty): (JSC::JSCallbackObjectData::JSPrivatePropertyMap::visitChildren): * API/JSValue.mm: (handerForStructTag): * API/tests/testapi.cpp: (testCAPIViaCpp): * assembler/testmasm.cpp: (JSC::run): * b3/air/testair.cpp: * b3/testb3_1.cpp: (run): * bytecode/DirectEvalCodeCache.cpp: (JSC::DirectEvalCodeCache::setSlow): (JSC::DirectEvalCodeCache::clear): (JSC::DirectEvalCodeCache::visitAggregateImpl): * bytecode/SuperSampler.cpp: (JSC::initializeSuperSampler): (JSC::resetSuperSamplerState): (JSC::printSuperSamplerState): (JSC::enableSuperSampler): (JSC::disableSuperSampler): * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::invalidate): (JSC::DFG::CommonData::~CommonData): (JSC::DFG::CommonData::installVMTrapBreakpoints): (JSC::DFG::codeBlockForVMTrapPC): * dfg/DFGPlan.cpp: (JSC::DFG::Plan::cleanMustHandleValuesIfNecessary): * dfg/DFGWorklist.cpp: (JSC::DFG::Worklist::~Worklist): (JSC::DFG::Worklist::finishCreation): (JSC::DFG::Worklist::isActiveForVM const): (JSC::DFG::Worklist::enqueue): (JSC::DFG::Worklist::compilationState): (JSC::DFG::Worklist::waitUntilAllPlansForVMAreReady): (JSC::DFG::Worklist::removeAllReadyPlansForVM): (JSC::DFG::Worklist::completeAllReadyPlansForVM): (JSC::DFG::Worklist::visitWeakReferences): (JSC::DFG::Worklist::removeDeadPlans): (JSC::DFG::Worklist::removeNonCompilingPlansForVM): (JSC::DFG::Worklist::queueLength): (JSC::DFG::Worklist::dump const): (JSC::DFG::Worklist::setNumberOfThreads): * dfg/DFGWorklistInlines.h: (JSC::DFG::Worklist::iterateCodeBlocksForGC): * disassembler/Disassembler.cpp: * heap/BlockDirectory.cpp: (JSC::BlockDirectory::addBlock): * heap/CodeBlockSetInlines.h: (JSC::CodeBlockSet::iterateCurrentlyExecuting): * heap/ConservativeRoots.cpp: (JSC::ConservativeRoots::add): * heap/Heap.cpp: (JSC::Heap::Heap): (JSC::Heap::lastChanceToFinalize): (JSC::Heap::collectAsync): (JSC::Heap::runBeginPhase): (JSC::Heap::waitForCollector): (JSC::Heap::requestCollection): (JSC::Heap::notifyIsSafeToCollect): * heap/SlotVisitor.cpp: (JSC::SlotVisitor::didReachTermination): * inspector/agents/InspectorScriptProfilerAgent.cpp: (Inspector::InspectorScriptProfilerAgent::startTracking): (Inspector::InspectorScriptProfilerAgent::trackingComplete): (Inspector::InspectorScriptProfilerAgent::stopSamplingWhenDisconnecting): * inspector/remote/RemoteConnectionToTarget.cpp: (Inspector::RemoteConnectionToTarget::setup): (Inspector::RemoteConnectionToTarget::sendMessageToTarget): (Inspector::RemoteConnectionToTarget::close): (Inspector::RemoteConnectionToTarget::targetClosed): * inspector/remote/RemoteInspector.cpp: (Inspector::RemoteInspector::registerTarget): (Inspector::RemoteInspector::unregisterTarget): (Inspector::RemoteInspector::updateTarget): (Inspector::RemoteInspector::updateClientCapabilities): (Inspector::RemoteInspector::setClient): (Inspector::RemoteInspector::setupFailed): (Inspector::RemoteInspector::setupCompleted): (Inspector::RemoteInspector::stop): * inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm: (Inspector::RemoteTargetHandleRunSourceGlobal): (Inspector::RemoteTargetQueueTaskOnGlobalQueue): (Inspector::RemoteTargetHandleRunSourceWithInfo): (Inspector::RemoteConnectionToTarget::setup): (Inspector::RemoteConnectionToTarget::targetClosed): (Inspector::RemoteConnectionToTarget::close): (Inspector::RemoteConnectionToTarget::sendMessageToTarget): (Inspector::RemoteConnectionToTarget::queueTaskOnPrivateRunLoop): * inspector/remote/cocoa/RemoteInspectorCocoa.mm: (Inspector::RemoteInspector::updateAutomaticInspectionCandidate): (Inspector::RemoteInspector::sendMessageToRemote): (Inspector::RemoteInspector::start): (Inspector::RemoteInspector::setupXPCConnectionIfNeeded): (Inspector::RemoteInspector::setParentProcessInformation): (Inspector::RemoteInspector::xpcConnectionReceivedMessage): (Inspector::RemoteInspector::xpcConnectionFailed): (Inspector::RemoteInspector::pushListingsSoon): (Inspector::RemoteInspector::receivedIndicateMessage): (Inspector::RemoteInspector::receivedProxyApplicationSetupMessage): * inspector/remote/cocoa/RemoteInspectorXPCConnection.mm: (Inspector::RemoteInspectorXPCConnection::close): (Inspector::RemoteInspectorXPCConnection::closeFromMessage): (Inspector::RemoteInspectorXPCConnection::deserializeMessage): (Inspector::RemoteInspectorXPCConnection::handleEvent): * inspector/remote/glib/RemoteInspectorGlib.cpp: (Inspector::RemoteInspector::start): (Inspector::RemoteInspector::setupConnection): (Inspector::RemoteInspector::pushListingsSoon): (Inspector::RemoteInspector::sendMessageToRemote): (Inspector::RemoteInspector::receivedGetTargetListMessage): (Inspector::RemoteInspector::receivedDataMessage): (Inspector::RemoteInspector::receivedCloseMessage): (Inspector::RemoteInspector::setup): * inspector/remote/socket/RemoteInspectorConnectionClient.cpp: (Inspector::RemoteInspectorConnectionClient::didReceive): * inspector/remote/socket/RemoteInspectorSocket.cpp: (Inspector::RemoteInspector::didClose): (Inspector::RemoteInspector::start): (Inspector::RemoteInspector::pushListingsSoon): (Inspector::RemoteInspector::setup): (Inspector::RemoteInspector::setupInspectorClient): (Inspector::RemoteInspector::frontendDidClose): (Inspector::RemoteInspector::sendMessageToBackend): (Inspector::RemoteInspector::startAutomationSession): * inspector/remote/socket/RemoteInspectorSocketEndpoint.cpp: (Inspector::RemoteInspectorSocketEndpoint::listenInet): (Inspector::RemoteInspectorSocketEndpoint::isListening): (Inspector::RemoteInspectorSocketEndpoint::workerThread): (Inspector::RemoteInspectorSocketEndpoint::createClient): (Inspector::RemoteInspectorSocketEndpoint::disconnect): (Inspector::RemoteInspectorSocketEndpoint::invalidateClient): (Inspector::RemoteInspectorSocketEndpoint::invalidateListener): (Inspector::RemoteInspectorSocketEndpoint::getPort const): (Inspector::RemoteInspectorSocketEndpoint::recvIfEnabled): (Inspector::RemoteInspectorSocketEndpoint::sendIfEnabled): (Inspector::RemoteInspectorSocketEndpoint::send): (Inspector::RemoteInspectorSocketEndpoint::acceptInetSocketIfEnabled): * interpreter/CLoopStack.cpp: (JSC::CLoopStack::addToCommittedByteCount): (JSC::CLoopStack::committedByteCount): * jit/ExecutableAllocator.cpp: (JSC::dumpJITMemory): * jit/ICStats.cpp: (JSC::ICStats::ICStats): (JSC::ICStats::~ICStats): * jit/JITThunks.cpp: (JSC::JITThunks::ctiStub): (JSC::JITThunks::existingCTIStub): (JSC::JITThunks::ctiSlowPathFunctionStub): * jit/JITWorklist.cpp: (JSC::JITWorklist::Plan::compileInThread): (JSC::JITWorklist::Plan::isFinishedCompiling): (JSC::JITWorklist::JITWorklist): (JSC::JITWorklist::completeAllForVM): (JSC::JITWorklist::poll): (JSC::JITWorklist::compileLater): (JSC::JITWorklist::finalizePlans): * parser/SourceProvider.cpp: (JSC::SourceProvider::getID): * profiler/ProfilerDatabase.cpp: (JSC::Profiler::Database::ensureBytecodesFor): (JSC::Profiler::Database::notifyDestruction): (JSC::Profiler::Database::addCompilation): (JSC::Profiler::Database::logEvent): (JSC::Profiler::Database::addDatabaseToAtExit): (JSC::Profiler::Database::removeDatabaseFromAtExit): (JSC::Profiler::Database::removeFirstAtExitDatabase): * profiler/ProfilerUID.cpp: (JSC::Profiler::UID::create): * runtime/DeferredWorkTimer.cpp: (JSC::DeferredWorkTimer::scheduleWorkSoon): (JSC::DeferredWorkTimer::didResumeScriptExecutionOwner): * runtime/SamplingProfiler.cpp: (JSC::SamplingProfiler::timerLoop): (JSC::SamplingProfiler::shutdown): (JSC::SamplingProfiler::start): (JSC::SamplingProfiler::noticeCurrentThreadAsJSCExecutionThread): (JSC::SamplingProfiler::noticeJSLockAcquisition): (JSC::SamplingProfiler::noticeVMEntry): (JSC::SamplingProfiler::registerForReportAtExit): * runtime/Watchdog.cpp: (JSC::Watchdog::startTimer): (JSC::Watchdog::willDestroyVM): * tools/VMInspector.cpp: (JSC::VMInspector::isValidExecutableMemory): * wasm/WasmBBQPlan.cpp: (JSC::Wasm::BBQPlan::work): * wasm/WasmEntryPlan.cpp: (JSC::Wasm::EntryPlan::ThreadCountHolder::ThreadCountHolder): (JSC::Wasm::EntryPlan::ThreadCountHolder::~ThreadCountHolder): * wasm/WasmOMGPlan.cpp: (JSC::Wasm::OMGPlan::work): * wasm/WasmPlan.cpp: (JSC::Wasm::Plan::addCompletionTask): (JSC::Wasm::Plan::waitForCompletion): (JSC::Wasm::Plan::tryRemoveContextAndCancelIfLast): * wasm/WasmSignature.cpp: (JSC::Wasm::SignatureInformation::signatureFor): (JSC::Wasm::SignatureInformation::tryCleanup): * wasm/WasmWorklist.cpp: (JSC::Wasm::Worklist::enqueue): (JSC::Wasm::Worklist::completePlanSynchronously): (JSC::Wasm::Worklist::stopAllPlansForContext): (JSC::Wasm::Worklist::Worklist): (JSC::Wasm::Worklist::~Worklist): Source/WebCore: * Modules/webaudio/AsyncAudioDecoder.cpp: (WebCore::AsyncAudioDecoder::AsyncAudioDecoder): (WebCore::AsyncAudioDecoder::runLoop): * Modules/webdatabase/Database.cpp: (WebCore::Database::performClose): (WebCore::Database::inProgressTransactionCompleted): (WebCore::Database::hasPendingTransaction): (WebCore::Database::runTransaction): * Modules/webdatabase/DatabaseThread.cpp: (WebCore::DatabaseThread::start): (WebCore::DatabaseThread::databaseThread): (WebCore::DatabaseThread::recordDatabaseOpen): (WebCore::DatabaseThread::recordDatabaseClosed): (WebCore::DatabaseThread::hasPendingDatabaseActivity const): * Modules/webdatabase/DatabaseTracker.cpp: (WebCore::DatabaseTracker::canEstablishDatabase): (WebCore::DatabaseTracker::retryCanEstablishDatabase): (WebCore::DatabaseTracker::maximumSize): (WebCore::DatabaseTracker::fullPathForDatabase): (WebCore::DatabaseTracker::origins): (WebCore::DatabaseTracker::databaseNames): (WebCore::DatabaseTracker::detailsForNameAndOrigin): (WebCore::DatabaseTracker::setDatabaseDetails): (WebCore::DatabaseTracker::doneCreatingDatabase): (WebCore::DatabaseTracker::openDatabases): (WebCore::DatabaseTracker::addOpenDatabase): (WebCore::DatabaseTracker::removeOpenDatabase): (WebCore::DatabaseTracker::originLockFor): (WebCore::DatabaseTracker::quota): (WebCore::DatabaseTracker::setQuota): (WebCore::DatabaseTracker::deleteOrigin): (WebCore::DatabaseTracker::deleteDatabase): (WebCore::DatabaseTracker::deleteDatabaseFile): (WebCore::DatabaseTracker::removeDeletedOpenedDatabases): * Modules/webdatabase/SQLCallbackWrapper.h: (WebCore::SQLCallbackWrapper::clear): (WebCore::SQLCallbackWrapper::unwrap): * Modules/webdatabase/SQLTransaction.cpp: (WebCore::SQLTransaction::enqueueStatement): (WebCore::SQLTransaction::checkAndHandleClosedDatabase): (WebCore::SQLTransaction::getNextStatement): * Modules/webdatabase/SQLTransactionBackend.cpp: (WebCore::SQLTransactionBackend::doCleanup): * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::clear): (WebCore::AXIsolatedTree::generateSubtree): (WebCore::AXIsolatedTree::createSubtree): (WebCore::AXIsolatedTree::updateNode): (WebCore::AXIsolatedTree::updateNodeProperty): (WebCore::AXIsolatedTree::updateChildren): (WebCore::AXIsolatedTree::focusedNode): (WebCore::AXIsolatedTree::rootNode): (WebCore::AXIsolatedTree::setFocusedNodeID): (WebCore::AXIsolatedTree::removeNode): (WebCore::AXIsolatedTree::removeSubtree): (WebCore::AXIsolatedTree::applyPendingChanges): * page/scrolling/mac/ScrollingTreeMac.mm: (ScrollingTreeMac::scrollingNodeForPoint): (ScrollingTreeMac::eventListenerRegionTypesForPoint const): * platform/AbortableTaskQueue.h: * platform/audio/cocoa/CARingBuffer.cpp: (WebCore::CARingBufferStorageVector::flush): (WebCore::CARingBufferStorageVector::setCurrentFrameBounds): * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: (WebCore::AVFWrapper::addToMap): (WebCore::AVFWrapper::removeFromMap const): (WebCore::AVFWrapper::periodicTimeObserverCallback): (WebCore::AVFWrapper::processNotification): (WebCore::AVFWrapper::loadPlayableCompletionCallback): (WebCore::AVFWrapper::loadMetadataCompletionCallback): (WebCore::AVFWrapper::seekCompletedCallback): (WebCore::AVFWrapper::processCue): (WebCore::AVFWrapper::legibleOutputCallback): (WebCore::AVFWrapper::processShouldWaitForLoadingOfResource): (WebCore::AVFWrapper::resourceLoaderShouldWaitForLoadingOfRequestedResource): * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm: (-[WebCoreSharedBufferResourceLoaderDelegate setExpectedContentSize:]): (-[WebCoreSharedBufferResourceLoaderDelegate updateData:complete:]): (-[WebCoreSharedBufferResourceLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]): (-[WebCoreSharedBufferResourceLoaderDelegate resourceLoader:didCancelLoadingRequest:]): (WebCore::ImageDecoderAVFObjC::setTrack): (WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex): * platform/graphics/gstreamer/ImageDecoderGStreamer.cpp: (WebCore::ImageDecoderGStreamer::createFrameImageAtIndex): * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp: (WebCore::InbandTextTrackPrivateGStreamer::handleSample): (WebCore::InbandTextTrackPrivateGStreamer::notifyTrackOfSample): * platform/graphics/gstreamer/MainThreadNotifier.h: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::parseInitDataFromProtectionMessage): (WebCore::MediaPlayerPrivateGStreamer::handleProtectionEvent): * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp: (WebCore::TrackPrivateBaseGStreamer::tagsChanged): (WebCore::TrackPrivateBaseGStreamer::notifyTrackOfTagsChanged): * platform/graphics/gstreamer/VideoSinkGStreamer.cpp: (VideoRenderRequestScheduler::start): (VideoRenderRequestScheduler::stop): (VideoRenderRequestScheduler::drain): (VideoRenderRequestScheduler::requestRender): * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: (transformInPlace): (sinkEventHandler): (webKitMediaCommonEncryptionDecryptIsFlushing): (setContext): * platform/graphics/nicosia/NicosiaBuffer.cpp: (Nicosia::Buffer::beginPainting): (Nicosia::Buffer::completePainting): (Nicosia::Buffer::waitUntilPaintingComplete): * platform/graphics/nicosia/NicosiaPlatformLayer.h: (Nicosia::PlatformLayer::setSceneIntegration): (Nicosia::PlatformLayer::createUpdateScope): (Nicosia::CompositionLayer::updateState): (Nicosia::CompositionLayer::flushState): (Nicosia::CompositionLayer::commitState): (Nicosia::CompositionLayer::accessPending): (Nicosia::CompositionLayer::accessCommitted): * platform/graphics/nicosia/NicosiaScene.h: (Nicosia::Scene::accessState): * platform/graphics/nicosia/NicosiaSceneIntegration.cpp: (Nicosia::SceneIntegration::setClient): (Nicosia::SceneIntegration::invalidate): (Nicosia::SceneIntegration::requestUpdate): * platform/graphics/nicosia/texmap/NicosiaBackingStoreTextureMapperImpl.cpp: (Nicosia::BackingStoreTextureMapperImpl::flushUpdate): (Nicosia::BackingStoreTextureMapperImpl::takeUpdate): * platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.cpp: (Nicosia::ContentLayerTextureMapperImpl::~ContentLayerTextureMapperImpl): (Nicosia::ContentLayerTextureMapperImpl::invalidateClient): (Nicosia::ContentLayerTextureMapperImpl::flushUpdate): (Nicosia::ContentLayerTextureMapperImpl::swapBuffersIfNeeded): * platform/graphics/nicosia/texmap/NicosiaImageBackingTextureMapperImpl.cpp: (Nicosia::ImageBackingTextureMapperImpl::flushUpdate): (Nicosia::ImageBackingTextureMapperImpl::takeUpdate): * platform/graphics/texmap/TextureMapperGCGLPlatformLayer.cpp: (WebCore::TextureMapperGCGLPlatformLayer::swapBuffersIfNeeded): * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp: (WebCore::MediaPlayerPrivateMediaFoundation::load): (WebCore::MediaPlayerPrivateMediaFoundation::naturalSize const): (WebCore::MediaPlayerPrivateMediaFoundation::addListener): (WebCore::MediaPlayerPrivateMediaFoundation::removeListener): (WebCore::MediaPlayerPrivateMediaFoundation::notifyDeleted): (WebCore::MediaPlayerPrivateMediaFoundation::setNaturalSize): (WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::Invoke): (WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::onMediaPlayerDeleted): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::OnClockStart): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::OnClockStop): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::OnClockPause): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::OnClockRestart): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::OnClockSetRate): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::ProcessMessage): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetCurrentMediaType): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::InitServicePointers): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::ReleaseServicePointers): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetVideoWindow): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetVideoWindow): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetVideoPosition): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetVideoPosition): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::RepaintVideo): (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::getSample): (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::returnSample): (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::areSamplesPending): (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::initialize): (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::clear): (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::stopScheduler): (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::scheduleSample): (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::processSamplesInQueue): (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::processSample): (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::schedulerThreadProcPrivate): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::setVideoWindow): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::setDestinationRect): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::createVideoSamples): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::checkDeviceState): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::presentSample): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame): (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::createD3DDevice): * platform/image-decoders/ScalableImageDecoder.cpp: (WebCore::ScalableImageDecoder::frameIsCompleteAtIndex const): (WebCore::ScalableImageDecoder::frameHasAlphaAtIndex const): (WebCore::ScalableImageDecoder::frameBytesAtIndex const): (WebCore::ScalableImageDecoder::frameDurationAtIndex const): (WebCore::ScalableImageDecoder::createFrameImageAtIndex): * platform/image-decoders/ScalableImageDecoder.h: * platform/ios/LegacyTileCache.mm: (WebCore::LegacyTileCache::setTilesOpaque): (WebCore::LegacyTileCache::doLayoutTiles): (WebCore::LegacyTileCache::setCurrentScale): (WebCore::LegacyTileCache::commitScaleChange): (WebCore::LegacyTileCache::layoutTilesNow): (WebCore::LegacyTileCache::layoutTilesNowForRect): (WebCore::LegacyTileCache::removeAllNonVisibleTiles): (WebCore::LegacyTileCache::removeAllTiles): (WebCore::LegacyTileCache::removeForegroundTiles): (WebCore::LegacyTileCache::setContentReplacementImage): (WebCore::LegacyTileCache::contentReplacementImage const): (WebCore::LegacyTileCache::tileCreationTimerFired): (WebCore::LegacyTileCache::setNeedsDisplayInRect): (WebCore::LegacyTileCache::updateTilingMode): (WebCore::LegacyTileCache::setTilingMode): (WebCore::LegacyTileCache::doPendingRepaints): (WebCore::LegacyTileCache::flushSavedDisplayRects): (WebCore::LegacyTileCache::prepareToDraw): * platform/ios/LegacyTileLayerPool.mm: (WebCore::LegacyTileLayerPool::addLayer): (WebCore::LegacyTileLayerPool::takeLayerWithSize): (WebCore::LegacyTileLayerPool::setCapacity): (WebCore::LegacyTileLayerPool::prune): (WebCore::LegacyTileLayerPool::drain): * platform/ios/wak/WAKWindow.mm: (-[WAKWindow setExposedScrollViewRect:]): (-[WAKWindow exposedScrollViewRect]): * platform/ios/wak/WebCoreThread.mm: (RunWebThread): (StartWebThread): * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp: (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::audioSamplesAvailable): (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData): * platform/network/cf/FormDataStreamCFNet.cpp: (WebCore::openNextStream): (WebCore::formFinalize): (WebCore::formClose): * platform/network/curl/CurlRequest.cpp: (WebCore::CurlRequest::setRequestPaused): (WebCore::CurlRequest::setCallbackPaused): (WebCore::CurlRequest::pausedStatusChanged): (WebCore::CurlRequest::enableDownloadToFile): (WebCore::CurlRequest::getDownloadedFilePath): (WebCore::CurlRequest::writeDataToDownloadFileIfEnabled): (WebCore::CurlRequest::closeDownloadFile): (WebCore::CurlRequest::cleanupDownloadFile): * platform/network/curl/CurlSSLHandle.cpp: (WebCore::CurlSSLHandle::allowAnyHTTPSCertificatesForHost): (WebCore::CurlSSLHandle::canIgnoreAnyHTTPSCertificatesForHost const): (WebCore::CurlSSLHandle::setClientCertificateInfo): (WebCore::CurlSSLHandle::getSSLClientCertificate const): * platform/sql/SQLiteDatabase.cpp: (WebCore::SQLiteDatabase::close): (WebCore::SQLiteDatabase::maximumSize): (WebCore::SQLiteDatabase::setMaximumSize): (WebCore::SQLiteDatabase::pageSize): (WebCore::SQLiteDatabase::freeSpaceSize): (WebCore::SQLiteDatabase::totalSize): (WebCore::SQLiteDatabase::runIncrementalVacuumCommand): (WebCore::SQLiteDatabase::interrupt): (WebCore::SQLiteDatabase::setAuthorizer): (WebCore::constructAndPrepareStatement): * platform/sql/SQLiteStatement.cpp: (WebCore::SQLiteStatement::step): Source/WebKit: * NetworkProcess/IndexedDB/WebIDBServer.cpp: (WebKit::m_closeCallback): (WebKit::WebIDBServer::getOrigins): (WebKit::WebIDBServer::closeAndDeleteDatabasesModifiedSince): (WebKit::WebIDBServer::closeAndDeleteDatabasesForOrigins): (WebKit::WebIDBServer::renameOrigin): (WebKit::WebIDBServer::openDatabase): (WebKit::WebIDBServer::deleteDatabase): (WebKit::WebIDBServer::abortTransaction): (WebKit::WebIDBServer::commitTransaction): (WebKit::WebIDBServer::didFinishHandlingVersionChangeTransaction): (WebKit::WebIDBServer::createObjectStore): (WebKit::WebIDBServer::deleteObjectStore): (WebKit::WebIDBServer::renameObjectStore): (WebKit::WebIDBServer::clearObjectStore): (WebKit::WebIDBServer::createIndex): (WebKit::WebIDBServer::deleteIndex): (WebKit::WebIDBServer::renameIndex): (WebKit::WebIDBServer::putOrAdd): (WebKit::WebIDBServer::getRecord): (WebKit::WebIDBServer::getAllRecords): (WebKit::WebIDBServer::getCount): (WebKit::WebIDBServer::deleteRecord): (WebKit::WebIDBServer::openCursor): (WebKit::WebIDBServer::iterateCursor): (WebKit::WebIDBServer::establishTransaction): (WebKit::WebIDBServer::databaseConnectionPendingClose): (WebKit::WebIDBServer::databaseConnectionClosed): (WebKit::WebIDBServer::abortOpenAndUpgradeNeeded): (WebKit::WebIDBServer::didFireVersionChangeEvent): (WebKit::WebIDBServer::openDBRequestCancelled): (WebKit::WebIDBServer::getAllDatabaseNamesAndVersions): (WebKit::WebIDBServer::addConnection): (WebKit::WebIDBServer::removeConnection): (WebKit::WebIDBServer::close): * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::writeSizeFile): (WebKit::CacheStorage::Engine::readSizeFile): (WebKit::CacheStorage::Engine::clearAllCachesFromDisk): (WebKit::CacheStorage::Engine::deleteNonEmptyDirectoryOnBackgroundThread): * NetworkProcess/glib/DNSCache.cpp: (WebKit::DNSCache::lookup): (WebKit::DNSCache::update): (WebKit::DNSCache::removeExpiredResponsesFired): (WebKit::DNSCache::clear): * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp: (WebKit::CompositingRunLoop::suspend): (WebKit::CompositingRunLoop::resume): (WebKit::CompositingRunLoop::scheduleUpdate): (WebKit::CompositingRunLoop::stopUpdates): (WebKit::CompositingRunLoop::updateTimerFired): * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::m_displayRefreshMonitor): (WebKit::ThreadedCompositor::setScaleFactor): (WebKit::ThreadedCompositor::setScrollPosition): (WebKit::ThreadedCompositor::setViewportSize): (WebKit::ThreadedCompositor::renderLayerTree): (WebKit::ThreadedCompositor::sceneUpdateFinished): (WebKit::ThreadedCompositor::updateSceneState): * UIProcess/API/glib/IconDatabase.cpp: (WebKit::IconDatabase::populatePageURLToIconURLMap): (WebKit::IconDatabase::clearLoadedIconsTimerFired): (WebKit::IconDatabase::checkIconURLAndSetPageURLIfNeeded): (WebKit::IconDatabase::loadIconForPageURL): (WebKit::IconDatabase::iconURLForPageURL): (WebKit::IconDatabase::setIconForPageURL): (WebKit::IconDatabase::clear): Source/WebKitLegacy: * Storage/InProcessIDBServer.cpp: (InProcessIDBServer::InProcessIDBServer): (InProcessIDBServer::deleteDatabase): (InProcessIDBServer::openDatabase): (InProcessIDBServer::abortTransaction): (InProcessIDBServer::commitTransaction): (InProcessIDBServer::didFinishHandlingVersionChangeTransaction): (InProcessIDBServer::createObjectStore): (InProcessIDBServer::deleteObjectStore): (InProcessIDBServer::renameObjectStore): (InProcessIDBServer::clearObjectStore): (InProcessIDBServer::createIndex): (InProcessIDBServer::deleteIndex): (InProcessIDBServer::renameIndex): (InProcessIDBServer::putOrAdd): (InProcessIDBServer::getRecord): (InProcessIDBServer::getAllRecords): (InProcessIDBServer::getCount): (InProcessIDBServer::deleteRecord): (InProcessIDBServer::openCursor): (InProcessIDBServer::iterateCursor): (InProcessIDBServer::establishTransaction): (InProcessIDBServer::databaseConnectionPendingClose): (InProcessIDBServer::databaseConnectionClosed): (InProcessIDBServer::abortOpenAndUpgradeNeeded): (InProcessIDBServer::didFireVersionChangeEvent): (InProcessIDBServer::openDBRequestCancelled): (InProcessIDBServer::getAllDatabaseNamesAndVersions): (InProcessIDBServer::closeAndDeleteDatabasesModifiedSince): * Storage/StorageAreaSync.cpp: (WebKit::StorageAreaSync::syncTimerFired): (WebKit::StorageAreaSync::performSync): * Storage/StorageTracker.cpp: (WebKit::StorageTracker::finishedImportingOriginIdentifiers): (WebKit::StorageTracker::syncImportOriginIdentifiers): (WebKit::StorageTracker::syncFileSystemAndTrackerDatabase): (WebKit::StorageTracker::setOriginDetails): (WebKit::StorageTracker::syncSetOriginDetails): (WebKit::StorageTracker::origins): (WebKit::StorageTracker::deleteAllOrigins): (WebKit::StorageTracker::syncDeleteAllOrigins): (WebKit::StorageTracker::deleteOrigin): (WebKit::StorageTracker::syncDeleteOrigin): (WebKit::StorageTracker::canDeleteOrigin): (WebKit::StorageTracker::cancelDeletingOrigin): (WebKit::StorageTracker::diskUsageForOrigin): Source/WebKitLegacy/mac: * WebView/WebView.mm: (-[WebView _synchronizeCustomFixedPositionLayoutRect]): (-[WebView _setCustomFixedPositionLayoutRectInWebThread:synchronize:]): (-[WebView _setCustomFixedPositionLayoutRect:]): (-[WebView _fetchCustomFixedPositionLayoutRect:]): Source/WebKitLegacy/win: * Plugins/PluginMainThreadScheduler.cpp: (WebCore::PluginMainThreadScheduler::scheduleCall): (WebCore::PluginMainThreadScheduler::registerPlugin): (WebCore::PluginMainThreadScheduler::unregisterPlugin): (WebCore::PluginMainThreadScheduler::dispatchCallsForPlugin): Source/WTF: * benchmarks/LockSpeedTest.cpp: * wtf/AutomaticThread.cpp: (WTF::AutomaticThread::~AutomaticThread): (WTF::AutomaticThread::join): (WTF::AutomaticThread::start): * wtf/AutomaticThread.h: * wtf/MetaAllocator.cpp: (WTF::MetaAllocatorHandle::shrink): (WTF::MetaAllocator::addFreshFreeSpace): (WTF::MetaAllocator::debugFreeSpaceSize): * wtf/ParallelHelperPool.cpp: (WTF::ParallelHelperClient::ParallelHelperClient): (WTF::ParallelHelperClient::~ParallelHelperClient): (WTF::ParallelHelperClient::setTask): (WTF::ParallelHelperClient::finish): (WTF::ParallelHelperClient::doSomeHelping): (WTF::ParallelHelperClient::runTask): (WTF::ParallelHelperPool::~ParallelHelperPool): (WTF::ParallelHelperPool::ensureThreads): (WTF::ParallelHelperPool::doSomeHelping): * wtf/Seconds.cpp: (WTF::sleep): * wtf/TimeWithDynamicClockType.cpp: (WTF::sleep): * wtf/WorkerPool.cpp: (WTF::WorkerPool::WorkerPool): (WTF::WorkerPool::~WorkerPool): (WTF::WorkerPool::postTask): * wtf/posix/ThreadingPOSIX.cpp: (WTF::Thread::suspend): (WTF::Thread::resume): (WTF::Thread::getRegisters): * wtf/win/DbgHelperWin.cpp: (WTF::DbgHelper::SymFromAddress): * wtf/win/ThreadingWin.cpp: (WTF::Thread::suspend): (WTF::Thread::resume): (WTF::Thread::getRegisters): Tools: * TestWebKitAPI/Tests/WTF/WorkQueue.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WTF/glib/WorkQueueGLib.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebCore/AbortableTaskQueue.cpp: (TestWebKitAPI::DeterministicScheduler::ThreadContext::waitMyTurn): (TestWebKitAPI::DeterministicScheduler::ThreadContext::yieldToThread): Canonical link: https://commits.webkit.org/238046@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277913 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-22 05:49:16 +00:00
2021-05-21 Chris Dumez <cdumez@apple.com>
Replace LockHolder with Locker in local variables
https://bugs.webkit.org/show_bug.cgi?id=226133
Reviewed by Darin Adler.
Replace LockHolder with Locker in local variables. It is shorter and it allows switching the lock
type more easily since the compiler with deduce the lock type T for Locker<T>.
* benchmarks/LockSpeedTest.cpp:
* wtf/AutomaticThread.cpp:
(WTF::AutomaticThread::~AutomaticThread):
(WTF::AutomaticThread::join):
(WTF::AutomaticThread::start):
* wtf/AutomaticThread.h:
* wtf/MetaAllocator.cpp:
(WTF::MetaAllocatorHandle::shrink):
(WTF::MetaAllocator::addFreshFreeSpace):
(WTF::MetaAllocator::debugFreeSpaceSize):
* wtf/ParallelHelperPool.cpp:
(WTF::ParallelHelperClient::ParallelHelperClient):
(WTF::ParallelHelperClient::~ParallelHelperClient):
(WTF::ParallelHelperClient::setTask):
(WTF::ParallelHelperClient::finish):
(WTF::ParallelHelperClient::doSomeHelping):
(WTF::ParallelHelperClient::runTask):
(WTF::ParallelHelperPool::~ParallelHelperPool):
(WTF::ParallelHelperPool::ensureThreads):
(WTF::ParallelHelperPool::doSomeHelping):
* wtf/Seconds.cpp:
(WTF::sleep):
* wtf/TimeWithDynamicClockType.cpp:
(WTF::sleep):
* wtf/WorkerPool.cpp:
(WTF::WorkerPool::WorkerPool):
(WTF::WorkerPool::~WorkerPool):
(WTF::WorkerPool::postTask):
* wtf/posix/ThreadingPOSIX.cpp:
(WTF::Thread::suspend):
(WTF::Thread::resume):
(WTF::Thread::getRegisters):
* wtf/win/DbgHelperWin.cpp:
(WTF::DbgHelper::SymFromAddress):
* wtf/win/ThreadingWin.cpp:
(WTF::Thread::suspend):
(WTF::Thread::resume):
(WTF::Thread::getRegisters):
Use CheckedCondition in more places https://bugs.webkit.org/show_bug.cgi?id=226113 Reviewed by Darin Adler. Use CheckedCondition in more places to benefit from Clang Thread Safety Analysis. Source/WebCore: * Modules/webdatabase/DatabaseTask.cpp: (WebCore::DatabaseTaskSynchronizer::waitForTaskCompletion): (WebCore::DatabaseTaskSynchronizer::taskCompleted): * Modules/webdatabase/DatabaseTask.h: (WebCore::DatabaseTaskSynchronizer::WTF_GUARDED_BY_LOCK): * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp: (webKitWebAudioSrcRenderAndPushFrames): (webKitWebAudioSrcRenderIteration): (webKitWebAudioSrcChangeState): * platform/graphics/gstreamer/ImageDecoderGStreamer.cpp: (WebCore::ImageDecoderGStreamer::setHasEOS): (WebCore::ImageDecoderGStreamer::notifySample): (WebCore::ImageDecoderGStreamer::InnerDecoder::handleMessage): (WebCore::ImageDecoderGStreamer::InnerDecoder::preparePipeline): (WebCore::ImageDecoderGStreamer::pushEncodedData): * platform/graphics/gstreamer/ImageDecoderGStreamer.h: * platform/graphics/gstreamer/MainThreadNotifier.h: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer): (WebCore::MediaPlayerPrivateGStreamer::pushTextureToCompositor): (WebCore::MediaPlayerPrivateGStreamer::repaint): (WebCore::MediaPlayerPrivateGStreamer::triggerRepaint): (WebCore::MediaPlayerPrivateGStreamer::cancelRepaint): (WebCore::MediaPlayerPrivateGStreamer::pushNextHolePunchBuffer): (WebCore::MediaPlayerPrivateGStreamer::waitForCDMAttachment): (WebCore::MediaPlayerPrivateGStreamer::cdmInstanceAttached): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: (WebCore::MediaPlayerPrivateGStreamer::WTF_GUARDED_BY_LOCK): * platform/graphics/holepunch/MediaPlayerPrivateHolePunch.cpp: (WebCore::MediaPlayerPrivateHolePunch::pushNextHolePunchBuffer): * platform/graphics/nicosia/NicosiaImageBufferPipe.cpp: (Nicosia::NicosiaImageBufferPipeSource::handle): * platform/graphics/nicosia/texmap/NicosiaGCGLLayer.cpp: (Nicosia::GCGLLayer::swapBuffersIfNeeded): * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp: (WebCore::TextureMapperPlatformLayerProxy::~TextureMapperPlatformLayerProxy): (WebCore::TextureMapperPlatformLayerProxy::activateOnCompositingThread): (WebCore::TextureMapperPlatformLayerProxy::invalidate): (WebCore::TextureMapperPlatformLayerProxy::releaseUnusedBuffersTimerFired): (WebCore::TextureMapperPlatformLayerProxy::swapBuffer): (WebCore::TextureMapperPlatformLayerProxy::dropCurrentBufferWhilePreservingTexture): (WebCore::TextureMapperPlatformLayerProxy::scheduleUpdateOnCompositorThread): (WebCore::TextureMapperPlatformLayerProxy::compositorThreadUpdateTimerFired): * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h: (WebCore::TextureMapperPlatformLayerProxy::WTF_RETURNS_LOCK): (WebCore::TextureMapperPlatformLayerProxy::WTF_GUARDED_BY_LOCK): Source/WTF: * wtf/RunLoop.h: * wtf/SynchronizedFixedQueue.h: * wtf/WTFSemaphore.h: * wtf/WorkQueue.cpp: (WTF::WorkQueue::concurrentApply): * wtf/generic/RunLoopGeneric.cpp: (WTF::RunLoop::~RunLoop): (WTF::RunLoop::populateTasks): (WTF::RunLoop::runImpl): (WTF::RunLoop::stop): (WTF::RunLoop::wakeUpWithLock): (WTF::RunLoop::wakeUp): (WTF::RunLoop::schedule): (WTF::RunLoop::scheduleAndWakeUpWithLock): (WTF::RunLoop::TimerBase::~TimerBase): (WTF::RunLoop::TimerBase::start): (WTF::RunLoop::TimerBase::stop): (WTF::RunLoop::TimerBase::isActive const): (WTF::RunLoop::TimerBase::secondsUntilFire const): * wtf/win/RunLoopWin.cpp: (WTF::RunLoop::TimerBase::timerFired): (WTF::RunLoop::TimerBase::start): (WTF::RunLoop::TimerBase::stop): (WTF::RunLoop::TimerBase::isActive const): (WTF::RunLoop::TimerBase::secondsUntilFire const): Canonical link: https://commits.webkit.org/238037@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277904 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-22 01:53:38 +00:00
2021-05-21 Chris Dumez <cdumez@apple.com>
Use CheckedCondition in more places
https://bugs.webkit.org/show_bug.cgi?id=226113
Reviewed by Darin Adler.
Use CheckedCondition in more places to benefit from Clang Thread Safety
Analysis.
* wtf/RunLoop.h:
* wtf/SynchronizedFixedQueue.h:
* wtf/WTFSemaphore.h:
* wtf/WorkQueue.cpp:
(WTF::WorkQueue::concurrentApply):
* wtf/generic/RunLoopGeneric.cpp:
(WTF::RunLoop::~RunLoop):
(WTF::RunLoop::populateTasks):
(WTF::RunLoop::runImpl):
(WTF::RunLoop::stop):
(WTF::RunLoop::wakeUpWithLock):
(WTF::RunLoop::wakeUp):
(WTF::RunLoop::schedule):
(WTF::RunLoop::scheduleAndWakeUpWithLock):
(WTF::RunLoop::TimerBase::~TimerBase):
(WTF::RunLoop::TimerBase::start):
(WTF::RunLoop::TimerBase::stop):
(WTF::RunLoop::TimerBase::isActive const):
(WTF::RunLoop::TimerBase::secondsUntilFire const):
* wtf/win/RunLoopWin.cpp:
(WTF::RunLoop::TimerBase::timerFired):
(WTF::RunLoop::TimerBase::start):
(WTF::RunLoop::TimerBase::stop):
(WTF::RunLoop::TimerBase::isActive const):
(WTF::RunLoop::TimerBase::secondsUntilFire const):
[macOS] Adopt QLItem in WKImageExtractionPreviewController https://bugs.webkit.org/show_bug.cgi?id=226114 rdar://76657718 Reviewed by Tim Horton. Source/WebCore/PAL: Add a PAL softlinking header for QuickLookUI on macOS. * PAL.xcodeproj/project.pbxproj: * pal/PlatformMac.cmake: * pal/mac/QuickLookUISoftLink.h: Added. * pal/mac/QuickLookUISoftLink.mm: Added. * pal/spi/mac/QuickLookMacSPI.h: Add staging declarations for some new QuickLook SPI; these method declarations should be moved into the non- internal-SDK section in the (near) future, once it is safe to do so. Source/WebKit: Adopt `QLItem` in `WKImageExtractionPreviewController`, and use it in place of `WKImageExtractionPreviewItem`. This allows us to vend image previews based solely on image data, rather than a file on disk. * UIProcess/mac/WKImageExtractionPreviewController.h: * UIProcess/mac/WKImageExtractionPreviewController.mm: (-[WKImageExtractionPreviewController initWithPage:imageData:title:imageURL:]): (-[WKImageExtractionPreviewController provideDataForItem:]): (-[WKImageExtractionPreviewController previewPanel:previewItemAtIndex:]): (-[WKImageExtractionPreviewItem initWithFileURL:title:imageURL:pageURL:]): Deleted. (-[WKImageExtractionPreviewItem dealloc]): Deleted. (-[WKImageExtractionPreviewItem previewItemURL]): Deleted. (-[WKImageExtractionPreviewItem previewItemTitle]): Deleted. (-[WKImageExtractionPreviewItem previewOptions]): Deleted. (-[WKImageExtractionPreviewController initWithPage:fileURL:title:imageURL:]): Deleted. * UIProcess/mac/WKImmediateActionController.mm: (-[WKImmediateActionController willDestroyView:]): Adopt the new QuickLookUI softlinking header in PAL. Source/WebKitLegacy/mac: Adopt the new QuickLookUI softlinking header in PAL. * WebView/WebImmediateActionController.mm: (-[WebImmediateActionController webViewClosed]): Source/WTF: Introduce `SOFT_LINK_FRAMEWORK_IN_UMBRELLA_FOR_SOURCE_WITH_EXPORT`, so that we can soft link frameworks that are embedded inside other umbrella frameworks in PAL. * wtf/cocoa/SoftLinking.h: Canonical link: https://commits.webkit.org/238036@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277903 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-22 01:33:40 +00:00
2021-05-21 Wenson Hsieh <wenson_hsieh@apple.com>
[macOS] Adopt QLItem in WKImageExtractionPreviewController
https://bugs.webkit.org/show_bug.cgi?id=226114
rdar://76657718
Reviewed by Tim Horton.
Introduce `SOFT_LINK_FRAMEWORK_IN_UMBRELLA_FOR_SOURCE_WITH_EXPORT`, so that we can soft link frameworks that are
embedded inside other umbrella frameworks in PAL.
* wtf/cocoa/SoftLinking.h:
Stop using holdLock() in WTF as it is not compatible with Clang thread safety analysis https://bugs.webkit.org/show_bug.cgi?id=226117 Reviewed by Darin Adler. Stop using holdLock() in WTF as it is not compatible with Clang thread safety analysis (WTF::CheckedLock) and use the Locker constructor instead. This is a step towards getting rid of holdLock() completely. * benchmarks/ConditionSpeedTest.cpp: * wtf/ConcurrentPtrHashSet.cpp: (WTF::ConcurrentPtrHashSet::deleteOldTables): (WTF::ConcurrentPtrHashSet::clear): (WTF::ConcurrentPtrHashSet::containsImplSlow const): (WTF::ConcurrentPtrHashSet::sizeSlow const): (WTF::ConcurrentPtrHashSet::resizeIfNecessary): * wtf/CountingLock.h: * wtf/HashTable.cpp: (WTF::HashTableStats::recordCollisionAtCount): (WTF::HashTableStats::dumpStats): * wtf/HashTable.h: (WTF::invalidateIterators): (WTF::addIterator): (WTF::removeIterator): * wtf/LockedPrintStream.cpp: (WTF::LockedPrintStream::vprintf): (WTF::LockedPrintStream::flush): * wtf/MetaAllocator.cpp: (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): * wtf/MetaAllocator.h: (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): * wtf/ReadWriteLock.h: * wtf/StackShotProfiler.h: (WTF::StackShotProfiler::profile): (WTF::StackShotProfiler::run): * wtf/StackStats.cpp: (WTF::StackStats::CheckPoint::CheckPoint): (WTF::StackStats::CheckPoint::~CheckPoint): (WTF::StackStats::probe): (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint): (WTF::StackStats::LayoutCheckPoint::~LayoutCheckPoint): * wtf/ThreadGroup.cpp: (WTF::ThreadGroup::~ThreadGroup): (WTF::ThreadGroup::add): * wtf/ThreadMessage.cpp: (WTF::sendMessageScoped): * wtf/Threading.cpp: (WTF::Thread::didExit): (WTF::Thread::addToThreadGroup): (WTF::Thread::removeFromThreadGroup): (WTF::Thread::numberOfThreadGroups): * wtf/TimingScope.cpp: * wtf/WTFConfig.cpp: (WTF::Config::permanentlyFreeze): * wtf/WTFSemaphore.h: * wtf/posix/ThreadingPOSIX.cpp: (WTF::Thread::changePriority): (WTF::Thread::waitForCompletion): (WTF::Thread::detach): (WTF::Thread::signal): (WTF::Thread::establishPlatformSpecificHandle): * wtf/threads/BinarySemaphore.cpp: (WTF::BinarySemaphore::signal): (WTF::BinarySemaphore::waitUntil): * wtf/threads/Signals.cpp: (WTF::SignalHandlers::add): (WTF::registerThreadForMachExceptionHandling): (WTF::activateSignalHandlersFor): * wtf/win/LanguageWin.cpp: (WTF::platformLanguage): * wtf/win/ThreadingWin.cpp: (WTF::Thread::changePriority): (WTF::Thread::waitForCompletion): (WTF::Thread::detach): (WTF::Thread::establishPlatformSpecificHandle): Canonical link: https://commits.webkit.org/238033@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277900 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-22 00:11:37 +00:00
2021-05-21 Chris Dumez <cdumez@apple.com>
Stop using holdLock() in WTF as it is not compatible with Clang thread safety analysis
https://bugs.webkit.org/show_bug.cgi?id=226117
Reviewed by Darin Adler.
Stop using holdLock() in WTF as it is not compatible with Clang thread safety analysis
(WTF::CheckedLock) and use the Locker constructor instead.
This is a step towards getting rid of holdLock() completely.
* benchmarks/ConditionSpeedTest.cpp:
* wtf/ConcurrentPtrHashSet.cpp:
(WTF::ConcurrentPtrHashSet::deleteOldTables):
(WTF::ConcurrentPtrHashSet::clear):
(WTF::ConcurrentPtrHashSet::containsImplSlow const):
(WTF::ConcurrentPtrHashSet::sizeSlow const):
(WTF::ConcurrentPtrHashSet::resizeIfNecessary):
* wtf/CountingLock.h:
* wtf/HashTable.cpp:
(WTF::HashTableStats::recordCollisionAtCount):
(WTF::HashTableStats::dumpStats):
* wtf/HashTable.h:
(WTF::invalidateIterators):
(WTF::addIterator):
(WTF::removeIterator):
* wtf/LockedPrintStream.cpp:
(WTF::LockedPrintStream::vprintf):
(WTF::LockedPrintStream::flush):
* wtf/MetaAllocator.cpp:
(WTF::MetaAllocatorHandle::~MetaAllocatorHandle):
* wtf/MetaAllocator.h:
(WTF::MetaAllocator::allocate):
(WTF::MetaAllocator::currentStatistics):
* wtf/ReadWriteLock.h:
* wtf/StackShotProfiler.h:
(WTF::StackShotProfiler::profile):
(WTF::StackShotProfiler::run):
* wtf/StackStats.cpp:
(WTF::StackStats::CheckPoint::CheckPoint):
(WTF::StackStats::CheckPoint::~CheckPoint):
(WTF::StackStats::probe):
(WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint):
(WTF::StackStats::LayoutCheckPoint::~LayoutCheckPoint):
* wtf/ThreadGroup.cpp:
(WTF::ThreadGroup::~ThreadGroup):
(WTF::ThreadGroup::add):
* wtf/ThreadMessage.cpp:
(WTF::sendMessageScoped):
* wtf/Threading.cpp:
(WTF::Thread::didExit):
(WTF::Thread::addToThreadGroup):
(WTF::Thread::removeFromThreadGroup):
(WTF::Thread::numberOfThreadGroups):
* wtf/TimingScope.cpp:
* wtf/WTFConfig.cpp:
(WTF::Config::permanentlyFreeze):
* wtf/WTFSemaphore.h:
* wtf/posix/ThreadingPOSIX.cpp:
(WTF::Thread::changePriority):
(WTF::Thread::waitForCompletion):
(WTF::Thread::detach):
(WTF::Thread::signal):
(WTF::Thread::establishPlatformSpecificHandle):
* wtf/threads/BinarySemaphore.cpp:
(WTF::BinarySemaphore::signal):
(WTF::BinarySemaphore::waitUntil):
* wtf/threads/Signals.cpp:
(WTF::SignalHandlers::add):
(WTF::registerThreadForMachExceptionHandling):
(WTF::activateSignalHandlersFor):
* wtf/win/LanguageWin.cpp:
(WTF::platformLanguage):
* wtf/win/ThreadingWin.cpp:
(WTF::Thread::changePriority):
(WTF::Thread::waitForCompletion):
(WTF::Thread::detach):
(WTF::Thread::establishPlatformSpecificHandle):
[Cocoa] Unable to upload files that are stored in the cloud (without a local copy) https://bugs.webkit.org/show_bug.cgi?id=226090 <rdar://77775887> Reviewed by Darin Adler. Source/WebKit: Allow the network process to load / read dataless files stored in the cloud by allowing the process to materialize such files. I initially only allowed the AsyncFileStream thread to materialize the dataless files and this was enough to make the file upload use cases work. However, I noticed that drag and dropping such file in the Safari URL bar would fail loading, which I think is bad user experience. As a result, I have decided to allow the materializing at network process level. I have verified manually that I can now upload such dataless files via either file picker or drag and drop (used https://blueimp.github.io/jQuery-File-Upload/). I have also verified that drag and dropping such a file in the Safari URL bar successfuly loads that file. * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): Source/WTF: Add FileSystem API to allow/disallow the materializing of dataless files stored in the cloud, at process or thread level. * wtf/FileSystem.h: * wtf/cocoa/FileSystemCocoa.mm: (WTF::FileSystemImpl::toIOPolicyScope): (WTF::FileSystemImpl::setAllowsMaterializingDatalessFiles): (WTF::FileSystemImpl::allowsMaterializingDatalessFiles): Canonical link: https://commits.webkit.org/238019@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277881 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-21 20:20:07 +00:00
2021-05-21 Chris Dumez <cdumez@apple.com>
[Cocoa] Unable to upload files that are stored in the cloud (without a local copy)
https://bugs.webkit.org/show_bug.cgi?id=226090
<rdar://77775887>
Reviewed by Darin Adler.
Add FileSystem API to allow/disallow the materializing of dataless files stored
in the cloud, at process or thread level.
* wtf/FileSystem.h:
* wtf/cocoa/FileSystemCocoa.mm:
(WTF::FileSystemImpl::toIOPolicyScope):
(WTF::FileSystemImpl::setAllowsMaterializingDatalessFiles):
(WTF::FileSystemImpl::allowsMaterializingDatalessFiles):
Replace more static Locks with CheckedLocks in WTF / WebCore https://bugs.webkit.org/show_bug.cgi?id=226040 Reviewed by Darin Adler. Replace more static Locks with CheckedLocks so that we can benefit from Clang Thread Safety Analysis. Source/WebCore: * Modules/indexeddb/server/IDBSerializationContext.cpp: (WebCore::IDBServer::IDBSerializationContext::getOrCreateForCurrentThread): (WebCore::IDBServer::IDBSerializationContext::~IDBSerializationContext): * Modules/mediastream/RTCDataChannel.cpp: (WebCore::WTF_REQUIRES_LOCK): (WebCore::RTCDataChannel::detach): (WebCore::RTCDataChannel::removeFromDataChannelLocalMapIfNeeded): (WebCore::RTCDataChannel::handlerFromIdentifier): * Modules/webdatabase/Database.cpp: (WebCore::WTF_REQUIRES_LOCK): (WebCore::Database::Database): (WebCore::Database::performOpenAndVerify): (WebCore::Database::closeDatabase): (WebCore::Database::getCachedVersion const): (WebCore::Database::setCachedVersion): * Modules/webgpu/WebGPUDevice.cpp: (WebCore::WebGPUDevice::instancesLock): (WebCore::WebGPUDevice::~WebGPUDevice): * Modules/webgpu/WebGPUDevice.h: * Modules/webgpu/WebGPUPipeline.cpp: (WebCore::WebGPUPipeline::instancesLock): (WebCore::WebGPUPipeline::WebGPUPipeline): (WebCore::WebGPUPipeline::~WebGPUPipeline): * Modules/webgpu/WebGPUPipeline.h: * Modules/websockets/WebSocket.cpp: (WebCore::WebSocket::WebSocket): (WebCore::WebSocket::~WebSocket): (WebCore::WebSocket::allActiveWebSocketsLock): * Modules/websockets/WebSocket.h: * bridge/objc/WebScriptObject.mm: (WebCore::getJSWrapper): (WebCore::addJSWrapper): (WebCore::removeJSWrapper): (WebCore::removeJSWrapperIfRetainCountOne): * crypto/CryptoAlgorithmRegistry.cpp: (WebCore::CryptoAlgorithmRegistry::singleton): (WebCore::CryptoAlgorithmRegistry::identifier): (WebCore::CryptoAlgorithmRegistry::name): (WebCore::CryptoAlgorithmRegistry::create): (WebCore::CryptoAlgorithmRegistry::registerAlgorithm): * crypto/CryptoAlgorithmRegistry.h: * dom/MessagePort.cpp: (WebCore::MessagePort::deref const): (WebCore::MessagePort::isExistingMessagePortLocallyReachable): (WebCore::MessagePort::notifyMessageAvailable): (WebCore::MessagePort::MessagePort): * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::contextIdentifier const): (WebCore::ScriptExecutionContext::removeFromContextsMap): (WebCore::ScriptExecutionContext::~ScriptExecutionContext): (WebCore::ScriptExecutionContext::postTaskTo): * html/canvas/CanvasRenderingContext.cpp: (WebCore::CanvasRenderingContext::instancesLock): (WebCore::CanvasRenderingContext::CanvasRenderingContext): (WebCore::CanvasRenderingContext::~CanvasRenderingContext): * html/canvas/CanvasRenderingContext.h: * html/canvas/WebGLProgram.cpp: (WebCore::WebGLProgram::instancesLock): (WebCore::WebGLProgram::WebGLProgram): (WebCore::WebGLProgram::~WebGLProgram): * html/canvas/WebGLProgram.h: * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::~WebGLRenderingContextBase): * inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::canvasElement const): (WebCore:: const): * inspector/agents/InspectorCanvasAgent.cpp: (WebCore::InspectorCanvasAgent::enable): * inspector/agents/InspectorNetworkAgent.cpp: (WebCore::InspectorNetworkAgent::enable): (WebCore::InspectorNetworkAgent::webSocketForRequestId): * inspector/agents/InspectorNetworkAgent.h: * inspector/agents/page/PageNetworkAgent.cpp: * inspector/agents/page/PageNetworkAgent.h: * inspector/agents/worker/WorkerNetworkAgent.cpp: * inspector/agents/worker/WorkerNetworkAgent.h: * page/SecurityPolicy.cpp: (WebCore::WTF_REQUIRES_LOCK): (WebCore::SecurityPolicy::isAccessAllowed): (WebCore::SecurityPolicy::addOriginAccessAllowlistEntry): (WebCore::SecurityPolicy::removeOriginAccessAllowlistEntry): (WebCore::SecurityPolicy::resetOriginAccessAllowlists): (WebCore::SecurityPolicy::allowAccessTo): * page/cocoa/ResourceUsageThreadCocoa.mm: (WebCore::ResourceUsageThread::platformCollectCPUData): * page/linux/ResourceUsageThreadLinux.cpp: (WebCore::ResourceUsageThread::platformCollectCPUData): * platform/GenericTaskQueue.cpp: (WebCore::TaskDispatcher<Timer>::postTask): (WebCore::TaskDispatcher<Timer>::sharedTimerFired): (WebCore::TaskDispatcher<Timer>::pendingDispatchers): (WebCore::TaskDispatcher<Timer>::dispatchOneTask): * platform/GenericTaskQueue.h: * platform/LegacySchemeRegistry.cpp: (WebCore::allBuiltinSchemes): (WebCore::WTF_REQUIRES_LOCK): (WebCore::LegacySchemeRegistry::registerURLSchemeAsLocal): (WebCore::LegacySchemeRegistry::removeURLSchemeRegisteredAsLocal): (WebCore::LegacySchemeRegistry::registerURLSchemeAsHandledBySchemeHandler): (WebCore::LegacySchemeRegistry::schemeIsHandledBySchemeHandler): (WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsLocal): (WebCore::LegacySchemeRegistry::registerURLSchemeAsNoAccess): (WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsNoAccess): (WebCore::LegacySchemeRegistry::registerURLSchemeAsDisplayIsolated): (WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsDisplayIsolated): (WebCore::LegacySchemeRegistry::registerURLSchemeAsSecure): (WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsSecure): (WebCore::LegacySchemeRegistry::canDisplayOnlyIfCanRequest): (WebCore::LegacySchemeRegistry::registerAsCanDisplayOnlyIfCanRequest): (WebCore::LegacySchemeRegistry::registerURLSchemeAsBypassingContentSecurityPolicy): (WebCore::LegacySchemeRegistry::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy): (WebCore::LegacySchemeRegistry::schemeShouldBypassContentSecurityPolicy): (WebCore::LegacySchemeRegistry::registerURLSchemeAsCachePartitioned): (WebCore::LegacySchemeRegistry::shouldPartitionCacheForURLScheme): * platform/audio/mac/FFTFrameMac.cpp: (WebCore::WTF_REQUIRES_LOCK): (WebCore::FFTFrame::fftSetupForSize): * platform/graphics/MediaPlayer.cpp: (WebCore::WTF_REQUIRES_LOCK): (WebCore::installedMediaEngines): (WebCore::MediaPlayer::resetMediaEngines): * platform/ios/QuickLook.mm: (WebCore::WTF_REQUIRES_LOCK): (WebCore::removeQLPreviewConverterForURL): (WebCore::addQLPreviewConverterWithFileForURL): * platform/ios/WebSQLiteDatabaseTrackerClient.mm: (WTF_REQUIRES_LOCK): (+[WebDatabaseTransactionBackgroundTaskController startBackgroundTask]): (+[WebDatabaseTransactionBackgroundTaskController endBackgroundTask]): * platform/network/mac/UTIUtilities.mm: (WebCore::WTF_REQUIRES_LOCK): (WebCore::UTIFromMIMEType): * platform/sql/SQLiteDatabase.cpp: (WebCore::WTF_GUARDED_BY_LOCK): (WebCore::SQLiteDatabase::setIsDatabaseOpeningForbidden): (WebCore::SQLiteDatabase::open): * platform/sql/SQLiteDatabaseTracker.cpp: (WebCore::SQLiteDatabaseTracker::WTF_GUARDED_BY_LOCK): (WebCore::SQLiteDatabaseTracker::setClient): (WebCore::SQLiteDatabaseTracker::incrementTransactionInProgressCount): (WebCore::SQLiteDatabaseTracker::decrementTransactionInProgressCount): (WebCore::SQLiteDatabaseTracker::hasTransactionInProgress): * platform/text/TextEncodingRegistry.cpp: (WebCore::WTF_REQUIRES_LOCK): (WebCore::newTextCodec): (WebCore::atomCanonicalTextEncodingName): * workers/WorkerGlobalScope.cpp: (WebCore::WTF_REQUIRES_LOCK): (WebCore::WorkerGlobalScope::WorkerGlobalScope): (WebCore::WorkerGlobalScope::~WorkerGlobalScope): (WebCore::WorkerGlobalScope::releaseMemoryInWorkers): * workers/WorkerOrWorkletThread.cpp: (WebCore::WorkerOrWorkletThread::workerOrWorkletThreadsLock): (WebCore::WorkerOrWorkletThread::WorkerOrWorkletThread): (WebCore::WorkerOrWorkletThread::~WorkerOrWorkletThread): (WebCore::WorkerOrWorkletThread::releaseFastMallocFreeMemoryInAllThreads): * workers/WorkerOrWorkletThread.h: Source/WTF: * wtf/Threading.cpp: (WTF::Thread::allThreadsLock): (WTF::Thread::create): (WTF::Thread::didExit): * wtf/Threading.h: * wtf/URL.cpp: (WTF::WTF_REQUIRES_LOCK): (WTF::registerDefaultPortForProtocolForTesting): (WTF::clearDefaultPortForProtocolMapForTesting): (WTF::defaultPortForProtocol): * wtf/cf/LanguageCF.cpp: (WTF::WTF_REQUIRES_LOCK): (WTF::platformLanguageDidChange): (WTF::platformUserPreferredLanguages): * wtf/text/StringView.cpp: (WTF::StringView::invalidate): (WTF::StringView::adoptUnderlyingString): (WTF::StringView::setUnderlyingString): * wtf/unicode/icu/CollatorICU.cpp: (WTF::Collator::Collator): (WTF::Collator::~Collator): Canonical link: https://commits.webkit.org/238018@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277880 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-21 20:19:46 +00:00
2021-05-21 Chris Dumez <cdumez@apple.com>
Replace more static Locks with CheckedLocks in WTF / WebCore
https://bugs.webkit.org/show_bug.cgi?id=226040
Reviewed by Darin Adler.
Replace more static Locks with CheckedLocks so that we can benefit from Clang Thread Safety Analysis.
* wtf/Threading.cpp:
(WTF::Thread::allThreadsLock):
(WTF::Thread::create):
(WTF::Thread::didExit):
* wtf/Threading.h:
* wtf/URL.cpp:
(WTF::WTF_REQUIRES_LOCK):
(WTF::registerDefaultPortForProtocolForTesting):
(WTF::clearDefaultPortForProtocolMapForTesting):
(WTF::defaultPortForProtocol):
* wtf/cf/LanguageCF.cpp:
(WTF::WTF_REQUIRES_LOCK):
(WTF::platformLanguageDidChange):
(WTF::platformUserPreferredLanguages):
* wtf/text/StringView.cpp:
(WTF::StringView::invalidate):
(WTF::StringView::adoptUnderlyingString):
(WTF::StringView::setUnderlyingString):
* wtf/unicode/icu/CollatorICU.cpp:
(WTF::Collator::Collator):
(WTF::Collator::~Collator):
Use CheckedLock more in cases where we try-lock https://bugs.webkit.org/show_bug.cgi?id=226056 Reviewed by Alex Christensen. Use CheckedLock more in cases where we try-lock to benefit from Clang Thread Safety Analysis. Source/WebCore: * Modules/webaudio/AudioParamTimeline.cpp: (WebCore::AudioParamTimeline::setValueAtTime): (WebCore::AudioParamTimeline::linearRampToValueAtTime): (WebCore::AudioParamTimeline::exponentialRampToValueAtTime): (WebCore::AudioParamTimeline::setTargetAtTime): (WebCore::AudioParamTimeline::setValueCurveAtTime): (WebCore::AudioParamTimeline::cancelScheduledValues): (WebCore::AudioParamTimeline::cancelAndHoldAtTime): (WebCore::AudioParamTimeline::valueForContextTime): (WebCore::AudioParamTimeline::valuesForFrameRange): (WebCore::AudioParamTimeline::hasValues const): * Modules/webaudio/AudioParamTimeline.h: * platform/audio/AudioDestination.h: (WebCore::AudioDestination::WTF_GUARDED_BY_LOCK): (WebCore::AudioDestination::AudioDestination): (WebCore::AudioDestination::clearCallback): (WebCore::AudioDestination::callRenderCallback): * platform/mediastream/cocoa/AudioMediaStreamTrackRendererUnit.cpp: (WebCore::AudioMediaStreamTrackRendererUnit::addSource): (WebCore::AudioMediaStreamTrackRendererUnit::removeSource): (WebCore::AudioMediaStreamTrackRendererUnit::render): * platform/mediastream/cocoa/AudioMediaStreamTrackRendererUnit.h: Source/WebKit: * WebProcess/GPU/webrtc/LibWebRTCCodecs.cpp: (WebKit::LibWebRTCCodecs::releaseDecoder): (WebKit::LibWebRTCCodecs::registerDecodeFrameCallback): (WebKit::LibWebRTCCodecs::completedDecoding): (WebKit::LibWebRTCCodecs::releaseEncoder): (WebKit::LibWebRTCCodecs::registerEncodeFrameCallback): (WebKit::LibWebRTCCodecs::completedEncoding): * WebProcess/GPU/webrtc/LibWebRTCCodecs.h: (WebKit::LibWebRTCCodecs::Decoder::WTF_GUARDED_BY_LOCK): (WebKit::LibWebRTCCodecs::Encoder::WTF_GUARDED_BY_LOCK): Source/WTF: * wtf/Logger.cpp: * wtf/Logger.h: (WTF::Logger::addObserver): (WTF::Logger::removeObserver): (WTF::Logger::log): (WTF::Logger::logVerbose): (WTF::Logger::WTF_RETURNS_LOCK): Canonical link: https://commits.webkit.org/238013@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277875 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-21 19:24:05 +00:00
2021-05-21 Chris Dumez <cdumez@apple.com>
Use CheckedLock more in cases where we try-lock
https://bugs.webkit.org/show_bug.cgi?id=226056
Reviewed by Alex Christensen.
Use CheckedLock more in cases where we try-lock to benefit from Clang
Thread Safety Analysis.
* wtf/Logger.cpp:
* wtf/Logger.h:
(WTF::Logger::addObserver):
(WTF::Logger::removeObserver):
(WTF::Logger::log):
(WTF::Logger::logVerbose):
(WTF::Logger::WTF_RETURNS_LOCK):
Use CheckedLock more in WTF https://bugs.webkit.org/show_bug.cgi?id=226045 Reviewed by Darin Adler. Use CheckedLock more in WTF to benefit from Clang Thread Safety Analysis. * wtf/CrossThreadQueue.h: (WTF::CrossThreadQueue<DataType>::append): (WTF::CrossThreadQueue<DataType>::waitForMessage): (WTF::CrossThreadQueue<DataType>::tryGetMessage): (WTF::CrossThreadQueue<DataType>::kill): (WTF::CrossThreadQueue<DataType>::isKilled const): (WTF::CrossThreadQueue<DataType>::isEmpty const): * wtf/CrossThreadTaskHandler.cpp: (WTF::CrossThreadTaskHandler::postTaskReply): (WTF::CrossThreadTaskHandler::handleTaskRepliesOnMainThread): * wtf/CrossThreadTaskHandler.h: (WTF::CrossThreadTaskHandler::WTF_GUARDED_BY_LOCK): * wtf/CryptographicallyRandomNumber.cpp: * wtf/FastMalloc.cpp: (WTF::MallocCallTracker::recordMalloc): (WTF::MallocCallTracker::recordRealloc): (WTF::MallocCallTracker::recordFree): (WTF::MallocCallTracker::dumpStats): * wtf/MessageQueue.h: (WTF::MessageQueue<DataType>::append): (WTF::MessageQueue<DataType>::appendAndKill): (WTF::MessageQueue<DataType>::appendAndCheckEmpty): (WTF::MessageQueue<DataType>::prepend): (WTF::MessageQueue<DataType>::waitForMessageFilteredWithTimeout): (WTF::MessageQueue<DataType>::tryGetMessage): (WTF::MessageQueue<DataType>::takeAllMessages): (WTF::MessageQueue<DataType>::tryGetMessageIgnoringKilled): (WTF::MessageQueue<DataType>::removeIf): (WTF::MessageQueue<DataType>::isEmpty): (WTF::MessageQueue<DataType>::kill): (WTF::MessageQueue<DataType>::killed const): * wtf/OSLogPrintStream.cpp: (WTF::OSLogPrintStream::vprintf): * wtf/OSLogPrintStream.h: * wtf/ParallelJobsGeneric.h: (WTF::ParallelEnvironment::ThreadPrivate::WTF_GUARDED_BY_LOCK): * wtf/ParallelVectorIterator.h: (WTF::ParallelVectorIterator::iterate): (WTF::ParallelVectorIterator::WTF_GUARDED_BY_LOCK): * wtf/ReadWriteLock.cpp: (WTF::ReadWriteLock::readLock): (WTF::ReadWriteLock::readUnlock): (WTF::ReadWriteLock::writeLock): (WTF::ReadWriteLock::writeUnlock): * wtf/ReadWriteLock.h: (WTF::ReadWriteLock::WTF_GUARDED_BY_LOCK): Canonical link: https://commits.webkit.org/237989@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277847 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-21 02:43:18 +00:00
2021-05-20 Chris Dumez <cdumez@apple.com>
Use CheckedLock more in WTF
https://bugs.webkit.org/show_bug.cgi?id=226045
Reviewed by Darin Adler.
Use CheckedLock more in WTF to benefit from Clang Thread Safety Analysis.
* wtf/CrossThreadQueue.h:
(WTF::CrossThreadQueue<DataType>::append):
(WTF::CrossThreadQueue<DataType>::waitForMessage):
(WTF::CrossThreadQueue<DataType>::tryGetMessage):
(WTF::CrossThreadQueue<DataType>::kill):
(WTF::CrossThreadQueue<DataType>::isKilled const):
(WTF::CrossThreadQueue<DataType>::isEmpty const):
* wtf/CrossThreadTaskHandler.cpp:
(WTF::CrossThreadTaskHandler::postTaskReply):
(WTF::CrossThreadTaskHandler::handleTaskRepliesOnMainThread):
* wtf/CrossThreadTaskHandler.h:
(WTF::CrossThreadTaskHandler::WTF_GUARDED_BY_LOCK):
* wtf/CryptographicallyRandomNumber.cpp:
* wtf/FastMalloc.cpp:
(WTF::MallocCallTracker::recordMalloc):
(WTF::MallocCallTracker::recordRealloc):
(WTF::MallocCallTracker::recordFree):
(WTF::MallocCallTracker::dumpStats):
* wtf/MessageQueue.h:
(WTF::MessageQueue<DataType>::append):
(WTF::MessageQueue<DataType>::appendAndKill):
(WTF::MessageQueue<DataType>::appendAndCheckEmpty):
(WTF::MessageQueue<DataType>::prepend):
(WTF::MessageQueue<DataType>::waitForMessageFilteredWithTimeout):
(WTF::MessageQueue<DataType>::tryGetMessage):
(WTF::MessageQueue<DataType>::takeAllMessages):
(WTF::MessageQueue<DataType>::tryGetMessageIgnoringKilled):
(WTF::MessageQueue<DataType>::removeIf):
(WTF::MessageQueue<DataType>::isEmpty):
(WTF::MessageQueue<DataType>::kill):
(WTF::MessageQueue<DataType>::killed const):
* wtf/OSLogPrintStream.cpp:
(WTF::OSLogPrintStream::vprintf):
* wtf/OSLogPrintStream.h:
* wtf/ParallelJobsGeneric.h:
(WTF::ParallelEnvironment::ThreadPrivate::WTF_GUARDED_BY_LOCK):
* wtf/ParallelVectorIterator.h:
(WTF::ParallelVectorIterator::iterate):
(WTF::ParallelVectorIterator::WTF_GUARDED_BY_LOCK):
* wtf/ReadWriteLock.cpp:
(WTF::ReadWriteLock::readLock):
(WTF::ReadWriteLock::readUnlock):
(WTF::ReadWriteLock::writeLock):
(WTF::ReadWriteLock::writeUnlock):
* wtf/ReadWriteLock.h:
(WTF::ReadWriteLock::WTF_GUARDED_BY_LOCK):
2021-05-20 Chris Dumez <cdumez@apple.com>
Add missing locks in Language.cpp
https://bugs.webkit.org/show_bug.cgi?id=226059
Reviewed by Alex Christensen.
Add missing locks in Language.cpp. This was found via Clang Thread Safety Analysis.
Some of the overrideUserPreferredLanguages() call sites were failing to grab the
lock first.
Also use NeverDestroyed in preferredLanguagesOverride() instead of LazyNeverDestroyed
with std::call_once. All call sites are already grabbing a lock so there is no need
for extra synchronization.
* wtf/Language.cpp:
(WTF::WTF_REQUIRES_LOCK):
(WTF::userPreferredLanguagesOverride):
(WTF::overrideUserPreferredLanguages):
(WTF::userPreferredLanguages):
(WTF::preferredLanguagesOverride): Deleted.
Add support for Navigation Timing Level 2 https://bugs.webkit.org/show_bug.cgi?id=184363 Reviewed by Ryosuke Niwa. LayoutTests/imported/w3c: * web-platform-tests/navigation-timing/META.yml: Added. * web-platform-tests/navigation-timing/dom_interactive_image_document-expected.txt: Added. * web-platform-tests/navigation-timing/dom_interactive_image_document.html: Added. * web-platform-tests/navigation-timing/dom_interactive_media_document-expected.txt: Added. * web-platform-tests/navigation-timing/dom_interactive_media_document.html: Added. * web-platform-tests/navigation-timing/idlharness.window.js: * web-platform-tests/navigation-timing/nav2_test_attributes_exist-expected.txt: Added. * web-platform-tests/navigation-timing/nav2_test_attributes_exist.html: Added. This test fails because we have not implemented transferSize, encodedBodySize, and decodedBodySize as noted in PerformanceResourceTiming.idl * web-platform-tests/navigation-timing/nav2_test_attributes_values-expected.txt: Added. * web-platform-tests/navigation-timing/nav2_test_attributes_values.html: Added. This test fails because we have not implemented transferSize, encodedBodySize, and decodedBodySize as noted in PerformanceResourceTiming.idl * web-platform-tests/navigation-timing/nav2_test_document_open-expected.txt: * web-platform-tests/navigation-timing/nav2_test_document_open.html: * web-platform-tests/navigation-timing/nav2_test_document_replaced-expected.txt: * web-platform-tests/navigation-timing/nav2_test_document_replaced.html: * web-platform-tests/navigation-timing/nav2_test_frame_removed-expected.txt: * web-platform-tests/navigation-timing/nav2_test_instance_accessible_from_the_start-expected.txt: * web-platform-tests/navigation-timing/nav2_test_instance_accessible_from_the_start.html: * web-platform-tests/navigation-timing/nav2_test_instance_accessors-expected.txt: Added. * web-platform-tests/navigation-timing/nav2_test_instance_accessors.html: Added. * web-platform-tests/navigation-timing/nav2_test_navigate_iframe-expected.txt: Added. * web-platform-tests/navigation-timing/nav2_test_navigate_iframe.html: Added. * web-platform-tests/navigation-timing/nav2_test_navigate_within_document-expected.txt: * web-platform-tests/navigation-timing/nav2_test_navigate_within_document.html: * web-platform-tests/navigation-timing/nav2_test_navigation_type_backforward-expected.txt: * web-platform-tests/navigation-timing/nav2_test_navigation_type_backforward.html: * web-platform-tests/navigation-timing/nav2_test_navigation_type_navigate-expected.txt: Added. * web-platform-tests/navigation-timing/nav2_test_navigation_type_navigate.html: Added. * web-platform-tests/navigation-timing/nav2_test_navigation_type_reload-expected.txt: * web-platform-tests/navigation-timing/nav2_test_navigation_type_reload.html: * web-platform-tests/navigation-timing/nav2_test_redirect_chain_xserver_final_original_origin-expected.txt: Added. This test fails because our test infrastructure doesn't support loading from www.localhost. * web-platform-tests/navigation-timing/nav2_test_redirect_chain_xserver_final_original_origin.html: Copied from LayoutTests/imported/w3c/web-platform-tests/navigation-timing/nav2_test_redirect_chain_xserver_partial_opt_in.html. * web-platform-tests/navigation-timing/nav2_test_redirect_chain_xserver_partial_opt_in-expected.txt: This test fails because our test infrastructure doesn't support loading from www.localhost. * web-platform-tests/navigation-timing/nav2_test_redirect_chain_xserver_partial_opt_in.html: * web-platform-tests/navigation-timing/nav2_test_redirect_none-expected.txt: Added. * web-platform-tests/navigation-timing/nav2_test_redirect_none.html: Added. * web-platform-tests/navigation-timing/nav2_test_redirect_server-expected.txt: This test failure needs further investigation. * web-platform-tests/navigation-timing/nav2_test_redirect_server.html: * web-platform-tests/navigation-timing/nav2_test_redirect_xserver-expected.txt: This test fails because our test infrastructure doesn't support loading from www.localhost. * web-platform-tests/navigation-timing/nav2_test_redirect_xserver.html: * web-platform-tests/navigation-timing/nav2_test_unique_nav_instances-expected.txt: Added. This test failure needs further investigation. * web-platform-tests/navigation-timing/nav2_test_unique_nav_instances.html: Added. * web-platform-tests/navigation-timing/po-navigation-expected.txt: Added. * web-platform-tests/navigation-timing/po-navigation.html: Added. * web-platform-tests/navigation-timing/resources/webperftestharness.js: (test_namespace): (test_attribute_exists): (test_enum): * web-platform-tests/navigation-timing/secure-connection-start-reuse.https-expected.txt: Added. * web-platform-tests/navigation-timing/secure-connection-start-reuse.https.html: Added. * web-platform-tests/navigation-timing/secure_connection_start_non_zero.https-expected.txt: This test has been marked as flaky. It needs to be fixed to not rely on no initial connection reuse. * web-platform-tests/navigation-timing/supported_navigation_type.any-expected.txt: * web-platform-tests/navigation-timing/supported_navigation_type.any.worker-expected.txt: * web-platform-tests/navigation-timing/test_document_onload-expected.txt: Added. * web-platform-tests/navigation-timing/test_document_onload.html: Added. This test failure needs further investigation. * web-platform-tests/navigation-timing/unload-event-same-origin-check-expected.txt: * web-platform-tests/navigation-timing/unload-event-same-origin-check.html: * web-platform-tests/performance-timeline/META.yml: Added. * web-platform-tests/performance-timeline/buffered-flag-after-timeout.any.js: Added. (async_test.t.t.step_timeout): * web-platform-tests/performance-timeline/buffered-flag-observer.any.js: Added. * web-platform-tests/performance-timeline/get-invalid-entries-expected.txt: Added. * web-platform-tests/performance-timeline/get-invalid-entries.html: Added. * web-platform-tests/performance-timeline/idlharness.any.js: Added. (async idl_array): * web-platform-tests/performance-timeline/multiple-buffered-flag-observers.any.js: Added. (promise_test): * web-platform-tests/performance-timeline/not-clonable-expected.txt: Added. * web-platform-tests/performance-timeline/not-clonable.html: Added. * web-platform-tests/performance-timeline/observer-buffered-false.any.js: Added. (async_test.t.t.step_timeout): * web-platform-tests/performance-timeline/performanceentry-tojson.any.js: Added. (test): * web-platform-tests/performance-timeline/po-callback-mutate.any.js: Added. (async_test): * web-platform-tests/performance-timeline/po-disconnect-removes-observed-types.any.js: Added. (async_test): * web-platform-tests/performance-timeline/po-disconnect.any.js: Added. (async_test): (test): * web-platform-tests/performance-timeline/po-entries-sort.any.js: Added. (async_test): * web-platform-tests/performance-timeline/po-getentries.any.js: Added. (async_test): * web-platform-tests/performance-timeline/po-mark-measure.any.js: Added. (async_test): * web-platform-tests/performance-timeline/po-observe-expected.txt: Added. * web-platform-tests/performance-timeline/po-observe-repeated-type.any.js: Added. (async_test): * web-platform-tests/performance-timeline/po-observe.html: Added. * web-platform-tests/performance-timeline/po-resource-expected.txt: Added. * web-platform-tests/performance-timeline/po-resource.html: Added. * web-platform-tests/performance-timeline/po-takeRecords.any.js: Added. (async_test): * web-platform-tests/performance-timeline/resources/postmessage-entry.html: Added. * web-platform-tests/performance-timeline/resources/worker-invalid-entries.js: Added. * web-platform-tests/performance-timeline/resources/worker-with-performance-observer.js: Added. (catch): * web-platform-tests/performance-timeline/supportedEntryTypes.any-expected.txt: This test failure needs further investigation. It's a bindings generation problem I've unsuccessfully looked into before. * web-platform-tests/performance-timeline/supportedEntryTypes.any.js: (test): * web-platform-tests/performance-timeline/supportedEntryTypes.any.worker-expected.txt: * web-platform-tests/performance-timeline/webtiming-resolution.any.js: Added. (testTimeResolution): (timeByUserTiming): * web-platform-tests/performance-timeline/worker-with-performance-observer-expected.txt: Added. * web-platform-tests/performance-timeline/worker-with-performance-observer.html: Added. * web-platform-tests/service-workers/service-worker/navigation-timing.https-expected.txt: This existing test failure needs more investigation. We are probably close to a fix after this patch. Source/WebCore: This is basically just a new shape for exposing the same data as window.performance.navigation, but with a shape that fits better into the rest of the performance timeline measurements that have been added to the web platform since performance.navigation. I noted that exposing transfer size is problematic, and some of the tests for reading transfer size still fail. There are still a few relatively minor test failures to fix in future patches. Each one is annotated in the LayoutTests ChangeLogs. Tests: imported/w3c/web-platform-tests/navigation-timing/dom_interactive_image_document.html imported/w3c/web-platform-tests/navigation-timing/dom_interactive_media_document.html imported/w3c/web-platform-tests/navigation-timing/nav2_test_attributes_exist.html imported/w3c/web-platform-tests/navigation-timing/nav2_test_attributes_values.html imported/w3c/web-platform-tests/navigation-timing/nav2_test_instance_accessors.html imported/w3c/web-platform-tests/navigation-timing/nav2_test_navigate_iframe.html imported/w3c/web-platform-tests/navigation-timing/nav2_test_navigation_type_navigate.html imported/w3c/web-platform-tests/navigation-timing/nav2_test_redirect_chain_xserver_final_original_origin.html imported/w3c/web-platform-tests/navigation-timing/nav2_test_redirect_none.html imported/w3c/web-platform-tests/navigation-timing/nav2_test_unique_nav_instances.html imported/w3c/web-platform-tests/navigation-timing/po-navigation.html imported/w3c/web-platform-tests/navigation-timing/secure-connection-start-reuse.https.html imported/w3c/web-platform-tests/navigation-timing/test_document_onload.html imported/w3c/web-platform-tests/performance-timeline/get-invalid-entries.html imported/w3c/web-platform-tests/performance-timeline/not-clonable.html imported/w3c/web-platform-tests/performance-timeline/po-observe.html imported/w3c/web-platform-tests/performance-timeline/po-resource.html imported/w3c/web-platform-tests/performance-timeline/worker-with-performance-observer.html * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSPerformanceEntryCustom.cpp: (WebCore::toJSNewlyCreated): * dom/Document.cpp: (WebCore::Document::setReadyState): Sometimes the ready state jumps right to Complete without hitting Interactive along the way. When this happens, we want to mark both m_documentTiming.domComplete and m_documentTiming.domInteractive. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::notifyFinished): Call addNavigationTiming in notifyFinished to create the navigation timing object when we are done navigating * loader/ResourceLoader.cpp: (WebCore::ResourceLoader::didFinishLoading): * loader/ResourceLoader.h: * loader/ResourceTiming.cpp: (WebCore::ResourceTiming::fromLoad): Add a URL parameter. Sometimes we need to use the request's URL and sometimes the response's. Different specs written at different times. (WebCore::ResourceTiming::populateServerTiming const): (WebCore::ResourceTiming::populateServerTiming): Deleted. * loader/ResourceTiming.h: (WebCore::ResourceTiming::url const): (WebCore::ResourceTiming::initiator const): (WebCore::ResourceTiming::loadTiming const): (WebCore::ResourceTiming::networkLoadMetrics const): * loader/SubresourceLoader.cpp: (WebCore::SubresourceLoader::reportResourceTiming): * page/Performance.cpp: (WebCore::Performance::getEntries const): (WebCore::Performance::getEntriesByType const): (WebCore::Performance::getEntriesByName const): (WebCore::Performance::appendBufferedEntriesByType const): (WebCore::Performance::addNavigationTiming): (WebCore::Performance::registerPerformanceObserver): (WebCore::Performance::queueEntry): (WebCore::Performance::scheduleTaskIfNeeded): * page/Performance.h: * page/PerformanceEntry.h: (WebCore::PerformanceEntry::startTime const): (WebCore::PerformanceEntry::duration const): (WebCore::PerformanceEntry::isResource const): Deleted. (WebCore::PerformanceEntry::isMark const): Deleted. (WebCore::PerformanceEntry::isMeasure const): Deleted. (WebCore::PerformanceEntry::isPaint const): Deleted. * page/PerformanceMark.h: (isType): Deleted. SPECIALIZE_TYPE_TRAITS_BEGIN/END doesn't work well with PerformanceNavigationTiming which inherits from PerformanceResourceTiming which both have distinct types. is<PerformanceResourceTiming> doesn't give us the info we need. I replaced that with "switch (entry->performanceEntryType())" in the one place it's used, and it works like a charm. Also renamed type to performanceEntryType so it doesn't conflict with PerformanceNavigationTiming::type, which is specified in the idl. * page/PerformanceMeasure.h: (isType): Deleted. * page/PerformanceNavigationTiming.cpp: Added. (WebCore::toPerformanceNavigationTimingNavigationType): (WebCore::PerformanceNavigationTiming::PerformanceNavigationTiming): (WebCore::PerformanceNavigationTiming::millisecondsSinceOrigin const): (WebCore::PerformanceNavigationTiming::sameOriginCheckFails const): (WebCore::PerformanceNavigationTiming::unloadEventStart const): (WebCore::PerformanceNavigationTiming::unloadEventEnd const): (WebCore::PerformanceNavigationTiming::domInteractive const): (WebCore::PerformanceNavigationTiming::domContentLoadedEventStart const): (WebCore::PerformanceNavigationTiming::domContentLoadedEventEnd const): (WebCore::PerformanceNavigationTiming::domComplete const): (WebCore::PerformanceNavigationTiming::loadEventStart const): (WebCore::PerformanceNavigationTiming::loadEventEnd const): (WebCore::PerformanceNavigationTiming::type const): (WebCore::PerformanceNavigationTiming::redirectCount const): (WebCore::PerformanceNavigationTiming::startTime const): (WebCore::PerformanceNavigationTiming::duration const): * page/PerformanceNavigationTiming.h: Added. * page/PerformanceNavigationTiming.idl: Copied from Source/WebCore/page/PerformanceObserver.idl. * page/PerformanceObserver.cpp: (WebCore::PerformanceObserver::takeRecords): (WebCore::PerformanceObserver::disconnect): (WebCore::PerformanceObserver::deliver): (WebCore::PerformanceObserver::supportedEntryTypes): * page/PerformanceObserver.h: * page/PerformanceObserver.idl: * page/PerformanceObserverEntryList.cpp: (WebCore::PerformanceObserverEntryList::getEntriesByName const): * page/PerformancePaintTiming.h: (isType): Deleted. * page/PerformanceResourceTiming.cpp: (WebCore::PerformanceResourceTiming::PerformanceResourceTiming): (WebCore::PerformanceResourceTiming::nextHopProtocol const): (WebCore::PerformanceResourceTiming::redirectStart const): (WebCore::PerformanceResourceTiming::redirectEnd const): (WebCore::PerformanceResourceTiming::fetchStart const): (WebCore::PerformanceResourceTiming::domainLookupStart const): (WebCore::PerformanceResourceTiming::domainLookupEnd const): (WebCore::PerformanceResourceTiming::connectStart const): (WebCore::PerformanceResourceTiming::connectEnd const): (WebCore::PerformanceResourceTiming::secureConnectionStart const): (WebCore::PerformanceResourceTiming::requestStart const): (WebCore::PerformanceResourceTiming::responseStart const): (WebCore::PerformanceResourceTiming::responseEnd const): (WebCore::PerformanceResourceTiming::networkLoadTimeToDOMHighResTimeStamp const): * page/PerformanceResourceTiming.h: (WebCore::PerformanceResourceTiming::initiatorType const): (isType): Deleted. * page/PerformanceResourceTiming.idl: * platform/network/BlobResourceHandle.cpp: (WebCore::doNotifyFinish): * platform/network/NetworkLoadMetrics.h: * platform/network/ResourceHandleClient.h: (WebCore::ResourceHandleClient::didFinishLoading): * platform/network/SynchronousLoaderClient.cpp: (WebCore::SynchronousLoaderClient::didFinishLoading): * platform/network/SynchronousLoaderClient.h: * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp: (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFinishLoading): Pass metrics including the response end time from NSURLConnection so we don't assert in WebKitLegacy. * platform/network/cocoa/NetworkLoadMetrics.mm: (WebCore::copyTimingData): Use currentRequest instead of passing in the response so we can call it from didFinishLoading, where we don't have a response stored anywhere. We're just looking for whether it's http or https, so the currentRequest (which is the request after all the redirects) fits our purpose. * platform/network/curl/ResourceHandleCurl.cpp: (WebCore::ResourceHandle::handleDataURL): * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm: (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]): (-[WebCoreResourceHandleAsOperationQueueDelegate connectionDidFinishLoading:]): Source/WebKit: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]): Mark reused TLS connections in complete metrics like I did in incomplete metrics in r277493. Source/WebKitLegacy: * WebCoreSupport/PingHandle.h: Source/WTF: * Scripts/Preferences/WebPreferencesExperimental.yaml: LayoutTests: * TestExpectations: Annoyingly secure_connection_start_non_zero.https.html becomes flaky with a correct implementation because it assumes that no connection is reused. However, when running this test after other tests, another connection is often reused. * performance-api/paint-timing/performance-observer-first-contentful-paint-expected.txt: * performance-api/paint-timing/performance-observer-first-contentful-paint.html: * performance-api/performance-observer-api-expected.txt: * performance-api/performance-timeline-api-expected.txt: * performance-api/resources/timeline-api.js: * platform/mac-wk1/imported/w3c/web-platform-tests/navigation-timing/nav2_test_attributes_values-expected.txt: Next hop protocol isn't implemented in ResourceHandle. That's probably no big deal because WebKitLegacy is deprecated and not used by Safari. Canonical link: https://commits.webkit.org/237930@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277767 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-20 00:33:02 +00:00
2021-05-19 Alex Christensen <achristensen@webkit.org>
Add support for Navigation Timing Level 2
https://bugs.webkit.org/show_bug.cgi?id=184363
Reviewed by Ryosuke Niwa.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
Drop "get" prefix from SQLiteStatement member functions as well as out-parameters https://bugs.webkit.org/show_bug.cgi?id=225971 Reviewed by Darin Adler. Source/WebCore: Drop "get" prefix from SQLiteStatement member functions as well as out-parameters to modernize the code a bit and follow WebKit style. * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: (WebCore::IDBServer::createOrMigrateRecordsTableIfNecessary): (WebCore::IDBServer::SQLiteIDBBackingStore::ensureValidBlobTables): (WebCore::IDBServer::SQLiteIDBBackingStore::ensureValidIndexRecordsTable): (WebCore::IDBServer::SQLiteIDBBackingStore::ensureValidIndexRecordsIndex): (WebCore::IDBServer::SQLiteIDBBackingStore::ensureValidIndexRecordsRecordIndex): (WebCore::IDBServer::SQLiteIDBBackingStore::ensureValidObjectStoreInfoTable): (WebCore::IDBServer::SQLiteIDBBackingStore::migrateIndexInfoTableForIDUpdate): (WebCore::IDBServer::SQLiteIDBBackingStore::migrateIndexRecordsTableForIDUpdate): (WebCore::IDBServer::SQLiteIDBBackingStore::addExistingIndex): (WebCore::IDBServer::SQLiteIDBBackingStore::extractExistingDatabaseInfo): (WebCore::IDBServer::SQLiteIDBBackingStore::databaseNameAndVersionFromFile): (WebCore::IDBServer::SQLiteIDBBackingStore::deleteUnusedBlobFileRecords): (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRecord): (WebCore::IDBServer::SQLiteIDBBackingStore::getBlobRecordsForObjectStoreRecord): (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord): (WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords): (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey): (WebCore::IDBServer::SQLiteIDBBackingStore::getCount): (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetKeyGeneratorValue): (WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore): * Modules/indexeddb/server/SQLiteIDBCursor.cpp: (WebCore::IDBServer::SQLiteIDBCursor::internalFetchNextRecord): * Modules/webdatabase/Database.cpp: (WebCore::retrieveTextResultFromDatabase): (WebCore::Database::performGetTableNames): * Modules/webdatabase/DatabaseTracker.cpp: (WebCore::DatabaseTracker::fullPathForDatabaseNoLock): (WebCore::DatabaseTracker::origins): (WebCore::DatabaseTracker::databaseNamesNoLock): (WebCore::DatabaseTracker::detailsForNameAndOrigin): (WebCore::DatabaseTracker::setDatabaseDetails): (WebCore::DatabaseTracker::quotaNoLock): (WebCore::DatabaseTracker::removeDeletedOpenedDatabases): * Modules/webdatabase/SQLStatement.cpp: (WebCore::SQLStatement::execute): * loader/appcache/ApplicationCacheStorage.cpp: (WebCore::ApplicationCacheStorage::loadCacheGroup): (WebCore::ApplicationCacheStorage::loadManifestHostHashes): (WebCore::ApplicationCacheStorage::cacheGroupForURL): (WebCore::ApplicationCacheStorage::fallbackCacheGroupForURL): (WebCore::ApplicationCacheStorage::calculateQuotaForOrigin): (WebCore::ApplicationCacheStorage::calculateUsageForOrigin): (WebCore::ApplicationCacheStorage::calculateRemainingSizeForOriginExcludingCache): (WebCore::ApplicationCacheStorage::verifySchemaVersion): (WebCore::ApplicationCacheStorage::loadCache): (WebCore::ApplicationCacheStorage::manifestURLs): (WebCore::ApplicationCacheStorage::deleteCacheGroupRecord): (WebCore::ApplicationCacheStorage::checkForDeletedResources): (WebCore::ApplicationCacheStorage::flatFileAreaSize): * platform/network/curl/CookieJarDB.cpp: (WebCore::CookieJarDB::verifySchemaVersion): (WebCore::CookieJarDB::checkDatabaseValidity): (WebCore::CookieJarDB::searchCookies): (WebCore::CookieJarDB::getAllCookies): (WebCore::CookieJarDB::allDomains): * platform/sql/SQLiteDatabase.cpp: (WebCore::SQLiteDatabase::useWALJournalMode): (WebCore::SQLiteDatabase::maximumSize): (WebCore::SQLiteDatabase::pageSize): (WebCore::SQLiteDatabase::freeSpaceSize): (WebCore::SQLiteDatabase::totalSize): (WebCore::SQLiteDatabase::clearAllTables): (WebCore::SQLiteDatabase::turnOnIncrementalAutoVacuum): * platform/sql/SQLiteStatement.cpp: (WebCore::SQLiteStatement::columnName): (WebCore::SQLiteStatement::columnValue): (WebCore::SQLiteStatement::columnText): (WebCore::SQLiteStatement::columnDouble): (WebCore::SQLiteStatement::columnInt): (WebCore::SQLiteStatement::columnInt64): (WebCore::SQLiteStatement::columnBlobAsString): (WebCore::SQLiteStatement::columnBlob): * platform/sql/SQLiteStatement.h: * platform/win/SearchPopupMenuDB.cpp: (WebCore::SearchPopupMenuDB::loadRecentSearches): (WebCore::SearchPopupMenuDB::checkDatabaseValidity): (WebCore::SearchPopupMenuDB::verifySchemaVersion): * workers/service/server/RegistrationDatabase.cpp: (WebCore::RegistrationDatabase::ensureValidRecordsTable): (WebCore::RegistrationDatabase::importRecords): Source/WebKit: Update code base due to SQLiteStatement API changes. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::ResourceLoadStatisticsDatabaseStore::currentTableAndIndexQueries): (WebKit::ResourceLoadStatisticsDatabaseStore::missingUniqueIndices): (WebKit::ResourceLoadStatisticsDatabaseStore::columnsForTable): (WebKit::ResourceLoadStatisticsDatabaseStore::openAndUpdateSchemaIfNecessary): (WebKit::ResourceLoadStatisticsDatabaseStore::isEmpty const): (WebKit::ResourceLoadStatisticsDatabaseStore::relationshipExists const): (WebKit::ResourceLoadStatisticsDatabaseStore::domainID const): (WebKit::ResourceLoadStatisticsDatabaseStore::merge): (WebKit::ResourceLoadStatisticsDatabaseStore::getThirdPartyDataForSpecificFirstPartyDomains const): (WebKit::ResourceLoadStatisticsDatabaseStore::aggregatedThirdPartyData const): (WebKit::ResourceLoadStatisticsDatabaseStore::recursivelyFindNonPrevalentDomainsThatRedirectedToThisDomain): (WebKit::ResourceLoadStatisticsDatabaseStore::markAsPrevalentIfHasRedirectedToPrevalent): (WebKit::ResourceLoadStatisticsDatabaseStore::findNotVeryPrevalentResources): (WebKit::ResourceLoadStatisticsDatabaseStore::hasHadUserInteraction): (WebKit::ResourceLoadStatisticsDatabaseStore::dumpResourceLoadStatistics): (WebKit::ResourceLoadStatisticsDatabaseStore::predicateValueForDomain const): (WebKit::ResourceLoadStatisticsDatabaseStore::getMostRecentlyUpdatedTimestamp const): (WebKit::ResourceLoadStatisticsDatabaseStore::ensureResourceStatisticsForRegistrableDomain): (WebKit::ResourceLoadStatisticsDatabaseStore::allDomains const): (WebKit::ResourceLoadStatisticsDatabaseStore::cookieAccess): (WebKit::ResourceLoadStatisticsDatabaseStore::hasUserGrantedStorageAccessThroughPrompt): (WebKit::ResourceLoadStatisticsDatabaseStore::domainsToBlockAndDeleteCookiesFor const): (WebKit::ResourceLoadStatisticsDatabaseStore::domainsToBlockButKeepCookiesFor const): (WebKit::ResourceLoadStatisticsDatabaseStore::domainsWithUserInteractionAsFirstParty const): (WebKit::ResourceLoadStatisticsDatabaseStore::domainsWithStorageAccess const): (WebKit::ResourceLoadStatisticsDatabaseStore::domains const): (WebKit::ResourceLoadStatisticsDatabaseStore::pruneStatisticsIfNeeded): (WebKit::ResourceLoadStatisticsDatabaseStore::isCorrectSubStatisticsCount): (WebKit::ResourceLoadStatisticsDatabaseStore::getDomainStringFromDomainID const): (WebKit::ResourceLoadStatisticsDatabaseStore::appendSubStatisticList const): (WebKit::ResourceLoadStatisticsDatabaseStore::resourceToString const): (WebKit::ResourceLoadStatisticsDatabaseStore::domainIDExistsInDatabase): (WebKit::ResourceLoadStatisticsDatabaseStore::updateOperatingDatesParameters): (WebKit::ResourceLoadStatisticsDatabaseStore::buildPrivateClickMeasurementFromDatabase): (WebKit::ResourceLoadStatisticsDatabaseStore::attributionToString): (WebKit::ResourceLoadStatisticsDatabaseStore::privateClickMeasurementToString): (WebKit::ResourceLoadStatisticsDatabaseStore::earliestTimesToSend): * NetworkProcess/WebStorage/LocalStorageDatabase.cpp: (WebKit::LocalStorageDatabase::items const): (WebKit::LocalStorageDatabase::item const): (WebKit::LocalStorageDatabase::databaseIsEmpty const): * UIProcess/API/glib/IconDatabase.cpp: (WebKit::IconDatabase::IconDatabase): (WebKit::IconDatabase::populatePageURLToIconURLMap): (WebKit::IconDatabase::iconIDForIconURL): (WebKit::IconDatabase::iconData): (WebKit::IconDatabase::loadIconForPageURL): * UIProcess/API/glib/IconDatabase.h: Source/WebKitLegacy: Update code base due to SQLiteStatement API changes. * Storage/StorageAreaSync.cpp: (WebKit::StorageAreaSync::performImport): (WebKit::StorageAreaSync::deleteEmptyDatabase): * Storage/StorageTracker.cpp: (WebKit::StorageTracker::syncImportOriginIdentifiers): (WebKit::StorageTracker::syncDeleteAllOrigins): (WebKit::StorageTracker::databasePathForOrigin): Source/WTF: Add Vector constructor that takes in an array and a size. * wtf/Vector.h: (WTF::Vector::Vector): Tools: Add API test coverage for new Vector constructor. * TestWebKitAPI/Tests/WTF/Vector.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/237920@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277750 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-19 21:00:39 +00:00
2021-05-19 Chris Dumez <cdumez@apple.com>
Drop "get" prefix from SQLiteStatement member functions as well as out-parameters
https://bugs.webkit.org/show_bug.cgi?id=225971
Reviewed by Darin Adler.
Add Vector constructor that takes in an array and a size.
* wtf/Vector.h:
(WTF::Vector::Vector):
Move CFStringRef and NSString support from StringBuilder into StringConcatenateCF https://bugs.webkit.org/show_bug.cgi?id=225839 Reviewed by Sam Weinig. Source/JavaScriptCore: * inspector/ConsoleMessage.cpp: (Inspector::ConsoleMessage::ConsoleMessage): Use StringBuilder::clear instead of StringBuilder::resize; no advantage to the latter after calling StringBuilder::toString. * runtime/JSONObject.cpp: (JSC::Stringifier::Holder::appendNextProperty): Update for name change of StringBuilder::resize to StringBuilder::shrink. * runtime/TypeSet.cpp: (JSC::StructureShape::stringRepresentation): Ditto. Source/WebCore: * Modules/airplay/WebMediaSessionManager.cpp: (WebCore::mediaProducerStateString): Use StringBuilder exclusively instead of mixing it with makeString. Also updated for StringBuilder::shrink name. * html/HTMLTextFormControlElement.cpp: (WebCore::stripTrailingNewline): Updated for StringBuilder::shrink name. * page/CaptionUserPreferencesMediaAF.cpp: (WebCore::CaptionUserPreferencesMediaAF::captionsTextColor const): Tweaked coding style a bit. (WebCore::appendCSS): Use variadic StringBuilder::append instead of many separate calls. (WebCore::CaptionUserPreferencesMediaAF::captionsDefaultFontCSS const): Tweaked coding style a bit, and use variadic StrinBuilder::append calls to reduce the number of calls and streamline the code. (WebCore::CaptionUserPreferencesMediaAF::captionsStyleSheetOverride const): Ditto. Also removed unnecessary checks that strings are empty before appending. * page/scrolling/ScrollingCoordinator.cpp: (WebCore::ScrollingCoordinator::synchronousScrollingReasonsAsText): Updated for StringBuilder::shrink name. * platform/LayoutUnit.h: Updated for saturatedSum/Difference names. * platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::NetworkStorageSession::cookiesForSession const): Tweaked codin style a bit, and use variadic StrinBuilder::append calls to reduce the number of calls and streamline the code. * rendering/RenderCounter.cpp: (WebCore::planCounter): Updated for saturatedSum name. * style/StyleBuilderCustom.h: (WebCore::Style::BuilderCustom::applyValueCounter): Ditto. * svg/SVGPathStringBuilder.cpp: (WebCore::SVGPathStringBuilder::result): Updated for StringBuilder::shrink name. * testing/Internals.cpp: (WebCore::Internals::pageMediaState): Ditto. * xml/XSLTProcessorLibxslt.cpp: (WebCore::saveResultToString): Ditto. Source/WebKit: * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::platformSetNetworkParameters): Use makeString instead of StringBuilder. Source/WTF: The new header makes CFStringRef and NSString work with string concatenation, which means it now works with the variadic StringBuilder::append and makeString, and still works with the single-argument StringBuilder::append. More efficient that the old version because it does not allocate a temporary WTF::String for the 16-bit character path. Also made many other small improvements to the StringBuilder implementation. * WTF.xcodeproj/project.pbxproj: Added StringConcatenateCF.h. * wtf/CheckedArithmetic.h: Removed ConditionalCrashOnOverflow, which was only here for use by StringBuilder, which does not use CheckedArithmetic any more. * wtf/PlatformFTW.cmake: Added StringConcatenateCF.h.. * wtf/PlatformMac.cmake: Ditto. * wtf/PlatformWin.cmake: Ditto. * wtf/SaturatedArithmetic.h: Moved the contents of this file inside the WTF namespace. (WTF::signedAddInt32Overflows): Renamed this function. The type here is important, and we are not doing anything to prevent type conversion or create ambiguity, so it's good to be explicit in the function name. (WTF::saturatedSum<int32_t>): Renamed this from saturatedAddition for clarity. The function returns a sum, so that's a better name than calling it "addition". Also, it's clearer to be explicit about the return type. (WTF::signedSubtractInt32Overflows): Renamed. Same reason as above. (WTF::saturatedDifference<int32_t>): Ditto. (WTF::saturatedSum): Added. Does unsigned integer saturated addition. This one can be written in a portable manner and still get really efficient code on at least Intel and ARM64. (WTF::saturatedSum): Added a function template that lets callers pass larger number of arguments to saturatedSum, rather than exactly two. * wtf/text/StringBuilder.cpp: (WTF::expandedCapacity): Renamed to use the term capacity rather than length for the new required capacity. (WTF::StringBuilder::didOverflow): Implement the new approach to overflow, meaning we need to write the CRASH() here explicitly and in the non-crashing mode, set m_length. (WTF::StringBuilder::reifyString const): Changed the overflow check into a RELEASE_ASSERT. This is now responsible for doing the check that callers were doing earlier, so we want it in production builds. Also simplified this since our m_length member is a simple integer now, and removed the unused m_isReified. (WTF::StringBuilder::shrink): Renamed this to shrink to match the Vector::shrink function, since this has never supported making the builder larger. Removed unnecessary overflow checks, since shrinking cannot cause overflow. (WTF::StringBuilder::allocateBuffer): Replaced two separate functions with a single simpler function template. Removed extra overflow checks because the StringImpl::tryCreateUninitialized function already does the only overflow check we need. Also move to StringImpl::copyCharacters for copying characters rather than using std::memcpy directly. Removed code to set m_is8Bit and m_bufferCharacters. (WTF::StringBuilder::reallocateBuffer): Replaced two separate functions with a function template and a cover that calls the appropriate instance of the template for places where we aren't already in character-type-specific code paths. This version now supports allocating a buffer for the first time in cases where we have m_string and not m_buffer, which used to be handled at the higher level. Removed code to set m_bufferCharacters. (WTF::StringBuilder::reserveCapacity): Rewrote for simplicity. By relying on the overflow checking inside reallocateBuffer and allocateBuffer we no longer need checking of the passed-in value at this level. (WTF::StringBuilder::extendBufferForAppending): Removed the version of this that takes additionalLength since it's potentially confusing to have a family of functions that have the same name and take the same type of argument, but interpret it subtly differently. Streamlined the code using std::exchange. This function now also includes the logic from the function named extendBufferForAppendingWithoutOverflowCheck, which was subtly misnamed since that was not the only semantic difference. Also removed the ALWAYS_INLINE because the compiler will do the right thing without such heavy handed advice. (WTF::StringBuilder::extendBufferForAppendingSlowCase): Streamlined this by using std::exchange and removed additional overflow checks at this level since reallocateBuffer already does them. Also added a check for the case where the new total length is 0, which would not be handled correctly and efficiently by reallocateBuffer. (WTF::StringBuilder::extendBufferForAppendingLChar): Renamed this from extendBufferForAppending8, since it's now identical to calling extendBufferForAppending<LChar>, except for inlining and linkage. (WTF::StringBuilder::extendBufferForAppendingWithUpconvert): Renamed this from extendBufferForAppending16. It is different from the other extendBuffer functions because is supports upconverting from LChar to UChar. Like the others it relies on allocateBuffer for the overflow checking. (WTF::StringBuilder::appendCharacters): Removed an unnecessary assertion that the characters pointer is non-null; that will fail in an obvious way without an assertion. Simplified the logic and removed some invariant assertions that don't help us much. Changed overflow checking by using saturatedSum to compute the new length. In overflow cases, the new sum will be larger than the maximum string length, but will fit in an unsigned, so we can pass it down to lower levels and let functions like reallocateBuffer do the actual overflow checking. Also use StringImpl::copyCharacters. (WTF::StringBuilder::append): Removed the CFStringRef overload. (WTF::StringBuilder::shouldShrinkToFit const): Rename this from canShrink. Simplify the function a bit and remove the vague FIXME that says "this should be tuned". That may be so, but the FIXME is not really driving us to action. (WTF::StringBuilder::shrinkToFit): Simplify by using the new reallocateBuffer and std::exchange. Removed unneeded assertion about overflow that doesn't help us maintain the invariant. (WTF::StringBuilder::isAllASCII const): Was tempted to remove this function, but for now just made it use the StringView version for brevity. * wtf/text/StringBuilder.h: Removed many unneeded includes, and notably included SaturatedArithmetic.h instead of CheckedArithmetic.h because we now use the former instead of the latter. Changed the overflow checking implementation to work more simply based on saturated addition rather than Checked. This allowed us to get rid of dependency on our own unique mode for Checked, called ConditionalCrashOnOverflow. Removed a comment about making a templatized version of StringBuilder. We can do it if we like, but does not seem urgent. Moved fucntion bodies out of the class definition so it's easier to see what's going on in the class. Since m_length is now an ordinary integer, the check for overflowed simply checks to see if the length is larger than the maximum string length. When we encounter overflow that is not about length computation, we set the length to the maximum integer to indicate the failure. Deleted the append overloads for CFStringRef and NSString. Removed m_bufferCharacters, m_is8Bit, and m_isReified. (WTF::StringBuilder::StringBuilder): Simplified the constructor since we only have to initialize the m_shouldCrashOnOverflow member. (WTF::StringBuilder::clear): Fixed a mistake where this was not resetting the m_isReified flag. (WTF::StringBuilder::swap): Updated for changes in the data members. (WTF::StringBuilder::operator StringView const): Moved out of line. Made sure to call the length() function so we crash if this is called after overflow. (WTF::StringBuilder::append): Remove some of the unnecessary checks and special cases in the various versions of append. Most of the checking is done inside appendCharacters, with only a few exceptions. (WTF::StringBuilder::appendSubstring): Moved out of the class definition without making significant changes. (WTF::StringBuilder::appendCharacter): Ditto. (WTF::StringBuilder::toString): Greatly simplified this function by relying on overflow checking in the reifyString function instead of doing it here and removing unneeded invariant assertions. (WTF::StringBuilder::toStringPreserveCapacity const): Ditto. (WTF::StringBuilder::toAtomString const): Rewrote this to streamline, removing explicit overflow checks. (WTF::StringBuilder::length const): Moved out of the class definition without making significant changes. (WTF::StringBuilder::capacity const): Ditto. (WTF::StringBuilder::operator[] const): Ditto. (WTF::StringBuilder::characters const): Implemented this operation in the function template. Now rather than having this call the characters8 and characters16 functions, they can call it. (WTF::StringBuilder::getBufferCharacters<LChar>): Deleted. (WTF::StringBuilder::getBufferCharacters<UChar>): Deleted. (WTF::StringBuilder::appendFromAdapters): Use saturatedSum to compute the required length, which allows the extendBuffer functions to do overflow checking without having to take special checked integer types for arguments. (WTF::StringBuilder::equal): Implement using StringView. * wtf/text/StringBuilderJSON.cpp: (WTF::StringBuilder::appendQuotedJSONString): Simplified the checked arithmetic for computing the required capacity. Updated since we removed m_bufferCharacters and changed the type of m_length. * wtf/text/cf/StringConcatenateCF.h: Added. Specializes StringTypeAdapter for both CFStringRef and NSString *. If CFStringGetCStringPtr works for Latin-1, then does the 8-bit code path, otherwise the 16-bit. * wtf/text/cocoa/TextStreamCocoa.mm: Include StringConcatenateCF.h, since it's now needed to use CFStringRef with StringBuilder. Tools: * TestWebKitAPI/Tests/WTF/SaturatedArithmeticOperations.cpp: Updated tests for changes to SaturatedArithmetic.h. * TestWebKitAPI/Tests/WTF/StringBuilder.cpp: Updated tests for changes to StringBuilder. * TestWebKitAPI/Tests/WebKit/GetUserMedia.mm: (TestWebKitAPI::wkMediaCaptureStateString): Ditto. * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp: Added include of StringConcatenateCF.h. Added StringTypeAdapter for WKStringRef. (WTR::styleDecToStr): Use ASCIILiteral instead of StringBuilder. (WTR::string): Removed unneeded toWTFString since the WKStringRef StringTypeAdapter takes care of it. (WTR::string): Renamed from frameToStr. Use makeString. (WTR::dumpResourceURL): Use append instead of appendLiteral. (WTR::dumpFrameDescriptionSuitableForTestResult): Deleted. (WTR::dumpLoadEvent): Use makeString. (WTR::string): Renamed from a longer name. Return a String instead of building in a StringBuilder. Use makeString. (WTR::string): Ditto. (WTR::dumpErrorDescriptionSuitableForTestResult): Removed unneeded toWTFString. (WTR::dumpFrameScrollPosition): Ditto. (WTR::dumpDescendantFramesText): Ditto. (WTR::InjectedBundlePage::dumpDOMAsWebArchive): Removed an unneeded local variable. (WTR::InjectedBundlePage::dump): Removed unneeded toWTFString. (WTR::InjectedBundlePage::didReceiveTitleForFrame): Ditto. (WTR::InjectedBundlePage::didFinishDocumentLoadForFrame): Updated for functon name change. (WTR::InjectedBundlePage::willSendRequestForFrame): Ditto. Also use variadic append. Also use makeString. (WTR::InjectedBundlePage::didReceiveResponseForResource): Ditto. (WTR::InjectedBundlePage::didFinishLoadForResource): Ditto. (WTR::InjectedBundlePage::didFailLoadForResource): Ditto. (WTR::InjectedBundlePage::decidePolicyForNavigationAction): Ditto. (WTR::InjectedBundlePage::decidePolicyForResponse): Ditto. (WTR::InjectedBundlePage::willAddMessageToConsole): Ditto. (WTR::InjectedBundlePage::willSetStatusbarText): Ditto. (WTR::InjectedBundlePage::willRunJavaScriptPrompt): Ditto. (WTR::InjectedBundlePage::didExceedDatabaseQuota): Ditto. (WTR::InjectedBundlePage::shouldInsertNode): Ditto. (WTR::InjectedBundlePage::shouldInsertText): Ditto. (WTR::InjectedBundlePage::shouldDeleteRange): Ditto. (WTR::InjectedBundlePage::shouldChangeSelectedRange): Ditto. (WTR::InjectedBundlePage::shouldApplyStyle): Ditto. (WTR::InjectedBundlePage::didBeginEditing): Ditto. (WTR::InjectedBundlePage::didEndEditing): Ditto. (WTR::InjectedBundlePage::didChange): Ditto. (WTR::InjectedBundlePage::didChangeSelection): Ditto. (WTR::InjectedBundlePage::dumpHistory): Ditto. Canonical link: https://commits.webkit.org/237916@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277744 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-19 19:37:21 +00:00
2021-05-18 Darin Adler <darin@apple.com>
Move CFStringRef and NSString support from StringBuilder into StringConcatenateCF
https://bugs.webkit.org/show_bug.cgi?id=225839
Reviewed by Sam Weinig.
The new header makes CFStringRef and NSString work with string concatenation,
which means it now works with the variadic StringBuilder::append and makeString,
and still works with the single-argument StringBuilder::append. More efficient
that the old version because it does not allocate a temporary WTF::String for
the 16-bit character path.
Also made many other small improvements to the StringBuilder implementation.
* WTF.xcodeproj/project.pbxproj: Added StringConcatenateCF.h.
* wtf/CheckedArithmetic.h: Removed ConditionalCrashOnOverflow, which was only
here for use by StringBuilder, which does not use CheckedArithmetic any more.
* wtf/PlatformFTW.cmake: Added StringConcatenateCF.h..
* wtf/PlatformMac.cmake: Ditto.
* wtf/PlatformWin.cmake: Ditto.
* wtf/SaturatedArithmetic.h: Moved the contents of this file inside the
WTF namespace.
(WTF::signedAddInt32Overflows): Renamed this function. The type here is
important, and we are not doing anything to prevent type conversion or
create ambiguity, so it's good to be explicit in the function name.
(WTF::saturatedSum<int32_t>): Renamed this from saturatedAddition for
clarity. The function returns a sum, so that's a better name than calling
it "addition". Also, it's clearer to be explicit about the return type.
(WTF::signedSubtractInt32Overflows): Renamed. Same reason as above.
(WTF::saturatedDifference<int32_t>): Ditto.
(WTF::saturatedSum): Added. Does unsigned integer saturated addition.
This one can be written in a portable manner and still get really
efficient code on at least Intel and ARM64.
(WTF::saturatedSum): Added a function template that lets callers pass
larger number of arguments to saturatedSum, rather than exactly two.
* wtf/text/StringBuilder.cpp:
(WTF::expandedCapacity): Renamed to use the term capacity rather than
length for the new required capacity.
(WTF::StringBuilder::didOverflow): Implement the new approach to
overflow, meaning we need to write the CRASH() here explicitly and
in the non-crashing mode, set m_length.
(WTF::StringBuilder::reifyString const): Changed the overflow check
into a RELEASE_ASSERT. This is now responsible for doing the check that
callers were doing earlier, so we want it in production builds. Also
simplified this since our m_length member is a simple integer now,
and removed the unused m_isReified.
(WTF::StringBuilder::shrink): Renamed this to shrink to match the
Vector::shrink function, since this has never supported making the
builder larger. Removed unnecessary overflow checks, since shrinking
cannot cause overflow.
(WTF::StringBuilder::allocateBuffer): Replaced two separate functions
with a single simpler function template. Removed extra overflow checks
because the StringImpl::tryCreateUninitialized function already does
the only overflow check we need. Also move to StringImpl::copyCharacters
for copying characters rather than using std::memcpy directly.
Removed code to set m_is8Bit and m_bufferCharacters.
(WTF::StringBuilder::reallocateBuffer): Replaced two separate
functions with a function template and a cover that calls the
appropriate instance of the template for places where we aren't
already in character-type-specific code paths. This version now
supports allocating a buffer for the first time in cases where
we have m_string and not m_buffer, which used to be handled at
the higher level. Removed code to set m_bufferCharacters.
(WTF::StringBuilder::reserveCapacity): Rewrote for simplicity.
By relying on the overflow checking inside reallocateBuffer and
allocateBuffer we no longer need checking of the passed-in value
at this level.
(WTF::StringBuilder::extendBufferForAppending): Removed the
version of this that takes additionalLength since it's
potentially confusing to have a family of functions that have the
same name and take the same type of argument, but interpret it
subtly differently. Streamlined the code using std::exchange.
This function now also includes the logic from the function named
extendBufferForAppendingWithoutOverflowCheck, which was subtly
misnamed since that was not the only semantic difference. Also
removed the ALWAYS_INLINE because the compiler will do the right
thing without such heavy handed advice.
(WTF::StringBuilder::extendBufferForAppendingSlowCase): Streamlined
this by using std::exchange and removed additional overflow checks
at this level since reallocateBuffer already does them. Also added
a check for the case where the new total length is 0, which would
not be handled correctly and efficiently by reallocateBuffer.
(WTF::StringBuilder::extendBufferForAppendingLChar): Renamed this
from extendBufferForAppending8, since it's now identical to calling
extendBufferForAppending<LChar>, except for inlining and linkage.
(WTF::StringBuilder::extendBufferForAppendingWithUpconvert):
Renamed this from extendBufferForAppending16. It is different from
the other extendBuffer functions because is supports upconverting
from LChar to UChar. Like the others it relies on allocateBuffer
for the overflow checking.
(WTF::StringBuilder::appendCharacters): Removed an unnecessary
assertion that the characters pointer is non-null; that will fail
in an obvious way without an assertion. Simplified the logic and
removed some invariant assertions that don't help us much. Changed
overflow checking by using saturatedSum to compute the new length.
In overflow cases, the new sum will be larger than the maximum
string length, but will fit in an unsigned, so we can pass it
down to lower levels and let functions like reallocateBuffer do
the actual overflow checking. Also use StringImpl::copyCharacters.
(WTF::StringBuilder::append): Removed the CFStringRef overload.
(WTF::StringBuilder::shouldShrinkToFit const): Rename this from
canShrink. Simplify the function a bit and remove the vague FIXME
that says "this should be tuned". That may be so, but the FIXME
is not really driving us to action.
(WTF::StringBuilder::shrinkToFit): Simplify by using the new
reallocateBuffer and std::exchange. Removed unneeded assertion
about overflow that doesn't help us maintain the invariant.
(WTF::StringBuilder::isAllASCII const): Was tempted to remove
this function, but for now just made it use the StringView
version for brevity.
* wtf/text/StringBuilder.h: Removed many unneeded includes, and
notably included SaturatedArithmetic.h instead of
CheckedArithmetic.h because we now use the former instead of the
latter. Changed the overflow checking implementation to work
more simply based on saturated addition rather than Checked.
This allowed us to get rid of dependency on our own unique mode
for Checked, called ConditionalCrashOnOverflow. Removed a
comment about making a templatized version of StringBuilder.
We can do it if we like, but does not seem urgent. Moved
fucntion bodies out of the class definition so it's easier to
see what's going on in the class. Since m_length is now an
ordinary integer, the check for overflowed simply checks to see
if the length is larger than the maximum string length. When we
encounter overflow that is not about length computation, we set
the length to the maximum integer to indicate the failure.
Deleted the append overloads for CFStringRef and NSString.
Removed m_bufferCharacters, m_is8Bit, and m_isReified.
(WTF::StringBuilder::StringBuilder): Simplified the constructor
since we only have to initialize the m_shouldCrashOnOverflow member.
(WTF::StringBuilder::clear): Fixed a mistake where this was not
resetting the m_isReified flag.
(WTF::StringBuilder::swap): Updated for changes in the data members.
(WTF::StringBuilder::operator StringView const): Moved out of line.
Made sure to call the length() function so we crash if this is
called after overflow.
(WTF::StringBuilder::append): Remove some of the unnecessary checks
and special cases in the various versions of append. Most of the
checking is done inside appendCharacters, with only a few exceptions.
(WTF::StringBuilder::appendSubstring): Moved out of the class
definition without making significant changes.
(WTF::StringBuilder::appendCharacter): Ditto.
(WTF::StringBuilder::toString): Greatly simplified this function
by relying on overflow checking in the reifyString function instead
of doing it here and removing unneeded invariant assertions.
(WTF::StringBuilder::toStringPreserveCapacity const): Ditto.
(WTF::StringBuilder::toAtomString const): Rewrote this to streamline,
removing explicit overflow checks.
(WTF::StringBuilder::length const): Moved out of the class
definition without making significant changes.
(WTF::StringBuilder::capacity const): Ditto.
(WTF::StringBuilder::operator[] const): Ditto.
(WTF::StringBuilder::characters const): Implemented this operation
in the function template. Now rather than having this call the
characters8 and characters16 functions, they can call it.
(WTF::StringBuilder::getBufferCharacters<LChar>): Deleted.
(WTF::StringBuilder::getBufferCharacters<UChar>): Deleted.
(WTF::StringBuilder::appendFromAdapters): Use saturatedSum to
compute the required length, which allows the extendBuffer
functions to do overflow checking without having to take special
checked integer types for arguments.
(WTF::StringBuilder::equal): Implement using StringView.
* wtf/text/StringBuilderJSON.cpp:
(WTF::StringBuilder::appendQuotedJSONString): Simplified the checked
arithmetic for computing the required capacity. Updated since we
removed m_bufferCharacters and changed the type of m_length.
* wtf/text/cf/StringConcatenateCF.h: Added. Specializes StringTypeAdapter for
both CFStringRef and NSString *. If CFStringGetCStringPtr works for Latin-1, then
does the 8-bit code path, otherwise the 16-bit.
* wtf/text/cocoa/TextStreamCocoa.mm: Include StringConcatenateCF.h, since it's
now needed to use CFStringRef with StringBuilder.
Update Base64 encoding/decoding to match more modern WebKit conventions https://bugs.webkit.org/show_bug.cgi?id=225920 Reviewed by Chris Dumez. Source/WebCore: - Updates to use new signatures for base64 encoding/decoding including utilizing the string type adaptor and makeString. - Replace out parameter based getDefaultWebCryptoMasterKey() with Optional<Vector<uint8_t>> defaultWebCryptoMasterKey(). - Update synchronous loading code path to use uint8_t* consistently for data buffer representation. - Replace out parameters in quotedPrintableEncode/quotedPrintableDecode with Optional. * Modules/encryptedmedia/InitDataRegistry.cpp: (WebCore::extractKeyIDsKeyids): Update to use new base64URLDecode. (WebCore::sanitizeKeyids): Update to use new base64URLEncodeToString() * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp: (WebCore::CDMSessionClearKey::update): Update to use new base64Decode(). * Modules/plugins/QuickTimePluginReplacement.mm: (WebCore::jsValueWithDataInContext): (WebCore::jsValueWithAVMetadataItemInContext): Update to use new base64EncodeToString(). Replace string concatentation using operator+ with makeString(). * Modules/webauthn/AuthenticatorCoordinator.cpp: (WebCore::AuthenticatorCoordinatorInternal::produceClientDataJson): Update to use new base64URLEncodeToString(). * Modules/webauthn/PublicKeyCredential.cpp: (WebCore::PublicKeyCredential::PublicKeyCredential): Update to use new base64URLEncodeToString(). * Modules/websockets/WebSocketHandshake.cpp: (WebCore::generateSecWebSocketKey): (WebCore::WebSocketHandshake::getExpectedWebSocketAccept): Update to use new base64URLEncodeToString(). * crypto/SerializedCryptoKeyWrap.h: Change from outparameter based getDefaultWebCryptoMasterKey() to new Optional<Vector<uint8_t>> defaultWebCryptoMasterKey(). * crypto/gcrypt/CryptoKeyECGCrypt.cpp: (WebCore::CryptoKeyEC::platformAddFieldElements const): Update to use new base64URLEncodeToString(). * crypto/gcrypt/SerializedCryptoKeyWrapGCrypt.cpp: (WebCore::defaultWebCryptoMasterKey): (WebCore::getDefaultWebCryptoMasterKey): Deleted. Update for new defaultWebCryptoMasterKey() signature. * crypto/keys/CryptoKeyAES.cpp: (WebCore::CryptoKeyAES::importJwk): (WebCore::CryptoKeyAES::exportJwk const): Update to use new base64URLDecode / base64URLEncodeToString(). * crypto/keys/CryptoKeyEC.cpp: (WebCore::CryptoKeyEC::importJwk): Update to use new base64URLDecode. * crypto/keys/CryptoKeyHMAC.cpp: (WebCore::CryptoKeyHMAC::importJwk): (WebCore::CryptoKeyHMAC::exportJwk const): Update to use new base64URLDecode / base64URLEncodeToString(). * crypto/keys/CryptoKeyRSA.cpp: (WebCore::CryptoKeyRSA::importJwk): (WebCore::CryptoKeyRSA::exportJwk const): Update to use new base64URLDecode / base64URLEncodeToString(). * crypto/mac/CryptoKeyECMac.cpp: (WebCore::CryptoKeyEC::platformAddFieldElements const): Update to use new base64URLEncodeToString(). * crypto/mac/SerializedCryptoKeyWrapMac.mm: (WebCore::createAndStoreMasterKey): (WebCore::findMasterKey): (WebCore::defaultWebCryptoMasterKey): (WebCore::getDefaultWebCryptoMasterKey): Deleted. Update for new defaultWebCryptoMasterKey() signature. * crypto/openssl/SerializedCryptoKeyWrapOpenSSL.cpp: (WebCore::defaultWebCryptoMasterKey): (WebCore::getDefaultWebCryptoMasterKey): Deleted. Update for new defaultWebCryptoMasterKey() signature. * fileapi/FileReaderLoader.cpp: (WebCore::FileReaderLoader::convertToDataURL): Update to use new base64EncodeToString(). * inspector/DOMPatchSupport.cpp: (WebCore::DOMPatchSupport::createDigest): Update to use new base64EncodeToString(). * inspector/InspectorFrontendHost.cpp: (WebCore::InspectorFrontendHost::showCertificate): Update to use new base64URLDecode / base64URLEncodeToString(). * inspector/NetworkResourcesData.cpp: (WebCore::NetworkResourcesData::ResourceData::decodeDataToContent): Update to use new base64EncodeToString(). * inspector/agents/InspectorDOMAgent.cpp: (WebCore::computeContentSecurityPolicySHA256Hash): Update to use new base64Decode / base64EncodeToString(). * inspector/agents/InspectorNetworkAgent.cpp: (WebCore::Inspector::buildWebSocketMessage): (WebCore::InspectorNetworkAgent::didReceiveData): (WebCore::InspectorNetworkAgent::getSerializedCertificate): (WebCore::InspectorNetworkAgent::interceptWithRequest): (WebCore::InspectorNetworkAgent::interceptWithResponse): (WebCore::InspectorNetworkAgent::interceptRequestWithResponse): (WebCore::InspectorNetworkAgent::cachedResourceContent): Update to use new base64Decode / base64EncodeToString(). * inspector/agents/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::dataContent): (WebCore::InspectorPageAgent::archive): Update to use new base64EncodeToString(). * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadResourceSynchronously): Switch to using Vector<uint8_t> buffer to match new loadResourceSynchronously signature. * loader/LoaderStrategy.h: Switch to using Vector<uint8_t> for the data buffer. * loader/PrivateClickMeasurement.cpp: (WebCore::PrivateClickMeasurement::EphemeralSourceNonce::isValid const): Update to use new base64URLDecode. * loader/ResourceCryptographicDigest.cpp: (WebCore::parseCryptographicDigestImpl): (WebCore::decodeEncodedResourceCryptographicDigest): Update to use new base64Decode. * loader/archive/mhtml/MHTMLArchive.cpp: (WebCore::MHTMLArchive::generateMHTMLData): Switch to using new base64Encode and new quotedPrintableEncode. * loader/archive/mhtml/MHTMLParser.cpp: (WebCore::MHTMLParser::parseNextPart): Switch to using new base64Decode and new quotedPrintableDecode. * loader/cocoa/PrivateClickMeasurementCocoa.mm: (WebCore::PrivateClickMeasurement::calculateAndUpdateSourceUnlinkableToken): (WebCore::PrivateClickMeasurement::calculateAndUpdateSourceSecretToken): Update to use new base64URLDecode / base64URLEncodeToString(). * page/Base64Utilities.cpp: (WebCore::Base64Utilities::btoa): (WebCore::Base64Utilities::atob): Update to use new base64Decode / base64EncodeToString(). * page/Page.cpp: (WebCore::Page::userStyleSheetLocationChanged): Update to use new base64Decode. * platform/SharedBuffer.cpp: (WebCore::SharedBuffer::append): * platform/SharedBuffer.h: Add overload for append which allows passing in a uint8_t*. * platform/encryptedmedia/clearkey/CDMClearKey.cpp: (WebCore::parseLicenseFormat): (WebCore::extractKeyidsFromCencInitData): (WebCore::extractKeyIdFromWebMInitData): (WebCore::CDMInstanceSessionClearKey::removeSessionData): Update to use new base64URLDecode / base64URLEncodeToString(). * platform/graphics/avfoundation/CDMFairPlayStreaming.cpp: (WebCore::extractSinfData): Update to use new base64Decode. * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm: (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestLicense): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequests): Update to use new base64Decode / base64EncodeToString(). * platform/graphics/cairo/ImageBufferCairoBackend.cpp: (WebCore::ImageBufferCairoBackend::toDataURL const): Update to use new base64EncodeToString(). * platform/graphics/cg/ImageBufferUtilitiesCG.cpp: (WebCore::dataURL): Update to use new base64EncodeToString(). * platform/graphics/win/FontCustomPlatformData.cpp: (WebCore::createUniqueFontName): Update to use new base64EncodeToString(). * platform/graphics/win/FontCustomPlatformDataCairo.cpp: (WebCore::createUniqueFontName): Update to use new base64EncodeToString(). * platform/mac/SSLKeyGeneratorMac.mm: (WebCore::signedPublicKeyAndChallengeString): Update to use new base64EncodeToString(). * platform/network/BlobRegistryImpl.cpp: (WebCore::loadBlobResourceSynchronously): Switch to using Vector<uint8_t> buffer to match new loadResourceSynchronously signature. * platform/network/BlobResourceHandle.cpp: * platform/network/BlobResourceHandle.h: (WebCore::BlobResourceHandle::loadResourceSynchronously): Switch to using Vector<uint8_t> buffer to match new loadResourceSynchronously signature. * platform/network/CredentialBase.cpp: * platform/network/CredentialBase.h: (WebCore::CredentialBase::serializationForBasicAuthorizationHeader const): Add helper to construct Basic auth header to replace duplicated logic in call sites. * platform/network/DataURLDecoder.cpp: (WebCore::DataURLDecoder::decodeBase64): (WebCore::DataURLDecoder::decodeEscaped): (WebCore::DataURLDecoder::decodeSynchronously): * platform/network/DataURLDecoder.h: Update to use new base64Decode. * platform/network/ResourceHandle.cpp: * platform/network/ResourceHandle.h: Switch to using Vector<uint8_t> for the data buffer in the synchronous load. * platform/network/SynchronousLoaderClient.cpp: (WebCore::SynchronousLoaderClient::didReceiveData): * platform/network/SynchronousLoaderClient.h: Switch to using Vector<uint8_t> buffer to match new loadResourceSynchronously signature. * platform/network/cf/ResourceHandleCFNet.cpp: (WebCore::applyBasicAuthorizationHeader): Use new serializationForBasicAuthorizationHeader() helper. (WebCore::ResourceHandle::platformLoadResourceSynchronously): Switch to using Vector<uint8_t> for the data buffer in the synchronous load. * platform/network/curl/ResourceHandleCurl.cpp: (WebCore::ResourceHandle::platformLoadResourceSynchronously): (WebCore::ResourceHandle::handleDataURL): Switch to using Vector<uint8_t> for the data buffer in the synchronous load. * platform/network/mac/ResourceHandleMac.mm: (WebCore::applyBasicAuthorizationHeader): Use new serializationForBasicAuthorizationHeader() helper. (WebCore::ResourceHandle::platformLoadResourceSynchronously): Switch to using Vector<uint8_t> for the data buffer in the synchronous load. * platform/network/soup/ResourceHandleSoup.cpp: (WebCore::ResourceHandle::platformLoadResourceSynchronously): Switch to using Vector<uint8_t> for the data buffer in the synchronous load. * platform/network/soup/SoupNetworkSession.cpp: (WebCore::HostTLSCertificateSet::computeCertificateHash): Update to use new base64EncodeToString(). * platform/text/DecodeEscapeSequences.h: (WebCore::decodeURLEscapeSequencesAsData): Switch to returning Vector<uint8_t>. * platform/text/QuotedPrintable.cpp: * platform/text/QuotedPrintable.h: (WebCore::lengthOfLineEndingAtIndex): (WebCore::quotedPrintableEncode): (WebCore::quotedPrintableDecode): Replace uses of Vector<char> with Vector<uint8_t> and the out parameters with Optional return values. * platform/win/SSLKeyGeneratorWin.cpp: (WebCore::signedPublicKeyAndChallengeString): Update to use new base64EncodeToString(). * workers/service/server/SWScriptStorage.cpp: (WebCore::SWScriptStorage::sha2Hash const): Update to use new base64URLEncodeToString(). Source/WebKit: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * UIProcess/API/C/WKPage.cpp: (WKPageSetPageNavigationClient): * UIProcess/WebPageProxy.messages.in: * UIProcess/WebURLSchemeHandler.h: * UIProcess/WebURLSchemeTask.cpp: (WebKit::WebURLSchemeTask::didComplete): * UIProcess/WebURLSchemeTask.h: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::loadResourceSynchronously): * WebProcess/Network/WebLoaderStrategy.h: * WebProcess/WebPage/WebURLSchemeHandlerProxy.cpp: (WebKit::WebURLSchemeHandlerProxy::loadSynchronously): * WebProcess/WebPage/WebURLSchemeHandlerProxy.h: Update to use uint8_t* data buffers more consistently for synchronous loads. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::sendReplyToSynchronousRequest): Update to use uint8_t* data buffers more consistently for synchronous loads. * NetworkProcess/PrivateClickMeasurementManager.cpp: (WebKit::PrivateClickMeasurementManager::fireConversionRequest): Update to use new base64URLDecode / base64URLEncodeToString(). * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::applyBasicAuthorizationHeader): Use new serializationForBasicAuthorizationHeader() helper. * Shared/API/APIData.h: (API::Data::create): (API::Data::fastFreeBytes): Deleted. Add new create function that takes ownership of a Vector's buffer rather than copying it. Replace use of static functions with inline lambdas for free-functions. * Shared/mac/AuxiliaryProcessMac.mm: (WebKit::sandboxFilePath): Use makeString and new base64URLEncoded(). * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm: (produceClientDataJson): Use new base64URLEncodeToString(). * UIProcess/Automation/cairo/WebAutomationSessionCairo.cpp: (WebKit::base64EncodedPNGData): Use new base64EncodeToString(). * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::webCryptoMasterKey): Use new defaultWebCryptoMasterKey() and new adopting API::Data::create function. * UIProcess/Inspector/glib/RemoteInspectorClient.cpp: (WebKit::RemoteInspectorClient::setBackendCommands): Use new base64EncodeToString(). * UIProcess/Inspector/gtk/RemoteWebInspectorUIProxyGtk.cpp: (WebKit::RemoteWebInspectorUIProxy::platformSave): Use new base64Decode(). * UIProcess/Inspector/gtk/WebInspectorUIProxyGtk.cpp: (WebKit::WebInspectorUIProxy::platformSave): Use new base64Decode(). * UIProcess/Inspector/mac/RemoteWebInspectorUIProxyMac.mm: (WebKit::RemoteWebInspectorUIProxy::platformSave): Use new base64Decode(). * UIProcess/Inspector/mac/WebInspectorUIProxyMac.mm: (WebKit::WebInspectorUIProxy::platformSave): Use new base64Decode(). * UIProcess/Inspector/socket/RemoteInspectorClient.cpp: (WebKit::RemoteInspectorClient::setBackendCommands): Use new base64EncodeToString(). * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm: (WebKit::LocalAuthenticatorInternal::produceHashSet): (WebKit::LocalAuthenticator::makeCredential): (WebKit::LocalAuthenticator::getAssertion): Use new base64EncodeToString(). * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp: (WebKit::MockHidConnection::feedReports): Use new base64Decode(). * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm: (WebKit::MockLocalConnection::filterResponses const): Use new base64EncodeToString(). Source/WebKitLegacy: * WebCoreSupport/WebResourceLoadScheduler.cpp: (WebResourceLoadScheduler::loadResourceSynchronously): * WebCoreSupport/WebResourceLoadScheduler.h: Update to match new signature. char -> uint8_t. Source/WebKitLegacy/mac: * WebCoreSupport/WebChromeClient.mm: (WebChromeClient::wrapCryptoKey const): (WebChromeClient::unwrapCryptoKey const): Update to use new Optional returning defaultWebCryptoMasterKey(). * WebCoreSupport/WebInspectorClient.mm: (WebInspectorFrontendClient::save): Update to use new Optional returning base64Decode(). Source/WTF: Bring base64 encoding/decoding up to more modern WebKit conventions by: - Replace use of "out parameter + bool" with Optional return values. - Using enum class for enumerations. - Replacing SignedOrUnsignedCharVectorAdapter/ConstSignedOrUnsignedCharVectorAdapter with appropriate function overloads. Also adds a new StringTypeAdapter for inline base64 encoding data in either makeString() or StringBuilder. To make this work, a few modifications were need to the base64Encode() functions to support the fixed size writeTo() function. First, the length of the encoded data is now computed up front depending on the policy. This has been extracted into a new calculateBase64EncodedSize() function used by both the adaptor and by base64Encode when passed a Vector. Previously, when encoding using some policies, the size was an overestimate and the resulting Vector would be resized down after encoding. Second, base64EncodeInternal was made into a template function to allow for two new base64Encode functions, one of which has a UChar* destination. These are used by the adaptor to write the encoded data. One additional small change is that now a optional map type parameter has been added to all the encoders to allow using either the default map or the URL one as defined in RFC 4648. This simplifies the implementation of the StringTypeAdapter and makes the base64URLEncode/base64URLDecode functions into simple convenience functions that use the right defaults for the generic encode/decode functions. * wtf/text/Base64.cpp: (WTF::base64EncodeInternal): (WTF::base64Encode): (WTF::base64DecodeInternal): (WTF::base64Decode): (WTF::base64URLDecode): (WTF::base64URLEncode): Deleted. * wtf/text/Base64.h: (WTF::base64Decode): (WTF::base64Encode): (WTF::base64URLEncode): (WTF::isBase64OrBase64URLCharacter): (WTF::calculateBase64EncodedSize): (WTF::base64Encoded): (WTF::base64URLEncoded): (WTF::StringTypeAdapter<Base64Specification>::StringTypeAdapter): (WTF::StringTypeAdapter<Base64Specification>::length const): (WTF::StringTypeAdapter<Base64Specification>::is8Bit const): (WTF::StringTypeAdapter<Base64Specification>::writeTo const): Tools: Update to use updated base64 and defaultWebCryptoMasterKey() related functions. * TestWebKitAPI/TCPServer.cpp: (TestWebKitAPI::TCPServer::startSecureConnection): (TestWebKitAPI::TCPServer::testCertificate): (TestWebKitAPI::TCPServer::testPrivateKey): * TestWebKitAPI/Tests/WebCore/ISOBox.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebCore/cocoa/PrivateClickMeasurementCocoa.mm: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebCore/cocoa/SerializedCryptoKeyWrap.mm: (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WebKitCocoa/Challenge.mm: (testIdentity2): * TestWebKitAPI/Tests/WebKitCocoa/EventAttribution.mm: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/mac/SSLKeyGenerator.mm: (TestWebKitAPI::TEST_F): * TestWebKitAPI/cocoa/HTTPServer.mm: (TestWebKitAPI::Connection::webSocketHandshake): Canonical link: https://commits.webkit.org/237912@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277740 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-19 18:43:29 +00:00
2021-05-19 Sam Weinig <weinig@apple.com>
Update Base64 encoding/decoding to match more modern WebKit conventions
https://bugs.webkit.org/show_bug.cgi?id=225920
Reviewed by Chris Dumez.
Bring base64 encoding/decoding up to more modern WebKit conventions by:
- Replace use of "out parameter + bool" with Optional return values.
- Using enum class for enumerations.
- Replacing SignedOrUnsignedCharVectorAdapter/ConstSignedOrUnsignedCharVectorAdapter
with appropriate function overloads.
Also adds a new StringTypeAdapter for inline base64 encoding data in either makeString()
or StringBuilder. To make this work, a few modifications were need to the base64Encode()
functions to support the fixed size writeTo() function.
First, the length of the encoded data is now computed up front depending on the policy.
This has been extracted into a new calculateBase64EncodedSize() function used by both
the adaptor and by base64Encode when passed a Vector. Previously, when encoding using
some policies, the size was an overestimate and the resulting Vector would be resized
down after encoding.
Second, base64EncodeInternal was made into a template function to allow for two new
base64Encode functions, one of which has a UChar* destination. These are used by the
adaptor to write the encoded data.
One additional small change is that now a optional map type parameter has been added
to all the encoders to allow using either the default map or the URL one as defined
in RFC 4648. This simplifies the implementation of the StringTypeAdapter and makes the
base64URLEncode/base64URLDecode functions into simple convenience functions that use
the right defaults for the generic encode/decode functions.
* wtf/text/Base64.cpp:
(WTF::base64EncodeInternal):
(WTF::base64Encode):
(WTF::base64DecodeInternal):
(WTF::base64Decode):
(WTF::base64URLDecode):
(WTF::base64URLEncode): Deleted.
* wtf/text/Base64.h:
(WTF::base64Decode):
(WTF::base64Encode):
(WTF::base64URLEncode):
(WTF::isBase64OrBase64URLCharacter):
(WTF::calculateBase64EncodedSize):
(WTF::base64Encoded):
(WTF::base64URLEncoded):
(WTF::StringTypeAdapter<Base64Specification>::StringTypeAdapter):
(WTF::StringTypeAdapter<Base64Specification>::length const):
(WTF::StringTypeAdapter<Base64Specification>::is8Bit const):
(WTF::StringTypeAdapter<Base64Specification>::writeTo const):
Make AirAllocateRegistersByGraphColoring use less memory https://bugs.webkit.org/show_bug.cgi?id=225848 Reviewed by Filip Pizlo. Source/JavaScriptCore: We've had some jetsam problems caused by the main Air register allocator, which caused us to lower Options::maximumTmpsForGraphColoring. Hence this patch tries to improve the memory usage of the allocator. It includes several changes: - Change the datastructure used for representing the interference graph. Before it was effectively a HashSet<std::pair<uint16_t, uint16_t>. Now, it is either a Bitvector (for n < 400 for now, can be tweaked easily), or a Vector<LikelyDenseUnsignedIntegerSet<uint16_t>> otherwise. LikelyDenseUnsignedIntegerSet is a new datastructure introduced by this patch, it is either a HashSet if very sparse, or a BitVector + an amount to shift it by. This is by far the largest memory reduction in this patch, it reduces the maximum memory used for an interference graph in tsf-wasm in JetStream2 from 16MB to 700kB, and in mruby-wasm.aotoki.dev from 262MB to 20MB (the later only happen when we increase Options::maximumTmpsForGraphColoring.. this is the exact function which caused us to lower it). Its effect on smaller functions in JetStream2 is rarely as dramatic but always an improvement, and improvements between 2x and 5x are extremely common (10x to 30x are significantly rarer but do occur). - In order to easily test this change and any further change to this datastructure, the old approach was preserved as InterferenceHashSet, and a template to run two such datastructures in parallel, checking their equivalence was added: InstrumentedInterferenceGraph. Running with it and reportInterferenceGraphMemoryUse set to true was used to compute the numbers given above. - There was already some template parameter to change the size of the tmp indices from unsigned to uint16_t but the code failed to compile unless it was unsigned. I fixed this, made more consistent use of it, and switched to uint16_t in the very common case that we have less than 65k Tmps (we can have more despite the option because of spilling). This halved the memory usage of various other datastructures in the register allocator - unspillableTmps was a HashSet<unsigned>. Since it is often quite dense (often around 20% on JetStream2), I replaced it by a Bitvector instead - m_biases was a HashMap<IndexType, HashSet<IndexType>>. Since it is extremely rare that the sets have more than 8 elements (from looking at some instrumented run of JetStream2), I replaced it by HashMap<IndexType, SmallSet<IndexType>>. This not only significantly reduces memory, but nearly halves the time spent in assignColors(around 80ms -> 40ms in JetStream 2) - UseCounts was needlessly general: it is only used by the register allocator (all other references to UseCounts refer to the completely different B3::UseCounts), so there is no point in it computing, and then storing lots of irrelevant data. A float is also more than enough precision (especially since it is pretty much always 1, 10, 100, or 1000 in practice…). Also, since we only need it indexed by Tmps, we can use a Vector with AbsoluteTmpMapper instead of its HashMap. These changes are not just memory savings, they also make selectSpill way faster (570ms -> 250ms on my machine on JetStream2) - While I was at it, I did a couple of other tweaks to the logic of selectSpill. In particular, instead of having to check for isFastTmp every time, I just put the fast tmps directly in unspillableTmps, which prevents them from getting added to m_spillWorklist in the first place. This + a bit of clean-up (for example putting an early exit instead of setting score to infinity in the case of dead tmps) resulted in a further perf win (to roughly 200ms spent in selectSpill() on JetStream2) All together, this patch reduces the time spent in the register allocator by roughly 15 to 20% in JetStream2 (tested both with the Briggs and the IRC allocators on my MBP 2019). I do not yet have precise performance numbers for this exact patch, but benchmarking a previous version of it (with a less optimized interference graph) resulted in significant RAMification improvements (around 1%), and more surprisingly some JetStream2 improvements on weaker machines (e.g. an iPhone 7 gained > 1%). I believe these gains come either from less trashing of the caches, or less contention caused by the memory traffic. I will try to update the bugzilla with more up-to-date thorough results when I get them. This patch does not increase Options::maximumTmpsForGraphColoring, I intend to do that in a separate patch to make it easier to revert in case of a problem. * b3/B3ReduceLoopStrength.cpp: (JSC::B3::ReduceLoopStrength::reduceByteCopyLoopsToMemcpy): * b3/air/AirAllocateRegistersAndStackByLinearScan.cpp: * b3/air/AirAllocateRegistersByGraphColoring.cpp: (JSC::B3::Air::allocateRegistersByGraphColoring): * b3/air/AirCode.h: (JSC::B3::Air::Code::forEachFastTmp const): * b3/air/AirUseCounts.h: (JSC::B3::Air::UseCounts::UseCounts): (JSC::B3::Air::UseCounts::isConstDef const): (JSC::B3::Air::UseCounts::numWarmUsesAndDefs const): (JSC::B3::Air::UseCounts::dump const): * parser/Nodes.h: Source/WTF: Two changes: the addition of LikelyDenseUnsignedIntegerSet, and various improvements to Small(Ptr)Set. The latter include: - Renaming SmallPtrSet into SmallSet, as it now supports integers as well as pointers. - Reducing its size by sharing the same storage for m_buffer and for m_smallStorage. This is safe to do, because all operations branch on isSmall() which depends purely on m_capacity. - Adding trivial size(), isEmpty() and memoryUse() methods - Adding a comment at the top of the file explaining when to use, and (more importantly) not to use SmallSet. LikelyDenseUnsignedIntegerSet is an even more specialized data structure, that can represent sets of unsigned integers very compactly if they are clustered. Finally I added an outOfLineMemoryUse() method to BitVector, making it more convenient to compare the memory consumption of different data structures in the register allocator. * WTF.xcodeproj/project.pbxproj: * wtf/BitVector.h: * wtf/CMakeLists.txt: * wtf/LikelyDenseUnsignedIntegerSet.cpp: Copied from Source/WTF/wtf/SmallPtrSet.cpp. * wtf/LikelyDenseUnsignedIntegerSet.h: Added. (WTF::LikelyDenseUnsignedIntegerSet::LikelyDenseUnsignedIntegerSet): (WTF::LikelyDenseUnsignedIntegerSet::~LikelyDenseUnsignedIntegerSet): (WTF::LikelyDenseUnsignedIntegerSet::contains const): (WTF::LikelyDenseUnsignedIntegerSet::add): (WTF::LikelyDenseUnsignedIntegerSet::size const): (WTF::LikelyDenseUnsignedIntegerSet::iterator::iterator): (WTF::LikelyDenseUnsignedIntegerSet::iterator::m_shift): (WTF::LikelyDenseUnsignedIntegerSet::iterator::operator++): (WTF::LikelyDenseUnsignedIntegerSet::iterator::operator* const): (WTF::LikelyDenseUnsignedIntegerSet::iterator::operator== const): (WTF::LikelyDenseUnsignedIntegerSet::iterator::operator!= const): (WTF::LikelyDenseUnsignedIntegerSet::begin const): (WTF::LikelyDenseUnsignedIntegerSet::end const): (WTF::LikelyDenseUnsignedIntegerSet::memoryUse const): (WTF::LikelyDenseUnsignedIntegerSet::validate const): (WTF::LikelyDenseUnsignedIntegerSet::isBitVector const): (WTF::LikelyDenseUnsignedIntegerSet::isValidValue const): (WTF::LikelyDenseUnsignedIntegerSet::transitionToHashSet): (WTF::LikelyDenseUnsignedIntegerSet::transitionToBitVector): * wtf/SmallPtrSet.h: Removed. * wtf/SmallSet.cpp: Renamed from Source/WTF/wtf/SmallPtrSet.cpp. * wtf/SmallSet.h: Added. Tools: Simply added some tests for SmallSet. * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/SmallSet.cpp: Added. (TestWebKitAPI::testSmallSetOfUnsigned): (TestWebKitAPI::testSmallSetOfPointers): (TestWebKitAPI::testVectorsOfSmallSetsOfUnsigned): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/237893@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277714 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-19 03:24:14 +00:00
2021-05-18 Robin Morisset <rmorisset@apple.com>
Make AirAllocateRegistersByGraphColoring use less memory
https://bugs.webkit.org/show_bug.cgi?id=225848
Reviewed by Filip Pizlo.
Two changes: the addition of LikelyDenseUnsignedIntegerSet, and various improvements to Small(Ptr)Set.
The latter include:
- Renaming SmallPtrSet into SmallSet, as it now supports integers as well as pointers.
- Reducing its size by sharing the same storage for m_buffer and for m_smallStorage.
This is safe to do, because all operations branch on isSmall() which depends purely on m_capacity.
- Adding trivial size(), isEmpty() and memoryUse() methods
- Adding a comment at the top of the file explaining when to use, and (more importantly) not to use SmallSet.
LikelyDenseUnsignedIntegerSet is an even more specialized data structure, that can represent sets of unsigned integers very compactly if they are clustered.
Finally I added an outOfLineMemoryUse() method to BitVector, making it more convenient to compare the memory consumption of different data structures in the register allocator.
* WTF.xcodeproj/project.pbxproj:
* wtf/BitVector.h:
* wtf/CMakeLists.txt:
* wtf/LikelyDenseUnsignedIntegerSet.cpp: Copied from Source/WTF/wtf/SmallPtrSet.cpp.
* wtf/LikelyDenseUnsignedIntegerSet.h: Added.
(WTF::LikelyDenseUnsignedIntegerSet::LikelyDenseUnsignedIntegerSet):
(WTF::LikelyDenseUnsignedIntegerSet::~LikelyDenseUnsignedIntegerSet):
(WTF::LikelyDenseUnsignedIntegerSet::contains const):
(WTF::LikelyDenseUnsignedIntegerSet::add):
(WTF::LikelyDenseUnsignedIntegerSet::size const):
(WTF::LikelyDenseUnsignedIntegerSet::iterator::iterator):
(WTF::LikelyDenseUnsignedIntegerSet::iterator::m_shift):
(WTF::LikelyDenseUnsignedIntegerSet::iterator::operator++):
(WTF::LikelyDenseUnsignedIntegerSet::iterator::operator* const):
(WTF::LikelyDenseUnsignedIntegerSet::iterator::operator== const):
(WTF::LikelyDenseUnsignedIntegerSet::iterator::operator!= const):
(WTF::LikelyDenseUnsignedIntegerSet::begin const):
(WTF::LikelyDenseUnsignedIntegerSet::end const):
(WTF::LikelyDenseUnsignedIntegerSet::memoryUse const):
(WTF::LikelyDenseUnsignedIntegerSet::validate const):
(WTF::LikelyDenseUnsignedIntegerSet::isBitVector const):
(WTF::LikelyDenseUnsignedIntegerSet::isValidValue const):
(WTF::LikelyDenseUnsignedIntegerSet::transitionToHashSet):
(WTF::LikelyDenseUnsignedIntegerSet::transitionToBitVector):
* wtf/SmallPtrSet.h: Removed.
* wtf/SmallSet.cpp: Renamed from Source/WTF/wtf/SmallPtrSet.cpp.
* wtf/SmallSet.h: Added.
Use WTF::Locker for locking BaseAudioContext's graph lock https://bugs.webkit.org/show_bug.cgi?id=225935 Reviewed by Sam Weinig. Source/WebCore: Use WTF::Locker for locking BaseAudioContext's graph lock instead of our own AutoLocker. Also use WTF::RecursiveLock instead of duplicating the recursive locking logic inside BaseAudioContext. This means we no longer need lock() / tryLock() / unlock() functions on BaseAudioContext. We now expose the BaseAudioContext's RecursiveLock via a graphLock() getter and the caller sites can just use a Locker. * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::setBuffer): * Modules/webaudio/AudioNode.cpp: (WebCore::AudioNode::connect): (WebCore::AudioNode::disconnect): (WebCore::AudioNode::setChannelCount): (WebCore::AudioNode::setChannelCountMode): (WebCore::AudioNode::setChannelInterpretation): (WebCore::AudioNode::enableOutputsIfNecessary): (WebCore::AudioNode::decrementConnectionCount): (WebCore::AudioNode::deref): * Modules/webaudio/AudioWorkletNode.cpp: (WebCore::AudioWorkletNode::create): * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::uninitialize): (WebCore::BaseAudioContext::refSourceNode): (WebCore::BaseAudioContext::addDeferredDecrementConnectionCount): (WebCore::BaseAudioContext::handlePreRenderTasks): (WebCore::BaseAudioContext::outputPosition): (WebCore::BaseAudioContext::handlePostRenderTasks): (WebCore::BaseAudioContext::deleteMarkedNodes): (WebCore::BaseAudioContext::removeMarkedSummingJunction): (WebCore::BaseAudioContext::handleDirtyAudioSummingJunctions): (WebCore::BaseAudioContext::handleDirtyAudioNodeOutputs): * Modules/webaudio/BaseAudioContext.h: (WebCore::BaseAudioContext::graphLock): (WebCore::BaseAudioContext::isGraphOwner const): * Modules/webaudio/ChannelMergerNode.cpp: (WebCore::ChannelMergerNode::ChannelMergerNode): * Modules/webaudio/ConvolverNode.cpp: (WebCore::ConvolverNode::setBuffer): * Modules/webaudio/MediaElementAudioSourceNode.cpp: (WebCore::MediaElementAudioSourceNode::setFormat): * Modules/webaudio/MediaStreamAudioSourceNode.cpp: (WebCore::MediaStreamAudioSourceNode::setFormat): * Modules/webaudio/OfflineAudioContext.cpp: (WebCore::OfflineAudioContext::suspendRendering): (WebCore::OfflineAudioContext::shouldSuspend): (WebCore::OfflineAudioContext::didSuspendRendering): * Modules/webaudio/OfflineAudioContext.h: * Modules/webaudio/WaveShaperNode.cpp: (WebCore::WaveShaperNode::setOversample): Source/WTF: * wtf/RecursiveLockAdapter.h: (WTF::RecursiveLockAdapter::isOwner const): Add isOwner() function that returns true if the current thread is holding the lock. This is needed for WebAudio purposes. Canonical link: https://commits.webkit.org/237890@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277709 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-19 01:51:47 +00:00
2021-05-18 Chris Dumez <cdumez@apple.com>
Use WTF::Locker for locking BaseAudioContext's graph lock
https://bugs.webkit.org/show_bug.cgi?id=225935
Reviewed by Sam Weinig.
* wtf/RecursiveLockAdapter.h:
(WTF::RecursiveLockAdapter::isOwner const):
Add isOwner() function that returns true if the current thread is holding the lock.
This is needed for WebAudio purposes.
[macOS] Titlebar separator doesn't show when WKWebView is scrolled https://bugs.webkit.org/show_bug.cgi?id=220633 <rdar://problem/71094055> Reviewed by Darin Adler. Source/WebKit: Starting in Big Sur, NSWindows with a titlebar display a separator if there is a scrolled NSScrollView adjacent to the titlebar. Since WKWebViews are scrollable views, but not backed by NSScrollView, we need to adopt SPI to support this functionality. This patch updates WKWebView to conform to the NSScrollViewSeparatorTrackingAdapter protocol, ensuring the titlebar separator is displayed when necessary. Note that since WKWebViews are not actually NSScrollView's we don't already have the scroll position of the view in the UIProcess. To determine whether or not the view is scrolled, this patch adds plumbing so that the WebProcess can tell the UIProcess the new scroll position when a page is scrolled. Tests: WKWebViewTitlebarSeparatorTests.BackForwardCache WKWebViewTitlebarSeparatorTests.ChangeTitlebarAdjacency WKWebViewTitlebarSeparatorTests.ChangeViewVisibility WKWebViewTitlebarSeparatorTests.NavigationResetsTitlebarAppearance WKWebViewTitlebarSeparatorTests.ParentWhileScrolled WKWebViewTitlebarSeparatorTests.ScrollWithTitlebarAdjacency WKWebViewTitlebarSeparatorTests.ScrollWithoutTitlebarAdjacency * Platform/spi/mac/AppKitSPI.h: * UIProcess/API/mac/WKView.mm: (-[WKView scrollViewFrame]): (-[WKView hasScrolledContentsUnderTitlebar]): * UIProcess/API/mac/WKWebViewMac.mm: (-[WKWebView scrollViewFrame]): (-[WKWebView hasScrolledContentsUnderTitlebar]): * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::updateWindowAndViewFrames): If the WKWebView's frame changes, update the titlebar adjacency state and notify observers of the change. (WebKit::WebViewImpl::viewWillMoveToWindowImpl): Unregister the WKWebView as an NSScrollViewSeparatorTrackingAdapter if it is removed from the window. (WebKit::WebViewImpl::viewDidHide): Hidden views are not adjacent to the titlebar. (WebKit::WebViewImpl::viewDidUnhide): An unhidden view may be adjacent to the titlebar. (WebKit::WebViewImpl::pageDidScroll): Use the scroll position of the page to determine whether or not the WKWebView is scrolled. (WebKit::WebViewImpl::scrollViewFrame): Needed to conform to NSScrollViewSeparatorTrackingAdapter. (WebKit::WebViewImpl::hasScrolledContentsUnderTitlebar): Needed to conform to NSScrollViewSeparatorTrackingAdapter. Returns true if the view is registered as an NSScrollViewSeparatorTrackingAdapter and is scrolled. (WebKit::WebViewImpl::updateTitlebarAdjacencyState): The WKWebView needs to be registered as an NSScrollViewSeparatorTrackingAdapter if it's adjacent to the titlebar and unregistered otherwise. * UIProcess/PageClient.h: (WebKit::PageClient::pageDidScroll): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::pageDidScroll): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/mac/PageClientImplMac.h: * UIProcess/mac/PageClientImplMac.mm: (WebKit::PageClientImpl::didCommitLoadForMainFrame): Reset the scroll position upon navigation, as pageDidScroll does not get called when navigating. (WebKit::PageClientImpl::pageDidScroll): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::pageDidScroll): Pass the current scroll position when the page is scrolled, so that the UIProcess knows whether or not the page has a non-zero scroll position. Source/WTF: * wtf/PlatformHave.h: Defined HAVE_NSSCROLLVIEW_SEPARATOR_TRACKING_ADAPTER. Tools: Added API tests to verify that the delegate implementation returns the correct value for `hasScrolledContentsUnderTitlebar` depending on the view's scroll position, visibility, and frame. * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/TestWebKitAPI/mac/AppKitSPI.h: * TestWebKitAPI/Tests/mac/WKWebViewTitlebarSeparatorTests.mm: Added. (-[TitlebarSeparatorTestWKWebView initWithFrame:configuration:]): (-[TitlebarSeparatorTestWKWebView separatorTrackingAdapter]): (BackForwardCache): (ChangeTitlebarAdjacency): (ChangeViewVisibility): (NavigationResetsTitlebarAppearance): (ParentWhileScrolled): (ScrollWithTitlebarAdjacency): (ScrollWithoutTitlebarAdjacency): Canonical link: https://commits.webkit.org/237884@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277688 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-18 23:15:23 +00:00
2021-05-18 Aditya Keerthi <akeerthi@apple.com>
[macOS] Titlebar separator doesn't show when WKWebView is scrolled
https://bugs.webkit.org/show_bug.cgi?id=220633
<rdar://problem/71094055>
Reviewed by Darin Adler.
* wtf/PlatformHave.h: Defined HAVE_NSSCROLLVIEW_SEPARATOR_TRACKING_ADAPTER.
2021-05-18 Yoshiaki Jitsukawa <yoshiaki.jitsukawa@sony.com>
[PlayStation] Fix PlayStation port
https://bugs.webkit.org/show_bug.cgi?id=225913
Reviewed by Don Olmstead.
Fix PlayStation port
* wtf/PlatformPlayStation.cmake: Rename
PLAYSTATION_COPY_SHARED_LIBRARIES to PLAYSTATION_COPY_REQUIREMENTS.
2021-05-17 Saam Barati <sbarati@apple.com>
Enable JS to emit sign posts and trace points under Options::exposeProfilersOnGlobalObject
https://bugs.webkit.org/show_bug.cgi?id=225895
Reviewed by Yusuke Suzuki.
* wtf/SystemTracing.h:
[GPU Process] Object identifiers with the deleted value should cause MESSAGE_CHECKs https://bugs.webkit.org/show_bug.cgi?id=225886 rdar://78114708 Reviewed by Chris Dumez. Source/WebCore: Implement some stricter validation around object identifiers in when decoding display list items in the GPU Process. Currently, we only check for the empty value (i.e. raw identifier value of 0) when iterating over these items, but treat an identifier with the deleted value as valid; instead, we should be treating items with either empty or deleted identifiers as invalid. To address this, we introduce a new helper method, `ObjectIdentifier::isValid`, and turn existing checks for `!!identifier` into `identifier.isValid()`. Test: DisplayListTests.InlineItemValidationFailure * platform/graphics/displaylists/DisplayListItems.h: (WebCore::DisplayList::ClipToImageBuffer::isValid const): (WebCore::DisplayList::DrawImageBuffer::isValid const): (WebCore::DisplayList::DrawNativeImage::isValid const): (WebCore::DisplayList::DrawPattern::isValid const): (WebCore::DisplayList::PaintFrameForMedia::isValid const): (WebCore::DisplayList::FlushContext::isValid const): (WebCore::DisplayList::MetaCommandChangeItemBuffer::isValid const): (WebCore::DisplayList::MetaCommandChangeDestinationImageBuffer::isValid const): Source/WebKit: See WebCore/ChangeLog for more details. Use `ObjectIdentifier::isValid()` instead of just checking for the empty value, when determining whether an object identifier should trigger a message check to the web process. * GPUProcess/graphics/RemoteRenderingBackend.cpp: (WebKit::RemoteRenderingBackend::nextDestinationImageBufferAfterApplyingDisplayLists): Source/WTF: See WebCore/ChangeLog for more details. Add a helper method on `ObjectIdentifier` that returns true only if it is the empty value or deleted value. * wtf/ObjectIdentifier.h: (WTF::ObjectIdentifier::isValid const): Tools: Adjust an existing API test to verify that the deleted object identifier value triggers an inline item decoding failure. * TestWebKitAPI/Tests/WebCore/cg/DisplayListTestsCG.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/237842@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277631 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-18 02:33:16 +00:00
2021-05-17 Wenson Hsieh <wenson_hsieh@apple.com>
[GPU Process] Object identifiers with the deleted value should cause MESSAGE_CHECKs
https://bugs.webkit.org/show_bug.cgi?id=225886
rdar://78114708
Reviewed by Chris Dumez.
See WebCore/ChangeLog for more details. Add a helper method on `ObjectIdentifier` that returns true only if it
is the empty value or deleted value.
* wtf/ObjectIdentifier.h:
(WTF::ObjectIdentifier::isValid const):
Use kAudioObjectPropertyElementMain where available https://bugs.webkit.org/show_bug.cgi?id=224635 Patch by Alex Christensen <achristensen@webkit.org> on 2021-05-17 Reviewed by Eric Carlson. Source/WebCore: * platform/audio/mac/AudioHardwareListenerMac.cpp: (WebCore::isAudioHardwareProcessRunning): (WebCore::currentDeviceSupportedBufferSizes): (WebCore::processIsRunningPropertyDescriptor): (WebCore::outputDevicePropertyDescriptor): * platform/audio/mac/AudioSessionMac.mm: (WebCore::defaultDevice): (WebCore::defaultDeviceTransportIsBluetooth): (WebCore::AudioSessionPrivate::addSampleRateObserverIfNeeded): (WebCore::AudioSessionPrivate::addBufferSizeObserverIfNeeded): (WebCore::AudioSession::sampleRate const): (WebCore::AudioSession::bufferSize const): (WebCore::AudioSession::maximumNumberOfOutputChannels const): (WebCore::AudioSession::setPreferredBufferSize): (WebCore::AudioSession::isMuted const): (WebCore::AudioSession::addMutedStateObserver): (WebCore::AudioSession::removeMutedStateObserver): * platform/mediastream/mac/CoreAudioCaptureDevice.cpp: (WebCore::getDeviceInfo): (WebCore::CoreAudioCaptureDevice::CoreAudioCaptureDevice): (WebCore::CoreAudioCaptureDevice::relatedAudioDeviceIDs): * platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp: (WebCore::deviceHasInputStreams): (WebCore::deviceHasOutputStreams): (WebCore::isValidCaptureDevice): (WebCore::CoreAudioCaptureDeviceManager::coreAudioCaptureDevices): (WebCore::computeAudioDeviceList): * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioSharedUnit::defaultOutputDevice): Source/WTF: * wtf/PlatformHave.h: Canonical link: https://commits.webkit.org/237824@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277607 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-17 21:26:59 +00:00
2021-05-17 Alex Christensen <achristensen@webkit.org>
Use kAudioObjectPropertyElementMain where available
https://bugs.webkit.org/show_bug.cgi?id=224635
Reviewed by Eric Carlson.
* wtf/PlatformHave.h:
Modernize / Optimize SQLiteStatement creation and preparation https://bugs.webkit.org/show_bug.cgi?id=225791 Reviewed by Sam Weinig. Source/WebCore: Modernize / Optimize SQLiteStatement creation and preparation: - The SQLiteStatement constructor is now private so that we never have a SQLiteStatement that has not been "prepared". Only the SQLiteDatabase can now construct SQLiteStatement objects. We already needed to pass a SQLiteDatabase reference when constructing the SQLiteStatement anyway. - The construct AND prepare a SQLiteStatement, we now call SQLiteDatabase::prepareStatement() to get a stack object or SQLiteDatabase::prepareHeapStatement() to get a heap one. These functions return an Expected<> type so they will either return a "prepared" SQLiteStatement or an unexpected SQLite error code. - The prepare*Statement() functions now avoid String allocations in most cases thanks to overloads taking in the query as an ASCIILiteral. - Drop finalize() function on SQLiteStatement so SQLiteStatement objects are always valid. It simplifies the implementation of SQLiteStatement member functions. The SQLiteStatement destructor "finalizes" the statement so users can simply destroy the SQLiteStatement if they need the object to be finalize at a certain point (e.g. before closing a database). - Drop the prepare() & prepareAndStep() SQLiteStatement member functions now that SQLiteStatement are always prepared. - Stop storing the SQL query as a String data member in SQLiteStatement class. This is no longer needed now that they is no separe prepare step after the construction. This makes the SQLiteStatement a bit smaller. * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: (WebCore::IDBServer::createOrMigrateRecordsTableIfNecessary): (WebCore::IDBServer::SQLiteIDBBackingStore::ensureValidBlobTables): (WebCore::IDBServer::SQLiteIDBBackingStore::ensureValidIndexRecordsTable): (WebCore::IDBServer::SQLiteIDBBackingStore::ensureValidIndexRecordsIndex): (WebCore::IDBServer::SQLiteIDBBackingStore::ensureValidIndexRecordsRecordIndex): (WebCore::IDBServer::SQLiteIDBBackingStore::createAndPopulateInitialDatabaseInfo): (WebCore::IDBServer::SQLiteIDBBackingStore::ensureValidObjectStoreInfoTable): (WebCore::IDBServer::SQLiteIDBBackingStore::migrateIndexInfoTableForIDUpdate): (WebCore::IDBServer::SQLiteIDBBackingStore::migrateIndexRecordsTableForIDUpdate): (WebCore::IDBServer::SQLiteIDBBackingStore::extractExistingDatabaseInfo): (WebCore::IDBServer::SQLiteIDBBackingStore::databaseNameAndVersionFromFile): (WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction): (WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore): (WebCore::IDBServer::SQLiteIDBBackingStore::cachedStatement): * Modules/indexeddb/server/SQLiteIDBCursor.cpp: (WebCore::IDBServer::SQLiteIDBCursor::createSQLiteStatement): (WebCore::IDBServer::SQLiteIDBCursor::resetAndRebindPreIndexStatementIfNecessary): (WebCore::IDBServer::SQLiteIDBCursor::internalFetchNextRecord): * Modules/webdatabase/Database.cpp: (WebCore::setTextValueInDatabase): (WebCore::retrieveTextResultFromDatabase): (WebCore::Database::performGetTableNames): * Modules/webdatabase/DatabaseTracker.cpp: (WebCore::DatabaseTracker::hasEntryForOriginNoLock): (WebCore::DatabaseTracker::hasEntryForDatabase): (WebCore::DatabaseTracker::fullPathForDatabaseNoLock): (WebCore::DatabaseTracker::origins): (WebCore::DatabaseTracker::databaseNamesNoLock): (WebCore::DatabaseTracker::detailsForNameAndOrigin): (WebCore::DatabaseTracker::setDatabaseDetails): (WebCore::DatabaseTracker::quotaNoLock): (WebCore::DatabaseTracker::setQuota): (WebCore::DatabaseTracker::addDatabase): (WebCore::DatabaseTracker::deleteOrigin): (WebCore::DatabaseTracker::deleteDatabase): (WebCore::DatabaseTracker::removeDeletedOpenedDatabases): (WebCore::DatabaseTracker::deleteDatabaseFileIfEmpty): * Modules/webdatabase/SQLStatement.cpp: (WebCore::SQLStatement::execute): * loader/appcache/ApplicationCacheStorage.cpp: (WebCore::ApplicationCacheStorage::loadCacheGroup): (WebCore::ApplicationCacheStorage::loadManifestHostHashes): (WebCore::ApplicationCacheStorage::cacheGroupForURL): (WebCore::ApplicationCacheStorage::fallbackCacheGroupForURL): (WebCore::ApplicationCacheStorage::calculateQuotaForOrigin): (WebCore::ApplicationCacheStorage::calculateUsageForOrigin): (WebCore::ApplicationCacheStorage::calculateRemainingSizeForOriginExcludingCache): (WebCore::ApplicationCacheStorage::storeUpdatedQuotaForOrigin): (WebCore::ApplicationCacheStorage::verifySchemaVersion): (WebCore::ApplicationCacheStorage::executeStatement): (WebCore::ApplicationCacheStorage::store): (WebCore::ApplicationCacheStorage::storeUpdatedType): (WebCore::ApplicationCacheStorage::ensureOriginRecord): (WebCore::ApplicationCacheStorage::storeNewestCache): (WebCore::ApplicationCacheStorage::loadCache): (WebCore::ApplicationCacheStorage::remove): (WebCore::ApplicationCacheStorage::manifestURLs): (WebCore::ApplicationCacheStorage::deleteCacheGroupRecord): (WebCore::ApplicationCacheStorage::checkForDeletedResources): (WebCore::ApplicationCacheStorage::flatFileAreaSize): * platform/network/curl/CookieJarDB.cpp: (WebCore::CookieJarDB::verifySchemaVersion): (WebCore::CookieJarDB::checkDatabaseValidity): (WebCore::CookieJarDB::searchCookies): (WebCore::CookieJarDB::getAllCookies): (WebCore::CookieJarDB::allDomains): (WebCore::CookieJarDB::createPrepareStatement): (WebCore::CookieJarDB::executeSql): * platform/sql/SQLiteDatabase.cpp: (WebCore::SQLiteDatabase::open): (WebCore::SQLiteDatabase::useWALJournalMode): (WebCore::SQLiteDatabase::maximumSize): (WebCore::SQLiteDatabase::setMaximumSize): (WebCore::SQLiteDatabase::pageSize): (WebCore::SQLiteDatabase::freeSpaceSize): (WebCore::SQLiteDatabase::totalSize): (WebCore::SQLiteDatabase::executeCommand): (WebCore::SQLiteDatabase::returnsAtLeastOneResult): (WebCore::SQLiteDatabase::tableExists): (WebCore::SQLiteDatabase::clearAllTables): (WebCore::SQLiteDatabase::turnOnIncrementalAutoVacuum): (WebCore::constructAndPrepareStatement): (WebCore::SQLiteDatabase::prepareStatement): (WebCore::SQLiteDatabase::prepareHeapStatement): * platform/sql/SQLiteDatabase.h: * platform/sql/SQLiteStatement.cpp: (WebCore::SQLiteStatement::SQLiteStatement): (WebCore::SQLiteStatement::~SQLiteStatement): (WebCore::SQLiteStatement::step): (WebCore::SQLiteStatement::reset): (WebCore::SQLiteStatement::executeCommand): (WebCore::SQLiteStatement::returnsAtLeastOneResult): (WebCore::SQLiteStatement::bindBlob): (WebCore::SQLiteStatement::bindText): (WebCore::SQLiteStatement::bindInt): (WebCore::SQLiteStatement::bindInt64): (WebCore::SQLiteStatement::bindDouble): (WebCore::SQLiteStatement::bindNull): (WebCore::SQLiteStatement::bindParameterCount const): (WebCore::SQLiteStatement::columnCount): (WebCore::SQLiteStatement::isColumnNull): (WebCore::SQLiteStatement::isColumnDeclaredAsBlob): (WebCore::SQLiteStatement::getColumnName): (WebCore::SQLiteStatement::getColumnValue): (WebCore::SQLiteStatement::getColumnText): (WebCore::SQLiteStatement::getColumnDouble): (WebCore::SQLiteStatement::getColumnInt): (WebCore::SQLiteStatement::getColumnInt64): (WebCore::SQLiteStatement::getColumnBlobAsString): (WebCore::SQLiteStatement::getColumnBlobAsVector): (WebCore::SQLiteStatement::returnTextResults): (WebCore::SQLiteStatement::returnIntResults): (WebCore::SQLiteStatement::returnInt64Results): (WebCore::SQLiteStatement::returnDoubleResults): * platform/sql/SQLiteStatement.h: * platform/win/SearchPopupMenuDB.cpp: (WebCore::SearchPopupMenuDB::checkDatabaseValidity): (WebCore::SearchPopupMenuDB::verifySchemaVersion): (WebCore::SearchPopupMenuDB::executeSimpleSql): (WebCore::SearchPopupMenuDB::createPreparedStatement): * workers/service/server/RegistrationDatabase.cpp: (WebCore::RegistrationDatabase::ensureValidRecordsTable): (WebCore::RegistrationDatabase::doPushChanges): (WebCore::RegistrationDatabase::importRecords): Source/WebKit: Update code base now that the SQLiteDatabase & SQLiteStatement API has changed. Also use more ASCIILiterals. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::ResourceLoadStatisticsDatabaseStore::openITPDatabase): (WebKit::ResourceLoadStatisticsDatabaseStore::checkForMissingTablesInSchema): (WebKit::ResourceLoadStatisticsDatabaseStore::enableForeignKeys): (WebKit::ResourceLoadStatisticsDatabaseStore::currentTableAndIndexQueries): (WebKit::ResourceLoadStatisticsDatabaseStore::missingUniqueIndices): (WebKit::ResourceLoadStatisticsDatabaseStore::migrateDataToNewTablesIfNecessary): (WebKit::ResourceLoadStatisticsDatabaseStore::columnsForTable): (WebKit::ResourceLoadStatisticsDatabaseStore::addMissingColumnsToTable): (WebKit::ResourceLoadStatisticsDatabaseStore::renameColumnInTable): (WebKit::ResourceLoadStatisticsDatabaseStore::openAndUpdateSchemaIfNecessary): (WebKit::ResourceLoadStatisticsDatabaseStore::scopedStatement const): (WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationshipList): (WebKit::ResourceLoadStatisticsDatabaseStore::aggregatedThirdPartyData const): (WebKit::ResourceLoadStatisticsDatabaseStore::incrementRecordsDeletedCountForDomains): (WebKit::ResourceLoadStatisticsDatabaseStore::recursivelyFindNonPrevalentDomainsThatRedirectedToThisDomain): (WebKit::ResourceLoadStatisticsDatabaseStore::markAsPrevalentIfHasRedirectedToPrevalent): (WebKit::ResourceLoadStatisticsDatabaseStore::findNotVeryPrevalentResources): (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess): (WebKit::ResourceLoadStatisticsDatabaseStore::grandfatherDataForDomains): (WebKit::ResourceLoadStatisticsDatabaseStore::clearTopFrameUniqueRedirectsToSinceSameSiteStrictEnforcement): (WebKit::ResourceLoadStatisticsDatabaseStore::clearUserInteraction): (WebKit::ResourceLoadStatisticsDatabaseStore::setDomainsAsPrevalent): (WebKit::ResourceLoadStatisticsDatabaseStore::cookieAccess): (WebKit::ResourceLoadStatisticsDatabaseStore::hasUserGrantedStorageAccessThroughPrompt): (WebKit::ResourceLoadStatisticsDatabaseStore::domainsToBlockAndDeleteCookiesFor const): (WebKit::ResourceLoadStatisticsDatabaseStore::domainsToBlockButKeepCookiesFor const): (WebKit::ResourceLoadStatisticsDatabaseStore::domainsWithUserInteractionAsFirstParty const): (WebKit::ResourceLoadStatisticsDatabaseStore::domainsWithStorageAccess const): (WebKit::ResourceLoadStatisticsDatabaseStore::domains const): (WebKit::ResourceLoadStatisticsDatabaseStore::clearGrandfathering): (WebKit::ResourceLoadStatisticsDatabaseStore::pruneStatisticsIfNeeded): (WebKit::ResourceLoadStatisticsDatabaseStore::isCorrectSubStatisticsCount): (WebKit::ResourceLoadStatisticsDatabaseStore::appendSubStatisticList const): (WebKit::ResourceLoadStatisticsDatabaseStore::updateOperatingDatesParameters): (WebKit::ResourceLoadStatisticsDatabaseStore::includeTodayAsOperatingDateIfNecessary): (WebKit::ResourceLoadStatisticsDatabaseStore::insertExpiredStatisticForTesting): (WebKit::ResourceLoadStatisticsDatabaseStore::insertPrivateClickMeasurement): (WebKit::ResourceLoadStatisticsDatabaseStore::privateClickMeasurementToString): (WebKit::ResourceLoadStatisticsDatabaseStore::clearSentAttribution): (WebKit::ResourceLoadStatisticsDatabaseStore::markAttributedPrivateClickMeasurementsAsExpiredForTesting): * NetworkProcess/WebStorage/LocalStorageDatabase.cpp: (WebKit::LocalStorageDatabase::migrateItemTableIfNeeded): (WebKit::LocalStorageDatabase::databaseIsEmpty const): (WebKit::LocalStorageDatabase::scopedStatement const): * NetworkProcess/WebStorage/LocalStorageDatabase.h: * UIProcess/API/glib/IconDatabase.cpp: (WebKit::IconDatabase::IconDatabase): (WebKit::IconDatabase::populatePageURLToIconURLMap): (WebKit::IconDatabase::pruneTimerFired): (WebKit::IconDatabase::iconIDForIconURL): (WebKit::IconDatabase::setIconIDForPageURL): (WebKit::IconDatabase::iconData): (WebKit::IconDatabase::addIcon): (WebKit::IconDatabase::updateIconTimestamp): (WebKit::IconDatabase::deleteIcon): Source/WebKitLegacy: Update code base now that the SQLiteDatabase & SQLiteStatement API has changed. Also use more ASCIILiterals. * Storage/StorageAreaSync.cpp: (WebKit::StorageAreaSync::migrateItemTableIfNeeded): (WebKit::StorageAreaSync::performImport): (WebKit::StorageAreaSync::sync): (WebKit::StorageAreaSync::deleteEmptyDatabase): * Storage/StorageTracker.cpp: (WebKit::StorageTracker::syncImportOriginIdentifiers): (WebKit::StorageTracker::syncSetOriginDetails): (WebKit::StorageTracker::syncDeleteAllOrigins): (WebKit::StorageTracker::syncDeleteOrigin): (WebKit::StorageTracker::databasePathForOrigin): Source/WTF: Allow constructing a UniqueRef<> from a C++ reference. std::unique_ptr<>() can be constructed using a raw pointer and we can construct a UniqueRef<> from a std::unique_ptr<>() so I see no reason not to allow that. The reason I needed this is that I want to prevent call sites from allocating SQLiteStatement without going through the SQLiteDatabase. As a result, I made the SQLiteStatement constructor private and marked SQLiteDatabase as a friend class. SQLiteDatabase has to heap-allocate a SQLiteStatement via new and then construct a UniqueRef<> for it. SQLiteDatabase cannot use makeUniqueRef() because the SQLiteStatement constructor is private. I also cannot mark makeUniqueRef() as a friend function of SQLiteStatement or anybody could heap allocate a SQLiteStatement via makeUniqueRef (not just the SQLiteDatabase). * wtf/UniqueRef.h: (WTF::UniqueRef::UniqueRef): Tools: Update code base now that the SQLiteDatabase & SQLiteStatement API has changed. Also use more ASCIILiterals. * TestWebKitAPI/Tests/WebCore/cocoa/DatabaseTrackerTest.mm: (TestWebKitAPI::addToDatabasesTable): Canonical link: https://commits.webkit.org/237799@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277571 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-16 17:18:30 +00:00
2021-05-16 Chris Dumez <cdumez@apple.com>
Modernize / Optimize SQLiteStatement creation and preparation
https://bugs.webkit.org/show_bug.cgi?id=225791
Reviewed by Sam Weinig.
Allow constructing a UniqueRef<> from a C++ reference. std::unique_ptr<>() can be constructed
using a raw pointer and we can construct a UniqueRef<> from a std::unique_ptr<>() so I see
no reason not to allow that.
The reason I needed this is that I want to prevent call sites from allocating SQLiteStatement
without going through the SQLiteDatabase. As a result, I made the SQLiteStatement constructor
private and marked SQLiteDatabase as a friend class. SQLiteDatabase has to heap-allocate
a SQLiteStatement via new and then construct a UniqueRef<> for it. SQLiteDatabase cannot use
makeUniqueRef() because the SQLiteStatement constructor is private. I also cannot mark
makeUniqueRef() as a friend function of SQLiteStatement or anybody could heap allocate a
SQLiteStatement via makeUniqueRef (not just the SQLiteDatabase).
* wtf/UniqueRef.h:
(WTF::UniqueRef::UniqueRef):
Delete WebSQL code from WebKit2 https://bugs.webkit.org/show_bug.cgi?id=225739 Reviewed by Sihui Liu. Source/WebCore: * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setWebSQLEnabled): Replaced setWebSQLDisabled. Source/WebKit: Deleted WebSQL code. We keep some code for website data store since it's possible for user's device to still have WebSQL data, and we should be able to delete them. * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::monitoredDataTypes): * Shared/WebProcessDataStoreParameters.h: (WebKit::WebProcessDataStoreParameters::encode const): (WebKit::WebProcessDataStoreParameters::decode): * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetWebSQLDisabled): (WKPreferencesGetWebSQLDisabled): * UIProcess/API/C/WKPreferencesRef.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::webProcessDataStoreParameters): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::setWebsiteDataStoreParameters): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformSetWebsiteDataStoreParameters): Source/WebKitLegacy/mac: * WebView/WebView.mm: (-[WebView _preferencesChanged:]): Source/WebKitLegacy/win: * WebView.cpp: (WebView::notifyPreferencesChanged): Source/WTF: Deleted the experimental feature to disable WebSQL since we've been shipping this, and made the flag to selectively enable WebSQL in WebKit1 an internal debug setting since nobody should be enabling this now. * Scripts/Preferences/WebPreferencesExperimental.yaml: * Scripts/Preferences/WebPreferencesInternal.yaml: Tools: * MiniBrowser/playstation/WebContext.cpp: (WebContext::WebContext): * TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm: (runWebsiteDataStoreCustomPaths): * WebKitTestRunner/TestController.cpp: (WTR::TestController::configureWebsiteDataStoreTemporaryDirectories): Canonical link: https://commits.webkit.org/237792@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-16 06:36:30 +00:00
2021-05-15 Ryosuke Niwa <rniwa@webkit.org>
Delete WebSQL code from WebKit2
https://bugs.webkit.org/show_bug.cgi?id=225739
Reviewed by Sihui Liu.
Deleted the experimental feature to disable WebSQL since we've been shipping this,
and made the flag to selectively enable WebSQL in WebKit1 an internal debug setting
since nobody should be enabling this now.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
* Scripts/Preferences/WebPreferencesInternal.yaml:
Allow conditionally enabling OffscreenCanvas only for non-worker contexts https://bugs.webkit.org/show_bug.cgi?id=225845 Reviewed by Darin Adler. .: * Source/cmake/OptionsGTK.cmake: * Source/cmake/OptionsWPE.cmake: * Source/cmake/WebKitFeatures.cmake: Match current behavior of ENABLE_OFFSCREEN_CANVAS for ENABLE_OFFSCREEN_CANVAS_IN_WORKERS. Source/WebCore: Enable both compile time and runtime conditional enablement of just the non-worker OffscreenCanvas code path. To make this work a new IDL extended attribute was needed, ConditionalForWorker=FOO, which allows specifying an additional macro to check for whether the constructor should be exposed on workers. Ideally this would be generic for any context type, but at the moment, the limited syntax of extended attributes makes that hard. If generalization is needed (or a similar syntax is needed for something else) this can be revisited. To support runtime conditional exposure, the existing EnabledForContext, which calls a static function on the implementation class passing the ScriptExecutationContext is used. If conditional per context type ever becomes a common thing, we should add another extended attribute (and add syntax to support like above) that allows specifying both the context type and the setting name. Other than that, uses of ENABLE_OFFSCREEN_CANVAS that guarded worker specific functionality were replaced by ENABLE_OFFSCREEN_CANVAS_IN_WORKERS. * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneSerializer::serialize): (WebCore::CloneSerializer::CloneSerializer): (WebCore::CloneSerializer::dumpIfTerminal): (WebCore::CloneDeserializer::deserialize): (WebCore::CloneDeserializer::CloneDeserializer): (WebCore::CloneDeserializer::readTerminal): (WebCore::SerializedScriptValue::SerializedScriptValue): (WebCore::SerializedScriptValue::computeMemoryCost const): (WebCore::SerializedScriptValue::create): (WebCore::SerializedScriptValue::deserialize): * bindings/js/SerializedScriptValue.h: (WebCore::SerializedScriptValue::SerializedScriptValue): * bindings/scripts/IDLAttributes.json: * bindings/scripts/preprocess-idls.pl: (GenerateConstructorAttributes): * html/HTMLCanvasElement.idl: * html/OffscreenCanvas.cpp: (WebCore::OffscreenCanvas::enabledForContext): * html/OffscreenCanvas.h: * html/OffscreenCanvas.idl: * html/canvas/OffscreenCanvasRenderingContext2D.cpp: (WebCore::OffscreenCanvasRenderingContext2D::enabledForContext): * html/canvas/OffscreenCanvasRenderingContext2D.h: * html/canvas/OffscreenCanvasRenderingContext2D.idl: * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setOffscreenCanvasInWorkersEnabled): (WebCore::RuntimeEnabledFeatures::offscreenCanvasInWorkersEnabled const): * workers/DedicatedWorkerGlobalScope.h: * workers/DedicatedWorkerGlobalScope.idl: * workers/WorkerAnimationController.cpp: * workers/WorkerAnimationController.h: Source/WTF: * Scripts/Preferences/WebPreferencesInternal.yaml: Add new OffscreenCanvasInWorkersEnabled preference. * wtf/PlatformEnable.h: Add new ENABLE_OFFSCREEN_CANVAS_IN_WORKERS macro. Tools: * Scripts/webkitperl/FeatureList.pm: * WebKitTestRunner/TestOptions.cpp: (WTR::TestOptions::defaults): Match current behavior of ENABLE_OFFSCREEN_CANVAS and OffscreenCanvasEnabled for ENABLE_OFFSCREEN_CANVAS_IN_WORKERS and OffscreenCanvasInWorkersEnabled. Canonical link: https://commits.webkit.org/237788@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277560 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-16 03:14:57 +00:00
2021-05-15 Sam Weinig <weinig@apple.com>
Allow conditionally enabling OffscreenCanvas only for non-worker contexts
https://bugs.webkit.org/show_bug.cgi?id=225845
Reviewed by Darin Adler.
* Scripts/Preferences/WebPreferencesInternal.yaml:
Add new OffscreenCanvasInWorkersEnabled preference.
* wtf/PlatformEnable.h:
Add new ENABLE_OFFSCREEN_CANVAS_IN_WORKERS macro.
2021-05-15 Alberto Garcia <berto@igalia.com>
CeilingOnPageSize too low for Loongson CPUs
https://bugs.webkit.org/show_bug.cgi?id=221198
<rdar://problem/74089683>
Reviewed by Michael Catanzaro.
Increase the page size to 16KB in MIPS64.
* wtf/PageBlock.h:
Drop FileSystem::fileMetadata() / fileMetadataFollowingSymlinks() https://bugs.webkit.org/show_bug.cgi?id=225820 Reviewed by Darin Adler. Source/JavaScriptCore: Update our code base because of the FileSystem API changes. * API/JSScript.mm: (validateBytecodeCachePath): Source/WebCore: Update our code base because of the FileSystem API changes. * Modules/entriesapi/DOMFileSystem.cpp: (WebCore::listDirectoryWithMetadata): (WebCore::toFileSystemEntries): (WebCore::fileTypeIgnoringHiddenFiles): (WebCore::validatePathIsExpectedType): (WebCore::DOMFileSystem::getParent): (WebCore::DOMFileSystem::getEntry): (WebCore::DOMFileSystem::getFile): * editing/cocoa/WebContentReaderCocoa.mm: (WebCore::attachmentForFilePath): * fileapi/File.cpp: (WebCore::File::isDirectory const): * html/DirectoryFileListCreator.cpp: (WebCore::appendDirectoryFiles): (WebCore::gatherFileInformation): * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm: (WebCore::CDMInstanceFairPlayStreamingAVFObjC::setStorageDirectory): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::ensureAssetCacheExistsForPath): * platform/network/BlobDataFileReference.cpp: (WebCore::BlobDataFileReference::startTrackingModifications): * platform/network/BlobRegistryImpl.cpp: * platform/network/FormData.cpp: (WebCore::FormData::prepareForUpload): * platform/network/mac/BlobDataFileReferenceMac.mm: (WebCore::BlobDataFileReference::generateReplacementFile): Source/WebKit: Update our code base because of the FileSystem API changes. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::getDirectorySize): (WebKit::CacheStorage::Engine::getDirectories): (WebKit::CacheStorage::Engine::clearAllCachesFromDisk): * NetworkProcess/cache/NetworkCacheFileSystem.cpp: (WebKit::NetworkCache::traverseDirectory): * Shared/mac/AuxiliaryProcessMac.mm: (WebKit::ensureSandboxCacheDirectory): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::isInternalInstall): Source/WTF: Drop FileSystem::fileMetadata() / fileMetadataFollowingSymlinks(). Those don't match very closely the std::filesystem API we use internally and they are not very efficient because we gather several attributes of a file but the callers are usually only interested in one thing (e.g. file type or file size). Callers interested in the file size, can call the pre-existing FileSystem::fileSize(). For call sites wanting to check if it is a hidden file, I introduced a new FileSystem::isHiddenFile() API. For call sites interested in the file type, I replaced FileSystem::isDirectory() / FileSystem::isDirectoryFollowingSymlinks() with more generic FileSystem::fileType() / FileSystem::fileTypeFollowingSymlinks(). * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/FileMetadata.h: Removed. * wtf/FileSystem.cpp: (WTF::FileSystemImpl::isHiddenFile): (WTF::FileSystemImpl::fileTypePotentiallyFollowingSymLinks): (WTF::FileSystemImpl::fileType): (WTF::FileSystemImpl::fileTypeFollowingSymlinks): * wtf/FileSystem.h: * wtf/glib/FileSystemGlib.cpp: * wtf/posix/FileSystemPOSIX.cpp: * wtf/win/FileSystemWin.cpp: Tools: Update the FileSystem API tests accordingly. * TestWebKitAPI/Tests/WTF/FileSystem.cpp: (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/237763@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277535 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-15 05:46:43 +00:00
2021-05-14 Chris Dumez <cdumez@apple.com>
Drop FileSystem::fileMetadata() / fileMetadataFollowingSymlinks()
https://bugs.webkit.org/show_bug.cgi?id=225820
Reviewed by Darin Adler.
Drop FileSystem::fileMetadata() / fileMetadataFollowingSymlinks(). Those don't match very closely the
std::filesystem API we use internally and they are not very efficient because we gather several attributes
of a file but the callers are usually only interested in one thing (e.g. file type or file size).
Callers interested in the file size, can call the pre-existing FileSystem::fileSize(). For call sites
wanting to check if it is a hidden file, I introduced a new FileSystem::isHiddenFile() API. For call sites
interested in the file type, I replaced FileSystem::isDirectory() / FileSystem::isDirectoryFollowingSymlinks()
with more generic FileSystem::fileType() / FileSystem::fileTypeFollowingSymlinks().
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/FileMetadata.h: Removed.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::isHiddenFile):
(WTF::FileSystemImpl::fileTypePotentiallyFollowingSymLinks):
(WTF::FileSystemImpl::fileType):
(WTF::FileSystemImpl::fileTypeFollowingSymlinks):
* wtf/FileSystem.h:
* wtf/glib/FileSystemGlib.cpp:
* wtf/posix/FileSystemPOSIX.cpp:
* wtf/win/FileSystemWin.cpp:
Drop legacy / prefixed WebAudio implementation https://bugs.webkit.org/show_bug.cgi?id=225832 Reviewed by Darin Adler. Source/WebCore: Drop legacy / prefixed WebAudio implementation now that it is no longer present in shipping and we have received any reports of issues. This drops all the legacy code but she should be able to clean up the code further in follow-ups. In particular, I believe some code can now be moved from BaseAudioContext to OfflineAudioContext. * CMakeLists.txt: * DerivedSources.make: * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::~AudioBufferSourceNode): (WebCore::AudioBufferSourceNode::totalPitchRate): * Modules/webaudio/AudioBufferSourceNode.h: * Modules/webaudio/AudioBufferSourceNode.idl: * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::create): (WebCore::AudioContext::AudioContext): * Modules/webaudio/AudioContext.h: * Modules/webaudio/AudioListener.h: * Modules/webaudio/AudioListener.idl: * Modules/webaudio/AudioNode.cpp: * Modules/webaudio/AudioNode.h: * Modules/webaudio/AudioNode.idl: * Modules/webaudio/AudioParam.h: * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::BaseAudioContext): * Modules/webaudio/BaseAudioContext.h: (WebCore::BaseAudioContext::isOfflineContext const): (WebCore::BaseAudioContext::BaseAudioContext): * Modules/webaudio/DynamicsCompressorNode.cpp: * Modules/webaudio/DynamicsCompressorNode.h: * Modules/webaudio/OfflineAudioContext.cpp: (WebCore::OfflineAudioContext::OfflineAudioContext): * Modules/webaudio/OscillatorNode.h: * Modules/webaudio/OscillatorNode.idl: * Modules/webaudio/WebKitAudioBufferSourceNode.h: Removed. * Modules/webaudio/WebKitAudioBufferSourceNode.idl: Removed. * Modules/webaudio/WebKitAudioContext.cpp: Removed. * Modules/webaudio/WebKitAudioContext.h: Removed. * Modules/webaudio/WebKitAudioContext.idl: Removed. * Modules/webaudio/WebKitAudioListener.h: Removed. * Modules/webaudio/WebKitAudioListener.idl: Removed. * Modules/webaudio/WebKitAudioPannerNode.cpp: Removed. * Modules/webaudio/WebKitAudioPannerNode.h: Removed. * Modules/webaudio/WebKitAudioPannerNode.idl: Removed. * Modules/webaudio/WebKitDynamicsCompressorNode.h: Removed. * Modules/webaudio/WebKitDynamicsCompressorNode.idl: Removed. * Modules/webaudio/WebKitOfflineAudioContext.cpp: Removed. * Modules/webaudio/WebKitOfflineAudioContext.h: Removed. * Modules/webaudio/WebKitOfflineAudioContext.idl: Removed. * Modules/webaudio/WebKitOscillatorNode.h: Removed. * Modules/webaudio/WebKitOscillatorNode.idl: Removed. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * testing/Internals.cpp: (WebCore::Internals::setAudioContextRestrictions): * testing/Internals.h: * testing/Internals.idl: Source/WebKitLegacy/win: Stop explicitly disabled with prefixed WebAudio implementation given that it no longer exists. * WebView.cpp: (WebView::notifyPreferencesChanged): Source/WTF: Drop preference for prefixed WebAudio, which was disabled everywhere. * Scripts/Preferences/WebPreferencesInternal.yaml: Canonical link: https://commits.webkit.org/237758@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277530 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-15 04:18:38 +00:00
2021-05-14 Chris Dumez <cdumez@apple.com>
Drop legacy / prefixed WebAudio implementation
https://bugs.webkit.org/show_bug.cgi?id=225832
Reviewed by Darin Adler.
Drop preference for prefixed WebAudio, which was disabled everywhere.
* Scripts/Preferences/WebPreferencesInternal.yaml:
2021-05-14 Chris Dumez <cdumez@apple.com>
Port WTF::FileSystem::realPath() to std::filesystem
https://bugs.webkit.org/show_bug.cgi?id=225828
Reviewed by Darin Adler.
Port WTF::FileSystem::realPath() to std::filesystem (in particular std::filesystem::canonical())
so that we no longer need platform-specific code.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::realPath):
* wtf/posix/FileSystemPOSIX.cpp:
* wtf/win/FileSystemWin.cpp:
Drop "get" prefix from WTF::FileSystem's getFileModificationTime() / getFileCreationTime() https://bugs.webkit.org/show_bug.cgi?id=225812 Reviewed by Darin Adler. Source/WebCore: Update code base due to WTF API change. * Modules/indexeddb/server/IDBServer.cpp: (WebCore::IDBServer::removeAllDatabasesForFullOriginPath): * Modules/webdatabase/DatabaseTracker.cpp: (WebCore::DatabaseTracker::deleteDatabasesModifiedSince): * fileapi/File.cpp: (WebCore::File::lastModified const): * page/Page.cpp: (WebCore::Page::userStyleSheet const): * platform/FileStream.cpp: (WebCore::FileStream::getSize): * platform/network/FormData.cpp: (WebCore::FormDataElement::EncodedFileData::fileModificationTimeMatchesExpectation const): * platform/network/curl/CurlCacheEntry.cpp: (WebCore::CurlCacheEntry::parseResponseHeaders): * platform/sql/SQLiteFileSystem.cpp: (WebCore::SQLiteFileSystem::databaseCreationTime): (WebCore::SQLiteFileSystem::databaseModificationTime): Source/WebKit: Update code base due to WTF API change. * NetworkProcess/cache/NetworkCacheFileSystem.cpp: (WebKit::NetworkCache::fileTimes): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::removeMediaKeys): * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp: (WebKit::removeAllMediaKeyStorageForOriginPath): Source/WebKitLegacy/win: Update code base due to WTF API change. * Plugins/PluginDatabase.cpp: (WebCore::PluginDatabase::refresh): Source/WTF: We avoid the "get" prefix in WebKit. * wtf/FileSystem.cpp: (WTF::FileSystemImpl::fileModificationTime): * wtf/FileSystem.h: * wtf/glib/FileSystemGlib.cpp: (WTF::FileSystemImpl::fileCreationTime): * wtf/posix/FileSystemPOSIX.cpp: (WTF::FileSystemImpl::fileCreationTime): * wtf/win/FileSystemWin.cpp: (WTF::FileSystemImpl::fileCreationTimeFromFindData): (WTF::FileSystemImpl::fileModificationTimeFromFindData): (WTF::FileSystemImpl::fileCreationTime): Tools: Update code base due to WTF API change. * TestWebKitAPI/Tests/WTF/FileSystem.cpp: (TestWebKitAPI::runGetFileModificationTimeTest): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/237745@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277515 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-14 23:12:12 +00:00
2021-05-14 Chris Dumez <cdumez@apple.com>
Drop "get" prefix from WTF::FileSystem's getFileModificationTime() / getFileCreationTime()
https://bugs.webkit.org/show_bug.cgi?id=225812
Reviewed by Darin Adler.
We avoid the "get" prefix in WebKit.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::fileModificationTime):
* wtf/FileSystem.h:
* wtf/glib/FileSystemGlib.cpp:
(WTF::FileSystemImpl::fileCreationTime):
* wtf/posix/FileSystemPOSIX.cpp:
(WTF::FileSystemImpl::fileCreationTime):
* wtf/win/FileSystemWin.cpp:
(WTF::FileSystemImpl::fileCreationTimeFromFindData):
(WTF::FileSystemImpl::fileModificationTimeFromFindData):
(WTF::FileSystemImpl::fileCreationTime):
2021-05-14 Chris Dumez <cdumez@apple.com>
Rename FileSystem::getVolumeFreeSpace() to FileSystem::volumeFreeSpace()
https://bugs.webkit.org/show_bug.cgi?id=225811
Reviewed by Darin Adler.
Rename FileSystem::getVolumeFreeSpace() to FileSystem::volumeFreeSpace() given that we
avoid the "get" prefix in WebKit. Also modernize the function by returning an
Optional<uint64_t> instead of using an out-parameter.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::volumeFreeSpace):
* wtf/FileSystem.h:
Promote `-[WKWebView _pageExtendedBackgroundColor]` SPI to `-[WKWebView underPageBackgroundColor]` API https://bugs.webkit.org/show_bug.cgi?id=225615 <rdar://problem/76568094> Reviewed by Wenson Hsieh. Source/WebCore: `underPageBackgroundColor` is a `null_resettable` property that will return (in order of validity) - the most recent non-null value provided - the CSS `background-color` of the `<body>` and/or `<html>` (this is the current value of `_pageExtendedBackgroundColor`) - the underlying platform view's background color Modifications to this property will not have any effect until control is returned to the runloop. Tests: WKWebViewUnderPageBackgroundColor.OnLoad WKWebViewUnderPageBackgroundColor.SingleSolidColor WKWebViewUnderPageBackgroundColor.SingleBlendedColor WKWebViewUnderPageBackgroundColor.MultipleSolidColors WKWebViewUnderPageBackgroundColor.MultipleBlendedColors WKWebViewUnderPageBackgroundColor.KVO WKWebViewUnderPageBackgroundColor.MatchesScrollView * page/Page.h: (WebCore::Page::underPageBackgroundColorOverride const): Added. * page/Page.cpp: (WebCore::Page::setUnderPageBackgroundColorOverride): Added. Hold the client-overriden value for `underPageBackgroundColor` so that it can be used when drawing the overscroll layer. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateLayerForOverhangAreasBackgroundColor): Remove the experimental settings `UseSampledPageTopColorForScrollAreaBackgroundColor` and `UseThemeColorForScrollAreaBackgroundColor` now that clients can override the default overscroll area background color using `-[WKWebView setUnderPageBackgroundColor:]`. * dom/Document.cpp: (WebCore::Document::themeColorChanged): It's no longer necessary to force the overscroll area to redraw since that'll be handled by a client calling `-[WKWebView setUnderPageBackgroundColor:]` (possibly in response to a `-[WKWebView themeColor]` KVO notification). Source/WebKit: `underPageBackgroundColor` is a `null_resettable` property that will return (in order of validity) - the most recent non-null value provided - the CSS `background-color` of the `<body>` and/or `<html>` (this is the current value of `_pageExtendedBackgroundColor`) - the underlying platform view's background color Modifications to this property will not have any effect until control is returned to the runloop. * UIProcess/API/Cocoa/WKWebView.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView underPageBackgroundColor]): Added. (-[WKWebView setUnderPageBackgroundColor:]): Added. (+[WKWebView automaticallyNotifiesObserversOfUnderPageBackgroundColor]): Added. * UIProcess/API/ios/WKWebViewIOS.mm: (baseScrollViewBackgroundColor): (scrollViewBackgroundColor): Remove the experimental settings `UseSampledPageTopColorForScrollAreaBackgroundColor` and `UseThemeColorForScrollAreaBackgroundColor` now that clients can override the default overscroll area background color using `-[WKWebView setUnderPageBackgroundColor:]`. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::underPageBackgroundColor const): Added. (WebKit::WebPageProxy::setUnderPageBackgroundColorOverride): Added. (WebKit::WebPageProxy::pageExtendedBackgroundColorDidChange): (WebKit::WebPageProxy::platformUnderPageBackgroundColor const): Added. (WebKit::WebPageProxy::scrollAreaBackgroundColor const): Deleted. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::platformUnderPageBackgroundColor const): Added. * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::platformUnderPageBackgroundColor const): Added. Store the client-overriden value for `underPageBackgroundColor` and manage state changes. * UIProcess/PageClient.h: (WebKit::PageClient::underPageBackgroundColorWillChange): Added. (WebKit::PageClient::underPageBackgroundColorDidChange): Added. * UIProcess/Cocoa/PageClientImplCocoa.h: * UIProcess/Cocoa/PageClientImplCocoa.mm: (WebKit::PageClientImplCocoa::underPageBackgroundColorWillChange): Added. (WebKit::PageClientImplCocoa::underPageBackgroundColorDidChange): Added. Add ObjC KVO support for `-[WKWebView underPageBackgroundColor]`. * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::contentViewBackgroundColor): Added. Provide a way to get the `backgroundColor` of the `WKContentView`. This is needed on iOS because `scrollViewBackgroundColor` (now `WebPageProxy::platformUnderPageBackgroundColor`) would use this value before falling back to the underlying platform view's background color. * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setUnderPageBackgroundColorOverride): Added. Pass the client-overriden value for `underPageBackgroundColor` to the WebProcess so that it can be used when drawing the overscroll layer. * UIProcess/ViewSnapshotStore.cpp: (WebKit::ViewSnapshotStore::recordSnapshot): Go back to using the `pageExtendedBackgroundColor` (before r273083). Source/WTF: `underPageBackgroundColor` is a `null_resettable` property that will return (in order of validity) - the most recent non-null value provided - the CSS `background-color` of the `<body>` and/or `<html>` (this is the current value of `_pageExtendedBackgroundColor`) - the underlying platform view's background color Modifications to this property will not have any effect until control is returned to the runloop. * Scripts/Preferences/WebPreferencesInternal.yaml: Remove the experimental settings `UseSampledPageTopColorForScrollAreaBackgroundColor`and `UseThemeColorForScrollAreaBackgroundColor` now that clients can override the default overscroll area background color using `-[WKWebView setUnderPageBackgroundColor:]`. Tools: * TestWebKitAPI/Tests/WebKitCocoa/WKWebViewUnderPageBackgroundColor.mm: Renamed from PageExtendedBackgroundColor.mm. (defaultBackgroundColor): Added. (TEST.WKWebViewUnderPageBackgroundColor.OnLoad): (TEST.WKWebViewUnderPageBackgroundColor.SingleSolidColor): Added. (TEST.WKWebViewUnderPageBackgroundColor.SingleBlendedColor): Added. (TEST.WKWebViewUnderPageBackgroundColor.MultipleSolidColors): Added. (TEST.WKWebViewUnderPageBackgroundColor.MultipleBlendedColors): Added. (-[WKWebViewUnderPageBackgroundColorObserver initWithWebView:]): Added. (-[WKWebViewUnderPageBackgroundColorObserver observeValueForKeyPath:ofObject:change:context:]): Added. (TEST.WKWebViewUnderPageBackgroundColor.KVO): (TEST.WKWebViewUnderPageBackgroundColor.MatchesScrollView): Added. (TEST.WKWebViewUnderPageBackgroundColor.MultipleStyles): Deleted. (-[WKWebViewPageExtendedBackgroundColorObserver initWithWebView:]): Deleted. (-[WKWebViewPageExtendedBackgroundColorObserver observeValueForKeyPath:ofObject:change:context:]): Deleted. * TestWebKitAPI/Tests/WebKitCocoa/SampledPageTopColor.mm: (createWebViewWithSampledPageTopColorMaxDifference): (TEST.SampledPageTopColor.ExperimentalUseSampledPageTopColorForScrollAreaBackgroundColor): Deleted. * TestWebKitAPI/Tests/WebKitCocoa/WKWebViewThemeColor.mm: (createWebView): Deleted. (TEST.WKWebView.ExperimentalUseThemeColorForScrollAreaBackgroundColor): Deleted. Remove the experimental settings `UseSampledPageTopColorForScrollAreaBackgroundColor` and `UseThemeColorForScrollAreaBackgroundColor` now that clients can override the default overscroll area background color using `-[WKWebView setUnderPageBackgroundColor:]`. * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: Canonical link: https://commits.webkit.org/237736@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277505 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-14 21:34:46 +00:00
2021-05-14 Devin Rousso <drousso@apple.com>
Promote `-[WKWebView _pageExtendedBackgroundColor]` SPI to `-[WKWebView underPageBackgroundColor]` API
https://bugs.webkit.org/show_bug.cgi?id=225615
<rdar://problem/76568094>
Reviewed by Wenson Hsieh.
`underPageBackgroundColor` is a `null_resettable` property that will return (in order of validity)
- the most recent non-null value provided
- the CSS `background-color` of the `<body>` and/or `<html>` (this is the current value of `_pageExtendedBackgroundColor`)
- the underlying platform view's background color
Modifications to this property will not have any effect until control is returned to the runloop.
* Scripts/Preferences/WebPreferencesInternal.yaml:
Remove the experimental settings `UseSampledPageTopColorForScrollAreaBackgroundColor`and
`UseThemeColorForScrollAreaBackgroundColor` now that clients can override the default
overscroll area background color using `-[WKWebView setUnderPageBackgroundColor:]`.
2021-05-14 Chris Dumez <cdumez@apple.com>
Introduce FileSystem::updateFileModificationTime()
https://bugs.webkit.org/show_bug.cgi?id=225810
Reviewed by Darin Adler.
Introduce FileSystem::updateFileModificationTime() to update the modification time of a
file. The implementation is cross-platform and relies on std::filesystem. It allows us
to replace platform-specific code that we had at the WebKit2 layer.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::updateFileModificationTime):
* wtf/FileSystem.h:
2021-05-14 Chris Dumez <cdumez@apple.com>
Drop unused FileSystem::homeDirectoryPath()
https://bugs.webkit.org/show_bug.cgi?id=225808
Reviewed by Anders Carlsson.
Only Windows-specific code was calling FileSystem::homeDirectoryPath() but the Windows implementation
for this was always returning the empty string.
* wtf/FileSystem.h:
* wtf/cocoa/FileSystemCocoa.mm:
(WTF::FileSystemImpl::homeDirectoryPath): Deleted.
* wtf/glib/FileSystemGlib.cpp:
(WTF::FileSystemImpl::homeDirectoryPath): Deleted.
* wtf/win/FileSystemWin.cpp:
(WTF::FileSystemImpl::homeDirectoryPath): Deleted.
Rename FileSystem::getFileSize() to FileSystem::fileSize() https://bugs.webkit.org/show_bug.cgi?id=225798 Reviewed by Alex Christensen. Source/JavaScriptCore: Update code path to due to the API change. * inspector/remote/socket/RemoteInspectorSocket.cpp: (Inspector::RemoteInspector::backendCommands const): * jsc.cpp: Source/WebCore: Update code path to due to the API change. * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: (WebCore::IDBServer::SQLiteIDBBackingStore::databasesSizeForDirectory): * Modules/webdatabase/DatabaseDetails.h: (WebCore::DatabaseDetails::DatabaseDetails): * Modules/webdatabase/DatabaseTracker.cpp: (WebCore::DatabaseTracker::hasAdequateQuotaForOrigin): (WebCore::DatabaseTracker::canEstablishDatabase): (WebCore::DatabaseTracker::retryCanEstablishDatabase): (WebCore::DatabaseTracker::maximumSize): (WebCore::DatabaseTracker::detailsForNameAndOrigin): (WebCore::DatabaseTracker::setDatabaseDetails): (WebCore::DatabaseTracker::usage): (WebCore::DatabaseTracker::quotaNoLock): (WebCore::DatabaseTracker::quota): (WebCore::DatabaseTracker::setQuota): (WebCore::isZeroByteFile): * Modules/webdatabase/DatabaseTracker.h: * editing/cocoa/WebContentReaderCocoa.mm: (WebCore::attachmentForFilePath): * loader/appcache/ApplicationCacheStorage.cpp: (WebCore::ApplicationCacheStorage::spaceNeeded): (WebCore::ApplicationCacheStorage::loadCache): (WebCore::ApplicationCacheStorage::flatFileAreaSize): * platform/FileStream.cpp: (WebCore::FileStream::getSize): * platform/network/FormData.cpp: (WebCore::FormDataElement::lengthInBytes const): * platform/network/curl/CurlCacheEntry.cpp: (WebCore::CurlCacheEntry::loadFileToBuffer): * platform/network/curl/CurlCacheManager.cpp: (WebCore::CurlCacheManager::loadIndex): * platform/sql/SQLiteFileSystem.cpp: (WebCore::SQLiteFileSystem::databaseFileSize): * platform/sql/SQLiteFileSystem.h: * rendering/RenderThemeWin.cpp: (WebCore::RenderThemeWin::stringWithContentsOfFile): * workers/service/server/SWScriptStorage.cpp: (WebCore::shouldUseFileMapping): (WebCore::SWScriptStorage::retrieve): Source/WebKit: Update code path to due to the API change. * NetworkProcess/WebStorage/LocalStorageDatabase.cpp: (WebKit::LocalStorageDatabase::setItem): * NetworkProcess/WebStorage/LocalStorageDatabase.h: * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::getDirectorySize): (WebKit::CacheStorage::Engine::readSizeFile): * NetworkProcess/cache/NetworkCacheBlobStorage.cpp: (WebKit::NetworkCache::BlobStorage::synchronize): * NetworkProcess/cache/NetworkCacheData.cpp: (WebKit::NetworkCache::mapFile): * NetworkProcess/cache/NetworkCacheIOChannelCurl.cpp: (WebKit::NetworkCache::IOChannel::read): * Shared/PersistencyUtils.cpp: (WebKit::createForFile): * UIProcess/DeviceIdHashSaltStorage.cpp: (WebKit::DeviceIdHashSaltStorage::loadStorageFromDisk): Source/WebKitLegacy: Update code path to due to the API change. * Storage/StorageTracker.cpp: (WebKit::StorageTracker::diskUsageForOrigin): * Storage/StorageTracker.h: Source/WTF: Rename FileSystem::getFileSize() to FileSystem::fileSize() as we usually avoid the "get" prefix in WebKit. It is also more consistent with the std::filesystem::file_size() the implementation relies on. Also have it return an Optional<uint64_t> instead of taking a long long out-parameter, as this is more modern. * wtf/FileSystem.cpp: (WTF::FileSystemImpl::fileSize): * wtf/FileSystem.h: * wtf/glib/FileSystemGlib.cpp: (WTF::FileSystemImpl::fileSize): * wtf/posix/FileSystemPOSIX.cpp: (WTF::FileSystemImpl::fileSize): * wtf/win/FileSystemWin.cpp: (WTF::FileSystemImpl::getFileSizeFromByHandleFileInformationStructure): (WTF::FileSystemImpl::fileSize): (WTF::FileSystemImpl::MappedFileData::mapFileHandle): Tools: Update code path to due to the API change. * TestWebKitAPI/Tests/WTF/FileSystem.cpp: (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WebCore/cocoa/DatabaseTrackerTest.mm: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/237726@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277492 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-14 16:10:38 +00:00
2021-05-14 Chris Dumez <cdumez@apple.com>
Rename FileSystem::getFileSize() to FileSystem::fileSize()
https://bugs.webkit.org/show_bug.cgi?id=225798
Reviewed by Alex Christensen.
Rename FileSystem::getFileSize() to FileSystem::fileSize() as we usually avoid the "get"
prefix in WebKit. It is also more consistent with the std::filesystem::file_size() the
implementation relies on.
Also have it return an Optional<uint64_t> instead of taking a long long out-parameter, as
this is more modern.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::fileSize):
* wtf/FileSystem.h:
* wtf/glib/FileSystemGlib.cpp:
(WTF::FileSystemImpl::fileSize):
* wtf/posix/FileSystemPOSIX.cpp:
(WTF::FileSystemImpl::fileSize):
* wtf/win/FileSystemWin.cpp:
(WTF::FileSystemImpl::getFileSizeFromByHandleFileInformationStructure):
(WTF::FileSystemImpl::fileSize):
(WTF::FileSystemImpl::MappedFileData::mapFileHandle):
Rename FileSystem::pathGetFileName() to FileSystem::pathFileName() https://bugs.webkit.org/show_bug.cgi?id=225806 Reviewed by Alex Christensen. Rename FileSystem::pathGetFileName() to FileSystem::pathFileName(), as we avoid "get" prefixes in WebKit. Source/WebCore: * Modules/entriesapi/FileSystemEntry.cpp: (WebCore::FileSystemEntry::FileSystemEntry): * Modules/webdatabase/DatabaseTracker.cpp: (WebCore::DatabaseTracker::removeDeletedOpenedDatabases): * editing/cocoa/WebContentReaderCocoa.mm: (WebCore::attachmentForFilePath): * fileapi/File.cpp: (WebCore::File::computeNameAndContentType): * fileapi/FileCocoa.mm: (WebCore::File::computeNameAndContentTypeForReplacedFile): * html/DirectoryFileListCreator.cpp: (WebCore::gatherFileInformation): * loader/appcache/ApplicationCacheStorage.cpp: (WebCore::ApplicationCacheStorage::store): * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm: (WebCore::CDMInstanceFairPlayStreamingAVFObjC::setStorageDirectory): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::purgeOldDownloadFiles): Source/WebKit: * NetworkProcess/WebStorage/LocalStorageDatabaseTracker.cpp: (WebKit::LocalStorageDatabaseTracker::origins const): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary): Source/WebKitLegacy/win: * Plugins/PluginDatabase.cpp: (WebCore::PluginDatabase::fileExistsAndIsNotDisabled const): * Plugins/PluginPackage.cpp: (WebCore::PluginPackage::PluginPackage): * WebDownloadCurl.cpp: (WebDownload::didReceiveResponse): Source/WTF: * wtf/FileSystem.cpp: (WTF::FileSystemImpl::pathFileName): (WTF::FileSystemImpl::pathGetFileName): Deleted. * wtf/FileSystem.h: Tools: * TestWebKitAPI/Tests/WTF/FileSystem.cpp: (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/237725@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277491 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-14 16:01:00 +00:00
2021-05-14 Chris Dumez <cdumez@apple.com>
Rename FileSystem::pathGetFileName() to FileSystem::pathFileName()
https://bugs.webkit.org/show_bug.cgi?id=225806
Reviewed by Alex Christensen.
Rename FileSystem::pathGetFileName() to FileSystem::pathFileName(), as we avoid "get" prefixes in WebKit.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::pathFileName):
(WTF::FileSystemImpl::pathGetFileName): Deleted.
* wtf/FileSystem.h:
[WebXR] Allow WebXR to be tested on PLATFORM(COCOA) https://bugs.webkit.org/show_bug.cgi?id=225578 <rdar://problem/77707283> Reviewed by Sam Weinig. LayoutTests/imported/w3c: New expected results. * web-platform-tests/webxr/exclusive_requestFrame_nolayer.https-expected.txt: Added. * web-platform-tests/webxr/render_state_vertical_fov_inline.https-expected.txt: Added. * web-platform-tests/webxr/webxr-supported-by-feature-policy-expected.txt: Added. * web-platform-tests/webxr/webxr_availability.http.sub-expected.txt: Added. * web-platform-tests/webxr/webxr_feature_policy.https-expected.txt: Added. * web-platform-tests/webxr/xrFrame_lifetime.https-expected.txt: Added. * web-platform-tests/webxr/xrPose_transform_sameObject.https-expected.txt: Added. * web-platform-tests/webxr/xrReferenceSpace_originOffsetBounded.https-expected.txt: Added. * web-platform-tests/webxr/xrSession_input_events_end.https-expected.txt: Added. * web-platform-tests/webxr/xrSession_visibilityState.https-expected.txt: Added. * web-platform-tests/webxr/xrStationaryReferenceSpace_floorlevel_updates.https-expected.txt: Added. * web-platform-tests/webxr/xrWebGLLayer_framebuffer_scale.https-expected.txt: Added. * web-platform-tests/webxr/xrWebGLLayer_opaque_framebuffer_stencil.https-expected.txt: Added. Source/WebKit: Remove checking for a WebXR feature flag. * Shared/WebPreferencesDefaultValues.cpp: (WebKit::defaultWebXREnabled): Source/WTF: Compile-time enabled on all Cocoa platforms. * wtf/PlatformEnableCocoa.h: LayoutTests: Remove the skip rule for the WebXR directory, and add more specific expected results. * TestExpectations: Canonical link: https://commits.webkit.org/237709@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277468 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-14 00:35:23 +00:00
2021-05-13 Dean Jackson <dino@apple.com>
[WebXR] Allow WebXR to be tested on PLATFORM(COCOA)
https://bugs.webkit.org/show_bug.cgi?id=225578
Reviewed by Sam Weinig.
Compile-time enabled on all Cocoa platforms.
* wtf/PlatformEnableCocoa.h:
Rename FileSystem::directoryName() to FileSystem::parentPath() https://bugs.webkit.org/show_bug.cgi?id=225768 Reviewed by Darin Adler. Rename FileSystem::directoryName() to FileSystem::parentPath() for clarity and consistency with std::filesystem::parent_path() which is used internally. Source/JavaScriptCore: * API/JSScript.mm: (validateBytecodeCachePath): Source/WebCore: * Modules/entriesapi/DOMFileSystem.cpp: (WebCore::DOMFileSystem::DOMFileSystem): * loader/appcache/ApplicationCacheStorage.cpp: (WebCore::ApplicationCacheStorage::writeDataToUniqueFileInDirectory): (WebCore::ApplicationCacheStorage::checkForDeletedResources): * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm: (WebCore::CDMSessionAVContentKeySession::contentKeySession): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::purgeOldDownloadFiles): * platform/network/curl/CookieJarDB.cpp: (WebCore::CookieJarDB::openDatabase): * platform/sql/SQLiteFileSystem.cpp: (WebCore::SQLiteFileSystem::ensureDatabaseFileExists): * platform/win/SearchPopupMenuDB.cpp: (WebCore::SearchPopupMenuDB::openDatabase): * workers/service/server/SWScriptStorage.cpp: (WebCore::SWScriptStorage::store): Source/WebKit: * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::ResourceLoadStatisticsDatabaseStore::openITPDatabase): * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::writeFile): * Shared/glib/ProcessExecutablePathGLib.cpp: (WebKit::getExecutablePath): * UIProcess/API/glib/IconDatabase.cpp: (WebKit::IconDatabase::IconDatabase): * UIProcess/API/glib/WebKitWebsiteDataManager.cpp: (webkit_website_data_manager_get_disk_cache_directory): * UIProcess/Launcher/glib/BubblewrapLauncher.cpp: (WebKit::bubblewrapSpawn): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::platformSetNetworkParameters): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary): Source/WebKitLegacy: * Storage/StorageTracker.cpp: (WebKit::ensureDatabaseFileExists): Source/WebKitLegacy/win: * Plugins/PluginDatabase.cpp: (WebCore::PluginDatabase::loadPersistentMetadataCache): Source/WTF: * wtf/FileSystem.cpp: (WTF::FileSystemImpl::readOrMakeSalt): (WTF::FileSystemImpl::parentPath): (WTF::FileSystemImpl::directoryName): Deleted. * wtf/FileSystem.h: Tools: * DumpRenderTree/win/DumpRenderTree.cpp: (findFontFallback): * TestWebKitAPI/Tests/WTF/FileSystem.cpp: (TestWebKitAPI::TEST_F): * TestWebKitAPI/win/PlatformUtilitiesWin.cpp: (TestWebKitAPI::Util::moduleDirectory): Canonical link: https://commits.webkit.org/237697@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277449 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-13 20:47:38 +00:00
2021-05-13 Chris Dumez <cdumez@apple.com>
Rename FileSystem::directoryName() to FileSystem::parentPath()
https://bugs.webkit.org/show_bug.cgi?id=225768
Reviewed by Darin Adler.
Rename FileSystem::directoryName() to FileSystem::parentPath() for clarity and
consistency with std::filesystem::parent_path() which is used internally.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::readOrMakeSalt):
(WTF::FileSystemImpl::parentPath):
(WTF::FileSystemImpl::directoryName): Deleted.
* wtf/FileSystem.h:
Rename FileSystem::fileIsDirectory(path, followSymlinks) to isDirectory(path) / isDirectoryFollowingSymlinks(path) https://bugs.webkit.org/show_bug.cgi?id=225772 Reviewed by Darin Adler. Source/JavaScriptCore: Update code base due to API naming change. * API/JSScript.mm: (validateBytecodeCachePath): Source/WebCore: Update code base due to API naming change. * Modules/entriesapi/DOMFileSystem.cpp: (WebCore::listDirectoryWithMetadata): * editing/cocoa/WebContentReaderCocoa.mm: (WebCore::attachmentForFilePath): * fileapi/File.cpp: (WebCore::File::isDirectory const): * html/DirectoryFileListCreator.cpp: (WebCore::gatherFileInformation): * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm: (WebCore::CDMInstanceFairPlayStreamingAVFObjC::setStorageDirectory): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::ensureAssetCacheExistsForPath): * platform/network/FormData.cpp: (WebCore::FormData::prepareForUpload): Source/WebKit: Update code base due to API naming change. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::getDirectorySize): (WebKit::CacheStorage::Engine::getDirectories): (WebKit::CacheStorage::Engine::clearAllCachesFromDisk): * NetworkProcess/cache/NetworkCacheFileSystem.cpp: (WebKit::NetworkCache::traverseDirectory): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::isInternalInstall): Source/WTF: I don't think the "file" prefix is useful here so I am renaming the function to isDirectory(). Also, instead of using an enum parameter to decide whether or not to follow symlink, I am adding a separate function called isDirectoryFollowingSymlinks(). This is consistent with the fileMetadata() / fileMetadataFollowingSymlinks() pattern, which Darin said he preferred. * wtf/FileSystem.cpp: (WTF::FileSystemImpl::isDirectory): (WTF::FileSystemImpl::isDirectoryFollowingSymlinks): (WTF::FileSystemImpl::fileIsDirectory): Deleted. * wtf/FileSystem.h: Tools: Update code base due to API naming change. * TestWebKitAPI/Tests/WTF/FileSystem.cpp: (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/237696@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277448 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-13 20:08:36 +00:00
2021-05-13 Chris Dumez <cdumez@apple.com>
Rename FileSystem::fileIsDirectory(path, followSymlinks) to isDirectory(path) / isDirectoryFollowingSymlinks(path)
https://bugs.webkit.org/show_bug.cgi?id=225772
Reviewed by Darin Adler.
I don't think the "file" prefix is useful here so I am renaming the function to
isDirectory(). Also, instead of using an enum parameter to decide whether or
not to follow symlink, I am adding a separate function called
isDirectoryFollowingSymlinks(). This is consistent with the
fileMetadata() / fileMetadataFollowingSymlinks() pattern, which Darin said he
preferred.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::isDirectory):
(WTF::FileSystemImpl::isDirectoryFollowingSymlinks):
(WTF::FileSystemImpl::fileIsDirectory): Deleted.
* wtf/FileSystem.h:
2021-05-13 Chris Dumez <cdumez@apple.com>
Introduce FileSystem::hardLinkCount()
https://bugs.webkit.org/show_bug.cgi?id=225767
Reviewed by Darin Adler.
Introduce FileSystem::hardLinkCount() to replace our platform-specific implementation
in NetworkCacheBlobStorage.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::hardLinkCount):
* wtf/FileSystem.h:
[WTF] Add holdLock() overload for WTF::DataMutex https://bugs.webkit.org/show_bug.cgi?id=225652 Reviewed by Xabier Rodriguez-Calvar. Source/WebCore: All instantiations of DataMutex::LockedWrapper have been replaced by holdLock(), for equivalent but more concise code. This patch introduces no behavior changes. * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (webKitWebSrcConstructed): (webKitWebSrcGetProperty): (webKitWebSrcSetContext): (webKitWebSrcCreate): (webKitWebSrcMakeRequest): (webKitWebSrcStop): (webKitWebSrcGetSize): (webKitWebSrcIsSeekable): (webKitWebSrcDoSeek): (webKitWebSrcQuery): (webKitWebSrcUnLock): (webKitWebSrcUnLockStop): (webKitWebSrcSetMediaPlayer): (webKitSrcPassedCORSAccessCheck): (CachedResourceStreamingClient::responseReceived): (CachedResourceStreamingClient::dataReceived): (CachedResourceStreamingClient::accessControlCheckFailed): (CachedResourceStreamingClient::loadFailed): (CachedResourceStreamingClient::loadFinished): (webKitSrcWouldTaintOrigin): * platform/graphics/gstreamer/mse/MediaSourceTrackGStreamer.cpp: (WebCore::MediaSourceTrackGStreamer::isReadyForMoreSamples): (WebCore::MediaSourceTrackGStreamer::notifyWhenReadyForMoreSamples): (WebCore::MediaSourceTrackGStreamer::enqueueObject): (WebCore::MediaSourceTrackGStreamer::clearQueue): * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp: (webKitMediaSrcActivateMode): (webKitMediaSrcPadLinked): (webKitMediaSrcLoop): (webKitMediaSrcStreamFlush): Source/WTF: This patch adds a holdLock() overload for WTF::DataMutex as syntactic sugar to simplify usage in a similar way to what holdLock() already does for WTF::Locker. * wtf/DataMutex.h: (WTF::holdLock): Canonical link: https://commits.webkit.org/237686@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277438 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-13 17:03:39 +00:00
2021-05-13 Alicia Boya García <aboya@igalia.com>
[WTF] Add holdLock() overload for WTF::DataMutex
https://bugs.webkit.org/show_bug.cgi?id=225652
Reviewed by Xabier Rodriguez-Calvar.
This patch adds a holdLock() overload for WTF::DataMutex as syntactic
sugar to simplify usage in a similar way to what holdLock() already
does for WTF::Locker.
* wtf/DataMutex.h:
(WTF::holdLock):
Remove StringBuilder::appendNumber https://bugs.webkit.org/show_bug.cgi?id=225732 Reviewed by Sam Weinig. Source/JavaScriptCore: * API/JSContextRef.cpp: (BacktraceFunctor::operator() const): Use append instead of appendNumber. * API/tests/PingPongStackOverflowTest.cpp: (PingPongStackOverflowObject_hasInstance): Ditto. * heap/HeapSnapshotBuilder.cpp: (JSC::HeapSnapshotBuilder::json): Ditto. * interpreter/StackVisitor.cpp: (JSC::StackVisitor::Frame::toString const): Use makeString instead of StringBuilder. * runtime/ConsoleClient.cpp: (JSC::appendURLAndPosition): Ditto. (JSC::ConsoleClient::printConsoleMessageWithArguments): Use append instead of appendNumber. * runtime/JSONObject.cpp: (JSC::Stringifier::appendStringifiedValue): Ditto. * runtime/Options.cpp: (JSC::OptionReader::Option::dump const): Ditto. * runtime/StackFrame.cpp: (JSC::StackFrame::toString const): Use makeString instead of StringBuilder. Source/WebCore: * Modules/indexeddb/server/IndexValueStore.cpp: (WebCore::IDBServer::IndexValueStore::loggingString const): Use append instead of appendNumber. * Modules/websockets/WebSocketHandshake.cpp: (WebCore::hostName): Use makeString instead of StringBuilder. * contentextensions/CombinedURLFilters.cpp: (WebCore::ContentExtensions::prefixTreeVertexToString): Use append instead of appendNumber. * contentextensions/Term.h: (WebCore::ContentExtensions::Term::toString const): Ditto. * css/CSSFontFeatureValue.cpp: (WebCore::CSSFontFeatureValue::customCSSText const): Ditto. * css/CSSTimingFunctionValue.cpp: (WebCore::CSSStepsTimingFunctionValue::customCSSText const): Ditto. * dom/Document.cpp: (WebCore::Document::downgradeReferrerToRegistrableDomain): Use makeString instead of StringBuilder. * editing/MarkupAccumulator.cpp: (WebCore::MarkupAccumulator::generateUniquePrefix): Ditto. * editing/cocoa/DataDetection.mm: (WebCore::dataDetectorStringForPath): Use append instead of appendNumber. * html/HTMLAnchorElement.cpp: (WebCore::appendServerMapMousePosition): Ditto. * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::createContext2d): Use makeString instead of StringBuilder. (WebCore::HTMLCanvasElement::createImageBuffer const): Ditto. * loader/ResourceLoadStatistics.cpp: (WebCore::ResourceLoadStatistics::toString const): Use append instead of appendNumber. * loader/SubresourceIntegrity.cpp: (WebCore::integrityMismatchDescription): Use makeString instead of StringBuilder. * page/IntersectionObserver.cpp: (WebCore::IntersectionObserver::rootMargin const): Use append instead of appendNumber. * page/SecurityOriginData.cpp: (WebCore::SecurityOriginData::databaseIdentifier const): Use makeString instead of StringBuilder. * platform/Decimal.cpp: (WebCore::Decimal::toString const): Use append instead of appendNumber. * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::animationNameForTransition): Use makeString instead of StringBuilder. * platform/graphics/ca/TileController.cpp: (WebCore::TileController::createTileLayer): Ditto. * platform/graphics/ca/win/PlatformCALayerWin.cpp: (printTransform): Use single append instead of a run of them. (printLayer): Ditto, and use append instead of apppendNumber. (PlatformCALayerWin::layerTreeAsString const): Ditto. * platform/mediarecorder/MediaRecorderPrivateMock.cpp: (WebCore::MediaRecorderPrivateMock::generateMockCounterString): Use append instead of appendNumber. * platform/network/ProxyServer.cpp: (WebCore::appendProxyServerString): Ditto. * rendering/RenderTreeAsText.cpp: (WebCore::nodePosition): Ditto. * svg/SVGPathUtilities.cpp: (WebCore::buildStringFromPath): Ditto. * testing/Internals.cpp: (WebCore::Internals::parserMetaData): Use makeString instead of StringBuilder. (WebCore::appendOffsets): Use append instead of appendNumber. * testing/MockPageOverlayClient.cpp: (WebCore::MockPageOverlayClient::drawRect): Use makeString instead of StringBuilder. (WebCore::MockPageOverlayClient::mouseEvent): Ditto. * xml/XMLErrors.cpp: (WebCore::XMLErrors::appendErrorMessage): Use append instead of appendNumber. Source/WebDriver: * SessionHost.cpp: (WebDriver::SessionHost::sendCommandToBackend): Use append instead of appendNumber. * socket/HTTPServerSocket.cpp: (WebDriver::HTTPRequestHandler::packHTTPMessage const): Ditto. Source/WebKit: * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::buildList): Use append instead of appendNumber. (WebKit::ResourceLoadStatisticsDatabaseStore::findNotVeryPrevalentResources): Ditto. (WebKit::ResourceLoadStatisticsDatabaseStore::resourceToString const): Ditto. (WebKit::ResourceLoadStatisticsDatabaseStore::attributionToString): Ditto. (WebKit::ResourceLoadStatisticsDatabaseStore::privateClickMeasurementToString): Ditto. * Shared/WebMemorySampler.cpp: (WebKit::WebMemorySampler::appendCurrentMemoryUsageToFile): Ditto. * UIProcess/API/glib/WebKitWebView.cpp: (webkitWebViewRunJavaScriptCallback): Ditto. * UIProcess/WebBackForwardList.cpp: (WebKit::WebBackForwardList::loggingString): Ditto. * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp: (PageResourceLoadClient::didReceiveResponseForResource): Use makeString instead of StringBuilder. * WebProcess/Plugins/PluginView.cpp: (WebKit::buildHTTPHeaders): Use append instead of appendNumber. Source/WebKitLegacy/win: * WebKitStatistics.cpp: (WebKitStatistics::comClassNameCounts): Use append instead of appendNumber. Source/WTF: We originally added StringBuilder::appendNumber to resolve the ambiguity between UChar and uint16_t, but that problem was solved long ago and it is safe to use StringBuilder::append, including the variadic form, on all types of numbers and we'll get the same results we did with appendNumber. * wtf/JSONValues.cpp: (WTF::JSONImpl::Value::writeJSON const): Use append instead of appendNumber. * wtf/text/StringBuilder.cpp: (WTF::StringBuilder::appendNumber): Deleted. * wtf/text/StringBuilder.h: Removed appendNumber. * wtf/text/TextStream.cpp: (WTF::TextStream::operator<<): Use append instead of appendNumber. Tools: * TestWebKitAPI/Tests/WTF/StringBuilder.cpp: Test append with a number instead of appendNumber. * TestWebKitAPI/Tests/WebKitGLib/TestAutomationSession.cpp: Use append instead of appendNumber. * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp: (WTR::dumpResponseDescriptionSuitableForTestResult): Use append instead of appendNumber. (WTR::dumpFrameScrollPosition): Ditto. (WTR::InjectedBundlePage::didFinishDocumentLoadForFrame): Use makeString instead of StringBuilder. (WTR::InjectedBundlePage::shouldCacheResponse): Ditto. * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp: (WTR::attributesOfElement): Use append instead of appendNumber. (WTR::AccessibilityUIElement::attributedStringForRange): Ditto. (WTR::stringAtOffset): Ditto. Canonical link: https://commits.webkit.org/237685@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277437 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-13 16:18:32 +00:00
2021-05-13 Darin Adler <darin@apple.com>
Remove StringBuilder::appendNumber
https://bugs.webkit.org/show_bug.cgi?id=225732
Reviewed by Sam Weinig.
We originally added StringBuilder::appendNumber to resolve the ambiguity
between UChar and uint16_t, but that problem was solved long ago and it
is safe to use StringBuilder::append, including the variadic form, on all
types of numbers and we'll get the same results we did with appendNumber.
* wtf/JSONValues.cpp:
(WTF::JSONImpl::Value::writeJSON const): Use append instead of appendNumber.
* wtf/text/StringBuilder.cpp:
(WTF::StringBuilder::appendNumber): Deleted.
* wtf/text/StringBuilder.h: Removed appendNumber.
* wtf/text/TextStream.cpp:
(WTF::TextStream::operator<<): Use append instead of appendNumber.
Implement some common Baseline JIT slow paths using JIT thunks. https://bugs.webkit.org/show_bug.cgi?id=225682 Reviewed by Filip Pizlo. Source/JavaScriptCore: This patch implements the following changes: 1. Implement exception handling thunks: a. handleExceptionGenerator, which calls operationLookupExceptionHandler(). b. handleExceptionWithCallFrameRollbackGenerator, which calls operationLookupExceptionHandlerFromCallerFrame(). All the JIT tiers were emitting their own copy of these routines to call these operation, one per CodeBlock. We now emit 2 thunks for these and have all the tiers just jump to them. PolymorphicAccess also now uses the handleExceptionGenerator thunk. DFG::JITCompiler::compileExceptionHandlers() has one small behavior difference before it calls operationLookupExceptionHandlerFromCallerFrame(): it first re-sets the top of stack for the function where we are about to throw a StackOverflowError from. This re-setting of top of stack is useless because we're imminently unwinding out of at least this frame for the StackOverflowError. Hence, it is ok to use the handleExceptionWithCallFrameRollbackGenerator thunk here as well. Note that no other tiers does this re-setting of top of stack. FTLLowerDFGToB3 has one case using operationLookupExceptionHandlerFromCallerFrame() which cannot be refactored to use these thunks because it does additional work to throw a StackOverflowError. A different thunk will be needed. I left it alone for now. 2. Introduce JITThunks::existingCTIStub(ThunkGenerator, NoLockingNecessaryTag) so that a thunk can get a pointer to another thunk without locking the JITThunks lock. Otherwise, deadlock ensues. 3. Change SlowPathCall to emit and use thunks instead of emitting a blob of code to call a slow path function for every bytecode in a CodeBlock. 4. Introduce JITThunks::ctiSlowPathFunctionStub() to manage these SlowPathFunction thunks. 5. Introduce JITThunks::preinitializeAggressiveCTIThunks() to initialize these thunks at VM initialization time. Pre-initializing them has multiple benefits: a. the thunks are not scattered through out JIT memory, thereby reducing fragmentation. b. we don't spend time at runtime compiling them when the user is interacting with the VM. Conceptually, these thunks can be VM independent and can be shared by VMs process-wide. However, it will require some additional work. For now, the thunks remain bound to a specific VM instance. These changes are only enabled when ENABLE(EXTRA_CTI_THUNKS), which is currently only available for ARM64 and non-Windows x86_64. This patch has passed JSC tests on AS Mac. With this patch, --dumpLinkBufferStats shows the following changes in emitted JIT code size (using a single run of the CLI version of JetStream2 on AS Mac): Base New Diff BaselineJIT: 89089964 (84.962811 MB) 84624776 (80.704475 MB) 0.95x (reduction) DFG: 39117360 (37.305222 MB) 36415264 (34.728302 MB) 0.93x (reduction) Thunk: 23230968 (22.154778 MB) 23130336 (22.058807 MB) 1.00x InlineCache: 22027416 (21.006981 MB) 21969728 (20.951965 MB) 1.00x FTL: 6575772 (6.271145 MB) 6097336 (5.814873 MB) 0.93x (reduction) Wasm: 2302724 (2.196049 MB) 2301956 (2.195316 MB) 1.00x YarrJIT: 1538956 (1.467663 MB) 1522488 (1.451958 MB) 0.99x CSSJIT: 0 0 Uncategorized: 0 0 * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: * bytecode/CodeBlock.h: (JSC::CodeBlock::offsetOfInstructionsRawPointer): * bytecode/PolymorphicAccess.cpp: (JSC::AccessGenerationState::emitExplicitExceptionHandler): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compileExceptionHandlers): (JSC::DFG::JITCompiler::link): * dfg/DFGJITCompiler.h: * ftl/FTLCompile.cpp: (JSC::FTL::compile): * ftl/FTLLink.cpp: (JSC::FTL::link): * jit/JIT.cpp: (JSC::JIT::link): (JSC::JIT::privateCompileExceptionHandlers): * jit/JIT.h: * jit/JITThunks.cpp: (JSC::JITThunks::existingCTIStub): (JSC::JITThunks::ctiSlowPathFunctionStub): (JSC::JITThunks::preinitializeExtraCTIThunks): * jit/JITThunks.h: * jit/SlowPathCall.cpp: Added. (JSC::JITSlowPathCall::call): (JSC::JITSlowPathCall::generateThunk): * jit/SlowPathCall.h: * jit/ThunkGenerators.cpp: (JSC::handleExceptionGenerator): (JSC::handleExceptionWithCallFrameRollbackGenerator): (JSC::popThunkStackPreservesAndHandleExceptionGenerator): * jit/ThunkGenerators.h: * runtime/CommonSlowPaths.h: * runtime/SlowPathFunction.h: Added. * runtime/VM.cpp: (JSC::VM::VM): Source/WTF: Introduce ENABLE(EXTRA_CTI_THUNKS) flag to guard the use of these new thunks. Currently, the thunks are 64-bit only, and only supported for ARM64 and non-Windows X86_64. The reason it is not supported for Windows as well is because Windows only has 4 argument registers. In this patch, the thunks do not use that many registers yet, but there will be more thunks coming that will require the use of up to 6 argument registers. * wtf/PlatformEnable.h: Canonical link: https://commits.webkit.org/237639@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277383 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-12 19:11:25 +00:00
2021-05-12 Mark Lam <mark.lam@apple.com>
Implement some common Baseline JIT slow paths using JIT thunks.
https://bugs.webkit.org/show_bug.cgi?id=225682
Reviewed by Filip Pizlo.
Introduce ENABLE(EXTRA_CTI_THUNKS) flag to guard the use of these new thunks.
Currently, the thunks are 64-bit only, and only supported for ARM64 and non-Windows
X86_64. The reason it is not supported for Windows as well is because Windows
only has 4 argument registers. In this patch, the thunks do not use that many
registers yet, but there will be more thunks coming that will require the use
of up to 6 argument registers.
* wtf/PlatformEnable.h:
Port WTF::FileSystem::listDirectory to std::filesystem https://bugs.webkit.org/show_bug.cgi?id=225633 Reviewed by Darin Adler. Source/WebCore: Update FileSystem::listDirectory() call sites to deal with the fact that: - The function now returns file names instead of full file paths - The callers now have to do filtering by themselves if they need it * Modules/entriesapi/DOMFileSystem.cpp: (WebCore::listDirectoryWithMetadata): * Modules/indexeddb/server/IDBServer.cpp: (WebCore::IDBServer::IDBServer::getAllDatabaseNamesAndVersions): (WebCore::IDBServer::collectOriginsForVersion): (WebCore::IDBServer::removeAllDatabasesForFullOriginPath): (WebCore::IDBServer::removeAllDatabasesForOriginPath): (WebCore::IDBServer::IDBServer::removeDatabasesModifiedSinceForVersion): (WebCore::IDBServer::IDBServer::removeDatabasesWithOriginsForVersion): * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: (WebCore::IDBServer::SQLiteIDBBackingStore::fullDatabaseDirectoryWithUpgrade): (WebCore::IDBServer::SQLiteIDBBackingStore::databasesSizeForDirectory): * Modules/webdatabase/DatabaseTracker.cpp: (WebCore::DatabaseTracker::usage): (WebCore::DatabaseTracker::deleteOrigin): * html/DirectoryFileListCreator.cpp: (WebCore::appendDirectoryFiles): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::uriDecodeBinElementAddedCallback): (WebCore::MediaPlayerPrivateGStreamer::purgeOldDownloadFiles): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: * platform/text/hyphen/HyphenationLibHyphen.cpp: (WebCore::extractLocaleFromDictionaryFileName): (WebCore::scanDirectoryForDictionaries): Source/WebKit: Update FileSystem::listDirectory() call sites to deal with the fact that: - The function now returns file names instead of full file paths - The callers now have to do filtering by themselves if they need it * NetworkProcess/WebStorage/LocalStorageDatabaseTracker.cpp: (WebKit::LocalStorageDatabaseTracker::origins const): * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::getDirectorySize): (WebKit::CacheStorage::Engine::getDirectories): (WebKit::CacheStorage::Engine::clearAllCachesFromDisk): * NetworkProcess/cache/NetworkCacheFileSystem.cpp: (WebKit::NetworkCache::traverseDirectory): * UIProcess/API/APIContentRuleListStore.cpp: (API::ContentRuleListStore::getAvailableContentRuleListIdentifiers): (API::ContentRuleListStore::synchronousRemoveAllContentRuleLists): * UIProcess/DeviceIdHashSaltStorage.cpp: (WebKit::DeviceIdHashSaltStorage::loadStorageFromDisk): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::mediaKeyOrigins): (WebKit::WebsiteDataStore::removeMediaKeys): * WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.cpp: (WebKit::WebKitExtensionManager::scanModules): * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp: (WebKit::WebMediaKeyStorageManager::getMediaKeyOrigins): (WebKit::removeAllMediaKeyStorageForOriginPath): (WebKit::WebMediaKeyStorageManager::deleteMediaKeyEntriesModifiedBetweenDates): (WebKit::WebMediaKeyStorageManager::deleteAllMediaKeyEntries): Source/WebKitLegacy: Update FileSystem::listDirectory() call sites to deal with the fact that: - The function now returns file names instead of full file paths - The callers now have to do filtering by themselves if they need it * Storage/StorageTracker.cpp: (WebKit::StorageTracker::syncFileSystemAndTrackerDatabase): Source/WebKitLegacy/win: Update FileSystem::listDirectory() call sites to deal with the fact that: - The function now returns file names instead of full file paths - The callers now have to do filtering by themselves if they need it * Plugins/PluginDatabase.cpp: (WebCore::PluginDatabase::getPluginPathsInDirectories const): Source/WTF: Port WTF::FileSystem::listDirectory to std::filesystem with the following 2 changes: - The function no longer takes a (blob-style) filter parameter - The function now returns file names instead of file paths, allowing the call sites to more easily filter based on prefixes. * wtf/FileSystem.cpp: (WTF::FileSystemImpl::listDirectory): * wtf/FileSystem.h: * wtf/glib/FileSystemGlib.cpp: * wtf/posix/FileSystemPOSIX.cpp: * wtf/win/FileSystemWin.cpp: Tools: Add API test coverage. * TestWebKitAPI/Tests/WTF/FileSystem.cpp: (TestWebKitAPI::createTestFile): (TestWebKitAPI::TEST_F): * TestWebKitAPI/Tests/WebCore/cocoa/DatabaseTrackerTest.mm: (TestWebKitAPI::removeDirectoryAndAllContents): Canonical link: https://commits.webkit.org/237615@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277357 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-12 05:55:23 +00:00
2021-05-11 Chris Dumez <cdumez@apple.com>
Port WTF::FileSystem::listDirectory to std::filesystem
https://bugs.webkit.org/show_bug.cgi?id=225633
Reviewed by Darin Adler.
Port WTF::FileSystem::listDirectory to std::filesystem with the following 2 changes:
- The function no longer takes a (blob-style) filter parameter
- The function now returns file names instead of file paths, allowing the call sites
to more easily filter based on prefixes.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::listDirectory):
* wtf/FileSystem.h:
* wtf/glib/FileSystemGlib.cpp:
* wtf/posix/FileSystemPOSIX.cpp:
* wtf/win/FileSystemWin.cpp:
Remove the String::toInt family of functions https://bugs.webkit.org/show_bug.cgi?id=225599 Reviewed by Anders Carlsson. Source/WebCore: * platform/graphics/GLContext.cpp: (WebCore::GLContext::version): Use parseIntegerAllowingTrailingJunk<unsigned> instead of String::toUInt. * platform/graphics/GlyphBuffer.h: (WebCore::GlyphBuffer::checkedStringOffsetAt const): Fix code that was assuming GlyphBufferStringOffset was signed to compile without a warning regardless of whether it's signed or unsigned. This was making GTK builds have tons and tons of warnings, which was distracting while working on the other fixes here. * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (CachedResourceStreamingClient::responseReceived): Use parseIntegerAllowingTrailingJunk<uint64_t> instead of String::toUInt64. Source/WebKit: * Shared/win/AuxiliaryProcessMainWin.cpp: (WebKit::AuxiliaryProcessMainCommon::parseCommandLine): Use parseIntegerAllowingTrailingJunk<uint64_t> instead of String::toUInt64. * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp: (WebKit::ScriptMessageClient::didPostMessage): Ditto. * UIProcess/win/WebProcessPoolWin.cpp: (WebKit::initializeRemoteInspectorServer): Use parseIntegerAllowingTrailingJunk<uint16_t> instead of StringView::toUInt64. This is a 16-bit port number, so not valuable to parse larger integers. Source/WTF: * wtf/text/AtomString.h: Deleted AtomString::toInt. * wtf/text/StringImpl.cpp: (WTF::StringImpl::toIntStrict): Deleted. (WTF::StringImpl::toUIntStrict): Deleted. (WTF::StringImpl::toInt64Strict): Deleted. (WTF::StringImpl::toUInt64Strict): Deleted. (WTF::StringImpl::toIntPtrStrict): Deleted. (WTF::StringImpl::toInt): Deleted. (WTF::StringImpl::toUInt): Deleted. (WTF::StringImpl::toInt64): Deleted. (WTF::StringImpl::toUInt64): Deleted. (WTF::StringImpl::toIntPtr): Deleted. * wtf/text/StringImpl.h: Deleted the above functions. * wtf/text/StringToIntegerConversion.h: Removed toIntegralType. * wtf/text/StringView.cpp: (WTF::parseUInt16): Deleted. * wtf/text/StringView.h: Deleted StringView::toInt, StringView::toIntStrict, StringView::toUInt64Strict, StringView::toInt64Strict, and parseUInt16. Changed the constructor that takes a const char* to work when passed nullptr. StringView has a null value, and converting a null const char* should produce that. * wtf/text/WTFString.cpp: (WTF::String::toIntStrict const): Deleted. (WTF::String::toUIntStrict const): Deleted. (WTF::String::toInt64Strict const): Deleted. (WTF::String::toUInt64Strict const): Deleted. (WTF::String::toIntPtrStrict const): Deleted. (WTF::String::toInt const): Deleted. (WTF::String::toUInt const): Deleted. (WTF::String::toInt64 const): Deleted. (WTF::String::toUInt64 const): Deleted. (WTF::String::toIntPtr const): Deleted. (WTF::lengthOfCharactersAsInteger): Deleted. (WTF::charactersToIntStrict): Deleted. (WTF::charactersToUIntStrict): Deleted. (WTF::charactersToInt64Strict): Deleted. (WTF::charactersToUInt64Strict): Deleted. (WTF::charactersToIntPtrStrict): Deleted. (WTF::charactersToInt): Deleted. (WTF::charactersToUInt): Deleted. (WTF::charactersToInt64): Deleted. (WTF::charactersToUInt64): Deleted. (WTF::charactersToIntPtr): Deleted. * wtf/text/WTFString.h: Deleted the above functions. Tools: * TestWebKitAPI/CMakeLists.txt: Added StringToIntegerConversion.cpp. * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: Ditto. * TestWebKitAPI/Tests/WTF/StringToIntegerConversion.cpp: Added. Contains tests moved and adapted from the files below so we don't lose test coverage. We and and should add many more tests. * TestWebKitAPI/Tests/WTF/StringView.cpp: Removed tests for parseUInt16 and StringView::toIntStrict. * TestWebKitAPI/Tests/WTF/WTFString.cpp: Removed tests for String::toInt. * TestWebKitAPI/Tests/WebKitCocoa/WKURLSchemeHandler-1.mm: Use parseInteger<uint64_t> instead of StringView::toUInt64Strict. * TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm: Ditto. Canonical link: https://commits.webkit.org/237613@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277355 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-12 04:23:30 +00:00
2021-05-11 Darin Adler <darin@apple.com>
Remove the String::toInt family of functions
https://bugs.webkit.org/show_bug.cgi?id=225599
Reviewed by Anders Carlsson.
* wtf/text/AtomString.h: Deleted AtomString::toInt.
* wtf/text/StringImpl.cpp:
(WTF::StringImpl::toIntStrict): Deleted.
(WTF::StringImpl::toUIntStrict): Deleted.
(WTF::StringImpl::toInt64Strict): Deleted.
(WTF::StringImpl::toUInt64Strict): Deleted.
(WTF::StringImpl::toIntPtrStrict): Deleted.
(WTF::StringImpl::toInt): Deleted.
(WTF::StringImpl::toUInt): Deleted.
(WTF::StringImpl::toInt64): Deleted.
(WTF::StringImpl::toUInt64): Deleted.
(WTF::StringImpl::toIntPtr): Deleted.
* wtf/text/StringImpl.h: Deleted the above functions.
* wtf/text/StringToIntegerConversion.h: Removed toIntegralType.
* wtf/text/StringView.cpp:
(WTF::parseUInt16): Deleted.
* wtf/text/StringView.h: Deleted StringView::toInt,
StringView::toIntStrict, StringView::toUInt64Strict,
StringView::toInt64Strict, and parseUInt16. Changed the constructor
that takes a const char* to work when passed nullptr. StringView has
a null value, and converting a null const char* should produce that.
* wtf/text/WTFString.cpp:
(WTF::String::toIntStrict const): Deleted.
(WTF::String::toUIntStrict const): Deleted.
(WTF::String::toInt64Strict const): Deleted.
(WTF::String::toUInt64Strict const): Deleted.
(WTF::String::toIntPtrStrict const): Deleted.
(WTF::String::toInt const): Deleted.
(WTF::String::toUInt const): Deleted.
(WTF::String::toInt64 const): Deleted.
(WTF::String::toUInt64 const): Deleted.
(WTF::String::toIntPtr const): Deleted.
(WTF::lengthOfCharactersAsInteger): Deleted.
(WTF::charactersToIntStrict): Deleted.
(WTF::charactersToUIntStrict): Deleted.
(WTF::charactersToInt64Strict): Deleted.
(WTF::charactersToUInt64Strict): Deleted.
(WTF::charactersToIntPtrStrict): Deleted.
(WTF::charactersToInt): Deleted.
(WTF::charactersToUInt): Deleted.
(WTF::charactersToInt64): Deleted.
(WTF::charactersToUInt64): Deleted.
(WTF::charactersToIntPtr): Deleted.
* wtf/text/WTFString.h: Deleted the above functions.
[macCatalyst] should have CSS `hover: hover` and `pointer: fine` https://bugs.webkit.org/show_bug.cgi?id=225672 Reviewed by Tim Horton. Source/WebKit: Test: iOSMouseSupport.MouseAlwaysConnected * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::isMousePrimaryPointingDevice): Added. (WebKit::hasAccessoryMousePointingDevice): Added. (WebKit::hasAccessoryStylusPointingDevice): Added. (WebKit::WebPage::hoverSupportedByPrimaryPointingDevice const): (WebKit::WebPage::hoverSupportedByAnyAvailablePointingDevice const): (WebKit::WebPage::pointerCharacteristicsOfPrimaryPointingDevice const): (WebKit::WebPage::pointerCharacteristicsOfAllAvailablePointingDevices const): (WebKit::hasMouseDevice): Deleted. macCatalyst should consider the mouse as the primary pointing device, just like macOS: - `hover` and `any-hover` should always be `hover` - `pointer` and `any-pointer` should always be `fine` (instead of only if an accessory mouse/stylus is connected) * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::notifyHasMouseDeviceChanged): Added. (WebKit::WebProcessProxy::notifyHasStylusDeviceChanged): * UIProcess/ios/WebProcessProxyIOS.mm: (WebKit::WebProcessProxy::platformInitialize): (WebKit::WebProcessProxy::platformDestroy): (WebKit::WebProcessProxy::notifyHasMouseDeviceChanged): Deleted. * UIProcess/ios/WKMouseDeviceObserver.h: * UIProcess/ios/WKMouseDeviceObserver.mm: * Shared/WebProcessCreationParameters.h: * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * WebProcess/WebProcess.messages.in: * WebProcess/WebProcess.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): Clean up macro usage to avoid unnecessary work on macCatalyst. Drive-by: Move non-platform code to non-platform files. Source/WTF: * wtf/PlatformHave.h: Add `HAVE_MOUSE_DEVICE_OBSERVATION` and `HAVE_STYLUS_DEVICE_OBSERVATION` to make callsites clearer instead of having a somewhat unrelated connection to `HAVE_UIKIT_WITH_MOUSE_SUPPORT` and `HAVE_PENCILKIT_TEXT_INPUT` (not to mention both of them are `PLATFORM(MACCATALYST)` which isn't desirable since macCatalyst should consider the mouse as the primary pointing device, just like macOS). Tools: * TestWebKitAPI/Tests/WebKitCocoa/iOSMouseSupport.mm: (TEST.iOSMouseSupport.MouseAlwaysConnected): * TestWebKitAPI/Tests/WebKitCocoa/iOSStylusSupport.mm: Canonical link: https://commits.webkit.org/237612@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277354 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-12 03:55:46 +00:00
2021-05-11 Devin Rousso <drousso@apple.com>
[macCatalyst] should have CSS `hover: hover` and `pointer: fine`
https://bugs.webkit.org/show_bug.cgi?id=225672
Reviewed by Tim Horton.
* wtf/PlatformHave.h:
Add `HAVE_MOUSE_DEVICE_OBSERVATION` and `HAVE_STYLUS_DEVICE_OBSERVATION` to make callsites
clearer instead of having a somewhat unrelated connection to `HAVE_UIKIT_WITH_MOUSE_SUPPORT`
and `HAVE_PENCILKIT_TEXT_INPUT` (not to mention both of them are `PLATFORM(MACCATALYST)`
which isn't desirable since macCatalyst should consider the mouse as the primary pointing
device, just like macOS).
2021-05-11 Alex Christensen <achristensen@webkit.org>
Remove xpc_connection_kill
https://bugs.webkit.org/show_bug.cgi?id=225602
Reviewed by Alexey Proskuryakov.
* wtf/PlatformHave.h:
2021-05-10 Chris Dumez <cdumez@apple.com>
[ macOS Release wk2 ] http/tests/cache-storage/cache-records-persistency.https.html is flaky crashing
https://bugs.webkit.org/show_bug.cgi?id=225522
<rdar://problem/77680019>
Reviewed by Darin Adler.
Pass ec parameter to std::filesystem::directory_iterator() so that it doesn't throw in case of the
path does not exist. Normally, the function would return early earlier if the path does not exist
or isn't a directory. However, in the context of the test, this function is getting called on a
background thread and another thread is deleting the directory in parallel.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::deleteEmptyDirectory):
2021-05-10 Devin Rousso <drousso@apple.com>
`SLEEP_THREAD_FOR_DEBUGGER` should print the PID before sleeping
https://bugs.webkit.org/show_bug.cgi?id=225619
Reviewed by Tim Horton.
* wtf/DebugUtilities.h:
Implement <form>.requestSubmit() https://bugs.webkit.org/show_bug.cgi?id=197958 Patch by Rob Buis <rbuis@igalia.com> on 2021-05-10 Reviewed by Darin Adler. LayoutTests/imported/w3c: Update improved test results and import requestSubmit tests. * web-platform-tests/html/dom/idlharness.https-expected.txt: * web-platform-tests/html/semantics/forms/form-submission-0/request-submit-activation-expected.txt: Added. * web-platform-tests/html/semantics/forms/form-submission-0/request-submit-activation.html: Added. * web-platform-tests/html/semantics/forms/the-form-element/form-requestsubmit-autofocus-expected.txt: Added. * web-platform-tests/html/semantics/forms/the-form-element/form-requestsubmit-autofocus.html: Added. * web-platform-tests/html/semantics/forms/the-form-element/form-requestsubmit-expected.txt: * web-platform-tests/html/semantics/forms/the-form-element/form-requestsubmit.html: Source/WebCore: Implement the requestSubmit method as defined here [1]. Behavior matches Chrome and Firefox. [1] https://html.spec.whatwg.org/multipage/forms.html#dom-form-requestsubmit Tests: imported/w3c/web-platform-tests/html/semantics/forms/the-form-element/form-requestsubmit.html imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/request-submit-activation.html imported/w3c/web-platform-tests/html/semantics/forms/the-form-element/form-requestsubmit-autofocus.html * html/HTMLButtonElement.cpp: (WebCore::HTMLButtonElement::defaultEventHandler): (WebCore::HTMLButtonElement::isSubmitButton const): * html/HTMLButtonElement.h: * html/HTMLFormControlElement.h: (WebCore::HTMLFormControlElement::isSubmitButton const): * html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::submitImplicitly): (WebCore::HTMLFormElement::submitIfPossible): (WebCore::HTMLFormElement::requestSubmit): (WebCore::HTMLFormElement::findSubmitButton): (WebCore::HTMLFormElement::submit): (WebCore::HTMLFormElement::effectiveTarget const): (WebCore::HTMLFormElement::findSubmitter const): (WebCore::HTMLFormElement::reportValidity): (WebCore::HTMLFormElement::prepareForSubmission): Deleted. (WebCore::HTMLFormElement::findSubmitButton const): Deleted. * html/HTMLFormElement.h: * html/HTMLFormElement.idl: * html/HTMLInputElement.h: * html/ImageInputType.cpp: (WebCore::ImageInputType::handleDOMActivateEvent): * html/ImageInputType.h: * html/InputType.h: (WebCore::InputType::isSubmitButton const): * html/SubmitInputType.cpp: (WebCore::SubmitInputType::handleDOMActivateEvent): * loader/FormSubmission.cpp: (WebCore::FormSubmission::create): * loader/FormSubmission.h: Source/WTF: Add requestSubmit as experimental feature, disabled by default. * Scripts/Preferences/WebPreferencesExperimental.yaml: LayoutTests: Update improved test results. * platform/gtk/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt: * platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt: * platform/mac-wk1/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt: * platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt: * platform/wpe/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt: Canonical link: https://commits.webkit.org/237526@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277257 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-10 07:16:13 +00:00
2021-05-10 Rob Buis <rbuis@igalia.com>
Implement <form>.requestSubmit()
https://bugs.webkit.org/show_bug.cgi?id=197958
Reviewed by Darin Adler.
Add requestSubmit as experimental feature, disabled by default.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
Remove uses of the String::toInt family of functions from WebCore/html and similar directories https://bugs.webkit.org/show_bug.cgi?id=225577 Reviewed by Sam Weinig. Source/WebCore: * dom/Document.cpp: (WebCore::Document::createEvent): Fix spelling error. * html/FTPDirectoryDocument.cpp: (WebCore::processFilesizeString): Use parseIntegerAllowingTrailingJunk<uint64_t> instead of String::toUInt64. * html/FormController.cpp: (WebCore::deserializeFormControlState): Use parseIntegerAllowingTrailingJunk<size_t> instead of String::toUInt. (WebCore::SavedFormState::deserialize): Ditto. * html/HTMLFontElement.cpp: (WebCore::parseFontSize): Use parseInteger<int> instead of charactersToIntStrict. * html/HTMLFrameElement.cpp: (WebCore::HTMLFrameElement::parseAttribute): Use parseIntegerAllowingTrailingJunk<int> instead of String::toInt. * html/HTMLFrameSetElement.cpp: (WebCore::HTMLFrameSetElement::parseAttribute): Ditto. * html/HTMLHRElement.cpp: (WebCore::HTMLHRElement::collectStyleForPresentationAttribute): Ditto. * html/HTMLIFrameElement.cpp: (WebCore::HTMLIFrameElement::collectStyleForPresentationAttribute): Ditto. * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::parseAttribute): Ditto. * html/HTMLLIElement.cpp: (WebCore::HTMLLIElement::parseValue): Ditto. * html/HTMLMarqueeElement.cpp: (WebCore::HTMLMarqueeElement::loop const): Ditto. * html/HTMLTableCellElement.cpp: (WebCore::HTMLTableCellElement::collectStyleForPresentationAttribute): Ditto. * html/HTMLTableColElement.cpp: (WebCore::HTMLTableColElement::parseAttribute): Ditto. * html/HTMLTableElement.cpp: (WebCore::HTMLTableElement::parseAttribute): Ditto. * html/LinkIconCollector.cpp: (WebCore::LinkIconCollector::iconsOfTypes): Use parseIntegerAllowingTrailingJunk<unsigned> instead of String::toUInt. Also removed unneeded call to stripWhiteSpace since the integer parsing function already skips leading and trailing spaces. * html/MediaFragmentURIParser.cpp: (WebCore::MediaFragmentURIParser::parseNPTTime): Use parseInteger<int> instead of String::toInt. The strings passsed in are fixed size and all digits. * html/TypeAhead.cpp: (WebCore::TypeAhead::handleEvent): Use parseIntegerAllowingTrailingJunk<int> instead of String::toInt. * html/URLDecomposition.cpp: (WebCore::URLDecomposition::setHost): Use parseInteger<uint16_t> instead of parseUInt16. (WebCore::parsePort): Ditto. * html/shadow/DateTimeNumericFieldElement.cpp: (WebCore::DateTimeNumericFieldElement::handleKeyboardEvent): Use parseIntegerAllowingTrailingJunk<int> instead of String::toInt. * html/track/VTTScanner.cpp: (WebCore::VTTScanner::scanDigits): Use parseInteger<int> instead of charactersToIntStrict. * mathml/MathMLSelectElement.cpp: (WebCore::MathMLSelectElement::getSelectedActionChildAndIndex): Use parseIntegerAllowingTrailingJunk<int> instead of AtomString::toInt. Source/WTF: * wtf/text/StringBuilder.h: Added conversion operator to make a StringView, built on the exiting is8Bit, characters8, characters16 and length functions. Removed now-uneeded equal function and == and != operators since the StringView ones work for those same cases with the same syntax. Canonical link: https://commits.webkit.org/237514@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277245 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-09 18:22:23 +00:00
2021-05-09 Darin Adler <darin@apple.com>
Remove uses of the String::toInt family of functions from WebCore/html and similar directories
https://bugs.webkit.org/show_bug.cgi?id=225577
Reviewed by Sam Weinig.
* wtf/text/StringBuilder.h: Added conversion operator to make a StringView, built on the exiting
is8Bit, characters8, characters16 and length functions. Removed now-uneeded equal function and
== and != operators since the StringView ones work for those same cases with the same syntax.
Rename toIntegralType to parseInteger and prepare to use it to replace all our integer-parsing functions https://bugs.webkit.org/show_bug.cgi?id=225560 Reviewed by Sam Weinig. I have a much larger patch that replaces all the many toInt functions with these parseInteger function templates. The parseInteger ones take StringView, which means we can pass almost any type of string or character/length pair including a substring without allocating a new string, return Optional rather than using an out argument to report failure, take the integer type as a template parameter so can be used for precisely the desired type at each call site, and make the "allow trailing junk" feature explicit, rather than implicitly including it in the shortest named functions, which I hope will discourage people from using that junk-ignoring mode when it's not desirable. Also includes adoption of parseInteger within WTF itself, outside the string classes. My plan is to land the rest of adoption of this in chunks so we can review carefully and spot mistakes as we go. Then return to files like WTFString.h and remove the many old functions this replaces, including the String::toInt and charactersToInt families of functions. * wtf/URL.cpp: (WTF::URL::port const): Use parseInteger<uint16_t>. (WTF::URL::setHostAndPort): Ditto. * wtf/text/StringToIntegerConversion.h: Refactored the existing code to tighten things up a bit, and got rid of overloads that take pointer and length and the the generic "any string type" feature, since StringView already works well for that. Renamed toIntegralType to parseInteger, leaving the old name behind to ease the transition while adopting parseInteger. * wtf/text/WTFString.cpp: (WTF::toDoubleType): Use the TrailingJunkPolicy enumeration from the StringToIntegerConversion.h header. (WTF::charactersToDouble): Ditto. (WTF::charactersToFloat): Ditto. Canonical link: https://commits.webkit.org/237503@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277234 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-09 00:59:28 +00:00
2021-05-08 Darin Adler <darin@apple.com>
Rename toIntegralType to parseInteger and prepare to use it to replace all our integer-parsing functions
https://bugs.webkit.org/show_bug.cgi?id=225560
Reviewed by Sam Weinig.
I have a much larger patch that replaces all the many toInt functions with these parseInteger
function templates. The parseInteger ones take StringView, which means we can pass almost any
type of string or character/length pair including a substring without allocating a new string,
return Optional rather than using an out argument to report failure, take the integer type as
a template parameter so can be used for precisely the desired type at each call site, and make
the "allow trailing junk" feature explicit, rather than implicitly including it in the shortest
named functions, which I hope will discourage people from using that junk-ignoring mode
when it's not desirable.
Also includes adoption of parseInteger within WTF itself, outside the string classes.
My plan is to land the rest of adoption of this in chunks so we can review carefully and spot
mistakes as we go. Then return to files like WTFString.h and remove the many old functions
this replaces, including the String::toInt and charactersToInt families of functions.
* wtf/URL.cpp:
(WTF::URL::port const): Use parseInteger<uint16_t>.
(WTF::URL::setHostAndPort): Ditto.
* wtf/text/StringToIntegerConversion.h: Refactored the existing code to tighten things up
a bit, and got rid of overloads that take pointer and length and the the generic "any string
type" feature, since StringView already works well for that. Renamed toIntegralType to
parseInteger, leaving the old name behind to ease the transition while adopting parseInteger.
* wtf/text/WTFString.cpp:
(WTF::toDoubleType): Use the TrailingJunkPolicy enumeration from the
StringToIntegerConversion.h header.
(WTF::charactersToDouble): Ditto.
(WTF::charactersToFloat): Ditto.
2021-05-08 Chris Dumez <cdumez@apple.com>
Port Filesystem::pathByAppendingComponent() & Filesystem:: pathByAppendingComponents() to std::filesystem
https://bugs.webkit.org/show_bug.cgi?id=225550
Reviewed by Darin Adler.
Port Filesystem::pathByAppendingComponent() & Filesystem:: pathByAppendingComponents() to std::filesystem
and get rid of platform-specific implementations.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::pathByAppendingComponent):
(WTF::FileSystemImpl::pathByAppendingComponents):
* wtf/glib/FileSystemGlib.cpp:
* wtf/posix/FileSystemPOSIX.cpp:
* wtf/win/FileSystemWin.cpp:
2021-05-08 Diego Pino Garcia <dpino@igalia.com>
[GLIB] REGRESSION(r277158) imported/w3c/web-platform-tests/xhr/FormData-append.html is crashing
https://bugs.webkit.org/show_bug.cgi?id=225551
Reviewed by Chris Dumez.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::fileIsDirectory): Remove unnecessary path.isEmpty check.
* wtf/glib/FileSystemGlib.cpp:
(WTF::FileSystemImpl::fileSystemRepresentation): Return empty CString if path is empty.
2021-05-07 Chris Dumez <cdumez@apple.com>
Port FileSystem::pathGetFileName() & Filesystem::directoryName() to std::filesystem
https://bugs.webkit.org/show_bug.cgi?id=225524
Reviewed by Darin Adler.
Port FileSystem::pathGetFileName() & Filesystem::directoryName() to std::filesystem so
that we can get rid of platform-specific implementions.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::pathGetFileName):
(WTF::FileSystemImpl::directoryName):
* wtf/glib/FileSystemGlib.cpp:
(WTF::FileSystemImpl::pathGetFileName): Deleted.
(WTF::FileSystemImpl::directoryName): Deleted.
* wtf/posix/FileSystemPOSIX.cpp:
(WTF::FileSystemImpl::pathGetFileName): Deleted.
(WTF::FileSystemImpl::directoryName): Deleted.
* wtf/win/FileSystemWin.cpp:
(WTF::FileSystemImpl::pathGetFileName): Deleted.
(WTF::FileSystemImpl::directoryName): Deleted.
Add an experimental alternative display-list-based RemoteLayerBackingStore implementation https://bugs.webkit.org/show_bug.cgi?id=225508 Reviewed by Sam Weinig. Source/WebKit: * Shared/RemoteLayerTree/CGDisplayListImageBufferBackend.cpp: Added. (WebKit::CGDisplayListImageBufferBackend::calculateMemoryCost): (WebKit::CGDisplayListImageBufferBackend::create): (WebKit::CGDisplayListImageBufferBackend::CGDisplayListImageBufferBackend): (WebKit::CGDisplayListImageBufferBackend::createImageBufferBackendHandle const): (WebKit::CGDisplayListImageBufferBackend::context const): (WebKit::CGDisplayListImageBufferBackend::backendSize const): (WebKit::CGDisplayListImageBufferBackend::bytesPerRow const): (WebKit::CGDisplayListImageBufferBackend::copyNativeImage const): (WebKit::CGDisplayListImageBufferBackend::toBGRAData const): (WebKit::CGDisplayListImageBufferBackend::getImageData const): (WebKit::CGDisplayListImageBufferBackend::putImageData): * Shared/RemoteLayerTree/CGDisplayListImageBufferBackend.h: Added. Add an ImageBuffer backend backed by a CG display list. * Shared/RemoteLayerTree/RemoteLayerBackingStore.h: Add a new RemoteLayerBackingStore type that uses CGDisplayListImageBufferBackend. * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::encode const): (WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer): (WebKit::RemoteLayerBackingStore::supportsPartialRepaint): Disable partial repaint if using display-list-based backing store, because we don't currently have any way to mutate display lists. (WebKit::RemoteLayerBackingStore::display): (WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer): When applying a display-list-based backing store to a layer, we just pass the encodede data directly to the layer, and tell it to use the display list to render. * SourcesCocoa.txt: * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm: (WebKit::RemoteLayerTreeNode::createWithPlainLayer): (-[WKPlainRemoteLayer description]): Deleted. Move WKPlainRemoteLayer to RemoteLayerTreeLayers, and rename it to WKCompositingLayer. It will now back all WKCompositingViews. * UIProcess/RemoteLayerTree/cocoa/RemoteLayerTreeLayers.h: Added. * UIProcess/RemoteLayerTree/cocoa/RemoteLayerTreeLayers.mm: Added. (-[WKCompositingLayer description]): (-[WKCompositingLayer _setWKContentsDisplayList:]): (-[WKCompositingLayer _wkContentsDisplayList]): (-[WKCompositingLayer drawInContext:]): Make WKCompositingLayer replay the given display list in drawRect (just because we're currently missing API to actually directly pass the encoded display list data to CA). * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm: (+[WKCompositingView layerClass]): Use WKCompositingLayer as the layer class for all WKCompositingViews. * WebKit.xcodeproj/project.pbxproj: * WebProcess/GPU/graphics/ImageBufferBackendHandle.h: * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::updateBackingStore): * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h: (WebKit::RemoteLayerTreeContext::useCGDisplayListsForDOMRendering const): (WebKit::RemoteLayerTreeContext::setUseCGDisplayListsForDOMRendering): * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::updatePreferences): Plumb the internal feature flag from WebPreferences to RemoteLayerTreeContext to PlatformCALayerRemote to RemoteLayerBackingStore; if the preference is on and the feature is available, we'll always prefer display-list backed surfaces over either of the bitmap types. Source/WTF: * Scripts/Preferences/WebPreferencesInternal.yaml: Canonical link: https://commits.webkit.org/237482@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277210 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-07 23:46:04 +00:00
2021-05-07 Tim Horton <timothy_horton@apple.com>
Add an experimental alternative display-list-based RemoteLayerBackingStore implementation
https://bugs.webkit.org/show_bug.cgi?id=225508
Reviewed by Sam Weinig.
* Scripts/Preferences/WebPreferencesInternal.yaml:
2021-05-07 Philippe Normand <pnormand@igalia.com>
[GTK] Warnings about unused filesystem functions
https://bugs.webkit.org/show_bug.cgi?id=225507
Reviewed by Adrian Perez de Castro.
Since r277158 these functions are no longer needed.
* wtf/glib/FileSystemGlib.cpp:
(WTF::FileSystemImpl::getFileStat): Deleted.
(WTF::FileSystemImpl::getFileLStat): Deleted.
2021-05-07 05:00:39 +00:00
2021-05-06 Chris Dumez <cdumez@apple.com>
Port Filesystem::fileMetadata() & Filesystem::getFileModificationTime() to std::filesystem
https://bugs.webkit.org/show_bug.cgi?id=225362
Reviewed by Darin Adler.
Port Filesystem::fileMetadata() & Filesystem::getFileModificationTime() to std::filesystem
and get rid of platform-specific implementations.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::toWallTime):
(WTF::FileSystemImpl::getFileModificationTime):
(WTF::FileSystemImpl::fileMetadata):
* wtf/FileSystem.h:
* wtf/glib/FileSystemGlib.cpp:
* wtf/posix/FileSystemPOSIX.cpp:
* wtf/win/FileSystemWin.cpp:
[OpenSSL] Implement CryptoAlgorithmRSA* https://bugs.webkit.org/show_bug.cgi?id=225294 Reviewed by Don Olmstead. Implement RSA for OpenSSL. Implement CryptoAlgorithmRSA_OAEP, CryptoAlgorithmRSA_PSS, CryptoAlgorithmRSAES_PKCS1_v1_5, CryptoAlgorithmRSASA_PKCS1_v1_5, and CryptoKeyRSA for OpenSSL. .: Note that if such OpenSSL version that does not support RSA_OAEP or RSA_PSS, the WebCrypto API for those algorithm will return a NotSupportedError. * Source/cmake/OptionsPlayStation.cmake: * Source/cmake/OptionsWinCairo.cmake: Source/WebCore: Note that if such OpenSSL version that does not support RSA_OAEP or RSA_PSS, the WebCrypto API for those algorithm will return a NotSupportedError. Also note that OpenSSL accepts RSA_PSS salt length longer than the hash length. This makes the crypto/subtle/rsa-pss-import-key-sign-large-salt.html test fail. Test: Existing crypto/subtle tests * crypto/keys/CryptoKeyRSA.h: Use the EVP_PKEY struct for the platform key. * crypto/openssl/CryptoAlgorithmHMACOpenSSL.cpp: Move HMACAlgorithm() to OpenSSLUtilities as DigestAlgorithm(). * crypto/openssl/CryptoAlgorithmRSAES_PKCS1_v1_5OpenSSL.cpp: (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt): Implemented. (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt): Implemented. * crypto/openssl/CryptoAlgorithmRSASSA_PKCS1_v1_5OpenSSL.cpp: (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformSign): Implemented. (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformVerify): Implemented. * crypto/openssl/CryptoAlgorithmRSA_OAEPOpenSSL.cpp: (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt): Implemented. (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt): Implemented. * crypto/openssl/CryptoAlgorithmRSA_PSSOpenSSL.cpp: (WebCore::CryptoAlgorithmRSA_PSS::platformSign): Implemented. (WebCore::CryptoAlgorithmRSA_PSS::platformVerify): Implemented. * crypto/openssl/CryptoAlgorithmRegistryOpenSSL.cpp: (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms): Registered RSAES_PKCS1_v_1_5, RSASSA_PKCS1_v1_5, RSA_OAEP, and RSA_PSS. * crypto/openssl/CryptoKeyRSAOpenSSL.cpp: (WebCore::getRSAModulusLength): (WebCore::convertToBytes): (WebCore::convertToBigNumber): (WebCore::CryptoKeyRSA::create): (WebCore::CryptoKeyRSA::CryptoKeyRSA): (WebCore::CryptoKeyRSA::isRestrictedToHash const): (WebCore::CryptoKeyRSA::keySizeInBits const): (WebCore::exponentVectorToUInt32): (WebCore::CryptoKeyRSA::generatePair): (WebCore::CryptoKeyRSA::importSpki): (WebCore::CryptoKeyRSA::importPkcs8): (WebCore::CryptoKeyRSA::exportSpki const): (WebCore::CryptoKeyRSA::exportPkcs8 const): (WebCore::CryptoKeyRSA::algorithm const): (WebCore::CryptoKeyRSA::exportData const): * crypto/openssl/OpenSSLCryptoUniquePtr.h: (WebCore::OpenSSLCryptoPtrDeleter<EVP_PKEY_CTX>::operator() const): Added. (WebCore::OpenSSLCryptoPtrDeleter<RSA>::operator() const): Added. (WebCore::OpenSSLCryptoPtrDeleter<PKCS8_PRIV_KEY_INFO>::operator() const): Added. (WebCore::OpenSSLCryptoPtrDeleter<BIGNUM>::operator() const): Added. (WebCore::OpenSSLCryptoPtrDeleter<BN_CTX>::operator() const): Added. * crypto/openssl/OpenSSLUtilities.cpp: (WebCore::digestAlgorithm): Added. (WebCore::calculateDigest): Added. * crypto/openssl/OpenSSLUtilities.h: * platform/OpenSSL.cmake: Source/WTF: Note that if such OpenSSL version that does not support RSA_OAEP or RSA_PSS, the WebCrypto API for those algorithm will return a NotSupportedError. * wtf/Platform.h: Set HAVE_RSA_PSS for USE(OPENSSL) LayoutTests: Add wincairo platform expectations for rsa-generate/import-key-malformed-parameters, modifying RSA-PSS related results from NotSupported to appropriate errors. * platform/wincairo/TestExpectations: Unskip tests that are now supported. * platform/wincairo/crypto/subtle/rsa-generate-key-malformed-parameters-expected.txt: Added. * platform/wincairo/crypto/subtle/rsa-import-key-malformed-parameters-expected.txt: Added. Canonical link: https://commits.webkit.org/237429@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277142 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-07 00:17:05 +00:00
2021-05-06 Yoshiaki Jitsukawa <yoshiaki.jitsukawa@sony.com>
[OpenSSL] Implement CryptoAlgorithmRSA*
https://bugs.webkit.org/show_bug.cgi?id=225294
Reviewed by Don Olmstead.
Implement RSA for OpenSSL.
Implement CryptoAlgorithmRSA_OAEP, CryptoAlgorithmRSA_PSS,
CryptoAlgorithmRSAES_PKCS1_v1_5, CryptoAlgorithmRSASA_PKCS1_v1_5,
and CryptoKeyRSA for OpenSSL.
Note that if such OpenSSL version that does not support RSA_OAEP or
RSA_PSS, the WebCrypto API for those algorithm will return a
NotSupportedError.
* wtf/Platform.h: Set HAVE_RSA_PSS for USE(OPENSSL)
Regression(r254389?) navigator.languages returns all lowercase languages for ports using CF https://bugs.webkit.org/show_bug.cgi?id=225461 Reviewed by Darin Adler. Source/WTF: Stop lowercasing the languages returned by navigator.language / navigator.languages as this does not match the specification [1][2] or other Web browsers. The proper format is 'en-US', not 'en-us'. [1] https://html.spec.whatwg.org/#dom-navigator-language [2] https://tools.ietf.org/html/bcp47 * wtf/cf/LanguageCF.cpp: (WTF::httpStyleLanguageCode): Tools: Update existing API tests to reflect behavior change. * TestWebKitAPI/Tests/WebKit/OverrideAppleLanguagesPreference.mm: (TEST): (TEST_F): LayoutTests: Update existing tests to reflect behavior change. * fast/text/international/system-language/navigator-language/navigator-language-en-GB-expected.txt: * fast/text/international/system-language/navigator-language/navigator-language-en-GB.html: * fast/text/international/system-language/navigator-language/navigator-language-en-US-expected.txt: * fast/text/international/system-language/navigator-language/navigator-language-en-US.html: * fast/text/international/system-language/navigator-language/navigator-language-en-expected.txt: * fast/text/international/system-language/navigator-language/navigator-language-en.html: * fast/text/international/system-language/navigator-language/navigator-language-es-ES-expected.txt: * fast/text/international/system-language/navigator-language/navigator-language-es-ES.html: * fast/text/international/system-language/navigator-language/navigator-language-es-MX-expected.txt: * fast/text/international/system-language/navigator-language/navigator-language-es-MX.html: * fast/text/international/system-language/navigator-language/navigator-language-es-expected.txt: * fast/text/international/system-language/navigator-language/navigator-language-es.html: * fast/text/international/system-language/navigator-language/navigator-language-fr-CA-expected.txt: * fast/text/international/system-language/navigator-language/navigator-language-fr-CA.html: * fast/text/international/system-language/navigator-language/navigator-language-fr-expected.txt: * fast/text/international/system-language/navigator-language/navigator-language-fr.html: * fast/text/international/system-language/navigator-language/navigator-language-hi-expected.txt: * fast/text/international/system-language/navigator-language/navigator-language-hi.html: * fast/text/international/system-language/navigator-language/navigator-language-pt-BR-expected.txt: * fast/text/international/system-language/navigator-language/navigator-language-pt-BR.html: * fast/text/international/system-language/navigator-language/navigator-language-pt-PT-expected.txt: * fast/text/international/system-language/navigator-language/navigator-language-pt-PT.html: * fast/text/international/system-language/navigator-language/navigator-language-ru-expected.txt: * fast/text/international/system-language/navigator-language/navigator-language-ru.html: * fast/text/international/system-language/navigator-language/navigator-language-zh-HK-expected.txt: * fast/text/international/system-language/navigator-language/navigator-language-zh-HK.html: * fast/text/international/system-language/navigator-language/navigator-language-zh-Hans-expected.txt: * fast/text/international/system-language/navigator-language/navigator-language-zh-Hans.html: * fast/text/international/system-language/navigator-language/navigator-language-zh-Hant-HK-expected.txt: * fast/text/international/system-language/navigator-language/navigator-language-zh-Hant-HK.html: * fast/text/international/system-language/navigator-language/navigator-language-zh-Hant-expected.txt: * fast/text/international/system-language/navigator-language/navigator-language-zh-Hant.html: * fast/text/international/system-language/navigator-language/navigator-language-zh-TW-expected.txt: * fast/text/international/system-language/navigator-language/navigator-language-zh-TW.html: * js/dom/navigator-language.html: * platform/mac-catalina/fast/text/international/system-language/navigator-language/navigator-language-en-US-expected.txt: * platform/mac-catalina/fast/text/international/system-language/navigator-language/navigator-language-en-expected.txt: * platform/mac-catalina/fast/text/international/system-language/navigator-language/navigator-language-es-ES-expected.txt: * platform/mac-catalina/fast/text/international/system-language/navigator-language/navigator-language-es-MX-expected.txt: * platform/mac-catalina/fast/text/international/system-language/navigator-language/navigator-language-es-expected.txt: * platform/mac-catalina/fast/text/international/system-language/navigator-language/navigator-language-fr-expected.txt: * platform/mac-catalina/fast/text/international/system-language/navigator-language/navigator-language-hi-expected.txt: * platform/mac-catalina/fast/text/international/system-language/navigator-language/navigator-language-pt-BR-expected.txt: * platform/mac-catalina/fast/text/international/system-language/navigator-language/navigator-language-ru-expected.txt: * platform/mac-mojave/fast/text/international/system-language/navigator-language/navigator-language-en-US-expected.txt: * platform/mac-mojave/fast/text/international/system-language/navigator-language/navigator-language-en-expected.txt: * platform/mac-mojave/fast/text/international/system-language/navigator-language/navigator-language-es-419-expected.txt: * platform/mac-mojave/fast/text/international/system-language/navigator-language/navigator-language-es-ES-expected.txt: * platform/mac-mojave/fast/text/international/system-language/navigator-language/navigator-language-es-MX-expected.txt: * platform/mac-mojave/fast/text/international/system-language/navigator-language/navigator-language-es-expected.txt: * platform/mac-mojave/fast/text/international/system-language/navigator-language/navigator-language-fr-expected.txt: * platform/mac-mojave/fast/text/international/system-language/navigator-language/navigator-language-hi-expected.txt: * platform/mac-mojave/fast/text/international/system-language/navigator-language/navigator-language-ja-expected.txt: * platform/mac-mojave/fast/text/international/system-language/navigator-language/navigator-language-pt-BR-expected.txt: * platform/mac-mojave/fast/text/international/system-language/navigator-language/navigator-language-ru-expected.txt: * platform/mac-mojave/fast/text/international/system-language/navigator-language/navigator-language-zh-HK-expected.txt: * platform/mac-mojave/fast/text/international/system-language/navigator-language/navigator-language-zh-Hant-HK-expected.txt: Canonical link: https://commits.webkit.org/237424@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277135 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-06 23:01:17 +00:00
2021-05-06 Chris Dumez <cdumez@apple.com>
Regression(r254389?) navigator.languages returns all lowercase languages for ports using CF
https://bugs.webkit.org/show_bug.cgi?id=225461
Reviewed by Darin Adler.
Stop lowercasing the languages returned by navigator.language / navigator.languages
as this does not match the specification [1][2] or other Web browsers. The proper format is
'en-US', not 'en-us'.
[1] https://html.spec.whatwg.org/#dom-navigator-language
[2] https://tools.ietf.org/html/bcp47
* wtf/cf/LanguageCF.cpp:
(WTF::httpStyleLanguageCode):
2021-05-06 Filip Pizlo <fpizlo@apple.com>
Remove old and unused memory barrier abstractions
https://bugs.webkit.org/show_bug.cgi?id=225487
Reviewed by Mark Lam.
We don't use memoryBarrierBlahBlah anymore.
* wtf/Atomics.h:
(WTF::memoryBarrierAfterLock): Deleted.
(WTF::memoryBarrierBeforeUnlock): Deleted.
Reduce use of dmb ish on ARM64 https://bugs.webkit.org/show_bug.cgi?id=225465 Reviewed by Keith Miller. Source/JavaScriptCore: We use loadLoadFence a lot, often in situations like: Foo* ptr = loadStuff; loadLoadFence(); use ptr On ARM64, we don't need a dmb ish here. This introduces a dependentLoadLoadFence() for these cases; it's just a compiler fence on ARM64 and Intel. We also used loadLoadFence in some places where I couldn't think of any good reason for the fence other than paranoia. I got rid of those. * bytecode/CallLinkStatus.cpp: (JSC::CallLinkStatus::computeFromCallLinkInfo): * bytecode/CodeBlock.h: (JSC::CodeBlock::jitType const): * bytecode/ObjectAllocationProfile.h: (JSC::ObjectAllocationProfileBase::structure): (JSC::ObjectAllocationProfileWithPrototype::prototype): * bytecode/Watchpoint.h: (JSC::WatchpointSet::state const): (JSC::InlineWatchpointSet::state const): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::parseBlock): (JSC::DFG::ByteCodeParser::handlePutByVal): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compileGetByValOnString): * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::compileStringCharAt): * runtime/GetterSetter.h: * runtime/InferredValue.h: (JSC::InferredValue::state const): * runtime/Structure.h: (JSC::Structure::tryRareData): * runtime/StructureInlines.h: (JSC::Structure::propertyReplacementWatchpointSet): Source/WTF: * wtf/Atomics.h: (WTF::dependentLoadLoadFence): Canonical link: https://commits.webkit.org/237415@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277117 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-06 20:54:16 +00:00
2021-05-06 Filip Pizlo <fpizlo@apple.com>
Reduce use of dmb ish on ARM64
https://bugs.webkit.org/show_bug.cgi?id=225465
Reviewed by Keith Miller.
* wtf/Atomics.h:
(WTF::dependentLoadLoadFence):
2021-05-06 Per Arne Vollan <pvollan@apple.com>
Add sandbox extension flag to specify that path contains no symlinks
https://bugs.webkit.org/show_bug.cgi?id=219428
<rdar://problem/66551986>
Reviewed by Brent Fulgham.
Declare canonical sandbox flag.
* wtf/spi/darwin/SandboxSPI.h:
2021-05-06 Dean Jackson <dino@apple.com>
[WebXR] Add IOSurface to FrameData::LayerData
https://bugs.webkit.org/show_bug.cgi?id=225428
<rdar://problem/77586270>
Reviewed by Tim Horton.
Add USE(IOSURFACE_FOR_XR_LAYER_DATA) and make it true
for Cocoa platforms.
* wtf/PlatformUse.h:
Streamline codec parsing, replacing uses of HashMap with SortedArrayMap https://bugs.webkit.org/show_bug.cgi?id=225368 Reviewed by Sam Weinig. Source/WebCore: * platform/ContentType.cpp: (WebCore::ContentType::parameter const): Use early return instead of nesting. Strip HTML spaces, not all whitespace, and do it only once rather than twice. Fixed a small bug where we search for the second quotation mark in a way that could find the same quotation mark twice if there is a space before the first one. Added FIXME comments about a few obvious problems in the parsing algorithm. Improved efficiency by using StringView, saving the allocation of one temporary StringImpl in the case where we have some HTML spaces to strip. (WebCore::ContentType::containerType const): Simplified the implemementation by taking advantage of the fact that our notFound value is designed to be used as an argument to functions like String::left, telling them to return the entire string. Strip HTML spaces, not all whitespace. * platform/graphics/HEVCUtilities.cpp: (WebCore::parseHEVCCodecParameters): Take a StringView instead of a String for greater flexibility and efficiency. Don't store codecName, which is never used after verifying that it is a legal value here. Don't store the generalTierFlag, which is never used after verifying that it is a legal value here. Don't store the constraint flags, which are never used after verifying that they are legal values here. (WebCore::makeOptionalFromPointer): Added to make code below cleaner. (WebCore::parseDoViCodecType): Renamed from codecStringForDoViCodecType since it now returns an enumeration value instead of a string. Also take a StringView instead of a String for greater flexibility and efficiency. Also use a SortedArrayMap instead of a MemoryCompactLookupOnlyRobinHoodHashMap. (WebCore::profileIDForAlphabeticDoViProfile): Take a StringView instead of a String for greater flexibility and efficiency. Use a SortedArrayMap instead of a MemoryCompactLookupOnlyRobinHoodHashMap. (WebCore::isValidProfileIDForCodec): Take a codec enumeration value parameter instead of a string. (WebCore::parseDoViCodecParameters): Take a StringView instead of a String for greater flexibility and efficiency. Store the codec as an enumeration instead of a String. Don't create a temporary String just so we can call the profileIDForAlphabeticDoViProfile function. * platform/graphics/HEVCUtilities.h: Renamed HEVCParameterSet and DoViParameterSet to HEVCParameters and DoViParameters. The word "set" is not helpful in these names. Removed codecName, generalTierFlag, and constraintFlags from HEVCParameterSet. Changed the parse functions to take StringView instead of String. Replaced the string codecName in DoViParameterSet with an enumeration since there are only a few valid values. * platform/graphics/cocoa/HEVCUtilitiesCocoa.h: Use Optional return value instead of a bool and an out argument. * platform/graphics/cocoa/HEVCUtilitiesCocoa.mm: (WebCore::validateHEVCParameters): Updated to return Optional. (WebCore::codecType): Updated to take an enumeration value and no longer need to return an optional. Also renamed from codecTypeForDoViCodecString since the type now makes this clear without a long function name. (WebCore::parseStringArrayFromDictionaryToUInt16Vector): Renamed from CFStringArrayToNumberVector, and moved the dictionary lookup in here. The old name was a little vague; "NumberVector" doesn't say 16-bit unsigned. Simplified code by using an Objective-C for loop instead of a block and enumeration. This cut the size of the function down quite a bit. (WebCore::validateDoViParameters): Updated to return Optional. Also refactored to use the imrpoved helper functions above. * platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp: (WebCore::videoCodecTypeFromRFC4281Type): Take a StringView instead of a String for greater flexibility and efficiency. (WebCore::computeMediaCapabilitiesInfo): Factored out this helper function so we don't have such complicated callback logic. Refactored to use the new versions of validateHEVCParameters, validateDoViParameters, and validateVPParameters. (WebCore::createMediaPlayerDecodingConfigurationCocoa): Moved most of the code into computeMediaCapabilitiesInfo; this mostly deals with the callback. * platform/graphics/cocoa/VP9UtilitiesCocoa.h: Removed extraneous use of extern. Added const for input-only reference arguments. Changed validateVPParameters to return Optional instead of a bool with an out argument. * platform/graphics/cocoa/VP9UtilitiesCocoa.mm: (WebCore::isVP9CodecConfigurationRecordSupported): Added const. (WebCore::isVP8CodecConfigurationRecordSupported): Ditto. (WebCore::isVPCodecConfigurationRecordSupported): Ditto. (WebCore::validateVPParameters): Refactored to return Optional. * platform/network/HTTPHeaderMap.h: Removed unneeded includes. * platform/text/LocaleToScriptMapping.cpp: Moved PackedASCIILowerCodes from here into the SortedArrayMap.h header. * testing/Internals.cpp: (WebCore::Internals::parseHEVCCodecParameters): Tweaked since HEVCParameterSet is now only the correct name here in the Internals class. (WebCore::Internals::parseDoViCodecParameters): Ditto. Also added code to expose the codec enumeration as a string. This is now a testing-only thing. (WebCore::Internals::parseVPCodecParameters): Ditto. * testing/Internals.h: Tweaked the ParameterSet types since they now don't exactly match the structures used in the real code. * testing/Internals.idl: Removed codecName, generalTierFlag, and constraintFlags from HEVCParameterSet. Neither codecName nor constraintFlags was used in any test. And the generalTierFlag test was something we can do without; the parsed value isn't actually used in any WebKit code. Source/WebKit: * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp: Removed unneeded include. * Shared/WebsiteData/WebsiteData.h: Ditto. Source/WTF: * wtf/SortedArrayMap.h: Moved PackedASCIILowerCodes here for reuse. Slightly tweaked ComparableASCIISubsetLiteral to match better. LayoutTests: * media/hevc-codec-parameters-expected.txt: Remove testing of generalTierFlag, which is ignored by our actual media code after parsing. * media/hevc-codec-parameters.html: Ditto. Canonical link: https://commits.webkit.org/237395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277093 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-06 16:08:17 +00:00
2021-05-06 Darin Adler <darin@apple.com>
Streamline codec parsing, replacing uses of HashMap with SortedArrayMap
https://bugs.webkit.org/show_bug.cgi?id=225368
Reviewed by Sam Weinig.
* wtf/SortedArrayMap.h: Moved PackedASCIILowerCodes here for reuse.
Slightly tweaked ComparableASCIISubsetLiteral to match better.
Sampled Page Top Color: take additional snapshots further down the page to see if the sampled top color is more than just a tiny strip https://bugs.webkit.org/show_bug.cgi?id=225323 Reviewed by Beth Dakin. Source/WebCore: Add a `SampledPageTopColorMinHeight` setting that controls how far down the sampled page top color needs to extend in order for us to not bail. If the value > 0, we take an additional snapshot at (0, SampledPageTopColorMinHeight) and (width, SampledPageTopColorMinHeight), comparing each to the snapshot directly above (e.g. (0, SampledPageTopColorMinHeight) is compared to (0, 0)) using the `SampledPageTopColorMaxDifference`. Depending on the value, if the color across the top of the page is only a small strip, these extra snapshot comparisons will prevent a resulting color from being derived. Tests: SampledPageTopColor.VerticalGradientBelowMaxDifference SampledPageTopColor.VerticalGradientAboveMaxDifference * dom/Document.cpp: (WebCore::Document::determineSampledPageTopColor): Source/WebKit: Add a `SampledPageTopColorMinHeight` setting that controls how far down the sampled page top color needs to extend in order for us to not bail. If the value > 0, we take an additional snapshot at (0, SampledPageTopColorMinHeight) and (width, SampledPageTopColorMinHeight), comparing each to the snapshot directly above (e.g. (0, SampledPageTopColorMinHeight) is compared to (0, 0)) using the `SampledPageTopColorMaxDifference`. Depending on the value, if the color across the top of the page is only a small strip, these extra snapshot comparisons will prevent a resulting color from being derived. * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _setSampledPageTopColorMinHeight:]): Added. (-[WKWebViewConfiguration _sampledPageTopColorMinHeight]): Added. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setupPageConfiguration:]): Provide SPI to configure the `SampledPageTopColorMinHeight` preference when creating the `WKWebView`. Source/WTF: Add a `SampledPageTopColorMinHeight` setting that controls how far down the sampled page top color needs to extend in order for us to not bail. If the value > 0, we take an additional snapshot at (0, SampledPageTopColorMinHeight) and (width, SampledPageTopColorMinHeight), comparing each to the snapshot directly above (e.g. (0, SampledPageTopColorMinHeight) is compared to (0, 0)) using the `SampledPageTopColorMaxDifference`. Depending on the value, if the color across the top of the page is only a small strip, these extra snapshot comparisons will prevent a resulting color from being derived. * Scripts/Preferences/WebPreferences.yaml: Tools: * TestWebKitAPI/Tests/WebKitCocoa/SampledPageTopColor.mm: (createWebViewWithSampledPageTopColorMaxDifference): (createHTMLGradientWithColorStops): (TEST.SampledPageTopColor.ZeroMaxDifference): (TEST.SampledPageTopColor.NegativeMaxDifference): (TEST.SampledPageTopColor.SolidColor): (TEST.SampledPageTopColor.DifferentColorsWithoutOutlierBelowMaxDifference): (TEST.SampledPageTopColor.DifferentColorsWithLeftOutlierAboveMaxDifference): (TEST.SampledPageTopColor.DifferentColorsWithMiddleOutlierAboveMaxDifference): (TEST.SampledPageTopColor.DifferentColorsWithRightOutlierAboveMaxDifference): (TEST.SampledPageTopColor.DifferentColorsIndividuallyAboveMaxDifference): (TEST.SampledPageTopColor.DifferentColorsCumulativelyAboveMaxDifference): (TEST.SampledPageTopColor.VerticalGradientBelowMaxDifference): Added. (TEST.SampledPageTopColor.VerticalGradientAboveMaxDifference): Added. (TEST.SampledPageTopColor.DISABLED_DisplayP3): (TEST.SampledPageTopColor.ExperimentalUseSampledPageTopColorForScrollAreaBackgroundColor): Canonical link: https://commits.webkit.org/237343@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277030 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-05 18:17:53 +00:00
2021-05-05 Devin Rousso <drousso@apple.com>
Sampled Page Top Color: take additional snapshots further down the page to see if the sampled top color is more than just a tiny strip
https://bugs.webkit.org/show_bug.cgi?id=225323
Reviewed by Beth Dakin.
Add a `SampledPageTopColorMinHeight` setting that controls how far down the sampled page top
color needs to extend in order for us to not bail. If the value > 0, we take an additional
snapshot at (0, SampledPageTopColorMinHeight) and (width, SampledPageTopColorMinHeight),
comparing each to the snapshot directly above (e.g. (0, SampledPageTopColorMinHeight) is
compared to (0, 0)) using the `SampledPageTopColorMaxDifference`. Depending on the value, if
the color across the top of the page is only a small strip, these extra snapshot comparisons
will prevent a resulting color from being derived.
* Scripts/Preferences/WebPreferences.yaml:
Add preliminary support for specifying a color space for 2D canvas https://bugs.webkit.org/show_bug.cgi?id=225286 Reviewed by Dean Jackson. Source/WebCore: Tests: fast/canvas/CanvasRenderingContext2DSettings-colorSpace-disabled.html fast/canvas/CanvasRenderingContext2DSettings-colorSpace-enabled.html fast/canvas/canvas-color-space-display-p3.html * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: Add new files. * html/canvas/CanvasRenderingContext2DSettings.idl: * html/canvas/CanvasRenderingContext2DSettings.h: Add a new setting blocked member to the CanvasRenderingContext2DSettings dictionary for specifying a color space. * html/canvas/PredefinedColorSpace.cpp: Added. * html/canvas/PredefinedColorSpace.h: Added. * html/canvas/PredefinedColorSpace.idl: Added. Add a new IDL enumeration to represent the possible color spaces supported. For ports that don't support DisplayP3, trying to use it will result in type error from JS. * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::reset): Add checks for color space and pixel format to 2d context reset optimation. This can happen if the image buffer is allocated prior to the context being requested (such as via canvas.toDataURL() or canvas.toBlob()). (WebCore::HTMLCanvasElement::createImageBuffer const): Pass the correct color space and pixel format (though the later is always BGRA8 at the moment) to the ImageBuffer create function to make a backing store in the right format. * html/HTMLVideoElement.cpp: (WebCore::HTMLVideoElement::createBufferForPainting const): * html/HTMLVideoElement.h: Pass color space and pixel format through to ensure the helper buffer matches the correct color space. * html/ImageBitmap.cpp: (WebCore::ImageBitmap::createPromise): Pass the existing defaults to HTMLVideoElement::createBufferForPainting. In the future, ImageBitmap will also gain color space and pixel format specificity and this will be updated. * html/canvas/CanvasRenderingContext.cpp: (WebCore::CanvasRenderingContext::pixelFormat const): (WebCore::CanvasRenderingContext::colorSpace const): * html/canvas/CanvasRenderingContext.h: Add virtual base implementations of colorSpace and pixelFormat which CanvasRenderingContext2D can override to return the values specified in the CanvasRenderingContext2DSettings. * html/canvas/CanvasRenderingContext2D.h: * html/canvas/CanvasRenderingContext2D.cpp: (WebCore::CanvasRenderingContext2D::fontProxy const): Fix incorrect formatting. (WebCore::CanvasRenderingContext2D::pixelFormat const): (WebCore::CanvasRenderingContext2D::colorSpace const): Add overrides, return m_settings.colorSpace for colorSpace. * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::drawImage): (WebCore::CanvasRenderingContext2DBase::createCompositingBuffer): (WebCore::CanvasRenderingContext2DBase::createPattern): (WebCore::CanvasRenderingContext2DBase::drawTextUnchecked): Pass along the colorSpace and pixelFormat when creating buffers. * html/shadow/DateTimeSymbolicFieldElement.cpp: Add missing includes that are now needed. Source/WTF: Add new experimental feature, CanvasColorSpaceEnabled, which blocks access to the new ability to specify color spaces for 2D canvas. * Scripts/Preferences/WebPreferencesExperimental.yaml: Tools: * DumpRenderTree/TestOptions.cpp: (WTR::TestOptions::defaults): Add CanvasColorSpaceEnabled for windows. LayoutTests: Add basic tests for color space in canvas support. * fast/canvas/CanvasRenderingContext2DSettings-colorSpace-disabled-expected.txt: Added. * fast/canvas/CanvasRenderingContext2DSettings-colorSpace-disabled.html: Added. * fast/canvas/CanvasRenderingContext2DSettings-colorSpace-enabled-expected.txt: Added. * fast/canvas/CanvasRenderingContext2DSettings-colorSpace-enabled.html: Added. * fast/canvas/canvas-color-space-display-p3-expected.html: Added. * fast/canvas/canvas-color-space-display-p3.html: Added. Canonical link: https://commits.webkit.org/237338@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277024 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-05 16:36:55 +00:00
2021-05-05 Sam Weinig <weinig@apple.com>
Add preliminary support for specifying a color space for 2D canvas
https://bugs.webkit.org/show_bug.cgi?id=225286
Reviewed by Dean Jackson.
Add new experimental feature, CanvasColorSpaceEnabled, which blocks
access to the new ability to specify color spaces for 2D canvas.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
2021-05-04 Alex Christensen <achristensen@webkit.org>
Don't iterate NetworkProcessProxy::m_websiteDataStores
https://bugs.webkit.org/show_bug.cgi?id=225337
<rdar://77233103>
Reviewed by Geoffrey Garen.
* wtf/Vector.h:
(WTF::copyToVectorOf):
Use a universal reference instead of const&.
* wtf/WeakHashSet.h:
WeakHashSet iteration returns T&, and we need this instead of WeakPtr<T> to be able to return a Ref from a map function.
2021-05-04 Chris Dumez <cdumez@apple.com>
Drop std::filesystem logic in PlatformJSCOnly.cmake
https://bugs.webkit.org/show_bug.cgi?id=225355
Reviewed by Alex Christensen.
Drop std::filesystem logic in PlatformJSCOnly.cmake as it is no longer needed after r276946.
* wtf/PlatformJSCOnly.cmake:
2021-05-03 Kimmo Kinnunen <kkinnunen@apple.com>
[GPUP] Move GPUProcess WebGL to Experimental Feature
https://bugs.webkit.org/show_bug.cgi?id=222836
rdar://75048190
Reviewed by Brent Fulgham.
Move the setting for WebGL in GPU process
to experimental features but disable it by default,
even on layout tests.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
* Scripts/Preferences/WebPreferencesInternal.yaml:
2021-05-03 Lauro Moura <lmoura@igalia.com>
REGRESSION(r276879) Add libstdc++fs to wtf libraries when using experimental fs headers
https://bugs.webkit.org/show_bug.cgi?id=225341
Reviewed by Chris Dumez.
After r276879, Filesystem.cpp uses std::filesystem directly. So,
expose the need for stdc++fs like was done in r268708 when std::fs was
used in WTR.
* wtf/CMakeLists.txt:
2021-05-03 Chris Dumez <cdumez@apple.com>
Restore pre-r276879 behavior for FileSystem::moveFile()
https://bugs.webkit.org/show_bug.cgi?id=225307
Reviewed by Sam Weinig.
Update FileSystem::moveFile() so that it now supports again moving a file across different
volumes by copying the file over and then deleting the source file.
I have verified locally that the function is now able to move a file to a different volumes.
Sadly, I don't think having an API test is feasible here as it requires pre-determined
volumes to be available.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::moveFile):
2021-05-03 Chris Dumez <cdumez@apple.com>
Unreviewed attempt to fix JSCOnly build with recent clang after r276879
https://bugs.webkit.org/show_bug.cgi?id=225327
* wtf/PlatformJSCOnly.cmake:
2021-05-03 Diego Pino Garcia <dpino@igalia.com>
[GLIB] REGRESSION(r276879): Several tests are crashing or failing
https://bugs.webkit.org/show_bug.cgi?id=225292
Reviewed by Carlos Alberto Lopez Perez.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::fileIsDirectory): Return false if path is empty.
2021-05-03 Chris Dumez <cdumez@apple.com>
Restore pre-r276879 behavior for FileSystem::deleteFile() and FileSystem::deleteEmptyDirectory()
https://bugs.webkit.org/show_bug.cgi?id=225289
Reviewed by Darin Adler.
Restore pre-r276879 behavior for FileSystem::deleteFile() and FileSystem::deleteEmptyDirectory() to
reduce the risk of regressions. In particular, calling FileSystem::deleteFile() on an empty directory
now fails and calling FileSystem::deleteEmptyDirectory() on a non-directory now fails.
I have also gotten rid of the macOS-specific implementation of deleteEmptyDirectory() and merged the
needed behavior (Dealing with .DS_Store files) to the generic function.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::deleteFile):
(WTF::FileSystemImpl::deleteEmptyDirectory):
* wtf/mac/FileSystemMac.mm:
(WTF::FileSystem::deleteEmptyDirectory): Deleted.
2021-05-02 Sam Weinig <weinig@apple.com>
Add support for DestinationColorSpace::DisplayP3 in preparation for DisplayP3 canvas
https://bugs.webkit.org/show_bug.cgi?id=225280
Reviewed by Anders Carlsson.
Add new ENABLE_DESTINATION_COLOR_SPACE_DISPLAY_P3 macro to declare which ports
support P3 backing stores. Currently, only the Apple/Cocoa ports support it.
* wtf/PlatformEnable.h:
* wtf/PlatformEnableCocoa.h:
Use SortedArrayMap in a few more places https://bugs.webkit.org/show_bug.cgi?id=225251 Reviewed by Sam Weinig. Source/WebCore: * Modules/encryptedmedia/CDM.h: Removed unneeded includes. * Modules/indexeddb/server/IDBServer.h: Ditto. * contentextensions/ContentExtensionActions.h: Ditto. * css/CSSVariableData.h: Ditto. * dom/FullscreenManager.h: Ditto. * dom/ScriptElement.cpp: (WebCore::isLegacySupportedJavaScriptLanguage): Use SortedArraySet. (WebCore::ScriptElement::executeClassicScript): Fixed typo. (WebCore::ScriptElement::executeModuleScript): Ditto. * inspector/InspectorAuditResourcesObject.cpp: Removed unneeded includes. * inspector/agents/InspectorNetworkAgent.cpp: Ditto. * loader/appcache/ApplicationCacheGroup.cpp: Ditto. * page/UserContentProvider.h: Ditto. * page/ios/DOMTimerHoldingTank.cpp: Ditto. * page/scrolling/ScrollingCoordinator.h: Ditto. * page/scrolling/ScrollingTreeNode.h: Added forward declaration that used to be inherited from another file where it's not needed. * platform/gamepad/cocoa/GameControllerGamepadProvider.mm: (WebCore::GameControllerGamepadProvider::willHandleVendorAndProduct): Use a switch statement. * platform/gamepad/mac/HIDGamepadElement.h: Removed unneeded includes. * platform/graphics/FontPlatformData.cpp: Ditto. * platform/graphics/HEVCUtilities.cpp: Ditto. * platform/graphics/IntRectHash.h: Ditto. * platform/graphics/MIMETypeCache.cpp: (WebCore::MIMETypeCache::isStaticContainerType): Renamed; this replaces the old staticContainerTypeList function and just returns false. * platform/graphics/MIMETypeCache.h: Replaced the staticContainerTypeList fucntion with an isStaticContainerType function. Also made it, and one other function, private. * platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.h: Updated for the change to MIMETypeCache. * platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm: (WebCore::AVAssetMIMETypeCache::isStaticContainerType): Use SortedArraySet. * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h: Removed unneeded includes. * platform/graphics/coreimage/FilterEffectRendererCoreImage.h: Ditto. * platform/mediastream/RealtimeMediaSourceSupportedConstraints.cpp: Ditto. * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.h: Ditto. * platform/mediastream/mac/CoreAudioCaptureDeviceManager.h: Ditto. * platform/mediastream/mac/CoreAudioCaptureSource.h: Ditto. * platform/network/cf/FormDataStreamCFNet.cpp: Ditto. * platform/network/mac/UTIUtilities.mm: (WebCore::UTIFromUnknownMIMEType): Use SortedArrayMap. Also fixed a regression from r271533 where we accidentally deleted the MIME type model/vnd.reality. * rendering/ComplexLineLayout.cpp: (WebCore::setLogicalWidthForTextRun): Use a range-based for loop. * rendering/updating/RenderTreeUpdater.h: Removed unneeded includes. * storage/StorageNamespaceProvider.h: Ditto. * storage/StorageQuotaManager.h: Ditto. * style/StyleUpdate.h: Ditto. * svg/SVGFitToViewBox.h: Ditto. * svg/SVGTests.cpp: (WebCore::SVGTests::isValid const): Use SortedArraySet. (WebCore::SVGTests::hasFeatureForLegacyBindings): Ditto. Source/WebKit: * NetworkProcess/NetworkLoad.cpp: Removed unneeded includes. * NetworkProcess/NetworkResourceLoadMap.h: Ditto. * Shared/SharedStringHashStore.h: Ditto. * UIProcess/API/APIPageConfiguration.h: Ditto. * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm: Ditto. * UIProcess/API/Cocoa/_WKInspector.mm: Ditto. * UIProcess/Automation/SimulatedInputDispatcher.h: Ditto. * UIProcess/Inspector/WebInspectorUIProxy.cpp: Ditto. * UIProcess/Plugins/mac/PluginInfoStoreMac.mm: Ditto. * UIProcess/WebPageGroup.h: Ditto. * UIProcess/WebPasteboardProxy.h: Ditto. * UIProcess/WebPreferences.h: Ditto. * WebProcess/Geolocation/WebGeolocationManager.h: Ditto. * WebProcess/WebPage/WebBackForwardListProxy.h: Ditto. Source/WTF: * wtf/SortedArrayMap.h: Added support for types that don't have a parse member function. * wtf/cocoa/MainThreadCocoa.mm: Removed unneeded includes. * wtf/text/AtomStringImpl.cpp: Ditto. * wtf/text/AtomStringTable.cpp: Ditto. Canonical link: https://commits.webkit.org/237226@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276880 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-02 03:09:34 +00:00
2021-04-30 Darin Adler <darin@apple.com>
Use SortedArrayMap in a few more places
https://bugs.webkit.org/show_bug.cgi?id=225251
Reviewed by Sam Weinig.
* wtf/SortedArrayMap.h: Added support for types that don't have a parse member function.
* wtf/cocoa/MainThreadCocoa.mm: Removed unneeded includes.
* wtf/text/AtomStringImpl.cpp: Ditto.
* wtf/text/AtomStringTable.cpp: Ditto.
Start leveraging std::filesystem in WTF::FileSystem https://bugs.webkit.org/show_bug.cgi?id=225255 Reviewed by Sam Weinig. Source/JavaScriptCore: Unexport some symbols to fix build. * Configurations/JavaScriptCore.xcconfig: Source/WTF: Start leveraging std::filesystem in WTF::FileSystem to reduce the amount of platform-specific code. * WTF.xcodeproj/project.pbxproj: * wtf/FileSystem.cpp: (WTF::FileSystemImpl::fileExists): (WTF::FileSystemImpl::deleteFile): (WTF::FileSystemImpl::deleteEmptyDirectory): (WTF::FileSystemImpl::moveFile): (WTF::FileSystemImpl::getFileSize): (WTF::FileSystemImpl::fileIsDirectory): (WTF::FileSystemImpl::makeAllDirectories): (WTF::FileSystemImpl::getVolumeFreeSpace): (WTF::FileSystemImpl::createSymbolicLink): (WTF::FileSystemImpl::hardLink): (WTF::FileSystemImpl::hardLinkOrCopyFile): (WTF::FileSystemImpl::deleteNonEmptyDirectory): * wtf/FileSystem.h: * wtf/cocoa/FileSystemCocoa.mm: (WTF::FileSystemImpl::createTemporaryDirectory): * wtf/glib/FileSystemGlib.cpp: * wtf/posix/FileSystemPOSIX.cpp: * wtf/win/FileSystemWin.cpp: * wtf/PlatformJSCOnly.cmake: GNU implementation prior to 9.1 requires linking with -lstdc++fs and LLVM implementation prior to LLVM 9.0 requires linking with -lc++fs. * wtf/StdFilesystem.cpp: Removed. * wtf/StdFilesystem.h: Drop our own copy of std::filesystem as all the operating system we support now have support for this. Tools: Add API test coverage for the FileSystem API that was modified. * TestWebKitAPI/Tests/WTF/FileSystem.cpp: (TestWebKitAPI::FileSystemTest::tempFilePath const): (TestWebKitAPI::FileSystemTest::tempFileSymlinkPath const): (TestWebKitAPI::FileSystemTest::tempEmptyFolderPath const): (TestWebKitAPI::FileSystemTest::tempEmptyFolderSymlinkPath const): (TestWebKitAPI::FileSystemTest::tempEmptyFilePath const): (TestWebKitAPI::FileSystemTest::spaceContainingFilePath const): (TestWebKitAPI::FileSystemTest::bangContainingFilePath const): (TestWebKitAPI::FileSystemTest::quoteContainingFilePath const): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/237225@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276879 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-02 02:36:14 +00:00
2021-05-01 Chris Dumez <cdumez@apple.com>
Start leveraging std::filesystem in WTF::FileSystem
https://bugs.webkit.org/show_bug.cgi?id=225255
Reviewed by Sam Weinig.
Start leveraging std::filesystem in WTF::FileSystem to reduce the amount of
platform-specific code.
* WTF.xcodeproj/project.pbxproj:
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::fileExists):
(WTF::FileSystemImpl::deleteFile):
(WTF::FileSystemImpl::deleteEmptyDirectory):
(WTF::FileSystemImpl::moveFile):
(WTF::FileSystemImpl::getFileSize):
(WTF::FileSystemImpl::fileIsDirectory):
(WTF::FileSystemImpl::makeAllDirectories):
(WTF::FileSystemImpl::getVolumeFreeSpace):
(WTF::FileSystemImpl::createSymbolicLink):
(WTF::FileSystemImpl::hardLink):
(WTF::FileSystemImpl::hardLinkOrCopyFile):
(WTF::FileSystemImpl::deleteNonEmptyDirectory):
* wtf/FileSystem.h:
* wtf/cocoa/FileSystemCocoa.mm:
(WTF::FileSystemImpl::createTemporaryDirectory):
* wtf/glib/FileSystemGlib.cpp:
* wtf/posix/FileSystemPOSIX.cpp:
* wtf/win/FileSystemWin.cpp:
* wtf/PlatformJSCOnly.cmake:
GNU implementation prior to 9.1 requires linking with -lstdc++fs and LLVM implementation
prior to LLVM 9.0 requires linking with -lc++fs.
* wtf/StdFilesystem.cpp: Removed.
* wtf/StdFilesystem.h:
Drop our own copy of std::filesystem as all the operating system we support now have
support for this.
Make destination color space enumeration match supported destination color spaces for the port https://bugs.webkit.org/show_bug.cgi?id=225237 Reviewed by Simon Fraser. Add ENABLE_DESTINATION_COLOR_SPACE_LINEAR_SRGB and enabled it for all ports except the Apple Windows port, which is the only one doesn't have any support for it. Source/WebCore: Removes existing behavior of returning SRGB when LinearSRGB was requested in the Apple Windows port. Now, the callers are responisble for dealing with a ports lack of support of LinearSRGB, making it very clear at those call sites that something is different and wrong. * platform/graphics/Color.cpp: * platform/graphics/Color.h: * platform/graphics/ColorConversion.cpp: * platform/graphics/ColorConversion.h: Add new functions to perform color conversion to and from an color space denoted by the ColorSpace or DestinationColorSpace enum. Previously, we only had convient ways to convert if the color was strongly typed (and this is implemented using that mechanism). This is useful when converting for final ouput, such in as the caller in FELighting::drawLighting. * platform/graphics/cg/ColorSpaceCG.h: * platform/graphics/ColorSpace.cpp: * platform/graphics/ColorSpace.h: * platform/graphics/filters/FELighting.cpp: * platform/graphics/filters/FilterEffect.h: * rendering/CSSFilter.cpp: * rendering/svg/RenderSVGResourceFilter.cpp: * rendering/svg/RenderSVGResourceMasker.cpp: Wrap uses of DestinationColorSpace::LinearSRGB in ENABLE(DESTINATION_COLOR_SPACE_LINEAR_SRGB). Source/WTF: * wtf/PlatformEnable.h: * wtf/PlatformEnableCocoa.h: * wtf/PlatformEnableWinApple.h: Canonical link: https://commits.webkit.org/237221@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276875 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-01 18:06:08 +00:00
2021-05-01 Sam Weinig <weinig@apple.com>
Make destination color space enumeration match supported destination color spaces for the port
https://bugs.webkit.org/show_bug.cgi?id=225237
Reviewed by Simon Fraser.
Add ENABLE_DESTINATION_COLOR_SPACE_LINEAR_SRGB and enabled it for all ports
except the Apple Windows port, which is the only one doesn't have any support
for it.
* wtf/PlatformEnable.h:
* wtf/PlatformEnableCocoa.h:
* wtf/PlatformEnableWinApple.h:
2021-04-30 Darin Adler <darin@apple.com>
Optimize SortedArrayMap by using linear search for small arrays
https://bugs.webkit.org/show_bug.cgi?id=225223
Reviewed by Yusuke Suzuki.
* wtf/SortedArrayMap.h: Added a base class SortedArrayBase that contains a constant
for the cutoff between linear and binary search. Based on a quick empirical test,
it seems faster to do linear search for arrays that have less then 20 elements.
While doing this also switched from tryBinarySearch to std::find/find_if/lower_bound
because the standard library function templates should be excellent for this purpose,
and there's no reason to use our own. Also filled out the operations for the
ComparableASCIILiteral family so that the "<" operator works in either direction,
since that's needed for compatibility with standard library algorithms.
Reduce memory footprint for background tabs https://bugs.webkit.org/show_bug.cgi?id=225007 Reviewed by Chris Dumez. Source/WebKit: When a WebContent process contains only non-visible pages (e.g. if it is a background tab), we should attempt to reduce our memory footprint after some time interval to help relieve system-wide memory pressure. This is enabled only on Mac because iOS already does something similar just before WebContent suspends. One exception to this is that we don't do this proactive slimming for processes that are in the back/forward cache or in the WebProcess cache. This is because dropping the memory cache in those types of processes leads to perf regressions in benchmarks that do certain types of cross-origin navigations. We'll use a separate mechanism for controlling the memory usage of those processes; our current logic keeps those processes around until we are at the warning or critical memory pressure level. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::pageDidEnterWindow): (WebKit::WebProcess::pageWillLeaveWindow): (WebKit::WebProcess::nonVisibleProcessGraphicsCleanupTimerFired): (WebKit::WebProcess::nonVisibleProcessMemoryCleanupTimerFired): (WebKit::WebProcess::nonVisibleProcessCleanupTimerFired): Deleted. * WebProcess/WebProcess.h: Source/WTF: Add an option to slim background tabs by proactively calling WebCore::releaseMemory on Macs. * wtf/PlatformEnableCocoa.h: Canonical link: https://commits.webkit.org/237166@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276788 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-29 19:01:53 +00:00
2021-04-29 Ben Nham <nham@apple.com>
Reduce memory footprint for background tabs
https://bugs.webkit.org/show_bug.cgi?id=225007
Reviewed by Chris Dumez.
Add an option to slim background tabs by proactively calling WebCore::releaseMemory on Macs.
* wtf/PlatformEnableCocoa.h:
Extend SortedArrayMap further to work on case-folded strings, use in MIMETypeRegistry https://bugs.webkit.org/show_bug.cgi?id=224968 Reviewed by Sam Weinig. Source/WebCore: Using fewer HashSet in MIMETypeRegistry saves code size and reduces memory use. * platform/MIMETypeRegistry.cpp: (WebCore::MIMETypeRegistry::supportedImageMIMETypes): Deleted. Replaced this function with a constexpr array, eliminating the use of HashSet. (WebCore::makeFixedVector): Added. Helper function used below for the repeated patttern of converting a constexpr array into a FixedVector<const char*>. (WebCore::supportedJavaScriptMIMETypes): Deleted. (WebCore::MIMETypeRegistry::supportedNonImageMIMETypes): Update since supportedJavaScriptMIMETypeArray is now an array, not a HashSet. (WebCore::MIMETypeRegistry::pdfMIMETypes): Rewrote to return a FixedVector<const char*> instead of a HashSet. The only caller makes an NSArray<NSString *>, so there is no need to involve a hash table or a WTF::String. (WebCore::MIMETypeRegistry::unsupportedTextMIMETypes): Ditto. (WebCore::commonMediaTypes): Deleted, merging into the function below. (WebCore::commonMimeTypesMap): Moved the commonMediaTypes data in here and use a constexpr array instead of an initializer_list. (WebCore::MIMETypeRegistry::isSupportedImageMIMEType): Use SortedArraySet instead of a HashSet for the core supported images types. Moved the code that checks this against defaultSupportedImageTypes here. (WebCore::MIMETypeRegistry::isSupportedJavaScriptMIMEType): Use SortedArraySet. (WebCore::MIMETypeRegistry::isUnsupportedTextMIMEType): Ditto. (WebCore::MIMETypeRegistry::isPDFMIMEType): Ditto. (WebCore::MIMETypeRegistry::isPostScriptMIMEType): Use equalLettersIgnoringASCIICase. For some reason this was the single case-sensitive function in this whole class! (WebCore::MIMETypeRegistry::isSystemPreviewMIMEType): Use SortedArraySet. (WebCore::MIMETypeRegistry::systemPreviewMIMETypes): Return a FixedVector. (WebCore::normalizedImageMIMEType): Renamed this from its old name, MIMETypeRegistry::normalizedMIMEType, to better reflect that it's only used in one place. Also added comments to clarify that it's CURL-only and suggest it be removed eventually. * platform/MIMETypeRegistry.h: Changed supportedImageMIMETypes, pdfMIMETypes, unsupportedTextMIMETypes, and systemPreviewMIMETypes to return FixedVector instead of HashSet. Also removed normalizedMIMEType. * svg/SVGTransformValue.h: Removed unneeded include of HashMap.h. * testing/TypeConversions.h: Ditto. Source/WebKit: * UIProcess/API/ios/WKWebViewIOS.mm: (-[WKWebView _isDisplayingPDF]): Updated since MIMETypeRegistry::pdfMIMETypes returns a different type. * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm: (-[WKWebViewContentProviderRegistry initWithConfiguration:]): Updated since MIMETypeRegistry::systemPreviewMIMETypes returns a different type. Source/WebKitLegacy/mac: * WebView/WebHTMLRepresentation.mm: (createNSArray): Renamed from newArrayWithStrings so this overloads the createNSArray function from VectorCocoa.h so we can use the two interchangably and handle both FixedVector and HashSet with the smae code. (+[WebHTMLRepresentation supportedMediaMIMETypes]): Updated for name change. (+[WebHTMLRepresentation supportedNonImageMIMETypes]): Ditto. (+[WebHTMLRepresentation supportedImageMIMETypes]): Ditto. (+[WebHTMLRepresentation unsupportedTextMIMETypes]): Ditto. Source/WTF: * wtf/ASCIICType.h: Make most functions constexpr. * wtf/Forward.h: Added FixedVector. * wtf/SortedArrayMap.h: Added SortedArraySet. Added ComparableCaseFoldingASCIILiteral and ComparableLettersLiteral, using a template shared with ComparableASCIILiteral. * wtf/StdLibExtras.h: Added isSortedConstExpr and allOfConstExpr. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: Added SortedArrayMap.cpp, and removed references to non-existent FullscreenRemoveNodeBeforeEnter.h and FloatQuadTests.h. * TestWebKitAPI/Tests/WTF/SortedArrayMap.cpp: Added. Canonical link: https://commits.webkit.org/237163@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276780 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-29 16:39:55 +00:00
2021-04-29 Darin Adler <darin@apple.com>
Extend SortedArrayMap further to work on case-folded strings, use in MIMETypeRegistry
https://bugs.webkit.org/show_bug.cgi?id=224968
Reviewed by Sam Weinig.
* wtf/ASCIICType.h: Make most functions constexpr.
* wtf/Forward.h: Added FixedVector.
* wtf/SortedArrayMap.h: Added SortedArraySet. Added ComparableCaseFoldingASCIILiteral
and ComparableLettersLiteral, using a template shared with ComparableASCIILiteral.
* wtf/StdLibExtras.h: Added isSortedConstExpr and allOfConstExpr.
2021-04-29 Ben Nham <nham@apple.com>
Unreviewed, reverting r276619.
Causes multiple regressions on perf bots.
Reverted changeset:
"Reduce memory footprint for background tabs"
https://bugs.webkit.org/show_bug.cgi?id=225007
https://commits.webkit.org/r276619
experiment with averaging sampling colors across the top of the page as the scroll area background https://bugs.webkit.org/show_bug.cgi?id=224987 <rdar://problem/76251889> Reviewed by Darin Adler. Source/WebCore: Tests: SampledPageTopColor.ZeroMaxDifference SampledPageTopColor.NegativeMaxDifference SampledPageTopColor.SolidColor SampledPageTopColor.DifferentColorsWithoutOutlierBelowMaxDifference SampledPageTopColor.DifferentColorsWithLeftOutlierAboveMaxDifference SampledPageTopColor.DifferentColorsWithMiddleOutlierAboveMaxDifference SampledPageTopColor.DifferentColorsWithRightOutlierAboveMaxDifference SampledPageTopColor.DifferentColorsIndividuallyAboveMaxDifference SampledPageTopColor.DifferentColorsCumulativelyAboveMaxDifference SampledPageTopColor.DisplayP3 SampledPageTopColor.ExperimentalUseSampledPageTopColorForScrollAreaBackgroundColor * dom/Document.h: (WebCore::Document::sampledPageTopColor const): Added. * dom/Document.cpp: (WebCore::Document::enqueuePaintTimingEntryIfNeeded): (WebCore::colorDifference): Added. (WebCore::averageColor): Added. (WebCore::Document::determineSampledPageTopColor): Added. Wait until the first contentful paint before sampling. Don't sample if that location would fall into a 3rd-party `<iframe>`. Currently use 5 snapshots across the top of the page, allowing for one of either the first or last snapshot to be an outlier, which is not included in the average of the other snapshots that's used as the final color value. If the Lab color difference between any two snapshots (unless it's the first or last snapshot as described above) or across all the (non-outlier) snapshots is too large, bail. Only enabled if the `SampledPageTopColorMaxDifference` setting is greater than 0. * page/Page.h: * page/Page.cpp: (WebCore::Page::sampledPageTopColor const): Added. * page/ChromeClient.h: (WebCore::ChromeClient::didSamplePageTopColor const): Added. Pass along the `sampledPageTopColor` to the UIProcess after it's determined or if the above logic bails (so that the `WKWebView` can adjust `_sampledPageTopColor` to `nil`). * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged): Use the `sampledPageTopColor` if the `UseSampledPageTopColorForScrollAreaBackgroundColor` internal preference is enabled instead of the CSS `background-color` of the `<html>`/`<body>`. Source/WebKit: * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::didSamplePageTopColor const): Added. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didSamplePageTopColor): Added. Pass along the `sampledPageTopColor` to the UIProcess. * UIProcess/WebPageProxy.messages.in: * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::sampledPageTopColor): Added. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::scrollAreaBackgroundColor const): (WebKit::WebPageProxy::didSamplePageTopColor): Added. Use the `sampledPageTopColor` if the `UseSampledPageTopColorForScrollAreaBackgroundColor` internal preference is enabled instead of the CSS `background-color` of the `<html>`/`<body>`. * UIProcess/PageClient.h: (WebKit::PageClient::sampledPageTopColorWillChange): Added. (WebKit::PageClient::sampledPageTopColorDidChange): Added. * UIProcess/Cocoa/PageClientImplCocoa.h: * UIProcess/Cocoa/PageClientImplCocoa.mm: (WebKit::PageClientImplCocoa::sampledPageTopColorWillChange): Added. (WebKit::PageClientImplCocoa::sampledPageTopColorDidChange): Added. Add ObjC KVO support for `-[WKWebView _sampledPageTopColor]`. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setupPageConfiguration:]): (-[WKWebView _sampledPageTopColor]): Added. * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _setSampledPageTopColorMaxDifference:]): Added. (-[WKWebViewConfiguration _sampledPageTopColorMaxDifference]): Added. Provide SPI to configure the `SampledPageTopColorMaxDifference` preference when creating the `WKWebView`. Expose the result as `_sampledPageTopColor` SPI. Source/WTF: * Scripts/Preferences/WebPreferences.yaml: Add a `SampledPageTopColorMaxDifference` setting that controls both whether or not to sample colors from the top of the page (only if value > 0) and the max Lab color difference allowed across all samples. * Scripts/Preferences/WebPreferencesInternal.yaml: Add a `UseSampledPageTopColorForScrollAreaBackgroundColor` internal setting that controls whether the sampled page top color can be used as the overscroll area background color. Tools: * TestWebKitAPI/Tests/WebKitCocoa/SampledPageTopColor.mm: Added. (-[TestKVOWrapper initWithObservable:keyPath:callback:]): (-[TestKVOWrapper dealloc]): (-[TestKVOWrapper observeValueForKeyPath:ofObject:change:context:]): (createWebViewWithSampledPageTopColorMaxDifference): (waitForSampledPageTopColorToChangeForHTML): (createHTMLGradientWithColorStops): (TEST.SampledPageTopColor.ZeroMaxDifference): (TEST.SampledPageTopColor.NegativeMaxDifference): (TEST.SampledPageTopColor.SolidColor): (TEST.SampledPageTopColor.DifferentColorsWithoutOutlierBelowMaxDifference): (TEST.SampledPageTopColor.DifferentColorsWithLeftOutlierAboveMaxDifference): (TEST.SampledPageTopColor.DifferentColorsWithMiddleOutlierAboveMaxDifference): (TEST.SampledPageTopColor.DifferentColorsWithRightOutlierAboveMaxDifference): (TEST.SampledPageTopColor.DifferentColorsIndividuallyAboveMaxDifference): (TEST.SampledPageTopColor.DifferentColorsCumulativelyAboveMaxDifference): (TEST.SampledPageTopColor.DisplayP3): (TEST.SampledPageTopColor.ExperimentalUseSampledPageTopColorForScrollAreaBackgroundColor): * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: Canonical link: https://commits.webkit.org/237144@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276744 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-29 00:51:46 +00:00
2021-04-28 Devin Rousso <drousso@apple.com>
experiment with averaging sampling colors across the top of the page as the scroll area background
https://bugs.webkit.org/show_bug.cgi?id=224987
<rdar://problem/76251889>
Reviewed by Darin Adler.
* Scripts/Preferences/WebPreferences.yaml:
Add a `SampledPageTopColorMaxDifference` setting that controls both whether or not to sample
colors from the top of the page (only if value > 0) and the max Lab color difference allowed
across all samples.
* Scripts/Preferences/WebPreferencesInternal.yaml:
Add a `UseSampledPageTopColorForScrollAreaBackgroundColor` internal setting that controls
whether the sampled page top color can be used as the overscroll area background color.
2021-04-28 Kate Cheney <katherine_cheney@apple.com>
Disable App Bound Requests on macOS
https://bugs.webkit.org/show_bug.cgi?id=225155
<rdar://problem/77288787>
App-bound requests is causing potential performance issues on macOS.
We should disable it while we investigate further.
Reviewed by Brent Fulgham.
* wtf/PlatformEnableCocoa.h:
Suppress warnings for %{private}s format specifier https://bugs.webkit.org/show_bug.cgi?id=225137 Reviewed by Alex Christensen. Add PRIVATE_LOG_STRING macro which is defined depending on if os_log() is used or rather old printf(). See also: https://bugs.webkit.org/show_bug.cgi?id=207478 Source/WebKit: * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::ResourceLoadStatisticsDatabaseStore::openITPDatabase): (WebKit::ResourceLoadStatisticsDatabaseStore::enableForeignKeys): (WebKit::ResourceLoadStatisticsDatabaseStore::currentTableAndIndexQueries): (WebKit::ResourceLoadStatisticsDatabaseStore::columnsForTable): (WebKit::ResourceLoadStatisticsDatabaseStore::addMissingColumnsToTable): (WebKit::ResourceLoadStatisticsDatabaseStore::renameColumnInTable): (WebKit::ResourceLoadStatisticsDatabaseStore::addMissingTablesIfNecessary): (WebKit::ResourceLoadStatisticsDatabaseStore::isEmpty const): (WebKit::ResourceLoadStatisticsDatabaseStore::insertObservedDomain): (WebKit::ResourceLoadStatisticsDatabaseStore::relationshipExists const): (WebKit::ResourceLoadStatisticsDatabaseStore::domainID const): (WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationshipList): (WebKit::ResourceLoadStatisticsDatabaseStore::populateFromMemoryStore): (WebKit::ResourceLoadStatisticsDatabaseStore::mergeStatistic): (WebKit::ResourceLoadStatisticsDatabaseStore::mergeStatistics): (WebKit::ResourceLoadStatisticsDatabaseStore::incrementRecordsDeletedCountForDomains): (WebKit::ResourceLoadStatisticsDatabaseStore::recursivelyFindNonPrevalentDomainsThatRedirectedToThisDomain): (WebKit::ResourceLoadStatisticsDatabaseStore::markAsPrevalentIfHasRedirectedToPrevalent): (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess): (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccessUnderOpener): (WebKit::ResourceLoadStatisticsDatabaseStore::grandfatherDataForDomains): (WebKit::ResourceLoadStatisticsDatabaseStore::ensurePrevalentResourcesForDebugMode): (WebKit::ResourceLoadStatisticsDatabaseStore::clearTopFrameUniqueRedirectsToSinceSameSiteStrictEnforcement): (WebKit::ResourceLoadStatisticsDatabaseStore::setUserInteraction): (WebKit::ResourceLoadStatisticsDatabaseStore::clearUserInteraction): (WebKit::ResourceLoadStatisticsDatabaseStore::hasHadUserInteraction): (WebKit::ResourceLoadStatisticsDatabaseStore::setPrevalentResource): (WebKit::ResourceLoadStatisticsDatabaseStore::setDomainsAsPrevalent): (WebKit::ResourceLoadStatisticsDatabaseStore::predicateValueForDomain const): (WebKit::ResourceLoadStatisticsDatabaseStore::clearPrevalentResource): (WebKit::ResourceLoadStatisticsDatabaseStore::setGrandfathered): (WebKit::ResourceLoadStatisticsDatabaseStore::setIsScheduledForAllButCookieDataRemoval): (WebKit::ResourceLoadStatisticsDatabaseStore::getMostRecentlyUpdatedTimestamp const): (WebKit::ResourceLoadStatisticsDatabaseStore::ensureResourceStatisticsForRegistrableDomain): (WebKit::ResourceLoadStatisticsDatabaseStore::clearDatabaseContents): (WebKit::ResourceLoadStatisticsDatabaseStore::removeDataForDomain): (WebKit::ResourceLoadStatisticsDatabaseStore::cookieAccess): (WebKit::ResourceLoadStatisticsDatabaseStore::clearGrandfathering): (WebKit::ResourceLoadStatisticsDatabaseStore::pruneStatisticsIfNeeded): (WebKit::ResourceLoadStatisticsDatabaseStore::updateLastSeen): (WebKit::ResourceLoadStatisticsDatabaseStore::updateDataRecordsRemoved): (WebKit::ResourceLoadStatisticsDatabaseStore::isCorrectSubStatisticsCount): (WebKit::ResourceLoadStatisticsDatabaseStore::getDomainStringFromDomainID const): (WebKit::ResourceLoadStatisticsDatabaseStore::appendSubStatisticList const): (WebKit::ResourceLoadStatisticsDatabaseStore::resourceToString const): (WebKit::ResourceLoadStatisticsDatabaseStore::domainIDExistsInDatabase): (WebKit::ResourceLoadStatisticsDatabaseStore::updateOperatingDatesParameters): (WebKit::ResourceLoadStatisticsDatabaseStore::includeTodayAsOperatingDateIfNecessary): (WebKit::ResourceLoadStatisticsDatabaseStore::insertExpiredStatisticForTesting): (WebKit::ResourceLoadStatisticsDatabaseStore::findPrivateClickMeasurement): (WebKit::ResourceLoadStatisticsDatabaseStore::insertPrivateClickMeasurement): (WebKit::ResourceLoadStatisticsDatabaseStore::markAllUnattributedPrivateClickMeasurementAsExpiredForTesting): (WebKit::ResourceLoadStatisticsDatabaseStore::removeUnattributed): (WebKit::ResourceLoadStatisticsDatabaseStore::allAttributedPrivateClickMeasurement): (WebKit::ResourceLoadStatisticsDatabaseStore::clearPrivateClickMeasurement): (WebKit::ResourceLoadStatisticsDatabaseStore::clearExpiredPrivateClickMeasurement): (WebKit::ResourceLoadStatisticsDatabaseStore::privateClickMeasurementToString): (WebKit::ResourceLoadStatisticsDatabaseStore::clearSentAttribution): (WebKit::ResourceLoadStatisticsDatabaseStore::markAttributedPrivateClickMeasurementsAsExpiredForTesting): Source/WTF: * wtf/Assertions.h: Canonical link: https://commits.webkit.org/237140@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276740 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-28 23:22:18 +00:00
2021-04-28 Basuke Suzuki <basuke.suzuki@sony.com>
Suppress warnings for %{private}s format specifier
https://bugs.webkit.org/show_bug.cgi?id=225137
Reviewed by Alex Christensen.
Add PRIVATE_LOG_STRING macro which is defined depending on if
os_log() is used or rather old printf().
See also: https://bugs.webkit.org/show_bug.cgi?id=207478
* wtf/Assertions.h:
2021-04-28 Alex Christensen <achristensen@webkit.org>
Remove support for NPAPI plugins in WebView
https://bugs.webkit.org/show_bug.cgi?id=224449
Reviewed by Geoffrey Garen.
* Scripts/Preferences/WebPreferencesInternal.yaml:
Drop ModernUnprefixedWebAudio & AudioWorklet experimental feature flags https://bugs.webkit.org/show_bug.cgi?id=225130 Reviewed by Eric Carlson. Drop ModernUnprefixedWebAudio & AudioWorklet experimental feature flags now that these features have shipped. It also doesn't make sense to disable them given that the prefixed WebAudio API is no longer exposed and there is no feature flag to turn the legacy prefixed API back on. Source/WebCore: * Modules/webaudio/AnalyserNode.idl: * Modules/webaudio/AudioBuffer.idl: * Modules/webaudio/AudioBufferSourceNode.idl: * Modules/webaudio/AudioContext.idl: * Modules/webaudio/AudioParamMap.idl: * Modules/webaudio/AudioProcessingEvent.idl: * Modules/webaudio/AudioWorklet.idl: * Modules/webaudio/AudioWorkletNode.idl: * Modules/webaudio/AudioWorkletNodeOptions.idl: * Modules/webaudio/BaseAudioContext.idl: * Modules/webaudio/BiquadFilterNode.idl: * Modules/webaudio/ChannelMergerNode.idl: * Modules/webaudio/ChannelSplitterNode.idl: * Modules/webaudio/ConstantSourceNode.idl: * Modules/webaudio/ConstantSourceOptions.idl: * Modules/webaudio/ConvolverNode.idl: * Modules/webaudio/DelayNode.idl: * Modules/webaudio/DynamicsCompressorNode.idl: * Modules/webaudio/GainNode.idl: * Modules/webaudio/IIRFilterNode.idl: * Modules/webaudio/MediaElementAudioSourceNode.idl: * Modules/webaudio/MediaStreamAudioDestinationNode.idl: * Modules/webaudio/MediaStreamAudioSourceNode.idl: * Modules/webaudio/OfflineAudioContext.idl: * Modules/webaudio/OscillatorNode.idl: * Modules/webaudio/PannerNode.idl: * Modules/webaudio/PeriodicWave.idl: * Modules/webaudio/StereoPannerNode.idl: * Modules/webaudio/WaveShaperNode.idl: Source/WebKitLegacy/mac: * WebView/WebPreferenceKeysPrivate.h: * WebView/WebPreferences.mm: (-[WebPreferences modernUnprefixedWebAudioEnabled]): Deleted. (-[WebPreferences setModernUnprefixedWebAudioEnabled:]): Deleted. (-[WebPreferences audioWorkletEnabled]): Deleted. (-[WebPreferences setAudioWorkletEnabled:]): Deleted. * WebView/WebPreferencesPrivate.h: Source/WTF: * Scripts/Preferences/WebPreferencesExperimental.yaml: Canonical link: https://commits.webkit.org/237119@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276715 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-28 15:44:02 +00:00
2021-04-28 Chris Dumez <cdumez@apple.com>
Drop ModernUnprefixedWebAudio & AudioWorklet experimental feature flags
https://bugs.webkit.org/show_bug.cgi?id=225130
Reviewed by Eric Carlson.
Drop ModernUnprefixedWebAudio & AudioWorklet experimental feature flags now that
these features have shipped. It also doesn't make sense to disable them given
that the prefixed WebAudio API is no longer exposed and there is no feature flag
to turn the legacy prefixed API back on.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
Asserting that function or variable is accessed in a certain thread should be simpler and more robust https://bugs.webkit.org/show_bug.cgi?id=224971 Patch by Kimmo Kinnunen <kkinnunen@apple.com> on 2021-04-28 Reviewed by Darin Adler. Source/WebKit: Use ThreadAssertions in RemoteGraphicsContextGL implementations as an example. * GPUProcess/graphics/RemoteGraphicsContextGL.cpp: (WebKit::RemoteGraphicsContextGL::RemoteGraphicsContextGL): (WebKit::RemoteGraphicsContextGL::~RemoteGraphicsContextGL): (WebKit::RemoteGraphicsContextGL::initialize): (WebKit::RemoteGraphicsContextGL::stopListeningForIPC): (WebKit::RemoteGraphicsContextGL::displayWasReconfigured): (WebKit::RemoteGraphicsContextGL::workQueueInitialize): (WebKit::RemoteGraphicsContextGL::workQueueUninitialize): (WebKit::RemoteGraphicsContextGL::didComposite): (WebKit::RemoteGraphicsContextGL::forceContextLost): (WebKit::RemoteGraphicsContextGL::dispatchContextChangedNotification): (WebKit::RemoteGraphicsContextGL::reshape): (WebKit::RemoteGraphicsContextGL::prepareForDisplay): (WebKit::RemoteGraphicsContextGL::synthesizeGLError): (WebKit::RemoteGraphicsContextGL::getError): (WebKit::RemoteGraphicsContextGL::ensureExtensionEnabled): (WebKit::RemoteGraphicsContextGL::notifyMarkContextChanged): (WebKit::RemoteGraphicsContextGL::paintRenderingResultsToCanvas): (WebKit::RemoteGraphicsContextGL::paintCompositedResultsToCanvas): (WebKit::RemoteGraphicsContextGL::paintImageDataToImageBuffer): (WebKit::RemoteGraphicsContextGL::copyTextureFromMedia): (WebKit::RemoteGraphicsContextGL::simulateEventForTesting): * GPUProcess/graphics/RemoteGraphicsContextGL.h: * GPUProcess/graphics/RemoteGraphicsContextGLCocoa.cpp: (WebKit::RemoteGraphicsContextGLCocoa::platformWorkQueueInitialize): (WebKit::RemoteGraphicsContextGLCocoa::prepareForDisplay): * GPUProcess/graphics/RemoteGraphicsContextGLFunctionsGenerated.h: Source/WTF: Adds support for more fine-grained thread assertion than ASSERT(isMainThread()) / ASSERT(!isMainThread()) * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/Compiler.h: Add NO_UNIQUE_ADDRESS which can be used to declare members that are empty in RELEASE builds. The declaration avoids increasing the size of the enclosing type. This should be used with ThreadAssertion: class MyThreadAware { .... NO_UNIQUE_ADDRESS ThreadAssertion m_ownerThread; }; * wtf/ThreadAssertions.h: Added. Add ThreadAssertion class that can be held as a member of a type. This allows consistent assertions that the code in the type runs in the expected thread. Add NamedAssertion& WTF::mainThread. Add NamedAssertion& WTF::mainRunLoop. These are only to be used in thread safety analysis phase. These are undefined symbols, it is an error to reference them. Adds functions assertIsMainThread() and assertIsMainRunLoop() to replace patterns of ASSERT(isMainThread()), ASSERT(isMainRunLoop(). In addition to behaving as the direct ASSERT behaves, the functions enable compile-time thread safety analysis to know that the calling scope has the assertions. These can be optionally then used in the function and member signatures to require the assertions. Tools: Add simple tests to make sure code in ThreadAssertions.h compiles. * Scripts/generate-gpup-webgl: Use ThreadAssertions in RemoteGraphicsContextGL implementation as an example. * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/ThreadAssertionsTest.cpp: Added. (TestWebKitAPI::TEST): (TestWebKitAPI::WTF_REQUIRES_LOCK): Canonical link: https://commits.webkit.org/237115@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276706 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-28 13:30:15 +00:00
2021-04-28 Kimmo Kinnunen <kkinnunen@apple.com>
Asserting that function or variable is accessed in a certain thread should be simpler and more robust
https://bugs.webkit.org/show_bug.cgi?id=224971
Reviewed by Darin Adler.
Adds support for more fine-grained thread assertion than
ASSERT(isMainThread()) / ASSERT(!isMainThread())
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/Compiler.h:
Add NO_UNIQUE_ADDRESS which can be used to declare members that are empty in
RELEASE builds. The declaration avoids increasing the size of the enclosing type.
This should be used with ThreadAssertion:
class MyThreadAware {
....
NO_UNIQUE_ADDRESS ThreadAssertion m_ownerThread;
};
* wtf/ThreadAssertions.h: Added.
Add ThreadAssertion class that can be held as a member of a type.
This allows consistent assertions that the code in the type
runs in the expected thread.
Add NamedAssertion& WTF::mainThread.
Add NamedAssertion& WTF::mainRunLoop.
These are only to be used in thread safety analysis phase. These are undefined
symbols, it is an error to reference them.
Adds functions assertIsMainThread() and assertIsMainRunLoop() to replace
patterns of ASSERT(isMainThread()), ASSERT(isMainRunLoop().
In addition to behaving as the direct ASSERT behaves, the functions
enable compile-time thread safety analysis to know that the calling
scope has the assertions. These can be optionally then used in the
function and member signatures to require the assertions.
[WPE][GTK] More correct fixes for stack size issues on musl libc https://bugs.webkit.org/show_bug.cgi?id=225099 Patch by Daniel Kolesa <dkolesa@igalia.com> on 2021-04-28 Reviewed by Adrian Perez de Castro. Partial revert https://bugs.webkit.org/show_bug.cgi?id=210068 Source/JavaScriptCore: After fixing the thread stack issues in WTF properly, we can revert the JSC options changes, which are actually harmful since they result in JSC being unstable. Previously, softReservedZoneSize was causing a crash when set to 128K because of the main thread stack bounds, and this is now fixed. We can keep the maxPerThreadStackUsage at 5M as well; there is no fundamental difference from how things are done on glibc anymore. * runtime/OptionsList.h: Source/WTF: While the changes in r236306 stopped JSC from crashing outright, they are not correct, since they also make it rather unstable. To counter this, increase stack size for threads on Linux with non-glibc/bionic libcs to 1 megabyte, which is a robust enough value that should always be sufficient. While at it, the previous approach to musl thread stack size was breaking use of DEFAULT_THREAD_STACK_SIZE_IN_KB (if defined) as well as not properly taking care of the unused parameter. Move the code to a more appropriate place, which solves these problems. All this is however not enough, since there is still the main thread; using pthread_attr_getstack on a main thread is not reliable since main thread stacks are allowed to grow, and we expect the bounds to always be constant. On glibc, this already behaved right, but e.g. on musl (and possibly other C libraries) this is not necessarily the case - at the point of the check, it was returning 128k (since that's the initial size reserved by the kernel). Therefore, do the same thing as on Darwin and use process resource limits to get the boundary on Linux as well. This results in JavaScriptCore behaving correctly on musl libc and allows us to drop the options special-casing that was in place. * wtf/StackBounds.cpp: (WTF::StackBounds::currentThreadStackBoundsInternal): * wtf/Threading.cpp: (WTF::stackSize): Canonical link: https://commits.webkit.org/237109@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276695 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-28 07:36:48 +00:00
2021-04-28 Daniel Kolesa <dkolesa@igalia.com>
[WPE][GTK] More correct fixes for stack size issues on musl libc
https://bugs.webkit.org/show_bug.cgi?id=225099
Reviewed by Adrian Perez de Castro.
Partial revert https://bugs.webkit.org/show_bug.cgi?id=210068
While the changes in r236306 stopped JSC from crashing outright,
they are not correct, since they also make it rather unstable.
To counter this, increase stack size for threads on Linux with
non-glibc/bionic libcs to 1 megabyte, which is a robust enough
value that should always be sufficient.
While at it, the previous approach to musl thread stack size was
breaking use of DEFAULT_THREAD_STACK_SIZE_IN_KB (if defined) as
well as not properly taking care of the unused parameter. Move
the code to a more appropriate place, which solves these problems.
All this is however not enough, since there is still the main thread;
using pthread_attr_getstack on a main thread is not reliable since main
thread stacks are allowed to grow, and we expect the bounds to always
be constant. On glibc, this already behaved right, but e.g. on musl
(and possibly other C libraries) this is not necessarily the case - at
the point of the check, it was returning 128k (since that's the initial
size reserved by the kernel). Therefore, do the same thing as on Darwin
and use process resource limits to get the boundary on Linux as well.
This results in JavaScriptCore behaving correctly on musl libc and
allows us to drop the options special-casing that was in place.
* wtf/StackBounds.cpp:
(WTF::StackBounds::currentThreadStackBoundsInternal):
* wtf/Threading.cpp:
(WTF::stackSize):
Add a Condition type that supports thread safety analysis https://bugs.webkit.org/show_bug.cgi?id=224970 Patch by Kimmo Kinnunen <kkinnunen@apple.com> on 2021-04-27 Reviewed by Darin Adler. Source/WebKit: Use CheckedCondition and CheckedLock as an example of the added implementations. * Platform/IPC/Connection.cpp: (IPC::Connection::waitForMessage): (IPC::Connection::processIncomingMessage): (IPC::Connection::connectionDidClose): * Platform/IPC/Connection.h: (IPC::Connection::WTF_GUARDED_BY_LOCK): Use CheckedCondition (as an example). Mark up variables protected by IPC::Connection::m_waitForMessageMutex to use thread safety analysis. * Shared/mac/MediaFormatReader/MediaTrackReader.cpp: (WebKit::MediaTrackReader::greatestPresentationTime const): Fix unlocked access. (WebKit::MediaTrackReader::addSample): (WebKit::MediaTrackReader::waitForSample const): (WebKit::MediaTrackReader::finishParsing): (WebKit::MediaTrackReader::copyProperty): (WebKit::MediaTrackReader::finalize): * Shared/mac/MediaFormatReader/MediaTrackReader.h: Use CheckedCondition (as an example). Mark up variables protected by MediaTrackReader::m_sampleStorageLock to use thread safety analysis. Source/WTF: Add CheckedCondition, a condition variable to be used with CheckedLock. Use thread safety analysis annotations for CheckedCondition. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/CheckedCondition.h: Added. * wtf/CheckedLock.h: Tools: A simple test for CheckedCondition to make sure it compiles. * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/CheckedConditionTest.cpp: Copied from Tools/TestWebKitAPI/Tests/WTF/CheckedLockTest.cpp. (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WTF/CheckedLockTest.cpp: Canonical link: https://commits.webkit.org/237105@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-28 06:26:12 +00:00
2021-04-27 Kimmo Kinnunen <kkinnunen@apple.com>
Add a Condition type that supports thread safety analysis
https://bugs.webkit.org/show_bug.cgi?id=224970
Reviewed by Darin Adler.
Add CheckedCondition, a condition variable to be used with CheckedLock.
Use thread safety analysis annotations for CheckedCondition.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/CheckedCondition.h: Added.
* wtf/CheckedLock.h:
2021-04-27 Ben Nham <nham@apple.com>
Memory pressure events should be logged to com.apple.WebKit subsystem
https://bugs.webkit.org/show_bug.cgi?id=225112
Reviewed by Chris Dumez.
Currently memory pressure events are logged to the default os_log subsystem instead of the
com.apple.WebKit subsystem. This makes it hard to capture such events using common logging
prefs (e.g. a pref that persists all logs from the WebKit subsystem).
To fix this, call WTFInitializeLogChannelStatesFromString at init time. This associates the
WTFLogChannel with an os_log object that sends the messages to the WebKit subsystem.
* wtf/MemoryPressureHandler.cpp:
(WTF::MemoryPressureHandler::singleton):
* wtf/cocoa/MemoryPressureHandlerCocoa.mm:
(WTF::MemoryPressureHandler::install):
2021-04-27 Alex Christensen <achristensen@webkit.org>
Unreviewed, reverting r275912.
rdar://77179042
Broke internal client
Reverted changeset:
"Remove support for NPAPI plugins in WebView"
https://bugs.webkit.org/show_bug.cgi?id=224449
https://commits.webkit.org/r275912
2021-04-26 Ben Nham <nham@apple.com>
Reduce memory footprint for background tabs
https://bugs.webkit.org/show_bug.cgi?id=225007
Reviewed by Chris Dumez.
When a WebContent process contains only non-visible pages (e.g. if it is a background tab),
we should attempt to reduce our memory footprint after some time interval to help relieve
system-wide memory pressure. This is enabled only on Mac because iOS already does something
similar just before WebContent suspends.
* wtf/PlatformEnableCocoa.h:
2021-04-26 Keith Miller <keith_miller@apple.com>
CodeBlock should do a better job accounting for extra memory it allocates.
https://bugs.webkit.org/show_bug.cgi?id=225068
Reviewed by Mark Lam.
Small convenience function to help compute the memory used by a Bag for JS GC
accounting.
* wtf/Bag.h:
2021-04-26 Angelos Oikonomopoulos <angelos@igalia.com>
Bump CeilingOnPageSize to 16KB on MIPS
https://bugs.webkit.org/show_bug.cgi?id=225030
Reviewed by Michael Catanzaro.
* wtf/PageBlock.h:
2021-04-25 Darin Adler <darin@apple.com>
Fix handling of overflow of /= and *= operators with double over Checked<uint64_t> and other 64-bit types.
https://bugs.webkit.org/show_bug.cgi?id=224835
Reviewed by Chris Dumez.
* wtf/CheckedArithmetic.h: Since it is quite difficult to write correct implementations of the
operations where we multiply or divide a checked integer by a floating point number, deleted
those functions, which were barely used. Also corrected return types of various member functions,
which were unconventional "const Type", replacing them with the conventional "Type" for functions
that return a distinct value, "Type&" for assignment operators, and bool for relational operators.
2021-04-25 Devin Rousso <drousso@apple.com>
Add `ALWAYS_LOG_WITH_STREAM` macro for easier development/debugging
https://bugs.webkit.org/show_bug.cgi?id=224959
Reviewed by Darin Adler.
It's often very helpful to use existing `operator<<` defined on objects, but annoying to
have to copypaste the boilerplate code that creates a `WTF::TextStream` and uses it in a
`WTFLogAlways` or wait for a debug build to enable existing `LOG_WITH_STREAM`.
* wtf/Assertions.h:
(LOG_WITH_STREAM): Moved from `Source/WebCore/pal/LogMacros.h`.
(ALWAYS_LOG_WITH_STREAM): Added.
Add `ALWAYS_LOG_WITH_STREAM` so that one change existing `LOG` when debugging with minimal
friction. As an example, many times I've wished I could've just changed
```
LOG_WITH_STREAM(Channel, stream << node);
```
to something like
```
ALWAYS_LOG_WITH_STREAM(stream << node);
```
and avoid having to modify the surrounding code too much.
Remove decoder memory allocations based on untrusted data (sizes) in the stream; related changes https://bugs.webkit.org/show_bug.cgi?id=224984 Reviewed by Sam Weinig. Source/WebCore: * platform/network/cf/CertificateInfoCFNet.cpp: (WTF::Persistence::decodeCFData): Removed unneeded check for zero size. Removed code that locally allocates a vector before bufferIsLargeEnoughToContain is called. Instead use bufferPointerForDirectRead, which makes does the buffer size check, and pass the pointer directly to CFDataCreate. Source/WebKit: * Platform/IPC/ArgumentCoders.h: Remove the calls to HashMap::reserveInitialCapacity and HashSet::reserveInitialCapacity, based on number read in from the decoder. This means there will be more wasted memory in these HashMap and HashSet objects, so we have to test to make sure this does not create a performance problem. But without this check, we are trying to allocate memory based on an unstrusted size. * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder<RefPtr<ApplePayError>>::encode): Removed the coder for a Vector of these RefPtr, replaced it with a coder for an individual one, allowing the Vector ArgumentCoder template to handle vector size and construction. One benefit is that this adds in a shrinkToFit and prevents us from making any separate mistake about pre-sizing the Vector here since we use shared code. (IPC::ArgumentCoder<RefPtr<ApplePayError>>::decode): Ditto. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder<RefPtr<SecurityOrigin>>::encode): Ditto. (IPC::ArgumentCoder<RefPtr<SecurityOrigin>>::decode): Ditto. (IPC::ArgumentCoder<WebCore::CDMInstanceSession::KeyStatusVector>::encode): (IPC::ArgumentCoder<WebCore::CDMInstanceSession::KeyStatusVector>::decode): Removed unnecessary specialization for the KeyStatusVector. There is already an ArgumentCoder for Vector, for std::pair, for Ref<SharedBuffer>, and for enumerations like CDMKeyStatus, so there's no need to have a specialized coder for this. This function that we are removing had a call to reserveInitialCapacity, but the Vector ArgumentCoder template does not. * Shared/WebCoreArgumentCoders.h: Replaced the ArgumentCoder<Vector<RefPtr<WebCore::ApplePayError>>> specialization with ArgumentCoder<RefPtr<WebCore::ApplePayError>>. Removed the ArgumentCoder<WebCore::CDMInstanceSession::KeyStatusVector> specialization. Source/WTF: * wtf/persistence/PersistentDecoder.cpp: (WTF::Persistence::Decoder::bufferPointerForDirectRead): Added. (WTF::Persistence::Decoder::decodeFixedLengthData): Refactor to use bufferPointerForDirectRead. * wtf/persistence/PersistentDecoder.h: Added bufferPointerForDirectRead function for use in the rare cases where we want to read directly out of the decoder buffer, rather than writing to a passed-in pointer. Also did a small refactoring of bufferIsLargeEnoughToContain to use && rather than an if statement. Canonical link: https://commits.webkit.org/236967@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276510 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-23 19:06:25 +00:00
2021-04-23 Darin Adler <darin@apple.com>
Remove decoder memory allocations based on untrusted data (sizes) in the stream; related changes
https://bugs.webkit.org/show_bug.cgi?id=224984
Reviewed by Sam Weinig.
* wtf/persistence/PersistentDecoder.cpp:
(WTF::Persistence::Decoder::bufferPointerForDirectRead): Added.
(WTF::Persistence::Decoder::decodeFixedLengthData): Refactor to use bufferPointerForDirectRead.
* wtf/persistence/PersistentDecoder.h: Added bufferPointerForDirectRead function for use in the
rare cases where we want to read directly out of the decoder buffer, rather than writing to a
passed-in pointer. Also did a small refactoring of bufferIsLargeEnoughToContain to use &&
rather than an if statement.
2021-04-23 Chris Dumez <cdumez@apple.com>
Disable GPUProcess on shipping iOS
https://bugs.webkit.org/show_bug.cgi?id=224897
Reviewed by Eric Carlson.
* wtf/PlatformEnableCocoa.h:
2021-04-22 Lauro Moura <lmoura@igalia.com>
[WTF] Undefined behavior warning in StringBuilder::allocateBuffer
https://bugs.webkit.org/show_bug.cgi?id=224942
Reviewed by Chris Dumez.
* wtf/text/StringBuilder.cpp:
(WTF::StringBuilder::allocateBuffer): Add check before calling memcpy
2021-04-22 Simon Fraser <simon.fraser@apple.com>
Add trace points for WKWebView snapshotting
https://bugs.webkit.org/show_bug.cgi?id=224943
Reviewed by Tim Horton.
New snapshot values.
* wtf/SystemTracing.h:
[GTK] Turn on editable <input type=date> and <input type=time> fields https://bugs.webkit.org/show_bug.cgi?id=224921 Reviewed by Carlos Garcia Campos. .: Turn on editable date and time inputs for GTK * Source/cmake/OptionsGTK.cmake: Add new source file to the list. Source/WebCore: Turn on editable date and time inputs for GTK. No new tests. This is covered by enabling existing <input type=date> and <input type=time> tests. * Headers.cmake: Add headers to the list. * loader/EmptyClients.cpp: Add missing header include. Source/WebKit: Turn on editable date and time inputs for GTK. * SourcesGTK.txt: Add source file. * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::createDateTimePicker): Added. * UIProcess/API/gtk/PageClientImpl.h: Added method declaration. * UIProcess/gtk/WebDateTimePickerGtk.cpp: Added. Stub for date/time picker which doesn't have any user interface. This will allow clients to use the editable shadow DOM date/time input editable fields. (WebKit::WebDateTimePickerGtk::create): (WebKit::WebDateTimePickerGtk::~WebDateTimePickerGtk): (WebKit::WebDateTimePickerGtk::WebDateTimePickerGtk): (WebKit::WebDateTimePickerGtk::endPicker): (WebKit::WebDateTimePickerGtk::showDateTimePicker): * UIProcess/gtk/WebDateTimePickerGtk.h: Added. Source/WTF: Turn on editable date and time inputs for GTK. * Scripts/Preferences/WebPreferencesInternal.yaml: Set editable date/time inputs on by default for GTK as well. LayoutTests: Turn on editable date and time inputs for GTK. * platform/gtk/TestExpectations: Enable new forms test for WebKitGTK. * platform/gtk/fast/forms/date/date-input-rendering-basic-expected.txt: Added. * platform/gtk/fast/forms/date/date-pseudo-elements-expected.txt: Added. * platform/gtk/fast/forms/time/time-input-rendering-basic-expected.txt: Added. Canonical link: https://commits.webkit.org/236908@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276448 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-22 18:09:53 +00:00
2021-04-22 Martin Robinson <mrobinson@webkit.org>
[GTK] Turn on editable <input type=date> and <input type=time> fields
https://bugs.webkit.org/show_bug.cgi?id=224921
Reviewed by Carlos Garcia Campos.
Turn on editable date and time inputs for GTK.
* Scripts/Preferences/WebPreferencesInternal.yaml: Set editable date/time inputs
on by default for GTK as well.
2021-04-22 Aditya Keerthi <akeerthi@apple.com>
Fix the tvOS build after r276325
https://bugs.webkit.org/show_bug.cgi?id=224929
<rdar://problem/77003408>
Reviewed by Wenson Hsieh.
Fix the tvOS build after r276325
* wtf/PlatformHave.h:
2021-04-21 Aditya Keerthi <akeerthi@apple.com>
[iOS] Fix internal builds after r276325
https://bugs.webkit.org/show_bug.cgi?id=224896
Reviewed by Tim Horton.
* wtf/PlatformHave.h:
2021-04-21 Martin Robinson <mrobinson@igalia.com>
Enable CSS Scroll Snap by default
https://bugs.webkit.org/show_bug.cgi?id=224867
Reviewed by Don Olmstead.
* wtf/PlatformEnable.h: Move the preprocessor enabling of scroll snap here.
* wtf/PlatformEnableCocoa.h: Move it from here.
2021-04-21 Simon Fraser <simon.fraser@apple.com>
Enhance scrolling-related trace points
https://bugs.webkit.org/show_bug.cgi?id=224852
Reviewed by Tim Horton.
One new trace point, and some argument descriptors.
* wtf/SystemTracing.h:
2021-04-20 Brent Fulgham <bfulgham@apple.com>
[Cocoa] Prevent GPU and WebContent processes from attempting to connect to the AppSSO service
https://bugs.webkit.org/show_bug.cgi?id=224834
<rdar://problem/72157514>
Reviewed by Jiewen Tan.
* wtf/PlatformHave.h:
2021-04-20 Eric Carlson <eric.carlson@apple.com>
[Cocoa] Enable MediaSession and MediaSessionCoordinator experimental features
https://bugs.webkit.org/show_bug.cgi?id=224822
<rdar://problem/76908014>
Reviewed by Jer Noble.
* Scripts/Preferences/WebPreferencesExperimental.yaml: Change the defaults for
MediaSessionCoordinatorEnabled and MediaSessionEnabled to true.
2021-04-20 Michael Catanzaro <mcatanzaro@gnome.org>
Lots of spurious -Wnonnull warnings with GCC 11
https://bugs.webkit.org/show_bug.cgi?id=224452
Reviewed by Darin Adler.
* wtf/RefPtr.h:
(WTF::DefaultRefDerefTraits::derefIfNotNull):
FullGCActivityCallback should use the percentage of pages uncompressed in RAM to determine deferral. https://bugs.webkit.org/show_bug.cgi?id=224817 Reviewed by Filip Pizlo. Source/JavaScriptCore: Right now we try to determine if too many pages are paged out by dereferencing them and bailing out of the GC if we go over a deadline. While this works if the only goal is to avoid causing extensive thrashing on spinny disks (HDD), it doesn't prevent thrashing when access to disk is fast (e.g. SSD). This is because on fast disks the proportional time to load the memory from disk is much lower. Additionally, on SSDs in particular we don't want to load the pages into RAM then bail as that will force a different page onto disk, increasing wear. This patch switches to asking the OS if each MarkedBlock is paged out. Then if we are over a threshold we wait until we would have GC'd anyway. This patch uses the (maxVMGrowthFactor - 1) as the percentage of "slow" pages (paged out or compressed) needed to defer the GC. The idea behind that threshold is that if we add that many pages then the same number of pages would be forced out of RAM for us to do a GC anyway (in the limit). * heap/BlockDirectory.cpp: (JSC::BlockDirectory::updatePercentageOfPagedOutPages): (JSC::BlockDirectory::isPagedOut): Deleted. * heap/BlockDirectory.h: * heap/FullGCActivityCallback.cpp: (JSC::FullGCActivityCallback::doCollection): * heap/Heap.cpp: (JSC::Heap::isPagedOut): * heap/Heap.h: * heap/MarkedSpace.cpp: (JSC::MarkedSpace::isPagedOut): * heap/MarkedSpace.h: * runtime/OptionsList.h: Source/WebKit: Add mincore to the acceptable syscall list. * WebProcess/com.apple.WebProcess.sb.in: Source/WTF: Add a noexcept flavor of FunctionTraits. On Linux mincore (and probably other syscalls) are marked noexcept so the existing overloads don't work. * wtf/FunctionTraits.h: Canonical link: https://commits.webkit.org/236804@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276324 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-20 22:42:05 +00:00
2021-04-20 Keith Miller <keith_miller@apple.com>
FullGCActivityCallback should use the percentage of pages uncompressed in RAM to determine deferral.
https://bugs.webkit.org/show_bug.cgi?id=224817
Reviewed by Filip Pizlo.
Add a noexcept flavor of FunctionTraits. On Linux mincore (and probably other syscalls) are marked noexcept so the existing overloads don't work.
* wtf/FunctionTraits.h:
2021-04-20 Chris Dumez <cdumez@apple.com>
Make sure we don't exit the GPUProcess too frequently while under memory pressure
https://bugs.webkit.org/show_bug.cgi?id=224798
Reviewed by Darin Adler.
Add member function to the MemoryPressureHandler to indicate if we're currently simulating memory
pressure or not.
* wtf/MemoryPressureHandler.h:
(WTF::MemoryPressureHandler::isSimulatingMemoryPressure const):
Refactor sorted array mapping machinery in LocaleToScriptMapping.cpp for reuse elsewhere https://bugs.webkit.org/show_bug.cgi?id=224733 Reviewed by Yusuke Suzuki. Source/WebCore: * Modules/indexeddb/client/IDBConnectionToServer.h: Removed unneeded includes. * Modules/mediastream/RTCRtpSFrameTransformer.h: Ditto. * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h: Ditto. * Modules/webauthn/AuthenticatorCoordinatorClient.h: Ditto. * Modules/websockets/WebSocketChannel.cpp: Ditto. * Modules/websockets/WebSocketDeflater.cpp: Ditto. * bindings/IDLTypes.h: Ditto. * bridge/jsc/BridgeJSC.h: Ditto. * contentextensions/DFANode.h: Ditto. * contentextensions/NFAToDFA.cpp: Ditto. * contentextensions/Term.h: Ditto. * css/typedom/StylePropertyMap.h: Ditto. * css/typedom/StylePropertyMapReadOnly.cpp: Ditto. * cssjit/SelectorCompiler.cpp: Ditto. * platform/text/LocaleToScriptMapping.cpp: (WebCore::scriptNameToCode): Refactor to use SortedArrayMap. Also changed to take StringView. (WebCore::localeToScriptCodeForFontSelection): Ditto. Cut down on memory allocation by using StringView instead of String while looping through substrings. * platform/text/LocaleToScriptMapping.h: Changed scriptNameToCode to take StringView. Source/WebKit: * NetworkProcess/PrivateClickMeasurementManager.h: Removed unused include of HashMap.h. * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h: Ditto. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::createSelectorExceptionMap): Deleted. (WebKit::commandNameForSelectorName): Use SortedArrayMap instead of HashMap. Source/WTF: * WTF.xcodeproj/project.pbxproj: Added SortedArrayMap.h. * wtf/CMakeLists.txt: Ditto. * wtf/SortedArrayMap.h: Added. Builds on the idiom in LocalToScriptMapping, and to be generic uses std::pair instead of custom structures. Includes the ComparableASCIILiteral structure for maps that are keyed by case-sensitive ASCII strings. * wtf/StdLibExtras.h: (WTF::binarySearchImpl): Use auto in one place to make this a bit more generic. Canonical link: https://commits.webkit.org/236785@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276303 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-20 14:48:06 +00:00
2021-04-19 Darin Adler <darin@apple.com>
Refactor sorted array mapping machinery in LocaleToScriptMapping.cpp for reuse elsewhere
https://bugs.webkit.org/show_bug.cgi?id=224733
Reviewed by Yusuke Suzuki.
* WTF.xcodeproj/project.pbxproj: Added SortedArrayMap.h.
* wtf/CMakeLists.txt: Ditto.
* wtf/SortedArrayMap.h: Added. Builds on the idiom in LocalToScriptMapping, and to be
generic uses std::pair instead of custom structures. Includes the ComparableASCIILiteral
structure for maps that are keyed by case-sensitive ASCII strings.
* wtf/StdLibExtras.h:
(WTF::binarySearchImpl): Use auto in one place to make this a bit more generic.
Enable -Wthread-safety, add attributes to custom lock classes, and provide macros to declare guards https://bugs.webkit.org/show_bug.cgi?id=221614 <rdar://problem/74396781> Patch by Kimmo Kinnunen <kkinnunen@apple.com> on 2021-04-19 Reviewed by David Kilzer. PerformanceTests: Add -Wthread-safety to compile flags. * DecoderTest/Configurations/Base.xcconfig: Source/bmalloc: Add -Wthread-safety to compile flags. * Configurations/Base.xcconfig: Source/JavaScriptCore: Add -Wthread-safety to compile flags. * Configurations/Base.xcconfig: Source/WebCore: Add -Wthread-safety to compile flags. * Configurations/Base.xcconfig: Source/WebCore/PAL: Add -Wthread-safety to compile flags. * Configurations/Base.xcconfig: Source/WebInspectorUI: Add -Wthread-safety to compile flags. * Configurations/Base.xcconfig: Source/WebKit: Add -Wthread-safety to compile flags. * Configurations/Base.xcconfig: Source/WebKitLegacy/mac: Add -Wthread-safety to compile flags. * Configurations/Base.xcconfig: Source/WTF: Implement rudimentary support for clang thread safety analysis. The added macros can be used to declare which member variables or global variables are locked by which mutexes. The compiler will check statically that the mutexes are held correctly. The checking is intra procedural, not global. * Configurations/Base.xcconfig: Add -Wthread-safety to compile flags. * wtf/CheckedLock.h: Added. Add CheckedLock, a Lock variant that is amenable to static analysis. Add a Locker specialization for CheckedLock that is amenable to static analysis. Locker<CheckedLock> is a std::scoped_lock. The scoped_lock cannot be aliased, since it appears that (Apple's) libcxx is not compiled with thread safety analysis support enabled by default. New types are needed due Locker move constructor and conditional locking. The Locker has default usage pattern of: auto locker = holdLock(m_lock); This forces dynamism that removes the possibility of simple statical analysis that thread safety analysis capabilities "mutex" and "scoped_lock" currently implement. Most likely large fraction of call sites is due to historical lack of CTAD and as such can be converted to less general form. Once the pattern is not used by default, CheckedLock can be deleted and the move dynamism bits of Locker can be moved to some more specific type ("UncheckedLocker"). * wtf/ThreadSafetyAnalysis.h: Added. Add macro wrappers around clang "mutex" and "scoped_lock" capability attributes. Tools: * TestWebKitAPI/Configurations/Base.xcconfig: Add -Wthread-safety to compile flags. * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/CheckedLock.cpp: Added. (TestWebKitAPI::TEST): Implement a test for testing that CheckedLock compiles. Canonical link: https://commits.webkit.org/236729@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276247 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-19 13:12:23 +00:00
2021-04-19 Kimmo Kinnunen <kkinnunen@apple.com>
Enable -Wthread-safety, add attributes to custom lock classes, and provide macros to declare guards
https://bugs.webkit.org/show_bug.cgi?id=221614
<rdar://problem/74396781>
Reviewed by David Kilzer.
Implement rudimentary support for clang thread safety analysis.
The added macros can be used to declare which member variables or
global variables are locked by which mutexes. The compiler will
check statically that the mutexes are held correctly. The checking
is intra procedural, not global.
* Configurations/Base.xcconfig:
Add -Wthread-safety to compile flags.
* wtf/CheckedLock.h: Added.
Add CheckedLock, a Lock variant that is amenable to static
analysis.
Add a Locker specialization for CheckedLock that is amenable to
static analysis.
Locker<CheckedLock> is a std::scoped_lock. The scoped_lock cannot be aliased,
since it appears that (Apple's) libcxx is not compiled with thread safety
analysis support enabled by default.
New types are needed due Locker move constructor and conditional locking.
The Locker has default usage pattern of:
auto locker = holdLock(m_lock);
This forces dynamism that removes the possibility of simple statical
analysis that thread safety analysis capabilities "mutex" and "scoped_lock"
currently implement. Most likely large fraction of call sites is due to historical
lack of CTAD and as such can be converted to less general form.
Once the pattern is not used by default, CheckedLock can be deleted
and the move dynamism bits of Locker can be moved to some more specific type
("UncheckedLocker").
* wtf/ThreadSafetyAnalysis.h: Added.
Add macro wrappers around clang "mutex" and "scoped_lock" capability attributes.
Move RuntimeEnabledFeatures to Settings (Part 1) https://bugs.webkit.org/show_bug.cgi?id=224440 Reviewed by Alex Christensen. Move a few RuntimeEnabledFeatures to Settings to consolidate settings in one object and removes the need for additional boilerplate. This is now possible as Settings are now accessible in workers. Moves PeerConnectionEnabled, WebGLUsingMetal, WebGL2Enabled, WebGPUEnabled and MaskWebGLStringsEnabled. Source/WebCore: * Modules/mediastream/RTCAnswerOptions.idl: * Modules/mediastream/RTCCertificate.idl: * Modules/mediastream/RTCConfiguration.idl: * Modules/mediastream/RTCDTMFSender.idl: * Modules/mediastream/RTCDTMFToneChangeEvent.idl: * Modules/mediastream/RTCDataChannel.idl: * Modules/mediastream/RTCDataChannelEvent.idl: * Modules/mediastream/RTCIceCandidate.idl: * Modules/mediastream/RTCIceCandidateInit.idl: * Modules/mediastream/RTCIceConnectionState.idl: * Modules/mediastream/RTCIceGatheringState.idl: * Modules/mediastream/RTCIceServer.idl: * Modules/mediastream/RTCIceTransport.idl: * Modules/mediastream/RTCIceTransportState.idl: * Modules/mediastream/RTCOfferAnswerOptions.idl: * Modules/mediastream/RTCOfferOptions.idl: * Modules/mediastream/RTCPeerConnection.idl: * Modules/mediastream/RTCPeerConnectionIceErrorEvent.idl: * Modules/mediastream/RTCPeerConnectionIceEvent.idl: * Modules/mediastream/RTCPeerConnectionState.idl: * Modules/mediastream/RTCPriorityType.idl: * Modules/mediastream/RTCRtcpParameters.idl: * Modules/mediastream/RTCRtpCapabilities.idl: * Modules/mediastream/RTCRtpCodecCapability.idl: * Modules/mediastream/RTCRtpCodecParameters.idl: * Modules/mediastream/RTCRtpCodingParameters.idl: * Modules/mediastream/RTCRtpContributingSource.idl: * Modules/mediastream/RTCRtpDecodingParameters.idl: * Modules/mediastream/RTCRtpEncodingParameters.idl: * Modules/mediastream/RTCRtpFecParameters.idl: * Modules/mediastream/RTCRtpHeaderExtensionParameters.idl: * Modules/mediastream/RTCRtpParameters.idl: * Modules/mediastream/RTCRtpReceiver.idl: * Modules/mediastream/RTCRtpRtxParameters.idl: * Modules/mediastream/RTCRtpSendParameters.idl: * Modules/mediastream/RTCRtpSender.idl: * Modules/mediastream/RTCRtpSynchronizationSource.idl: * Modules/mediastream/RTCRtpTransceiver.idl: * Modules/mediastream/RTCRtpTransceiverDirection.idl: * Modules/mediastream/RTCSdpType.idl: * Modules/mediastream/RTCSessionDescription.idl: * Modules/mediastream/RTCSignalingState.idl: * Modules/mediastream/RTCStatsReport.idl: * Modules/mediastream/RTCTrackEvent.idl: * Modules/webgpu/GPUBindGroupLayoutBinding.idl: * Modules/webgpu/GPUBindGroupLayoutDescriptor.idl: * Modules/webgpu/GPUBlendDescriptor.idl: * Modules/webgpu/GPUBufferDescriptor.idl: * Modules/webgpu/GPUBufferUsage.idl: * Modules/webgpu/GPUCanvasContext.idl: * Modules/webgpu/GPUColor.idl: * Modules/webgpu/GPUColorStateDescriptor.idl: * Modules/webgpu/GPUColorWrite.idl: * Modules/webgpu/GPUCompareFunction.idl: * Modules/webgpu/GPUDepthStencilStateDescriptor.idl: * Modules/webgpu/GPUErrorFilter.idl: * Modules/webgpu/GPUExtent3D.idl: * Modules/webgpu/GPULoadOp.idl: * Modules/webgpu/GPUOrigin3D.idl: * Modules/webgpu/GPUOutOfMemoryError.idl: * Modules/webgpu/GPURequestAdapterOptions.idl: * Modules/webgpu/GPUSamplerDescriptor.idl: * Modules/webgpu/GPUShaderStage.idl: * Modules/webgpu/GPUStoreOp.idl: * Modules/webgpu/GPUTextureDescriptor.idl: * Modules/webgpu/GPUTextureFormat.idl: * Modules/webgpu/GPUTextureUsage.idl: * Modules/webgpu/GPUUncapturedErrorEvent.idl: * Modules/webgpu/GPUValidationError.idl: * Modules/webgpu/GPUVertexAttributeDescriptor.idl: * Modules/webgpu/GPUVertexBufferDescriptor.idl: * Modules/webgpu/GPUVertexInputDescriptor.idl: * Modules/webgpu/Navigator+GPU.idl: * Modules/webgpu/NavigatorGPU.cpp: * Modules/webgpu/WebGPU.idl: * Modules/webgpu/WebGPUAdapter.idl: * Modules/webgpu/WebGPUBindGroup.idl: * Modules/webgpu/WebGPUBindGroupBinding.idl: * Modules/webgpu/WebGPUBindGroupDescriptor.idl: * Modules/webgpu/WebGPUBindGroupLayout.idl: * Modules/webgpu/WebGPUBuffer.idl: * Modules/webgpu/WebGPUBufferBinding.idl: * Modules/webgpu/WebGPUCommandBuffer.idl: * Modules/webgpu/WebGPUCommandEncoder.idl: * Modules/webgpu/WebGPUComputePassEncoder.idl: * Modules/webgpu/WebGPUComputePipeline.idl: * Modules/webgpu/WebGPUComputePipelineDescriptor.idl: * Modules/webgpu/WebGPUDevice.idl: * Modules/webgpu/WebGPUDeviceErrorScopes.idl: * Modules/webgpu/WebGPUDeviceEventHandler.idl: * Modules/webgpu/WebGPUPipelineDescriptorBase.idl: * Modules/webgpu/WebGPUPipelineLayout.idl: * Modules/webgpu/WebGPUPipelineLayoutDescriptor.idl: * Modules/webgpu/WebGPUProgrammablePassEncoder.idl: * Modules/webgpu/WebGPUProgrammableStageDescriptor.idl: * Modules/webgpu/WebGPUQueue.idl: * Modules/webgpu/WebGPURenderPassDescriptor.idl: * Modules/webgpu/WebGPURenderPassEncoder.idl: * Modules/webgpu/WebGPURenderPipeline.idl: * Modules/webgpu/WebGPURenderPipelineDescriptor.idl: * Modules/webgpu/WebGPUSampler.idl: * Modules/webgpu/WebGPUShaderModule.idl: * Modules/webgpu/WebGPUShaderModuleDescriptor.idl: * Modules/webgpu/WebGPUSwapChain.idl: * Modules/webgpu/WebGPUTexture.idl: * Modules/webgpu/WebGPUTextureView.idl: * Modules/webgpu/WorkerNavigator+GPU.idl: * Modules/webgpu/WorkerNavigatorGPU.cpp: * Modules/webxr/Navigator+WebXR.idl: * Modules/webxr/WebXRBoundedReferenceSpace.idl: * Modules/webxr/WebXRFrame.idl: * Modules/webxr/WebXRInputSource.idl: * Modules/webxr/WebXRInputSourceArray.idl: * Modules/webxr/WebXRLayer.idl: * Modules/webxr/WebXRPose.idl: * Modules/webxr/WebXRReferenceSpace.idl: * Modules/webxr/WebXRRenderState.idl: * Modules/webxr/WebXRRigidTransform.idl: * Modules/webxr/WebXRSession.idl: * Modules/webxr/WebXRSpace.idl: * Modules/webxr/WebXRSystem.cpp: * Modules/webxr/WebXRSystem.idl: * Modules/webxr/WebXRView.idl: * Modules/webxr/WebXRViewerPose.idl: * Modules/webxr/WebXRViewport.idl: * Modules/webxr/WebXRWebGLLayer.idl: * Modules/webxr/XREnvironmentBlendMode.idl: * Modules/webxr/XREye.idl: * Modules/webxr/XRHandedness.idl: * Modules/webxr/XRInputSourceEvent.idl: * Modules/webxr/XRInputSourcesChangeEvent.idl: * Modules/webxr/XRInteractionMode.idl: * Modules/webxr/XRReferenceSpaceEvent.idl: * Modules/webxr/XRReferenceSpaceType.idl: * Modules/webxr/XRRenderStateInit.idl: * Modules/webxr/XRSessionEvent.idl: * Modules/webxr/XRSessionInit.idl: * Modules/webxr/XRSessionMode.idl: * Modules/webxr/XRTargetRayMode.idl: * Modules/webxr/XRVisibilityState.idl: * Modules/webxr/XRWebGLLayerInit.idl: * html/HTMLCanvasElement.cpp: * html/canvas/WebGL2RenderingContext.cpp: * html/canvas/WebGL2RenderingContext.idl: * html/canvas/WebGLRenderingContextBase.cpp: * html/canvas/WebGLTransformFeedback.idl: * html/canvas/WebGLVertexArrayObject.idl: * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::peerConnectionEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setPeerConnectionEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::setWebGLUsingMetal): Deleted. (WebCore::RuntimeEnabledFeatures::webGLUsingMetal const): Deleted. (WebCore::RuntimeEnabledFeatures::setWebGL2Enabled): Deleted. (WebCore::RuntimeEnabledFeatures::webGL2Enabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setWebGPUEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::webGPUEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setMaskWebGLStringsEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::maskWebGLStringsEnabled const): Deleted. * testing/FakeXRBoundsPoint.idl: * testing/FakeXRButtonStateInit.idl: * testing/FakeXRInputSourceInit.idl: * testing/FakeXRRigidTransformInit.idl: * testing/FakeXRViewInit.idl: * testing/InternalSettings.cpp: (WebCore::InternalSettings::Backup::Backup): (WebCore::InternalSettings::Backup::restoreTo): (WebCore::InternalSettings::setWebGL2Enabled): Deleted. (WebCore::InternalSettings::setWebGPUEnabled): Deleted. * testing/InternalSettings.h: * testing/InternalSettings.idl: * testing/Internals.cpp: * testing/WebFakeXRDevice.idl: * testing/WebFakeXRInputController.idl: * testing/WebXRTest.idl: * testing/XRSimulateUserActivationFunction.idl: Source/WebKit: * WebProcess/Inspector/RemoteWebInspectorUI.cpp: (WebKit::RemoteWebInspectorUI::RemoteWebInspectorUI): * WebProcess/Inspector/WebInspectorUI.cpp: (WebKit::WebInspectorUI::enableFrontendFeatures): (WebKit::WebInspectorUI::WebInspectorUI): * WebProcess/Inspector/WebInspectorUI.h: Source/WTF: * Scripts/Preferences/WebPreferences.yaml: * Scripts/Preferences/WebPreferencesExperimental.yaml: Canonical link: https://commits.webkit.org/236686@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276204 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-17 20:07:30 +00:00
2021-04-17 Sam Weinig <weinig@apple.com>
Move RuntimeEnabledFeatures to Settings (Part 1)
https://bugs.webkit.org/show_bug.cgi?id=224440
Reviewed by Alex Christensen.
Move a few RuntimeEnabledFeatures to Settings to consolidate settings
in one object and removes the need for additional boilerplate. This
is now possible as Settings are now accessible in workers.
Moves PeerConnectionEnabled, WebGLUsingMetal, WebGL2Enabled, WebGPUEnabled
and MaskWebGLStringsEnabled.
* Scripts/Preferences/WebPreferences.yaml:
* Scripts/Preferences/WebPreferencesExperimental.yaml:
2021-04-16 Kate Cheney <katherine_cheney@apple.com>
Disable app-bound request API tests on specific OS versions
https://bugs.webkit.org/show_bug.cgi?id=223692
<rdar://problem/75787288>
Reviewed by Brent Fulgham.
* wtf/PlatformEnableCocoa.h:
Disable ApplicationCache with linkedOnOrAfter check https://bugs.webkit.org/show_bug.cgi?id=224629 Patch by Alex Christensen <achristensen@webkit.org> on 2021-04-16 Reviewed by Brady Eidson. Source/WebCore: ApplicationCache has been deprecated for two years in WebKit with a message to developers since r227225. Firefox removed support in https://bugzilla.mozilla.org/show_bug.cgi?id=1619673 which shipped with Firefox 84 on Dec 15, 2020. Chrome removed support in https://bugs.chromium.org/p/chromium/issues/detail?id=582750 by default in Chrome 85 on August 25, 2020 but they have a reverse origin trial program running right now so that some origins have it working, but they are planning to remove even that support October 2021. We have kept it working for a reason related to rdar://38505756, specifically the 4th and 5th comment in that bug. That reason is now passed. This patch removes support for new apps but keeps it working for 3rd party apps linked with existing SDKs. Once those apps update to a new SDK, they will be unable to use ApplicationCache. They will need to migrate to use fetch service workers instead. * platform/cocoa/VersionChecks.h: Source/WebKit: * Shared/WebPreferencesDefaultValues.cpp: (WebKit::defaultOfflineWebApplicationCacheEnabled): * Shared/WebPreferencesDefaultValues.h: Source/WTF: * Scripts/Preferences/WebPreferences.yaml: Tools: * TestWebKitAPI/Tests/WebKit/WKPreferences.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm: (TEST): * WebKitTestRunner/TestOptions.cpp: (WTR::TestOptions::defaults): Canonical link: https://commits.webkit.org/236651@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276164 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-16 20:41:08 +00:00
2021-04-16 Alex Christensen <achristensen@webkit.org>
Disable ApplicationCache with linkedOnOrAfter check
https://bugs.webkit.org/show_bug.cgi?id=224629
Reviewed by Brady Eidson.
* Scripts/Preferences/WebPreferences.yaml:
2021-04-16 Alex Christensen <achristensen@webkit.org>
Reduce maximum HashTable entry size to 128 bytes
https://bugs.webkit.org/show_bug.cgi?id=224381
Reviewed by Yusuke Suzuki.
* wtf/HashTable.h:
(WTF::KeyTraits>::inlineLookup):
[css-counter-styles] Parse and add feature flag for @counter-style https://bugs.webkit.org/show_bug.cgi?id=223150 Patch by Tyler Wilcock <twilco.o@protonmail.com> on 2021-04-16 Reviewed by Darin Adler. LayoutTests/imported/w3c: @counter-style and its descriptors are now exposed behind a feature flag, so pass some tests and fail others for a different reason because this patch doesn't actually implement descriptor parsing and setting yet. * web-platform-tests/css/css-counter-styles/counter-style-additive-symbols-syntax-expected.txt: * web-platform-tests/css/css-counter-styles/counter-style-fallback-expected.txt: * web-platform-tests/css/css-counter-styles/counter-style-name-syntax-expected.txt: * web-platform-tests/css/css-counter-styles/counter-style-negative-syntax-expected.txt: * web-platform-tests/css/css-counter-styles/counter-style-pad-syntax-expected.txt: * web-platform-tests/css/css-counter-styles/counter-style-prefix-suffix-syntax-expected.txt: * web-platform-tests/css/css-counter-styles/counter-style-range-syntax-expected.txt: * web-platform-tests/css/css-counter-styles/counter-style-speak-as-syntax-expected.txt: * web-platform-tests/css/css-counter-styles/counter-style-symbols-syntax-expected.txt: * web-platform-tests/css/css-counter-styles/counter-style-system-syntax-expected.txt: * web-platform-tests/css/css-counter-styles/idlharness-expected.txt: * web-platform-tests/css/cssom/CSSCounterStyleRule-expected.txt: Source/WebCore: Parse @counter-style (without implementing descriptor parsing) behind a new feature flag, CSSCounterStyleAtRulesEnabled. A separate feature flag for @counter-style <image> symbol values has also been added, as image symbols have extra complexities that we won't want to hold the entire feature back on. https://www.w3.org/TR/css-counter-styles-3 The CSSCounterStyleRule IDL interface is also added and implemented, and similarly feature flagged. https://www.w3.org/TR/css-counter-styles-3/#apis Test: webexposed/counter-style-is-not-exposed.html and existing WPTs. * CMakeLists.txt: Add CSSCounterStyleRule.idl. * DerivedSources-input.xcfilelist: Add CSSCounterStyleRule.idl. * DerivedSources-output.xcfilelist: Add JSCSSCounterStyleRule.h and JSCSSCounterStyleRule.cpp. * DerivedSources.make: Add CSSCounterStyleRule.idl. * Sources.txt: Add CSSCounterStyleRule.cpp and JSCSSCounterStyleRule.cpp. * WebCore.xcodeproj/project.pbxproj: Add CounterStyle.h, CounterStyle.cpp, and CounterStyle.idl. * bindings/js/JSCSSRuleCustom.cpp: (WebCore::toJSNewlyCreated): Support CSSCounterStyleRule. * bindings/js/WebCoreBuiltinNames.h: Add macro(CSSCounterStyleRule) to generate counter-style built-in names. * css/CSSCounterStyleRule.cpp: Added. (WebCore::StyleRuleCounterStyle::StyleRuleCounterStyle): (WebCore::StyleRuleCounterStyle::create): (WebCore::StyleRuleCounterStyle::mutableProperties): (WebCore::CSSCounterStyleRule::CSSCounterStyleRule): (WebCore::CSSCounterStyleRule::reattach): (WebCore::CSSCounterStyleRule::cssText const): * css/CSSCounterStyleRule.h: Added. (isType): Add specialized rule.isCounterStyleRule() implementation. * css/CSSCounterStyleRule.idl: Added. * css/CSSRule.cpp: Add new StyleRuleType::CounterStyle COMPILE_ASSERT. * css/CSSRule.h: Add COUNTER_STYLE_RULE constant. Also add comment `// WebIDL enum` to disable enum_casing lint, since these values are named to match IDL attributes. * css/CSSRule.idl: Add COUNTER_STYLE_RULE constant behind flag. * css/StyleRule.cpp: (WebCore::StyleRuleBase::destroy): (WebCore::StyleRuleBase::copy const): (WebCore::StyleRuleBase::createCSSOMWrapper const): Handle newly added StyleRuleType::CounterStyle. * css/StyleRule.h: (WebCore::StyleRuleBase::isCounterStyleRule const): Added. * css/StyleRuleType.h: Add StyleRuleType::CounterStyle * css/StyleSheetContents.cpp: (WebCore::traverseRulesInVector): (WebCore::StyleSheetContents::traverseSubresources const): If @counter-style image symbols flag is enabled, do traverse subresources. * css/parser/CSSAtRuleID.cpp: If the @counter-style feature flag is enabled, return newly added CSSAtRuleCounterStyle ID. (WebCore::cssAtRuleID): * css/parser/CSSAtRuleID.h: Add CSSAtRuleCounterStyle ID. * css/parser/CSSParserContext.cpp: (WebCore::operator==): * css/parser/CSSParserContext.h: (WebCore::CSSParserContextHash::hash): Add cssCounterStyleAtRulesEnabled and cssCounterStyleAtRuleImageSymbolsEnabled flags. * css/parser/CSSParserFastPaths.cpp: (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue): Refactor to use new CSSPropertyParserHelpers::isPredefinedCounterStyle method. * css/parser/CSSParserImpl.cpp: (WebCore::computeNewAllowedRules): (WebCore::CSSParserImpl::consumeAtRule): (WebCore::CSSParserImpl::consumeCounterStyleRule): Added. (WebCore::CSSParserImpl::consumeDeclarationList): (WebCore::CSSParserImpl::consumeDeclaration): * css/parser/CSSParserImpl.h: Handle new @counter-style rule. * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseValue): Handle StyleRuleType::CounterStyle. (WebCore::consumeCounterContent): Refactor to use new CSSPropertyParserHelpers::isPredefinedCounterStyle method. (WebCore::CSSPropertyParser::parseCounterStyleDescriptor): Add placeholder for future @counter-style descriptor parsing work. * css/parser/CSSPropertyParser.h: Add parseCounterStyleDescriptor method * css/parser/CSSPropertyParserHelpers.h: * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::consumeCustomIdent): Add new flag that allows consumed custom ident values to be lowercased on-parse. This is necessary for some <counter-style-name> values. (WebCore::CSSPropertyParserHelpers::isPredefinedCounterStyle): Added. (WebCore::CSSPropertyParserHelpers::consumeCounterStyleName): (WebCore::CSSPropertyParserHelpers::consumeCounterStyleNameInPrelude): Parse @counter-style names, both in-prelude names and non-prelude names (e.g. as part of the `extends` descriptor). Source/WTF: * Scripts/Preferences/WebPreferencesExperimental.yaml: Add CSSCounterStyleAtRulesEnabled and CSSCounterStyleAtRuleImageSymbolsEnabled flags. Tools: * DumpRenderTree/TestOptions.cpp: (WTR::TestOptions::defaults): Add `false` defaults for CSSCounterStyleAtRulesEnabled and CSSCounterStyleAtRuleImageSymbolsEnabled flags. LayoutTests: Add tests ensuring @counter-style is not exposed when feature flag is disabled. * webexposed/counter-style-is-not-exposed-expected.txt: Added. * webexposed/counter-style-is-not-exposed.html: Added. Canonical link: https://commits.webkit.org/236643@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276152 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-16 19:19:04 +00:00
2021-04-16 Tyler Wilcock <twilco.o@protonmail.com>
[css-counter-styles] Parse and add feature flag for @counter-style
https://bugs.webkit.org/show_bug.cgi?id=223150
Reviewed by Darin Adler.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
Add CSSCounterStyleAtRulesEnabled and CSSCounterStyleAtRuleImageSymbolsEnabled flags.
2021-04-15 Alex Christensen <achristensen@webkit.org>
Use WTF::Function instead of std::function in SVGPropertyAnimatorFactory::attributeAnimatorCreator
https://bugs.webkit.org/show_bug.cgi?id=224586
Reviewed by Darin Adler.
This requires something like r223122 until something like http://wg21.link/P1249 is accepted.
I also added a missing reserveInitialCapacity call that could reduce rehashing when constructing a HashMap from an initializer_list.
* wtf/HashMap.h:
2021-04-14 Alex Christensen <achristensen@webkit.org>
Revert important part of r275948
https://bugs.webkit.org/show_bug.cgi?id=224381
It caused an internal build failure.
* wtf/HashTable.h:
(WTF::KeyTraits>::inlineLookup):
2021-04-14 Alex Christensen <achristensen@webkit.org>
Reduce maximum HashTable entry size to 128 bytes
https://bugs.webkit.org/show_bug.cgi?id=224381
Reviewed by Yusuke Suzuki.
It turns out that HashMaps use HashTable::Value as KeyValuePair, so sizeof(Key) + sizeof(Value) was double counting the key size.
This caused FontCascadeCache to be a false positive. It has a key size of a little over 100 bytes. Only counting it once reflects what is intended.
Also, the USE(ANGLE) exception was convenient for a downstream branch, but isn't needed. Next time they rebase they will use UniqueRef.
* wtf/HashTable.h:
(WTF::KeyTraits>::inlineLookup):
2021-04-13 Ada Chan <ada.chan@apple.com>
Implement PlatformXRSystem::xrCoordinator() for USE(APPLE_INTERNAL_SDK)
https://bugs.webkit.org/show_bug.cgi?id=224510
Reviewed by Dean Jackson.
Update ENABLE_WEBXR flag
* wtf/PlatformEnableCocoa.h:
WebProcessPool should store Vector<Ref<WebProcessProxy>> instead of Vector<RefPtr> https://bugs.webkit.org/show_bug.cgi?id=224412 Patch by Alex Christensen <achristensen@webkit.org> on 2021-04-13 Reviewed by Chris Dumez. Source/WebKit: No change in behavior, except I also changed a raw pointer to a WeakPtr, so we should be a little safer. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::remoteWebInspectorEnabledCallback): (WebKit::WebProcessPool::registerNotificationObservers): * UIProcess/Cocoa/WebProcessProxyCocoa.mm: (WebKit::WebProcessProxy::cacheMediaMIMETypes): * UIProcess/VisitedLinkStore.cpp: (WebKit::VisitedLinkStore::removeAll): (WebKit::VisitedLinkStore::sendStoreHandleToProcess): (WebKit::VisitedLinkStore::didUpdateSharedStringHashes): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::gpuProcessCrashed): (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess): (WebKit::WebProcessPool::tryTakePrewarmedProcess): (WebKit::WebProcessPool::initializeNewWebProcess): (WebKit::WebProcessPool::enableProcessTermination): (WebKit::WebProcessPool::shouldTerminate): (WebKit::WebProcessPool::processDidFinishLaunching): (WebKit::WebProcessPool::disconnectProcess): (WebKit::WebProcessPool::processForRegistrableDomain): (WebKit::WebProcessPool::createWebPage): (WebKit::WebProcessPool::terminateAllWebContentProcesses): (WebKit::webProcessProxyFromConnection): * UIProcess/WebProcessPool.h: (WebKit::WebProcessPool::sendToAllProcesses): (WebKit::WebProcessPool::sendToAllProcessesForSession): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didFinishLaunching): Source/WTF: * wtf/Ref.h: (WTF::operator==): (WTF::operator!=): Canonical link: https://commits.webkit.org/236480@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275916 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-13 22:48:10 +00:00
2021-04-13 Alex Christensen <achristensen@webkit.org>
WebProcessPool should store Vector<Ref<WebProcessProxy>> instead of Vector<RefPtr>
https://bugs.webkit.org/show_bug.cgi?id=224412
Reviewed by Chris Dumez.
* wtf/Ref.h:
(WTF::operator==):
(WTF::operator!=):
2021-04-13 Alex Christensen <achristensen@webkit.org>
Remove support for NPAPI plugins in WebView
https://bugs.webkit.org/show_bug.cgi?id=224449
Reviewed by Chris Dumez.
* Scripts/Preferences/WebPreferences.yaml:
2021-04-13 Chris Dumez <cdumez@apple.com>
Make MemoryPressureHandler::isUnderMemoryPressure() return true for 2 seconds after a simulated warning
https://bugs.webkit.org/show_bug.cgi?id=224505
Reviewed by Darin Adler.
Make MemoryPressureHandler::isUnderMemoryPressure() return true for 2 seconds after a simulated warning,
to make our simulated warning more realistic.
* wtf/cocoa/MemoryPressureHandlerCocoa.mm:
(WTF::MemoryPressureHandler::install):
2021-04-13 Yusuke Suzuki <ysuzuki@apple.com>
[WTF] Add Vector&& move constructor / assignment to FixedVector and RefCountedArray
https://bugs.webkit.org/show_bug.cgi?id=224475
Reviewed by Ryosuke Niwa.
This patch adds move constructor and move-assignment taking Vector to FixedVector / RefCountedArray.
This allows transferring MoveOnly things from Vector to FixedVector.
* wtf/FixedVector.h:
(WTF::FixedVector::FixedVector):
(WTF::FixedVector::operator=):
* wtf/RefCountedArray.h:
(WTF::RefCountedArray::RefCountedArray):
(WTF::RefCountedArray::operator=):
(WTF::RefCountedArray::~RefCountedArray):
(WTF::RefCountedArray::allocateUninitializedData):
(WTF::RefCountedArray::assign):
2021-04-13 Alex Christensen <achristensen@webkit.org>
Revert r275172
https://bugs.webkit.org/show_bug.cgi?id=224499
<rdar://76396241>
Reviewed by Tim Horton.
* wtf/spi/darwin/XPCSPI.h:
2021-04-12 Basuke Suzuki <basuke.suzuki@sony.com>
[PlayStation] Enable WTFCrashWithInfo implementation
https://bugs.webkit.org/show_bug.cgi?id=224458
Reviewed by Don Olmstead.
Enable WTFCrashWithInfo implementation for PlayStation platform. It is x86_64 and uses clang
so that it can share Darwin's implemetation with us.
* wtf/Assertions.cpp:
2021-04-12 Youenn Fablet <youenn@apple.com>
Block loading for port 10080
https://bugs.webkit.org/show_bug.cgi?id=224432
Reviewed by Alex Christensen.
Follow Chrome and Firefox by blocking port 10080.
* wtf/URL.cpp:
(WTF::portAllowed):
Reduce compile time and binary size cost of enabling proper CSSStyleDeclaration property access behavior https://bugs.webkit.org/show_bug.cgi?id=222518 <rdar://problem/75136887> Reviewed by Darin Adler. LayoutTests/imported/w3c: * web-platform-tests/css/cssom/cssstyledeclaration-properties-expected.txt: Update test result now that it is passing. Source/WebCore: Re-implement proper (not using named-getters) support for the CSSStyleDeclaration bindings using a new DelegateToSharedSyntheticAttribute extended atttribute which allows IDL attributes to share a custom getter / setter implementation and delegate their implementation to it. When using this functionality, the synthetic attribute's implementation is passed the original property name so it can implement functionality based on it. We use this for CSSStyleDeclaration by breaking the huge list of generated properties into four groups, each with their own synthetic attribute. The groups are based on the different transformation rules in the spec. * bindings/js/JSDOMAttribute.h: (WebCore::IDLAttribute::setPassingPropertyName): (WebCore::IDLAttribute::getPassingPropertyName): Add overloads of get/set that pass the property name to the provided function. These can't be simple overloads of get/set as MSVC does not allow overloading with only a non-type template parameters differentiating. * bindings/scripts/CodeGeneratorJS.pm: (GenerateInterface): Eagerly generate the any synthetic attributes before the rest of code generation, matching the behavior of other synthetic constructions like map/set/stringifiers. (GetAttributeGetterName): (GetAttributeSetterName): Add special cases to getter/setter name generation to forward to the generated name of the synthetic attribute when delegating. (GenerateImplementation): Extract attribute function forward declaration genation into a new GenerateAttributeGetterAndSetterDeclaration subroutine and use it for generation of both normal and synthetic attributes. Also adds synthetic attributes to the list of attributes to generate function implementations for. (GenerateAttributeGetterAndSetterDeclaration): Extracted from GenerateImplementation. Adds extra condition to bail if DelegateToSharedSyntheticAttribute is specified. (GenerateAttributeGetterBodyDefinition): Add support for the new CallWith=PropertyName extended attribute by adding a PropertyName argument to the signature of getter body if it is present. Removes now unnecessary support for the CSSProperty extended attribute. (GenerateAttributeGetterTrampolineDefinition): Switch function name from get to getPassingPropertyName if CallWith=PropertyName is specified. (GenerateAttributeGetterDefinition): Adds extra condition to bail if DelegateToSharedSyntheticAttribute is specified. (GenerateAttributeSetterBodyDefinition): Add support for the new CallWith=PropertyName extended attribute by adding a PropertyName argument to the signature of getter body if it is present. Removes now unnecessary support for the CSSProperty extended attribute. (GenerateAttributeSetterTrampolineDefinition): Switch function name from get to getPassingPropertyName if CallWith=PropertyName is specified. (GenerateAttributeSetterDefinition): Adds extra condition to bail if DelegateToSharedSyntheticAttribute is specified. (GenerateCallWith): Add support for the PropertyName value to CallWith. (MakeSharedSyntheticAttribute): Helper to generate the synthetic attribute from the base attribute with DelegateToSharedSyntheticAttribute specefied. Maintains all existing extended attributes of the base attribute except DelegateToSharedSyntheticAttribute is replaced with IsSharedSyntheticAttribute to avoid infinite recursion. (AddSharedSyntheticAttributesIfNeeded): Helper to find all delegating attributes and generate / store the synthetic attributes. (GetSharedSyntheticAttribute): Helper to get the corresponding synthetic attribute given an attribute with DelegateToSharedSyntheticAttribute specified on it. * bindings/scripts/IDLAttributes.json: Removes CSSProperty. Adds DelegateToSharedSyntheticAttribute. Adds PropertyName value to CallWith and SetterCallWith. * css/CSSStyleDeclaration.cpp: (WebCore::lookupCSSPropertyFromIDLAttribute): (WebCore::CSSStyleDeclaration::propertyValueForCamelCasedIDLAttribute): (WebCore::CSSStyleDeclaration::setPropertyValueForCamelCasedIDLAttribute): (WebCore::CSSStyleDeclaration::propertyValueForWebKitCasedIDLAttribute): (WebCore::CSSStyleDeclaration::setPropertyValueForWebKitCasedIDLAttribute): (WebCore::CSSStyleDeclaration::propertyValueForDashedIDLAttribute): (WebCore::CSSStyleDeclaration::setPropertyValueForDashedIDLAttribute): (WebCore::CSSStyleDeclaration::propertyValueForEpubCasedIDLAttribute): (WebCore::CSSStyleDeclaration::setPropertyValueForEpubCasedIDLAttribute): (WebCore::CSSStyleDeclaration::namedItem): Deleted. (WebCore::CSSStyleDeclaration::setNamedItem): Deleted. (WebCore::CSSStyleDeclaration::supportedPropertyNames const): Deleted. * css/CSSStyleDeclaration.h: Replace named-getter based implementation with helpers based on the definitions in the CSSOM spec (plus one special set for 'epub' specializations we currently maintain). * css/CSSStyleDeclaration.idl: Remove !ENABLE_ATTRIBUTE_BASED_PROPERTIES_FOR_CSS_STYLE_DECLARATION sections now that we can fully support ENABLE_ATTRIBUTE_BASED_PROPERTIES_FOR_CSS_STYLE_DECLARATION. * css/makeprop.pl: Remove !ENABLE_ATTRIBUTE_BASED_PROPERTIES_FOR_CSS_STYLE_DECLARATION sections now that we can fully support ENABLE_ATTRIBUTE_BASED_PROPERTIES_FOR_CSS_STYLE_DECLARATION. Replaces CSSProperty extended attributes with DelegateToSharedSyntheticAttribute and CallWith=PropertyName, which together allow us to implement all the attributes with just 8 implementation functions. * bindings/scripts/test/BindingTestGlobalConstructors.idl: * bindings/scripts/test/JS/JSTestCSSProperty.cpp: Removed. * bindings/scripts/test/JS/JSTestCSSProperty.h: Removed. * bindings/scripts/test/JS/JSTestDelegateToSharedSyntheticAttribute.cpp: Added. * bindings/scripts/test/JS/JSTestDelegateToSharedSyntheticAttribute.h: Added. * bindings/scripts/test/JS/JSTestGlobalObject.cpp: * bindings/scripts/test/SupplementalDependencies.dep: * bindings/scripts/test/TestCSSProperty.idl: Removed. * bindings/scripts/test/TestDelegateToSharedSyntheticAttribute.idl: Added. Replace CSSProperty tests with DelegateToSharedSyntheticAttribute tests and update results all around for new generation. Source/WTF: * wtf/PlatformEnable.h: Remove ENABLE_ATTRIBUTE_BASED_PROPERTIES_FOR_CSS_STYLE_DECLARATION, as it is now the default and on everwhere. LayoutTests: * fast/css/style-enumerate-properties-expected.txt: * fast/css/style-enumerate-properties.html: * fast/dom/domListEnumeration-expected.txt: * fast/dom/domListEnumeration.html: Remove existing tests for iteration order, which is not standardized, and not consistent among browsers. Adds a new one that checks invariants of the 4 groupings of properties which we currently expect to hold, at least in our implementation. * fast/dom/CSSStyleDeclaration/cssstyledeclaration-properties-descriptor-expected.txt: * fast/dom/CSSStyleDeclaration/cssstyledeclaration-properties-descriptor.html: Update now that the properties are proper attributes on the prototype. * js/dom/put-override-should-not-use-ic.html: Switch to using a DOMStringList as the object that overrides put, since CSSStyleDeclaration no longer does. * transitions/transitions-parsing-expected.txt: * transitions/transitions-parsing.html: Remove Object.keys() aspect of the test, which is no longer meaningful since the properties should no longer exist in the result set. Canonical link: https://commits.webkit.org/236379@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275808 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-11 17:06:47 +00:00
2021-04-11 Sam Weinig <weinig@apple.com>
Reduce compile time and binary size cost of enabling proper CSSStyleDeclaration property access behavior
https://bugs.webkit.org/show_bug.cgi?id=222518
<rdar://problem/75136887>
Reviewed by Darin Adler.
* wtf/PlatformEnable.h:
Remove ENABLE_ATTRIBUTE_BASED_PROPERTIES_FOR_CSS_STYLE_DECLARATION, as it is now the default and on everwhere.
2021-04-09 Jer Noble <jer.noble@apple.com>
WTF SoftLinking macros can cause collisions with their target functions
https://bugs.webkit.org/show_bug.cgi?id=224379
<rdar://76434202>
Reviewed by Eric Carlson.
Do not declare an inline version of the target function, as this will collide if the target function
becomes inlined. Instead, callers should use the explicit softLink_Library_Function() syntax, or
the LibrarySoftLinking.h headers should use #defines to re-declare the function name.
* wtf/cocoa/SoftLinking.h:
2021-04-08 Stephan Szabo <stephan.szabo@sony.com>
[RunLoopGeneric] OneShotTimer should not remain "isActive" after fired
https://bugs.webkit.org/show_bug.cgi?id=189335
<rdar://problem/44226604>
Reviewed by Geoffrey Garen.
* wtf/generic/RunLoopGeneric.cpp:
Deactivate one-shot timer before invoking its callback.
2021-04-08 Khem Raj <raj.khem@gmail.com>
[WPE] Build fixes for musl C library on Linux
https://bugs.webkit.org/show_bug.cgi?id=210068
Reviewed by Carlos Alberto Lopez Perez.
Define 128KB DEFAULT_THREAD_STACK_SIZE_IN_KB for musl
Use OS(LINUX) check to include musl when building for
Linux based platforms.
* wtf/PlatformHave.h:
* wtf/Threading.cpp:
OfflineAudioContext objects are leaking https://bugs.webkit.org/show_bug.cgi?id=224279 Reviewed by Darin Adler. Source/WebCore: OfflineAudioContext objects were always leaking due to 2 reference cycles: 1. BaseAudioContext -> m_listener (AudioListener) -> m_positionX (AudioParam) -> m_context (BaseAudioContext) 2. BaseAudioContext -> m_destinationNode (AudioDestinationNode) -> m_context (BaseAudioContext) For reference cycle 1, I made AudioSummingJunction (base class of AudioParam) hold a weak pointer to the AudioContext instead of a Ref<>. I don't think there is a good reason for an AudioSummingJunction (AudioParam or AudioNodeInput) to keep its AudioContext alive. AudioNodes already keep their AudioContext alive. AudioNodeInputs and AudioParams are associated to AudioNodes. For reference cycle 2, I made AudioDestinationNode not hold a strong pointer to its context but instead a weak pointer. Since keeping an AudioDestinationNode alive should keep its AudioContext alive, I made it so that ref'ing the AudioDestinationNode refs its BaseAudioContext. Also, BaseAudioContext::m_destinationNode is now a UniqueRef<> instead of a RefPtr<> to avoid a cycle. Tests: webaudio/OfflineAudioContext/offlineaudiocontext-leak-after-rendering.html webaudio/OfflineAudioContext/offlineaudiocontext-leak.html * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::baseLatency): (WebCore::AudioContext::getOutputTimestamp): (WebCore::AudioContext::close): (WebCore::AudioContext::destination): (WebCore::AudioContext::destination const): (WebCore::AudioContext::suspendRendering): (WebCore::AudioContext::resumeRendering): (WebCore::AudioContext::startRendering): (WebCore::AudioContext::lazyInitialize): (WebCore::AudioContext::mediaState const): (WebCore::AudioContext::mayResumePlayback): (WebCore::AudioContext::suspendPlayback): (WebCore::AudioContext::pageMutedStateDidChange): * Modules/webaudio/AudioContext.h: - Drop some null checks now that m_destinationNode can no longer be null. - Capture an ActiveDOMObject::PendingActivity when doing async work that ends up resolving a Promise, so that we keep both the object and its wrapper alive for the duration of the async work. * Modules/webaudio/AudioDestinationNode.cpp: (WebCore::AudioDestinationNode::ref): (WebCore::AudioDestinationNode::deref): * Modules/webaudio/AudioDestinationNode.h: Have AudioDestinationNode override AudioNode's ref() / deref() to forward the refcounting to its BaseAudioContext, instead of using the AudioNode's internal refCount. * Modules/webaudio/AudioListener.cpp: (WebCore::AudioListener::updateValuesIfNeeded): (WebCore::AudioListener::setPosition): (WebCore::AudioListener::setOrientation): Add some null-checks for AudioParam::context() now that AudioParam holds a WeakPtr to its context. * Modules/webaudio/AudioNode.cpp: (WebCore::AudioNode::toWeakOrStrongContext): (WebCore::AudioNode::AudioNode): (WebCore::AudioNode::connect): (WebCore::AudioNode::sampleRate const): (WebCore::AudioNode::markNodeForDeletionIfNecessary): (WebCore::AudioNode::contextForBindings): (WebCore::AudioNode::context): (WebCore::AudioNode::context const): * Modules/webaudio/AudioNode.h: - Hold the BaseAudioContext as a WeakPtr instead of a Ref<> if the AudioNode is an AudioDestinationNode. This avoids a reference cycle since the BaseAudioContext owns the AudioDestinationNode. Even though we are using a WeakPtr, it is safe to assume that the context is not null because ref'ing an AudioDestinationNode refs its BaseAudioContext. - Make sure markNodeForDeletionIfNecessary() has no effect for AudioDestinationNode since BaseAudioContext now owns the AudioDestinationNode when we take care of destroying its destination node when destroyed. * Modules/webaudio/AudioNodeInput.cpp: (WebCore::AudioNodeInput::connect): (WebCore::AudioNodeInput::disconnect): (WebCore::AudioNodeInput::outputEnabledStateChanged): (WebCore::AudioNodeInput::updateInternalBus): (WebCore::AudioNodeInput::bus): (WebCore::AudioNodeInput::internalSummingBus): (WebCore::AudioNodeInput::sumAllConnections): (WebCore::AudioNodeInput::pull): Add assertions that the context is not null. There were already assertions that we are the graph owner, which means we are holding the BaseAudioContext's lock, which means that the audio context is alive. * Modules/webaudio/AudioParam.cpp: (WebCore::AudioParam::value): (WebCore::AudioParam::setValueForBindings): (WebCore::AudioParam::smooth): (WebCore::AudioParam::hasSampleAccurateValues const): (WebCore::AudioParam::calculateSampleAccurateValues): (WebCore::AudioParam::calculateFinalValues): (WebCore::AudioParam::calculateTimelineValues): (WebCore::AudioParam::connect): (WebCore::AudioParam::disconnect): Add null-checks for the AudioContext now that the AudioParam is only holding a WeakPtr to its BaseAudioContext (to avoid a reference cycle). * Modules/webaudio/AudioSummingJunction.cpp: (WebCore::AudioSummingJunction::AudioSummingJunction): (WebCore::AudioSummingJunction::~AudioSummingJunction): (WebCore::AudioSummingJunction::markRenderingStateAsDirty): (WebCore::AudioSummingJunction::addOutput): (WebCore::AudioSummingJunction::removeOutput): (WebCore::AudioSummingJunction::updateRenderingState): (WebCore::AudioSummingJunction::outputEnabledStateChanged): * Modules/webaudio/AudioSummingJunction.h: (WebCore::AudioSummingJunction::context): (WebCore::AudioSummingJunction::context const): - Hold a WeakPtr to the BaseAudioContext to avoid a reference cycle. - Deal with the fact that the audio context may be null now that we're holding a WeakPtr to it (except when holding the graph lock) * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::BaseAudioContext): (WebCore::BaseAudioContext::~BaseAudioContext): (WebCore::BaseAudioContext::numberOfInstances): (WebCore::BaseAudioContext::lazyInitialize): (WebCore::BaseAudioContext::clear): (WebCore::BaseAudioContext::uninitialize): (WebCore::BaseAudioContext::stop): (WebCore::BaseAudioContext::sampleRate const): (WebCore::BaseAudioContext::decodeAudioData): (WebCore::BaseAudioContext::markForDeletion): (WebCore::BaseAudioContext::deleteMarkedNodes): (WebCore::BaseAudioContext::setPendingActivity): (WebCore::BaseAudioContext::workletIsReady): * Modules/webaudio/BaseAudioContext.h: (WebCore::BaseAudioContext::destination): (WebCore::BaseAudioContext::destination const): (WebCore::BaseAudioContext::currentSampleFrame const): (WebCore::BaseAudioContext::currentTime const): - Switch m_destinationNode from RefPtr<> to UniqueRef<> since the AudioContext is now the owner of the destinationNode and since refing the destination node actually refs its BaseAudioContext. - Drop some null checks now that m_destinationNode can no longer be null. - Rename makePendingActivity() to setPendingActivity() to avoid a naming conflict with ActiveDOMObject::makePendingActivity(). * Modules/webaudio/DefaultAudioDestinationNode.h: * Modules/webaudio/OfflineAudioDestinationNode.h: - Drop create() factory functions and make the constructor public now that the BaseAudioContext owns its destination node via a UniqueRef<>. - Make some member functions public as they are virtual and they now called on the subclass instead of the base class (and these functions are public in the base class). * Modules/webaudio/OfflineAudioContext.cpp: (WebCore::OfflineAudioContext::startOfflineRendering): (WebCore::OfflineAudioContext::resumeOfflineRendering): * Modules/webaudio/OfflineAudioContext.h: - Drop some null checks now that m_destinationNode can no longer be null. - Capture an ActiveDOMObject::PendingActivity when doing async work that ends up resolving a Promise, so that we keep both the object and its wrapper alive for the duration of the async work. * Modules/webaudio/WebKitAudioContext.cpp: (WebCore::WebKitAudioContext::close): Drop null checks for the destination node now that it can never be null. * dom/ShadowRoot.cpp: * rendering/FloatingObjects.cpp: * rendering/RootInlineBox.cpp: Update classes used of size restrictions since the size of a WeakPtr is not longer the same as the size of a pointer when debug assertions are enabled. As long as they are the same size in release builds, there is no memory use concern. * testing/Internals.cpp: (WebCore::Internals::numberOfBaseAudioContexts const): * testing/Internals.h: * testing/Internals.idl: Add testing function to check how many BaseAudioContexts are alive, so that we can write layout tests and check for leaks. Source/WTF: Add flag that can be passed when constructing a WeakPtr to disable threading assertions. This is useful for cases where we know it is safe due to locking but we'd like to use a WeakPtr instead of a raw pointer because it is safer. * wtf/WeakPtr.h: (WTF::WeakPtr::get const): (WTF::WeakPtr::operator-> const): (WTF::WeakPtr::operator* const): (WTF::WeakPtr::WeakPtr): (WTF::WeakPtrFactory::createWeakPtr const): (WTF::=): (WTF::makeWeakPtr): LayoutTests: Add layout test coverage. * webaudio/OfflineAudioContext/offlineaudiocontext-leak-after-rendering-expected.txt: Added. * webaudio/OfflineAudioContext/offlineaudiocontext-leak-after-rendering.html: Added. * webaudio/OfflineAudioContext/offlineaudiocontext-leak-expected.txt: Added. * webaudio/OfflineAudioContext/offlineaudiocontext-leak.html: Added. Canonical link: https://commits.webkit.org/236304@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275668 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-08 18:41:23 +00:00
2021-04-08 Chris Dumez <cdumez@apple.com>
OfflineAudioContext objects are leaking
https://bugs.webkit.org/show_bug.cgi?id=224279
Reviewed by Darin Adler.
Add flag that can be passed when constructing a WeakPtr to disable threading assertions.
This is useful for cases where we know it is safe due to locking but we'd like to use a
WeakPtr instead of a raw pointer because it is safer.
* wtf/WeakPtr.h:
(WTF::WeakPtr::get const):
(WTF::WeakPtr::operator-> const):
(WTF::WeakPtr::operator* const):
(WTF::WeakPtr::WeakPtr):
(WTF::WeakPtrFactory::createWeakPtr const):
(WTF::=):
(WTF::makeWeakPtr):
2021-04-08 Simon Fraser <simon.fraser@apple.com>
Copy-constructed Vectors should not have excess capacity
https://bugs.webkit.org/show_bug.cgi?id=224313
Reviewed by Darin Adler.
When copy-constructing a Vector<>, set the capacity to the size of the input.
This avoids wasted vector capacity at call sites that dynamically build vectors
and then copy them into read-only caches.
* wtf/Vector.h:
(WTF::Malloc>::Vector):
Use Hasher more, remove IntegerHasher, fix hashing-related mistakes https://bugs.webkit.org/show_bug.cgi?id=224138 Reviewed by Chris Dumez. Source/JavaScriptCore: * bytecode/BytecodeIndex.h: (JSC::BytecodeIndex::hash const): Remove unneeded WTF prefix on call to intHash. * ftl/FTLAbstractHeap.h: Use HashTraits instead of WTF::GenericHashTraits. * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::validateAIState): Remove unneeded WTF prefix on call to intHash. * wasm/WasmLLIntGenerator.cpp: Use HashTraits instead of WTF::GenericHashTraits. Source/WebCore: * contentextensions/ContentExtensionRule.h: (WebCore::ContentExtensions::TriggerHash::hash): Use computeHash to hash all the fields instead of a custom-written algorithm. The custom algorithm had some magic numbers, repeatedly hashed hashes, and combined hashes using exclusive or. The new one is almost certainly better. * contentextensions/Term.h: (WebCore::ContentExtensions::Term::CharacterSet::hash const): Use computeHash to hash the boolean and the characters rather than using intHash and pairIntHash. * css/parser/CSSParserContext.cpp: (WebCore::add): Moved the hashing here from the header. Fixed the mistake where this was using & instead of | and so none of the booleans were having any effect on the hash value. * css/parser/CSSParserContext.h: Use WTF_MAKE_STRUCT_FAST_ALLOCATED so we don't have to say public: explicitly. Also moved all the function members to the bottom of the struct. This is typically preferred style for structures as opposed to classes. Since the data members are the primary interface, they are first, and all function members are secondary and so they come after. (WebCore::CSSParserContextHash::hash): Use convertHash instead of a custom written hash function. The custom written function was combining hahes using exclusive or, not a best practice, and also had a mistake where it used & instead of | and so the "bits" local variable was always 0. * html/FormController.cpp: Use HashTraits instead of WTF::GenericHashTraits. * platform/encryptedmedia/CDMProxy.h: Removed unneedes includes. * platform/graphics/Font.cpp: Changed CharacterFallbackMapKey into a simple struct with no additional function members or static data members. Changed CharacterFallbackMapKeyHash to use computeHash to calculate the hash, instead of IntegerHasher. Probably better to hash the pointer of the AtomString rather than hashing the hash, but either way, we should have the best implementation for AtomString hashing in the Hasher class. Added CharacterFallbackMapKeyHashTraits instead of using SimpleClassHashTraits. Use the value U_SENTINEL for the UChar32 character, which is the same as the -1 used before, but slightly clearer why it's OK. (WebCore::Font::systemFallbackFontForCharacter const): Use HashMap::ensure instead of HashMap::add to make the logic simpler. * platform/graphics/Font.h: Use bool instead of uint8_t as the base type for the No/Yes enumeration IsForPlatformFont. * platform/graphics/FontCache.cpp: Removed unneeded "using namespace WTF", which is not our best practice, especially given unified builds. Changed FontPlatformDataCacheKey into a simple struct, removing all the hash-related member functions. Also used struct-style naming for the members without an "m_" prefix. Used the type FontFamilyName for the family name, which means we will use FontCascadeDescription's system for hashing and comparing family names for equality without having to remember do to so explicitly. Changed FontPlatformDataCacheKeyHash to use computeHash. The old version had unnecessarily complex logic to handle Optional and was unnecessarily hashing hashes. (WebCore::FontCache::cachedFontPlatformData): Renamed to remove "get" from the function's name. Also use shorter argument and local variable names that are single words, and updated since FontPlatformDataCacheKey is now a struct without a constructor. (WebCore::FontCache::fontForFamily): Use shorter names. (WebCore::operator==): To compare two FontCascadeCacheKey objects, use a simpler constructions, depending on the fact that Vector already has an == operator and we are using FontFamilyName for the elements of the vector, which has a correct == operator. (WebCore::FontCascadeCacheKeyHash::hash): Use computeHash since the FontFamilyName hashing is now correct, and we can rely on the way Hasher knows how to iterate a collection. (WebCore::FontCache::retrieveOrAddCachedFonts): Update since FontCascadeCacheEntry is now a simple struct. Also use constexpr a bit. (WebCore::FontCache::invalidate): Use copyToVectorOf<> to simplify the code that calls fontCacheInvalidated on all the font selectors. * platform/graphics/FontCache.h: Use "using" instead of "typedef". Remove FontDescriptionKey::computeHash. (WebCore::add): An overload of add for Hasher to include a FontDescriptionKey in a hash, which just lists all the data members. The old version did a hash of hashes, but that's not needed any more. Updated FontDescriptionKeyHash to use the Hasher version of ComputeHash. Added FontFamilyName. Change FontCascadeCacheKey to use a vector of FontFamilyName instead of AtomString. In FontCascadeCacheEntry, use WTF_MAKE_STRUCT_FAST_ALLOCATED instead of WTF_MAKE_FAST_ALLOCATED and also got rid of the unneeeded constructor. (WebCore::FontCascadeCacheKeyHashTraits::constructDeletedValue): Use the deleted value of FontDescriptionKey. (WebCore::FontCascadeCacheKeyHashTraits::isDeletedValue): Ditto. Renamed getCachedFontPlatformData to just cachedFontPlatformData. * platform/graphics/FontGenericFamilies.h: Use HashTraits instead of WTF::GenericHashTraits. * platform/graphics/FontSelectionAlgorithm.h: (WebCore::FontSelectionRange::uniqueValue const): Deleted. (WebCore::add): Add both the minimum and maximum values to the hash separately instead of combining them. For now, this makes the way they are hashed a bit inefficient, but that can be re-tightened up by improving the algorithm of Hasher if we like. Should be fine for our needs either way. * platform/graphics/FontTaggedSettings.cpp: (WebCore::FontFeatureSettings::hash const): Deleted. (WebCore::FontVariationSettings::hash const): Deleted. * platform/graphics/FontTaggedSettings.h: Added overloads of the add(Hasher&) function for std::array<char, 4> and FontTaggedSetting<T>. Got rid of many uses of pass by reference instead of value for FontTag, since it fits into a 32-bit register and bth more source code and less efficient to pass by value. * platform/graphics/Gradient.cpp: Removed "using WTF::pairIntHash" since that's now done in the WTF header. * platform/graphics/cg/GraphicsContextCG.cpp: Ditto. Also removed "using WTF::GenericHashTraits", which was unhelpful. The GenericHashTraits template is only really needed when specializing HashTraits, which already has to be done within the WTF namespace. In all other cases, we should just use HashTraits instead. * platform/graphics/cg/SubimageCacheWithTimer.h: Use HashTraits instead of WTF::GenericHashTraits. * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp: Move the data members to the top of the FontFamilySpecificationKey struct. Removed unneeded computeHash function and WTF prefix from safeCFEqual. (WebCore::FontFamilySpecificationKeyHash::hash): Call the Hasher version of computeHash directly to hash the two items in this structure. * platform/graphics/cocoa/SystemFontDatabaseCoreText.h: (WebCore::SystemFontDatabaseCoreText::CascadeListParameters::hash const): Use computeHash instead of IntegerHasher. Also renamed the hash function struct from CascadeListParameters::CascadeListParametersHash to CascadeListParameters::Hash. * platform/graphics/mac/ComplexTextControllerCoreText.mm: (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Removed now-unneeded WTF prefixes from calls to safeCFEqual. * rendering/TextAutoSizing.h: Use HashTraits instead of WTF::GenericHashTraits. * rendering/style/RenderStyle.cpp: (WebCore::computeFontHash): Use computeHash instead of IntegerHasher. Still not great that we hash a hash here, but we can improve that later. * workers/service/ServiceWorkerClientIdentifier.h: (WebCore::ServiceWorkerClientIdentifier::decode): Removed unneeded WTFMove on ObjectIdentifier, which are just integers, so move vs. copy is not an important distinction. (WebCore::ServiceWorkerClientIdentifier::hash const): Use computeHash instead of combining intHash with StringHasher::hashMemory. This fixes two mistakes: one is that there is no need to hash a hash. The second is that intHash takes a 32-bit integer as its parameter, so high bits of object identifiers were discarded unnecessarily. * workers/service/ServiceWorkerContextData.h: Removed unneeded include. * workers/service/ServiceWorkerGlobalScope.h: Added now-needed include of URLHash.h, since we removed it from a widely-included header. * workers/service/context/SWContextManager.h: Ditto. * workers/service/server/ServiceWorkerThreadProxy.h: Ditto. * workers/service/server/RegistrationStore.h: Ditto. * workers/service/server/SWServer.h: Ditto. * workers/service/server/SWServerToContextConnection.h: Ditto. * workers/service/server/SWServerWorker.h: Ditto. Source/WebKit: * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h: Added now-needed include of URLHash.h, since we removed it from a widely-included header. * NetworkProcess/cache/NetworkCache.h: (WebKit::NetworkCache::GlobalFrameID::hash const): Use computeHash instead of combining intHash with StringHasher::hashMemory. This fixes two mistakes: one is that there is no need to hash a hash. The second is that intHash takes a 32-bit integer as its parameter, so high bits of object identifiers were discarded unnecessarily. * Scripts/webkit/messages.py: Added code so that if URL is in an argument, we include the URLHash.h header. Would be better to just use URL.h and use URLHash.h only if it's a HashMap<URL>, but currently the script does not distinguish those cases. This wasn't needed before becuase a widely included header was always pulling in URLHash.h. * Shared/API/Cocoa/WKBrowsingContextHandle.mm: (-[WKBrowsingContextHandle hash]): Use computeHash instead of pairIntHash. This fixes a mistake: pairIntHash takes two 32-bit integers, so high bits of object identifiers were discarded unnecessarily. * NetworkProcess/Storage/WebSWContextManagerConnection.h: Added now-needed include of URLHash.h, since we removed it from a widely-included header. Source/WebKitLegacy/mac: * History/BinaryPropertyList.cpp: Use HashTraits instead of WTF::GenericHashTraits. Source/WTF: * wtf/HashFunctions.h: Export intHash and pairIntHash to the global namespace so they can be called without an explicit WTF prefix. This follows the usual WTF design pattern given that these functions are intended for use outside WTF. * wtf/Hasher.h: Deleted IntegerHasher. (WTF::add): Added overloads for String, AtomString, and URL. * wtf/ObjectIdentifier.h: (WTF::add): Added a Hasher overload for any ObjectIdentifier. * wtf/RetainPtr.h: Export safeCFEqual and safeCFHash to the global namespace so they can be called without an explicit WTF prefix. This follows the usual WTF design pattern given that these functions are intended for use outside WTF. * wtf/VectorHash.h: Removed the VectorHash template, instead just specializing DefaultHash. Use computeHash to hash the contents of the vector instead of hashing the hashes of the items in the vector. This is better in general and better for the one case where we are currently using this, for a Vector<int>. We want to hash all the integers rather than hashing hashes of all the integers. In the future, this means the elements of the Vector need to be hashable using the Hasher machinery. The old requirement was the the elements had a DefaultHash. Canonical link: https://commits.webkit.org/236286@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275650 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-08 02:19:20 +00:00
2021-04-02 Darin Adler <darin@apple.com>
Use Hasher more, remove IntegerHasher, fix hashing-related mistakes
https://bugs.webkit.org/show_bug.cgi?id=224138
Reviewed by Chris Dumez.
* wtf/HashFunctions.h: Export intHash and pairIntHash to the global namespace
so they can be called without an explicit WTF prefix. This follows the usual
WTF design pattern given that these functions are intended for use outside WTF.
* wtf/Hasher.h: Deleted IntegerHasher.
(WTF::add): Added overloads for String, AtomString, and URL.
* wtf/ObjectIdentifier.h:
(WTF::add): Added a Hasher overload for any ObjectIdentifier.
* wtf/RetainPtr.h: Export safeCFEqual and safeCFHash to the global namespace
so they can be called without an explicit WTF prefix. This follows the usual
WTF design pattern given that these functions are intended for use outside WTF.
* wtf/VectorHash.h: Removed the VectorHash template, instead just specializing
DefaultHash. Use computeHash to hash the contents of the vector instead of
hashing the hashes of the items in the vector. This is better in general and
better for the one case where we are currently using this, for a Vector<int>.
We want to hash all the integers rather than hashing hashes of all the integers.
In the future, this means the elements of the Vector need to be hashable using
the Hasher machinery. The old requirement was the the elements had a DefaultHash.
2021-04-07 Michael Catanzaro <mcatanzaro@gnome.org>
Suppress -Warray-bounds warning spam in Bitmap.h
https://bugs.webkit.org/show_bug.cgi?id=224207
Reviewed by Don Olmstead.
Suppress this warning.
* wtf/Bitmap.h:
(WTF::WordType>::clear):
[JSC] Use FixedVector more in bytecode dir and JumpTable https://bugs.webkit.org/show_bug.cgi?id=224275 Reviewed by Michael Saboff and Mark Lam. Source/JavaScriptCore: 1. Use FixedVector more in bytecode/ directory's long-living data structures. 2. Use FixedVector in SimpleJumpTable. This involves LLInt changes because we need to access FixedVector data from LLInt. * bytecode/CodeBlock.cpp: (JSC::CodeBlock::finishCreation): * bytecode/InlineCallFrame.cpp: (JSC::InlineCallFrame::dumpInContext const): * bytecode/InlineCallFrame.h: * bytecode/JumpTable.h: (JSC::SimpleJumpTable::clear): * bytecode/ObjectPropertyConditionSet.cpp: (JSC::ObjectPropertyConditionSet::mergedWith const): (JSC::ObjectPropertyConditionSet::dumpInContext const): (JSC::ObjectPropertyConditionSet::isValidAndWatchable const): * bytecode/ObjectPropertyConditionSet.h: (JSC::ObjectPropertyConditionSet::create): (JSC::ObjectPropertyConditionSet::isValid const): (JSC::ObjectPropertyConditionSet::size const): (JSC::ObjectPropertyConditionSet::begin const): (JSC::ObjectPropertyConditionSet::end const): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::findArgumentPositionForLocal): (JSC::DFG::ByteCodeParser::flushImpl): (JSC::DFG::ByteCodeParser::parseBlock): (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry): * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::validateReferences): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::isLiveInBytecode): * dfg/DFGGraph.h: * dfg/DFGPreciseLocalClobberize.h: (JSC::DFG::PreciseLocalClobberizeAdaptor::readTop): * dfg/DFGStackLayoutPhase.cpp: (JSC::DFG::StackLayoutPhase::run): * ftl/FTLCompile.cpp: (JSC::FTL::compile): * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::compileGetMyArgumentByVal): * jit/AssemblyHelpers.h: (JSC::AssemblyHelpers::argumentsStart): * jit/SetupVarargsFrame.cpp: (JSC::emitSetupVarargsFrameFastCase): * llint/LowLevelInterpreter.asm: * llint/LowLevelInterpreter32_64.asm: * llint/LowLevelInterpreter64.asm: * runtime/ClonedArguments.cpp: (JSC::ClonedArguments::createWithInlineFrame): Source/WTF: * wtf/FixedVector.h: (WTF::FixedVector::offsetOfStorage): * wtf/RefCountedArray.h: (WTF::RefCountedArray::Header::size): (WTF::RefCountedArray::Header::offsetOfLength): Canonical link: https://commits.webkit.org/236271@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275626 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-07 21:14:57 +00:00
2021-04-07 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Use FixedVector more in bytecode dir and JumpTable
https://bugs.webkit.org/show_bug.cgi?id=224275
Reviewed by Michael Saboff and Mark Lam.
* wtf/FixedVector.h:
(WTF::FixedVector::offsetOfStorage):
* wtf/RefCountedArray.h:
(WTF::RefCountedArray::Header::size):
(WTF::RefCountedArray::Header::offsetOfLength):
2021-04-07 Alex Christensen <achristensen@webkit.org>
Use os_transaction_create instead of deprecated xpc_transaction_begin/end
https://bugs.webkit.org/show_bug.cgi?id=224288
Reviewed by Tim Horton.
* wtf/spi/darwin/XPCSPI.h:
JSTests: [JSC] WasmMemory caging should care about nullptr https://bugs.webkit.org/show_bug.cgi?id=224268 <rdar://problem/74654838> Reviewed by Mark Lam. * wasm/stress/4g-memory-cage.js: Added. (async test): * wasm/stress/more-than-4g-offset-access-oom.js: Added. (async test): * wasm/stress/null-memory-cage-explicit.js: Added. (async test): * wasm/stress/null-memory-cage.js: Added. (async test): Source/JavaScriptCore: [JSC] WasmMemory caging should care about nullptr https://bugs.webkit.org/show_bug.cgi?id=224268 <rdar://problem/74654838> Reviewed by Mark Lam. 1. Fix Wasm::MemoryHandle::boundsCheckingSize. We should just return m_mappedCapacity here since UINT32_MAX is not 4GB. This checking size can include redzone for fast-memory, but this is OK: bounds-check pass in LLInt (in upper tiers, we do not use bounds-check for fast-memory), and access to redzone, then fault occurs and signal handler can make it error since signal handler is checking whether the access is within Memory::fastMappedBytes which includes redzone. 2. Fix caging of wasm memory-base pointer in LLInt. We should use pointer sized length since it can be larger than 4GB. And we should handle nullptr case correctly: Wasm::MemoryHandle's memory can be nullptr when mapped size is zero. caging needs to handle this case as we do in CagedPtr::getMayBeNull. * assembler/MacroAssemblerARM64E.h: (JSC::MacroAssemblerARM64E::untagArrayPtrLength32): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::cageTypedArrayStorage): * llint/LowLevelInterpreter64.asm: * llint/WebAssembly.asm: * offlineasm/arm64e.rb: * offlineasm/ast.rb: * offlineasm/instructions.rb: * runtime/CagedBarrierPtr.h: (JSC::CagedBarrierPtr::CagedBarrierPtr): (JSC::CagedBarrierPtr::set): (JSC::CagedBarrierPtr::get const): (JSC::CagedBarrierPtr::getMayBeNull const): (JSC::CagedBarrierPtr::at const): (JSC::CagedBarrierPtr::setWithoutBarrier): * wasm/WasmInstance.h: (JSC::Wasm::Instance::updateCachedMemory): * wasm/WasmMemory.cpp: (JSC::Wasm::MemoryHandle::MemoryHandle): * wasm/WasmMemory.h: Source/WTF: [JSC] WasmMemory caging should care nullptr https://bugs.webkit.org/show_bug.cgi?id=224268 <rdar://problem/74654838> Reviewed by Mark Lam. Accept size_t since Wasm::Memory's length can be larger than 4GB. * wtf/CagedPtr.h: (WTF::CagedPtr::CagedPtr): (WTF::CagedPtr::get const): (WTF::CagedPtr::getMayBeNull const): (WTF::CagedPtr::at const): (WTF::CagedPtr::recage): * wtf/CagedUniquePtr.h: (WTF::CagedUniquePtr::CagedUniquePtr): (WTF::CagedUniquePtr::create): (WTF::CagedUniquePtr::tryCreate): Canonical link: https://commits.webkit.org/236242@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275597 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-07 09:28:49 +00:00
2021-04-06 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] WasmMemory caging should care nullptr
https://bugs.webkit.org/show_bug.cgi?id=224268
<rdar://problem/74654838>
Reviewed by Mark Lam.
Accept size_t since Wasm::Memory's length can be larger than 4GB.
* wtf/CagedPtr.h:
(WTF::CagedPtr::CagedPtr):
(WTF::CagedPtr::get const):
(WTF::CagedPtr::getMayBeNull const):
(WTF::CagedPtr::at const):
(WTF::CagedPtr::recage):
* wtf/CagedUniquePtr.h:
(WTF::CagedUniquePtr::CagedUniquePtr):
(WTF::CagedUniquePtr::create):
(WTF::CagedUniquePtr::tryCreate):
2021-04-06 Alex Christensen <achristensen@webkit.org>
Add U+0581 and U+0585 to list of Armenian characters that look like Latin characters
https://bugs.webkit.org/show_bug.cgi?id=224219
<rdar://75896365>
Reviewed by Brent Fulgham.
These code points are allowed in the context of other Armenian code points and punctuation, but not other script code points.
This was already implemented for the others, but I consolidated the list to one location to avoid having two locations for the list.
* wtf/URLHelpers.cpp:
(WTF::URLHelpers::isArmenianLookalikeCharacter):
(WTF::URLHelpers::isArmenianLookalikeSequence):
(WTF::URLHelpers::isLookalikeCharacter):
[WTF] Introduce FixedVector and use it for FixedOperands https://bugs.webkit.org/show_bug.cgi?id=224171 Reviewed by Mark Lam. Source/JavaScriptCore: Define FixedOperands<T> which uses FixedVector for its storage. We use FixedOperands in FTL::OSRExitDescriptor. We also replace RefCountedArray<T> with FixedVector<T> if they are not requiring RefCountedArray<T>'s ref-counting semantics. * bytecode/BytecodeGeneratorification.cpp: (JSC::BytecodeGeneratorification::run): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::finishCreation): (JSC::CodeBlock::setConstantRegisters): (JSC::CodeBlock::setNumParameters): (JSC::CodeBlock::setRareCaseProfiles): (JSC::CodeBlock::insertBasicBlockBoundariesForControlFlowProfiler): * bytecode/CodeBlock.h: * bytecode/Operands.h: (JSC::Operands::Operands): * bytecode/OperandsInlines.h: (JSC::U>::dumpInContext const): (JSC::U>::dump const): (JSC::Operands<T>::dumpInContext const): Deleted. (JSC::Operands<T>::dump const): Deleted. * bytecode/PolyProtoAccessChain.h: * bytecode/PolymorphicAccess.cpp: (JSC::PolymorphicAccess::regenerate): * bytecode/PolymorphicAccess.h: * bytecode/UnlinkedCodeBlock.cpp: (JSC::UnlinkedCodeBlock::dumpExpressionRangeInfo): (JSC::UnlinkedCodeBlock::expressionRangeForBytecodeIndex const): * bytecode/UnlinkedCodeBlock.h: (JSC::UnlinkedCodeBlock::expressionInfo): (JSC::UnlinkedCodeBlock::identifiers const): (JSC::UnlinkedCodeBlock::constantRegisters): (JSC::UnlinkedCodeBlock::constantsSourceCodeRepresentation): (JSC::UnlinkedCodeBlock::constantIdentifierSets): (JSC::UnlinkedCodeBlock::opProfileControlFlowBytecodeOffsets const): * bytecode/UnlinkedFunctionExecutable.h: * bytecompiler/BytecodeGenerator.cpp: (JSC::prepareJumpTableForSwitch): * dfg/DFGJITCode.h: * dfg/DFGPlan.h: (JSC::DFG::Plan::tierUpInLoopHierarchy): * ftl/FTLOSRExit.h: * jit/GCAwareJITStubRoutine.h: * jit/JIT.cpp: (JSC::JIT::privateCompileSlowCases): * jit/PolymorphicCallStubRoutine.h: * llint/LLIntOffsetsExtractor.cpp: * llint/LowLevelInterpreter.asm: * parser/Parser.cpp: (JSC::Parser<LexerType>::parseInner): (JSC::Parser<LexerType>::parseClassFieldInitializerSourceElements): * parser/Parser.h: (JSC::Parser<LexerType>::parse): (JSC::parse): * runtime/CachedTypes.cpp: (JSC::CachedVector::encode): (JSC::CachedVector::decode const): * wasm/js/JSWebAssemblyInstance.h: Source/WTF: This FixedVector<T> is a wrapper around RefCountedArray<T>, but this offers Vector-like copy / move semantics, so that we can use this FixedVector<T> as a drop-in-replacement for fixed-sized Vector fields. The purpose of that is saving memory by removing unnecessary storage (FixedVector is fixed-sized allocated) and putting size into the allocated memory. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/FastBitVector.h: (WTF::FastBitVector::FastBitVector): * wtf/FixedVector.h: Added. (WTF::FixedVector::FixedVector): (WTF::FixedVector::operator=): (WTF::FixedVector::size const): (WTF::FixedVector::isEmpty const): (WTF::FixedVector::byteSize const): (WTF::FixedVector::data): (WTF::FixedVector::begin): (WTF::FixedVector::end): (WTF::FixedVector::data const): (WTF::FixedVector::begin const): (WTF::FixedVector::end const): (WTF::FixedVector::rbegin): (WTF::FixedVector::rend): (WTF::FixedVector::rbegin const): (WTF::FixedVector::rend const): (WTF::FixedVector::at): (WTF::FixedVector::at const): (WTF::FixedVector::operator[]): (WTF::FixedVector::operator[] const): (WTF::FixedVector::first): (WTF::FixedVector::first const): (WTF::FixedVector::last): (WTF::FixedVector::last const): (WTF::FixedVector::fill): (WTF::FixedVector::operator== const): (WTF::FixedVector::swap): (WTF::swap): * wtf/RefCountedArray.h: (WTF::RefCountedArray::RefCountedArray): (WTF::RefCountedArray::fill): (WTF::RefCountedArray::swap): Tools: * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/FixedVector.cpp: Added. (TestWebKitAPI::TEST): (TestWebKitAPI::DestructorObserver::DestructorObserver): (TestWebKitAPI::DestructorObserver::~DestructorObserver): (TestWebKitAPI::DestructorObserver::operator=): Canonical link: https://commits.webkit.org/236198@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275542 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-06 19:47:47 +00:00
2021-04-06 Yusuke Suzuki <ysuzuki@apple.com>
[WTF] Introduce FixedVector and use it for FixedOperands
https://bugs.webkit.org/show_bug.cgi?id=224171
Reviewed by Mark Lam.
This FixedVector<T> is a wrapper around RefCountedArray<T>, but this offers Vector-like copy / move semantics,
so that we can use this FixedVector<T> as a drop-in-replacement for fixed-sized Vector fields. The purpose
of that is saving memory by removing unnecessary storage (FixedVector is fixed-sized allocated) and putting size
into the allocated memory.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/FastBitVector.h:
(WTF::FastBitVector::FastBitVector):
* wtf/FixedVector.h: Added.
(WTF::FixedVector::FixedVector):
(WTF::FixedVector::operator=):
(WTF::FixedVector::size const):
(WTF::FixedVector::isEmpty const):
(WTF::FixedVector::byteSize const):
(WTF::FixedVector::data):
(WTF::FixedVector::begin):
(WTF::FixedVector::end):
(WTF::FixedVector::data const):
(WTF::FixedVector::begin const):
(WTF::FixedVector::end const):
(WTF::FixedVector::rbegin):
(WTF::FixedVector::rend):
(WTF::FixedVector::rbegin const):
(WTF::FixedVector::rend const):
(WTF::FixedVector::at):
(WTF::FixedVector::at const):
(WTF::FixedVector::operator[]):
(WTF::FixedVector::operator[] const):
(WTF::FixedVector::first):
(WTF::FixedVector::first const):
(WTF::FixedVector::last):
(WTF::FixedVector::last const):
(WTF::FixedVector::fill):
(WTF::FixedVector::operator== const):
(WTF::FixedVector::swap):
(WTF::swap):
* wtf/RefCountedArray.h:
(WTF::RefCountedArray::RefCountedArray):
(WTF::RefCountedArray::fill):
(WTF::RefCountedArray::swap):
2021-04-06 Youenn Fablet <youenn@apple.com>
Enable NSURLSession WebSocket code path by default
https://bugs.webkit.org/show_bug.cgi?id=224102
Reviewed by Alex Christensen.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
[JSC] Shrink some of Vectors in JSC https://bugs.webkit.org/show_bug.cgi?id=224162 Reviewed by Simon Fraser. Source/JavaScriptCore: 1. Add XXXStatus::shrinkToFit to shrink underlying dynamic Vectors. 2. Replace tierUpInLoopHierarchy's Vector with RefCountedArray since it is constructed-once-lookup-only data. 3. Use MemoryCompactLookupOnlyRobinHoodHashSet for StringTables since this is constructed-once-lookup-only data. We also add MemoryCompactLookupOnlyRobinHoodHashSet support for CachedTypes. 4. Use resizeToFit for StringSwitchJumpTables and SwitchJumpTables. 5. JITStubRoutineSet's Vector should be shrunk. 6. BlockDirectoryBits's Vector's initial size should be small. 7. Make PolyProtoAccessChain RefCounted, and use RefCountedArray for its Vector<StructureID>. And remove PolyProtoAccessChain::clone. Just having Ref is enough since this is immutable data. 8. Use RefCountedArray for UnlinkedFunctionExecutable's m_classFieldLocations. 9. Use RefCountedArray for JSWebAssemblyInstance. * bytecode/AccessCase.cpp: (JSC::AccessCase::AccessCase): (JSC::AccessCase::create): (JSC::AccessCase::createTransition): * bytecode/AccessCase.h: (JSC::AccessCase::AccessCase): Deleted. * bytecode/CallLinkInfo.cpp: (JSC::CallLinkInfo::setFrameShuffleData): * bytecode/CheckPrivateBrandStatus.cpp: (JSC::CheckPrivateBrandStatus::shrinkToFit): (JSC::CheckPrivateBrandStatus::computeForStubInfoWithoutExitSiteFeedback): (JSC::CheckPrivateBrandStatus::merge): * bytecode/CheckPrivateBrandStatus.h: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::finishCreation): * bytecode/DeleteByStatus.cpp: (JSC::DeleteByStatus::shrinkToFit): (JSC::DeleteByStatus::computeForStubInfoWithoutExitSiteFeedback): (JSC::DeleteByStatus::merge): * bytecode/DeleteByStatus.h: * bytecode/GetByStatus.cpp: (JSC::GetByStatus::shrinkToFit): (JSC::GetByStatus::computeForStubInfoWithoutExitSiteFeedback): (JSC::GetByStatus::computeFor): (JSC::GetByStatus::merge): * bytecode/GetByStatus.h: * bytecode/GetterSetterAccessCase.cpp: (JSC::GetterSetterAccessCase::GetterSetterAccessCase): (JSC::GetterSetterAccessCase::create): * bytecode/GetterSetterAccessCase.h: * bytecode/InByIdStatus.cpp: (JSC::InByIdStatus::shrinkToFit): (JSC::InByIdStatus::computeForStubInfoWithoutExitSiteFeedback): (JSC::InByIdStatus::merge): * bytecode/InByIdStatus.h: * bytecode/InstanceOfStatus.cpp: (JSC::InstanceOfStatus::shrinkToFit): (JSC::InstanceOfStatus::computeForStubInfo): * bytecode/InstanceOfStatus.h: * bytecode/IntrinsicGetterAccessCase.cpp: (JSC::IntrinsicGetterAccessCase::IntrinsicGetterAccessCase): (JSC::IntrinsicGetterAccessCase::create): * bytecode/IntrinsicGetterAccessCase.h: * bytecode/JumpTable.h: * bytecode/PolyProtoAccessChain.cpp: (JSC::PolyProtoAccessChain::tryCreate): (JSC::PolyProtoAccessChain::create): Deleted. * bytecode/PolyProtoAccessChain.h: (JSC::PolyProtoAccessChain::clone): Deleted. (JSC::PolyProtoAccessChain::chain const): Deleted. (JSC::PolyProtoAccessChain::operator!= const): Deleted. (JSC::PolyProtoAccessChain::forEach const): Deleted. (JSC::PolyProtoAccessChain::slotBaseStructure const): Deleted. * bytecode/PolymorphicAccess.cpp: (JSC::PolymorphicAccess::visitWeak const): (JSC::PolymorphicAccess::regenerate): * bytecode/PolymorphicAccess.h: * bytecode/ProxyableAccessCase.cpp: (JSC::ProxyableAccessCase::ProxyableAccessCase): (JSC::ProxyableAccessCase::create): * bytecode/ProxyableAccessCase.h: * bytecode/PutByIdStatus.cpp: (JSC::PutByIdStatus::shrinkToFit): (JSC::PutByIdStatus::computeForStubInfo): (JSC::PutByIdStatus::computeFor): (JSC::PutByIdStatus::merge): * bytecode/PutByIdStatus.h: * bytecode/SetPrivateBrandStatus.cpp: (JSC::SetPrivateBrandStatus::shrinkToFit): (JSC::SetPrivateBrandStatus::computeForStubInfoWithoutExitSiteFeedback): (JSC::SetPrivateBrandStatus::merge): * bytecode/SetPrivateBrandStatus.h: * bytecode/UnlinkedCodeBlock.h: * bytecode/UnlinkedFunctionExecutable.cpp: (JSC::generateUnlinkedFunctionCodeBlock): * bytecode/UnlinkedFunctionExecutable.h: * dfg/DFGJITCode.h: * dfg/DFGPlan.h: (JSC::DFG::Plan::tierUpInLoopHierarchy): * dfg/DFGTierUpCheckInjectionPhase.cpp: (JSC::DFG::TierUpCheckInjectionPhase::run): * heap/BlockDirectoryBits.h: * heap/JITStubRoutineSet.cpp: (JSC::JITStubRoutineSet::deleteUnmarkedJettisonedStubRoutines): * jit/CallFrameShuffleData.h: (JSC::CallFrameShuffleData::shrinkToFit): * jit/GCAwareJITStubRoutine.h: * jit/PolymorphicCallStubRoutine.h: * jit/Repatch.cpp: (JSC::tryCacheGetBy): (JSC::tryCachePutByID): (JSC::tryCacheInByID): * parser/Parser.cpp: (JSC::Parser<LexerType>::parseInner): (JSC::Parser<LexerType>::parseClassFieldInitializerSourceElements): * parser/Parser.h: (JSC::Parser<LexerType>::parse): (JSC::parse): * runtime/CachedTypes.cpp: (JSC::CachedFunctionExecutableRareData::encode): (JSC::CachedFunctionExecutableRareData::decode const): * runtime/VM.cpp: (JSC::VM::popAllCheckpointOSRSideStateUntil): * wasm/js/JSWebAssemblyInstance.cpp: (JSC::JSWebAssemblyInstance::visitChildrenImpl): * wasm/js/JSWebAssemblyInstance.h: Source/WTF: Add rbegin and rend to make RefCountedArray usable for Vector clients who use these features. * wtf/RefCountedArray.h: (WTF::RefCountedArray::begin): (WTF::RefCountedArray::end): (WTF::RefCountedArray::begin const): (WTF::RefCountedArray::end const): (WTF::RefCountedArray::rbegin): (WTF::RefCountedArray::rend): (WTF::RefCountedArray::rbegin const): (WTF::RefCountedArray::rend const): Canonical link: https://commits.webkit.org/236147@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275490 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-06 04:25:33 +00:00
2021-04-05 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Shrink some of Vectors in JSC
https://bugs.webkit.org/show_bug.cgi?id=224162
Reviewed by Simon Fraser.
Add rbegin and rend to make RefCountedArray usable for Vector clients who use these features.
* wtf/RefCountedArray.h:
(WTF::RefCountedArray::begin):
(WTF::RefCountedArray::end):
(WTF::RefCountedArray::begin const):
(WTF::RefCountedArray::end const):
(WTF::RefCountedArray::rbegin):
(WTF::RefCountedArray::rend):
(WTF::RefCountedArray::rbegin const):
(WTF::RefCountedArray::rend const):
Resurrect Mac CMake build https://bugs.webkit.org/show_bug.cgi?id=224084 Patch by Alex Christensen <achristensen@webkit.org> on 2021-04-05 Reviewed by Tim Horton. .: * Source/cmake/OptionsMac.cmake: Source/JavaScriptCore: * PlatformMac.cmake: Source/ThirdParty/ANGLE: * PlatformMac.cmake: Added. Source/ThirdParty/libwebrtc: * CMakeLists.txt: Source/WebCore: * PlatformMac.cmake: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/mac/WebGLBlocklist.mm: * platform/text/cocoa/LocalizedDateCache.h: Renamed from Source/WebCore/platform/text/ios/LocalizedDateCache.h. * platform/text/cocoa/LocalizedDateCache.mm: Renamed from Source/WebCore/platform/text/ios/LocalizedDateCache.mm. (WebCore::localizedDateCache): (WebCore::_localeChanged): (WebCore::LocalizedDateCache::LocalizedDateCache): (WebCore::LocalizedDateCache::~LocalizedDateCache): (WebCore::LocalizedDateCache::localeChanged): (WebCore::LocalizedDateCache::formatterForDateType): (WebCore::LocalizedDateCache::maximumWidthForDateType): (WebCore::LocalizedDateCache::createFormatterForType): (WebCore::LocalizedDateCache::calculateMaximumWidth): * testing/cocoa/WebViewVisualIdentificationOverlay.mm: Source/WebCore/PAL: * pal/PlatformMac.cmake: Source/WebKit: * NetworkProcess/PrivateClickMeasurementNetworkLoader.cpp: (WebKit::PrivateClickMeasurementNetworkLoader::didReceiveBuffer): * PlatformMac.cmake: * Shared/Cocoa/SandboxExtensionCocoa.mm: * SourcesCocoa.txt: * UIProcess/Media/MediaSessionCoordinatorProxyPrivate.h: Source/WebKitLegacy: * PlatformMac.cmake: Source/WTF: * wtf/PlatformMac.cmake: Tools: * TestWebKitAPI/PlatformMac.cmake: * WebKitTestRunner/PlatformMac.cmake: Canonical link: https://commits.webkit.org/236142@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275484 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-06 03:19:14 +00:00
2021-04-05 Alex Christensen <achristensen@webkit.org>
Resurrect Mac CMake build
https://bugs.webkit.org/show_bug.cgi?id=224084
Reviewed by Tim Horton.
* wtf/PlatformMac.cmake:
REGRESSION: ASSERTION FAILED: settings().textAutosizingEnabled() && settings().textAutosizingUsesIdempotentMode() on various tests https://bugs.webkit.org/show_bug.cgi?id=209450 <rdar://problem/60799255> Reviewed by Tim Horton. Source/WebCore: When running layout tests without idempotent text autosizing after layout tests with idempotent text autosizing enabled, it's possible to get into a state where the text size adjustment timer (which is used to schedule idempotent text autosizing style adjustments) is scheduled, but idempotent text autosizing is disabled before the timer fires. This causes the assertion in `resetIdempotentTextAutosizingIfNeeded` to fail, leading to a debug assertion. To prevent this, we simply add a client method to call out to WebPage to stop its idempotent text autosizing timer when the idempotent text autosizing WebCore setting changes to disabled. This fixes assertions on these four tests, which are normally run after fast/text-autosizing: - fast/text/control-characters/visible-control-characters-1.html - fast/text/firstline/001.html - fast/text-indicator/text-indicator-empty-link.html - fast/text/basic/001.html * page/ChromeClient.h: (WebCore::ChromeClient::textAutosizingUsesIdempotentModeChanged): Add the new chrome client hook (see WebKit2 change for more details). * page/SettingsBase.cpp: (WebCore::SettingsBase::textAutosizingUsesIdempotentModeChanged): Replace the existing settings change handler (`setNeedsRecalcStyleInAllFrames`) with a custom change handler (`textAutosizingUsesIdempotentModeChanged`) that invokes the client hook above, in addition to flagging all frames for a style recalc. * page/SettingsBase.h: Source/WebKit: See WebCore for more details. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::textAutosizingUsesIdempotentModeChanged): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::textAutosizingUsesIdempotentModeChanged): Stop the idempotent text autosizing recomputation timer (`m_textAutoSizingAdjustmentTimer`) when idempotent text autosizing is disabled. * WebProcess/WebPage/WebPage.h: Source/WTF: Replace the call to `setNeedsRecalcStyleInAllFrames` with `textAutosizingUsesIdempotentModeChanged` when changing whether idempotent text autosizing is enabled. * Scripts/Preferences/WebPreferencesInternal.yaml: LayoutTests: Remove crashing expectations for several tests that previously hit this assertion, due to running immediately after some layout tests in `fast/text-autosizing` that enable idempotent text autosizing. * platform/ios-wk2/TestExpectations: Canonical link: https://commits.webkit.org/236138@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275480 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-06 02:36:12 +00:00
2021-04-05 Wenson Hsieh <wenson_hsieh@apple.com>
REGRESSION: ASSERTION FAILED: settings().textAutosizingEnabled() && settings().textAutosizingUsesIdempotentMode() on various tests
https://bugs.webkit.org/show_bug.cgi?id=209450
<rdar://problem/60799255>
Reviewed by Tim Horton.
Replace the call to `setNeedsRecalcStyleInAllFrames` with `textAutosizingUsesIdempotentModeChanged` when
changing whether idempotent text autosizing is enabled.
* Scripts/Preferences/WebPreferencesInternal.yaml:
Define AtomString(ASCIILiteral) and use ASCIILiteral more to avoid memory allocation https://bugs.webkit.org/show_bug.cgi?id=224125 Reviewed by Saam Barati. Source/WebCore: We apply "..."_s more. This avoids allocating of string storage when creating StringImpl. * accessibility/AccessibilityObject.cpp: (WebCore::initializeRoleMap): * dom/ScriptElement.cpp: (WebCore::isLegacySupportedJavaScriptLanguage): * editing/EditorCommand.cpp: (WebCore::createCommandMap): * html/Autofill.cpp: (WebCore::fieldNameMap): * platform/LegacySchemeRegistry.cpp: (WebCore::builtinLocalURLSchemes): (WebCore::builtinSecureSchemes): (WebCore::builtinSchemesWithUniqueOrigins): (WebCore::builtinEmptyDocumentSchemes): (WebCore::builtinCanDisplayOnlyIfCanRequestSchemes): (WebCore::builtinCORSEnabledSchemes): * platform/MIMETypeRegistry.cpp: (WebCore::MIMETypeRegistry::systemPreviewMIMETypes): * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::hasValidAverageCharWidth const): * platform/graphics/HEVCUtilities.cpp: (WebCore::codecStringForDoViCodecType): (WebCore::profileIDForAlphabeticDoViProfile): * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: (WebCore::MediaPlayerPrivateAVFoundation::staticMIMETypeList): * platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm: (WebCore::AVAssetMIMETypeCache::staticContainerTypeList): * platform/graphics/cg/ImageSourceCGWin.cpp: (WebCore::preferredExtensionForImageType): * svg/SVGTests.cpp: (WebCore::supportedSVGFeatures): Source/WTF: Add AtomString(ASCIILiteral). ASCIILiteral ensures that storage is constant non-heap string by its type. So we can just use it as a literal (not allocating a string storage). * wtf/text/AtomString.h: Canonical link: https://commits.webkit.org/236117@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275457 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-06 00:09:31 +00:00
2021-04-05 Yusuke Suzuki <ysuzuki@apple.com>
Define AtomString(ASCIILiteral) and use ASCIILiteral more to avoid memory allocation
https://bugs.webkit.org/show_bug.cgi?id=224125
Reviewed by Saam Barati.
Add AtomString(ASCIILiteral). ASCIILiteral ensures that storage is constant non-heap string by its type.
So we can just use it as a literal (not allocating a string storage).
* wtf/text/AtomString.h:
2021-04-02 Simon Fraser <simon.fraser@apple.com>
Enable PreferPageRenderingUpdatesNear60FPSEnabled by default
https://bugs.webkit.org/show_bug.cgi?id=224133
Reviewed by Tim Horton.
Turn the PreferPageRenderingUpdatesNear60FPSEnabled internal setting on by default. This
means that requestAnimationFrame on 144Hz displays will fire at 72Hz. 60Hz displays are
unaffected.
Firing at "close to 60fps" was determined to be necessary for web compatibility and power.
* Scripts/Preferences/WebPreferencesInternal.yaml:
2021-04-02 Youenn Fablet <youenn@apple.com>
[MacOS] Enable NSURLSession WebSocket code path in WebKitTestRunner
https://bugs.webkit.org/show_bug.cgi?id=220973
<rdar://problem/73655870>
Reviewed by Darin Adler.
* wtf/PlatformHave.h:
Bump NSURLSessionWebSocket path to above BigSur and iOS14.
2021-04-02 Yusuke Suzuki <ysuzuki@apple.com>
Unreviewed, fix passing hash value
https://bugs.webkit.org/show_bug.cgi?id=223895
* wtf/RobinHoodHashTable.h:
(WTF::SizePolicy>::addPassingHashCode):
[WTF] Introduce RobinHoodHashTable https://bugs.webkit.org/show_bug.cgi?id=223895 Reviewed by Fil Pizlo. Source/JavaScriptCore: * builtins/BuiltinNames.cpp: (JSC::lookUpPrivateNameImpl): (JSC::lookUpWellKnownSymbolImpl): * builtins/BuiltinNames.h: * bytecode/BytecodeIntrinsicRegistry.h: * runtime/Identifier.h: * runtime/IntlCollator.cpp: (JSC::IntlCollator::initializeCollator): (JSC::IntlCollator::checkICULocaleInvariants): * runtime/IntlCollator.h: * runtime/IntlDateTimeFormat.cpp: (JSC::IntlDateTimeFormat::initializeDateTimeFormat): * runtime/IntlDateTimeFormatConstructor.cpp: (JSC::JSC_DEFINE_HOST_FUNCTION): * runtime/IntlDisplayNames.cpp: (JSC::IntlDisplayNames::initializeDisplayNames): * runtime/IntlDisplayNamesConstructor.cpp: (JSC::JSC_DEFINE_HOST_FUNCTION): * runtime/IntlListFormat.cpp: (JSC::IntlListFormat::initializeListFormat): * runtime/IntlListFormatConstructor.cpp: (JSC::JSC_DEFINE_HOST_FUNCTION): * runtime/IntlNumberFormat.cpp: (JSC::IntlNumberFormat::initializeNumberFormat): * runtime/IntlNumberFormatConstructor.cpp: (JSC::JSC_DEFINE_HOST_FUNCTION): * runtime/IntlObject.cpp: (JSC::addScriptlessLocaleIfNeeded): (JSC::intlAvailableLocales): (JSC::intlCollatorAvailableLocales): (JSC::intlSegmenterAvailableLocales): (JSC::bestAvailableLocale): (JSC::lookupMatcher): (JSC::bestFitMatcher): (JSC::resolveLocale): (JSC::lookupSupportedLocales): (JSC::bestFitSupportedLocales): (JSC::supportedLocales): * runtime/IntlObject.h: (JSC::intlDateTimeFormatAvailableLocales): (JSC::intlDisplayNamesAvailableLocales): (JSC::intlNumberFormatAvailableLocales): (JSC::intlPluralRulesAvailableLocales): (JSC::intlRelativeTimeFormatAvailableLocales): (JSC::intlListFormatAvailableLocales): * runtime/IntlPluralRules.cpp: (JSC::IntlPluralRules::initializePluralRules): * runtime/IntlPluralRulesConstructor.cpp: (JSC::JSC_DEFINE_HOST_FUNCTION): * runtime/IntlRelativeTimeFormat.cpp: (JSC::IntlRelativeTimeFormat::initializeRelativeTimeFormat): * runtime/IntlRelativeTimeFormatConstructor.cpp: (JSC::JSC_DEFINE_HOST_FUNCTION): * runtime/IntlSegmenter.cpp: (JSC::IntlSegmenter::initializeSegmenter): * runtime/IntlSegmenterConstructor.cpp: (JSC::JSC_DEFINE_HOST_FUNCTION): * runtime/RegExpCache.h: * runtime/RegExpKey.h: Source/WebCore: * Modules/mediacapabilities/MediaCapabilities.cpp: (WebCore::bucketMIMETypes): * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::popupValue const): * dom/Element.cpp: (WebCore::canAttachAuthorShadowRoot): * dom/QualifiedName.h: * dom/make_names.pl: (printNamesHeaderFile): (printFactoryCppFile): (printWrapperFactoryCppFile): * editing/FormatBlockCommand.cpp: (WebCore::isElementForFormatBlock): * editing/RemoveFormatCommand.cpp: (WebCore::isElementForRemoveFormatCommand): * editing/ReplaceSelectionCommand.cpp: (WebCore::isProhibitedParagraphChild): * html/Autofill.cpp: (WebCore::fieldNameMap): * html/HTMLDocument.cpp: (WebCore::HTMLDocument::isCaseSensitiveAttribute): * html/HTMLObjectElement.cpp: (WebCore::preventsParentObjectFromExposure): * html/parser/HTMLTreeBuilder.cpp: (WebCore::createCaseMap): (WebCore::adjustSVGTagNameCase): (WebCore::adjustAttributes): (WebCore::createForeignAttributesMap): (WebCore::adjustForeignAttributes): (WebCore::addNamesWithPrefix): Deleted. * page/DebugPageOverlays.cpp: (WebCore::touchEventRegionColors): (WebCore::NonFastScrollableRegionOverlay::drawRect): * page/PerformanceUserTiming.cpp: (WebCore::restrictedMarkNamesToNavigationTimingFunctionMap): * platform/cocoa/MIMETypeRegistryCocoa.mm: (WebCore::extensionsForMIMETypeMap): * platform/graphics/FontCascade.cpp: (WebCore::useBackslashAsYenSignForFamily): (WebCore::FontCascade::hasValidAverageCharWidth const): * platform/graphics/avfoundation/CDMFairPlayStreaming.cpp: (WebCore::validInitDataTypes): * platform/graphics/cg/UTIRegistry.cpp: (WebCore::defaultSupportedImageTypes): * platform/graphics/cg/UTIRegistry.h: * platform/graphics/cocoa/HEVCUtilitiesCocoa.mm: (WebCore::codecTypeForDoViCodecString): * platform/graphics/cocoa/SourceBufferParserWebM.cpp: (WebCore::SourceBufferParserWebM::supportedVideoCodecs): (WebCore::SourceBufferParserWebM::supportedAudioCodecs): * platform/graphics/cocoa/SourceBufferParserWebM.h: * rendering/svg/SVGResources.cpp: (WebCore::clipperFilterMaskerTags): (WebCore::markerTags): (WebCore::fillAndStrokeTags): (WebCore::chainableResourceTags): * style/StyleAdjuster.cpp: (WebCore::Style::hasEffectiveDisplayNoneForDisplayContents): * svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::isSupportedAttribute): * svg/SVGElement.cpp: (WebCore::createAttributeNameToCSSPropertyIDMap): (WebCore::SVGElement::animatableAttributeForName): (WebCore::SVGElement::cssPropertyIdForSVGAttributeName): * svg/SVGTests.cpp: (WebCore::SVGTests::addSupportedAttributes): * svg/SVGTests.h: * svg/SVGUseElement.cpp: (WebCore::createAllowedElementSet): (WebCore::isDisallowedElement): * svg/animation/SVGSMILElement.cpp: (WebCore::SVGSMILElement::isSupportedAttribute): * xml/XPathFunctions.cpp: (WebCore::XPath::createFunctionMap): * xml/XPathParser.cpp: (WebCore::XPath::createAxisNamesMap): Source/WebKit: * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::ObservedDomainsTableSchemaV1Alternate): (WebKit::expectedUnattributedColumns): (WebKit::expectedAttributedColumns): (WebKit::createTableQueries): * Platform/IPC/ArgumentCoders.h: * Shared/Cocoa/DefaultWebBrowserChecks.mm: (WebKit::getAppBoundDomainsTesting): * Shared/WebPreferencesStore.cpp: (WebKit::WebPreferencesStore::decode): * Shared/WebPreferencesStore.h: * UIProcess/Cocoa/WebProcessProxyCocoa.mm: (WebKit::WebProcessProxy::platformPathsWithAssumedReadAccess): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::platformPathsWithAssumedReadAccess): * UIProcess/WebProcessProxy.h: Source/WTF: This patch implements RobinHoodHashTable[1]. We don't use it as a default hashtable since it has different performance v.s. memory-saving characteristics, and this patch's goal is not tackling on making this default. Rather, the goal of this patch is introducing it to non-performance sensitive area quickly so that we can save memory. RobinHoodHashTable more frequently computes hash value compared to HashTable, so this is not drop-in replacement for the existing one. But still, this is useful since we know that "while there are many small HashTables and they holds much memory, there are super large HashTables and they holds almost same amount of memory while they are a few.". This patch's goal is applying this RobinHoodHashTable to these "large, but a few" singleton tables. RobinHoodHashTable maintains distance-from-initial-bucket (DIB) small by adjusting existing entries when inserting. When inserting, if we found that the existing entry has less DIB than the current inserting entry's DIB, then we swap entries, and insert the existing entry to the other place. This is giving some good DIB from rich entry to poor entry (that's why it is called RobinHood Hashing), and making average DIB lower. And this algorithm adds good invariant that, when looking up an entry, and we found that existing entry has smaller DIB, then we can stop searching in the middle of the chain since we know that we should swap entries when this happened when inserting. These two tricks maintain HashTable performance even under significantly high load factor: 90% load-factor just works. 95% load-factor regress adding performance, but still it does not become catastrophic compared to normal open-addressing HashTable. We introduce RobinHoodHashTable, and adding several kinds of tables based on load-factors. 1. MemoryCompactLookupOnlyRobinHoodHashSet / HashMap This has 95% load-factor. This is suitable for sets and maps which is mostly-constant: constructing once, and looking up repeatedly. In WebKit, there are so many this kind of tables e.g. singleton HashMap for various kinds of things. We can use this super high load-factor table so that we can save memory even while we are maintains fast HashTable lookup. 2. MemoryCompactRobinHoodHashSet / HashMap This has 90% load-factor. It just works, and we can try using it if sets and maps are significantly performance intensive. 3. FastRobinHoodHashSet / HashMap This has 75% load-factor. This is still good compared to HashSet and HashMap since they are using 50% load-factor for large sized tables. This has very slightly performance regressed compared to 50% load-factor large HashSet and HashMap, but if that is not performance intensive (e.g. AtomStringTable is one of the most performance intensive table), this is good. In this patch, we replace many singleton HashSet / HashMap with RobinHoodHashTable. [1]: https://www.sebastiansylvan.com/post/robin-hood-hashing-should-be-your-default-hash-table-implementation/ * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/Forward.h: * wtf/HashMap.h: (WTF::Y>::swap): (WTF::Y>::size const): (WTF::Y>::capacity const): (WTF::Y>::isEmpty const): (WTF::Y>::begin): (WTF::Y>::end): (WTF::Y>::begin const): (WTF::Y>::end const): (WTF::Y>::find): (WTF::Y>::find const): (WTF::Y>::contains const): (WTF::Y>::get const): (WTF::Y>::inlineGet const): (WTF::TableTraitsArg>::inlineSet): (WTF::TableTraitsArg>::inlineAdd): (WTF::TableTraitsArg>::inlineEnsure): (WTF::TableTraitsArg>::set): (WTF::TableTraitsArg>::add): (WTF::TableTraitsArg>::fastAdd): (WTF::TableTraitsArg>::ensure): (WTF::Y>::remove): (WTF::Y>::removeIf): (WTF::Y>::clear): (WTF::Y>::take): (WTF::Y>::checkConsistency const): (WTF::Y>::isValidKey): (WTF::operator==): (WTF::operator!=): (WTF::X>::swap): Deleted. (WTF::X>::size const): Deleted. (WTF::X>::capacity const): Deleted. (WTF::X>::isEmpty const): Deleted. (WTF::X>::begin): Deleted. (WTF::X>::end): Deleted. (WTF::X>::begin const): Deleted. (WTF::X>::end const): Deleted. (WTF::X>::find): Deleted. (WTF::X>::find const): Deleted. (WTF::X>::contains const): Deleted. (WTF::X>::get const): Deleted. (WTF::X>::inlineGet const): Deleted. (WTF::MappedTraitsArg>::inlineSet): Deleted. (WTF::MappedTraitsArg>::inlineAdd): Deleted. (WTF::MappedTraitsArg>::inlineEnsure): Deleted. (WTF::MappedTraitsArg>::set): Deleted. (WTF::MappedTraitsArg>::add): Deleted. (WTF::MappedTraitsArg>::fastAdd): Deleted. (WTF::MappedTraitsArg>::ensure): Deleted. (WTF::MappedTraits>::get const): Deleted. (WTF::MappedTraits>::inlineGet const): Deleted. (WTF::X>::remove): Deleted. (WTF::X>::removeIf): Deleted. (WTF::X>::clear): Deleted. (WTF::MappedTraits>::take): Deleted. (WTF::X>::take): Deleted. (WTF::X>::checkConsistency const): Deleted. (WTF::X>::isValidKey): Deleted. * wtf/HashSet.h: (WTF::W>::swap): (WTF::W>::size const): (WTF::W>::capacity const): (WTF::W>::isEmpty const): (WTF::W>::begin const): (WTF::W>::end const): (WTF::W>::find const): (WTF::W>::contains const): (WTF::TableTraits>::find const): (WTF::TableTraits>::contains const): (WTF::TableTraits>::ensure): (WTF::W>::add): (WTF::W>::addVoid): (WTF::TableTraits>::add): (WTF::W>::remove): (WTF::W>::removeIf): (WTF::W>::clear): (WTF::W>::take): (WTF::W>::takeAny): (WTF::TableTraits>::remove): (WTF::TableTraits>::take): (WTF::W>::isValidValue): (WTF::= const): (WTF::W>::checkConsistency const): (WTF::V>::swap): Deleted. (WTF::V>::size const): Deleted. (WTF::V>::capacity const): Deleted. (WTF::V>::isEmpty const): Deleted. (WTF::V>::begin const): Deleted. (WTF::V>::end const): Deleted. (WTF::V>::find const): Deleted. (WTF::V>::contains const): Deleted. (WTF::Traits>::find const): Deleted. (WTF::Traits>::contains const): Deleted. (WTF::Traits>::ensure): Deleted. (WTF::V>::add): Deleted. (WTF::V>::addVoid): Deleted. (WTF::Traits>::add): Deleted. (WTF::V>::remove): Deleted. (WTF::V>::removeIf): Deleted. (WTF::V>::clear): Deleted. (WTF::V>::take): Deleted. (WTF::V>::takeAny): Deleted. (WTF::Traits>::remove): Deleted. (WTF::Traits>::take): Deleted. (WTF::V>::isValidValue): Deleted. (WTF::V>::checkConsistency const): Deleted. * wtf/HashTable.h: (WTF::addIterator): (WTF::removeIterator): (WTF::invalidateIterators): (WTF::HashTable::~HashTable): (WTF::HashTable::random): (WTF::KeyTraits>::inlineLookup): (WTF::KeyTraits>::lookupForWriting): (WTF::KeyTraits>::fullLookupForWriting): (WTF::KeyTraits>::addUniqueForInitialization): (WTF::KeyTraits>::add): (WTF::KeyTraits>::addPassingHashCode): (WTF::KeyTraits>::removeAndInvalidateWithoutEntryConsistencyCheck): (WTF::KeyTraits>::removeAndInvalidate): (WTF::KeyTraits>::clear): (WTF::KeyTraits>::swap): (WTF::KeyTraits>::HashTable): (WTF::HashTable::invalidateIterators): Deleted. (WTF::KeyTraits>::invalidateIterators): Deleted. * wtf/RobinHoodHashMap.h: Added. * wtf/RobinHoodHashSet.h: Added. * wtf/RobinHoodHashTable.h: Added. (WTF::RobinHoodHashTable::~RobinHoodHashTable): (WTF::RobinHoodHashTable::begin): (WTF::RobinHoodHashTable::end): (WTF::RobinHoodHashTable::begin const): (WTF::RobinHoodHashTable::end const): (WTF::RobinHoodHashTable::random): (WTF::RobinHoodHashTable::random const): (WTF::RobinHoodHashTable::size const): (WTF::RobinHoodHashTable::capacity const): (WTF::RobinHoodHashTable::isEmpty const): (WTF::RobinHoodHashTable::reserveInitialCapacity): (WTF::RobinHoodHashTable::add): (WTF::RobinHoodHashTable::find): (WTF::RobinHoodHashTable::find const): (WTF::RobinHoodHashTable::contains const): (WTF::RobinHoodHashTable::isEmptyBucket): (WTF::RobinHoodHashTable::isEmptyOrDeletedBucket): (WTF::RobinHoodHashTable::lookup): (WTF::RobinHoodHashTable::checkTableConsistency): (WTF::RobinHoodHashTable::internalCheckTableConsistency const): (WTF::RobinHoodHashTable::internalCheckTableConsistencyExceptSize const): (WTF::RobinHoodHashTable::internalCheckTableConsistencyExceptSize): (WTF::RobinHoodHashTable::internalCheckTableConsistency): (WTF::RobinHoodHashTable::shouldExpand): (WTF::RobinHoodHashTable::computeTableHash): (WTF::RobinHoodHashTable::shouldExpand const): (WTF::RobinHoodHashTable::shouldShrink const): (WTF::RobinHoodHashTable::shrink): (WTF::RobinHoodHashTable::deleteBucket): (WTF::RobinHoodHashTable::desiredIndex): (WTF::RobinHoodHashTable::probeDistance): (WTF::RobinHoodHashTable::makeIterator): (WTF::RobinHoodHashTable::makeConstIterator const): (WTF::RobinHoodHashTable::makeKnownGoodIterator): (WTF::RobinHoodHashTable::makeKnownGoodConstIterator const): (WTF::RobinHoodHashTable::checkTableConsistencyExceptSize): (WTF::RobinHoodHashTable::tableSize const): (WTF::RobinHoodHashTable::tableSizeMask const): (WTF::RobinHoodHashTable::keyCount const): (WTF::RobinHoodHashTable::tableHash const): (WTF::SizePolicy>::checkKey): (WTF::SizePolicy>::lookup): (WTF::SizePolicy>::inlineLookup): (WTF::SizePolicy>::initializeBucket): (WTF::SizePolicy>::add): (WTF::SizePolicy>::maintainProbeDistanceForAdd): (WTF::SizePolicy>::addPassingHashCode): (WTF::SizePolicy>::reinsert): (WTF::SizePolicy>::find): (WTF::SizePolicy>::find const): (WTF::SizePolicy>::contains const): (WTF::SizePolicy>::removeAndInvalidateWithoutEntryConsistencyCheck): (WTF::SizePolicy>::removeAndInvalidate): (WTF::SizePolicy>::remove): (WTF::SizePolicy>::removeWithoutEntryConsistencyCheck): (WTF::SizePolicy>::allocateTable): (WTF::SizePolicy>::deallocateTable): (WTF::SizePolicy>::expand): (WTF::SizePolicy>::computeBestTableSize): (WTF::SizePolicy>::shrinkToBestSize): (WTF::SizePolicy>::rehash): (WTF::SizePolicy>::clear): (WTF::SizePolicy>::RobinHoodHashTable): (WTF::SizePolicy>::swap): (WTF::=): (WTF::SizePolicy>::checkTableConsistency const): (WTF::SizePolicy>::checkTableConsistencyExceptSize const): * wtf/text/AtomStringHash.h: * wtf/text/AtomStringImpl.cpp: * wtf/text/AtomStringTable.cpp: (WTF::AtomStringTable::~AtomStringTable): * wtf/text/AtomStringTable.h: (WTF::AtomStringTable::table): * wtf/text/StringHash.h: Tools: * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/DeletedAddressOfOperator.h: * TestWebKitAPI/Tests/WTF/HashMap.cpp: (TestWebKitAPI::testMovingUsingEnsure): (TestWebKitAPI::testMovingUsingAdd): * TestWebKitAPI/Tests/WTF/HashSet.cpp: (TestWebKitAPI::generateTestCapacityUpToSize<0>): (TestWebKitAPI::generateTestCapacityUpToSize): * TestWebKitAPI/Tests/WTF/MoveOnly.h: * TestWebKitAPI/Tests/WTF/RobinHoodHashMap.cpp: Copied from Tools/TestWebKitAPI/Tests/WTF/HashMap.cpp. (TestWebKitAPI::TEST): (TestWebKitAPI::bucketForKey): (TestWebKitAPI::ZeroHash::hash): (TestWebKitAPI::ObjectWithRefLogger::ObjectWithRefLogger): (TestWebKitAPI::testMovingUsingEnsure): (TestWebKitAPI::testMovingUsingAdd): (TestWebKitAPI::DerefObserver::ref): (TestWebKitAPI::DerefObserver::deref): (TestWebKitAPI::TestObjectWithCustomDestructor::TestObjectWithCustomDestructor): (TestWebKitAPI::TestObjectWithCustomDestructor::~TestObjectWithCustomDestructor): * TestWebKitAPI/Tests/WTF/RobinHoodHashSet.cpp: Copied from Tools/TestWebKitAPI/Tests/WTF/HashSet.cpp. (TestWebKitAPI::capacityForSize): (TestWebKitAPI::testInitialCapacity): (TestWebKitAPI::generateTestCapacityUpToSize<0>): (TestWebKitAPI::generateTestCapacityUpToSize): (TestWebKitAPI::TEST): (TestWebKitAPI::DerefObserver::ref): (TestWebKitAPI::DerefObserver::deref): Canonical link: https://commits.webkit.org/236073@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275410 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-02 08:33:32 +00:00
2021-04-01 Yusuke Suzuki <ysuzuki@apple.com>
[WTF] Introduce RobinHoodHashTable
https://bugs.webkit.org/show_bug.cgi?id=223895
Reviewed by Fil Pizlo.
This patch implements RobinHoodHashTable[1]. We don't use it as a default hashtable since it has different performance v.s. memory-saving characteristics,
and this patch's goal is not tackling on making this default. Rather, the goal of this patch is introducing it to non-performance sensitive area quickly
so that we can save memory. RobinHoodHashTable more frequently computes hash value compared to HashTable, so this is not drop-in replacement for the existing
one. But still, this is useful since we know that "while there are many small HashTables and they holds much memory, there are super large HashTables and
they holds almost same amount of memory while they are a few.". This patch's goal is applying this RobinHoodHashTable to these "large, but a few" singleton tables.
RobinHoodHashTable maintains distance-from-initial-bucket (DIB) small by adjusting existing entries when inserting. When inserting, if we found that the
existing entry has less DIB than the current inserting entry's DIB, then we swap entries, and insert the existing entry to the other place. This is giving
some good DIB from rich entry to poor entry (that's why it is called RobinHood Hashing), and making average DIB lower. And this algorithm adds good invariant
that, when looking up an entry, and we found that existing entry has smaller DIB, then we can stop searching in the middle of the chain since we know that
we should swap entries when this happened when inserting. These two tricks maintain HashTable performance even under significantly high load factor: 90% load-factor
just works. 95% load-factor regress adding performance, but still it does not become catastrophic compared to normal open-addressing HashTable.
We introduce RobinHoodHashTable, and adding several kinds of tables based on load-factors.
1. MemoryCompactLookupOnlyRobinHoodHashSet / HashMap
This has 95% load-factor. This is suitable for sets and maps which is mostly-constant: constructing once, and looking up repeatedly. In WebKit, there are so
many this kind of tables e.g. singleton HashMap for various kinds of things. We can use this super high load-factor table so that we can save memory even while
we are maintains fast HashTable lookup.
2. MemoryCompactRobinHoodHashSet / HashMap
This has 90% load-factor. It just works, and we can try using it if sets and maps are significantly performance intensive.
3. FastRobinHoodHashSet / HashMap
This has 75% load-factor. This is still good compared to HashSet and HashMap since they are using 50% load-factor for large sized tables. This has very slightly performance regressed
compared to 50% load-factor large HashSet and HashMap, but if that is not performance intensive (e.g. AtomStringTable is one of the most performance intensive table), this is good.
In this patch, we replace many singleton HashSet / HashMap with RobinHoodHashTable.
[1]: https://www.sebastiansylvan.com/post/robin-hood-hashing-should-be-your-default-hash-table-implementation/
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/Forward.h:
* wtf/HashMap.h:
(WTF::Y>::swap):
(WTF::Y>::size const):
(WTF::Y>::capacity const):
(WTF::Y>::isEmpty const):
(WTF::Y>::begin):
(WTF::Y>::end):
(WTF::Y>::begin const):
(WTF::Y>::end const):
(WTF::Y>::find):
(WTF::Y>::find const):
(WTF::Y>::contains const):
(WTF::Y>::get const):
(WTF::Y>::inlineGet const):
(WTF::TableTraitsArg>::inlineSet):
(WTF::TableTraitsArg>::inlineAdd):
(WTF::TableTraitsArg>::inlineEnsure):
(WTF::TableTraitsArg>::set):
(WTF::TableTraitsArg>::add):
(WTF::TableTraitsArg>::fastAdd):
(WTF::TableTraitsArg>::ensure):
(WTF::Y>::remove):
(WTF::Y>::removeIf):
(WTF::Y>::clear):
(WTF::Y>::take):
(WTF::Y>::checkConsistency const):
(WTF::Y>::isValidKey):
(WTF::operator==):
(WTF::operator!=):
(WTF::X>::swap): Deleted.
(WTF::X>::size const): Deleted.
(WTF::X>::capacity const): Deleted.
(WTF::X>::isEmpty const): Deleted.
(WTF::X>::begin): Deleted.
(WTF::X>::end): Deleted.
(WTF::X>::begin const): Deleted.
(WTF::X>::end const): Deleted.
(WTF::X>::find): Deleted.
(WTF::X>::find const): Deleted.
(WTF::X>::contains const): Deleted.
(WTF::X>::get const): Deleted.
(WTF::X>::inlineGet const): Deleted.
(WTF::MappedTraitsArg>::inlineSet): Deleted.
(WTF::MappedTraitsArg>::inlineAdd): Deleted.
(WTF::MappedTraitsArg>::inlineEnsure): Deleted.
(WTF::MappedTraitsArg>::set): Deleted.
(WTF::MappedTraitsArg>::add): Deleted.
(WTF::MappedTraitsArg>::fastAdd): Deleted.
(WTF::MappedTraitsArg>::ensure): Deleted.
(WTF::MappedTraits>::get const): Deleted.
(WTF::MappedTraits>::inlineGet const): Deleted.
(WTF::X>::remove): Deleted.
(WTF::X>::removeIf): Deleted.
(WTF::X>::clear): Deleted.
(WTF::MappedTraits>::take): Deleted.
(WTF::X>::take): Deleted.
(WTF::X>::checkConsistency const): Deleted.
(WTF::X>::isValidKey): Deleted.
* wtf/HashSet.h:
(WTF::W>::swap):
(WTF::W>::size const):
(WTF::W>::capacity const):
(WTF::W>::isEmpty const):
(WTF::W>::begin const):
(WTF::W>::end const):
(WTF::W>::find const):
(WTF::W>::contains const):
(WTF::TableTraits>::find const):
(WTF::TableTraits>::contains const):
(WTF::TableTraits>::ensure):
(WTF::W>::add):
(WTF::W>::addVoid):
(WTF::TableTraits>::add):
(WTF::W>::remove):
(WTF::W>::removeIf):
(WTF::W>::clear):
(WTF::W>::take):
(WTF::W>::takeAny):
(WTF::TableTraits>::remove):
(WTF::TableTraits>::take):
(WTF::W>::isValidValue):
(WTF::= const):
(WTF::W>::checkConsistency const):
(WTF::V>::swap): Deleted.
(WTF::V>::size const): Deleted.
(WTF::V>::capacity const): Deleted.
(WTF::V>::isEmpty const): Deleted.
(WTF::V>::begin const): Deleted.
(WTF::V>::end const): Deleted.
(WTF::V>::find const): Deleted.
(WTF::V>::contains const): Deleted.
(WTF::Traits>::find const): Deleted.
(WTF::Traits>::contains const): Deleted.
(WTF::Traits>::ensure): Deleted.
(WTF::V>::add): Deleted.
(WTF::V>::addVoid): Deleted.
(WTF::Traits>::add): Deleted.
(WTF::V>::remove): Deleted.
(WTF::V>::removeIf): Deleted.
(WTF::V>::clear): Deleted.
(WTF::V>::take): Deleted.
(WTF::V>::takeAny): Deleted.
(WTF::Traits>::remove): Deleted.
(WTF::Traits>::take): Deleted.
(WTF::V>::isValidValue): Deleted.
(WTF::V>::checkConsistency const): Deleted.
* wtf/HashTable.h:
(WTF::addIterator):
(WTF::removeIterator):
(WTF::invalidateIterators):
(WTF::HashTable::~HashTable):
(WTF::HashTable::random):
(WTF::KeyTraits>::inlineLookup):
(WTF::KeyTraits>::lookupForWriting):
(WTF::KeyTraits>::fullLookupForWriting):
(WTF::KeyTraits>::addUniqueForInitialization):
(WTF::KeyTraits>::add):
(WTF::KeyTraits>::addPassingHashCode):
(WTF::KeyTraits>::removeAndInvalidateWithoutEntryConsistencyCheck):
(WTF::KeyTraits>::removeAndInvalidate):
(WTF::KeyTraits>::clear):
(WTF::KeyTraits>::swap):
(WTF::KeyTraits>::HashTable):
(WTF::HashTable::invalidateIterators): Deleted.
(WTF::KeyTraits>::invalidateIterators): Deleted.
* wtf/RobinHoodHashMap.h: Added.
* wtf/RobinHoodHashSet.h: Added.
* wtf/RobinHoodHashTable.h: Added.
(WTF::RobinHoodHashTable::~RobinHoodHashTable):
(WTF::RobinHoodHashTable::begin):
(WTF::RobinHoodHashTable::end):
(WTF::RobinHoodHashTable::begin const):
(WTF::RobinHoodHashTable::end const):
(WTF::RobinHoodHashTable::random):
(WTF::RobinHoodHashTable::random const):
(WTF::RobinHoodHashTable::size const):
(WTF::RobinHoodHashTable::capacity const):
(WTF::RobinHoodHashTable::isEmpty const):
(WTF::RobinHoodHashTable::reserveInitialCapacity):
(WTF::RobinHoodHashTable::add):
(WTF::RobinHoodHashTable::find):
(WTF::RobinHoodHashTable::find const):
(WTF::RobinHoodHashTable::contains const):
(WTF::RobinHoodHashTable::isEmptyBucket):
(WTF::RobinHoodHashTable::isEmptyOrDeletedBucket):
(WTF::RobinHoodHashTable::lookup):
(WTF::RobinHoodHashTable::checkTableConsistency):
(WTF::RobinHoodHashTable::internalCheckTableConsistency const):
(WTF::RobinHoodHashTable::internalCheckTableConsistencyExceptSize const):
(WTF::RobinHoodHashTable::internalCheckTableConsistencyExceptSize):
(WTF::RobinHoodHashTable::internalCheckTableConsistency):
(WTF::RobinHoodHashTable::shouldExpand):
(WTF::RobinHoodHashTable::computeTableHash):
(WTF::RobinHoodHashTable::shouldExpand const):
(WTF::RobinHoodHashTable::shouldShrink const):
(WTF::RobinHoodHashTable::shrink):
(WTF::RobinHoodHashTable::deleteBucket):
(WTF::RobinHoodHashTable::desiredIndex):
(WTF::RobinHoodHashTable::probeDistance):
(WTF::RobinHoodHashTable::makeIterator):
(WTF::RobinHoodHashTable::makeConstIterator const):
(WTF::RobinHoodHashTable::makeKnownGoodIterator):
(WTF::RobinHoodHashTable::makeKnownGoodConstIterator const):
(WTF::RobinHoodHashTable::checkTableConsistencyExceptSize):
(WTF::RobinHoodHashTable::tableSize const):
(WTF::RobinHoodHashTable::tableSizeMask const):
(WTF::RobinHoodHashTable::keyCount const):
(WTF::RobinHoodHashTable::tableHash const):
(WTF::SizePolicy>::checkKey):
(WTF::SizePolicy>::lookup):
(WTF::SizePolicy>::inlineLookup):
(WTF::SizePolicy>::initializeBucket):
(WTF::SizePolicy>::add):
(WTF::SizePolicy>::maintainProbeDistanceForAdd):
(WTF::SizePolicy>::addPassingHashCode):
(WTF::SizePolicy>::reinsert):
(WTF::SizePolicy>::find):
(WTF::SizePolicy>::find const):
(WTF::SizePolicy>::contains const):
(WTF::SizePolicy>::removeAndInvalidateWithoutEntryConsistencyCheck):
(WTF::SizePolicy>::removeAndInvalidate):
(WTF::SizePolicy>::remove):
(WTF::SizePolicy>::removeWithoutEntryConsistencyCheck):
(WTF::SizePolicy>::allocateTable):
(WTF::SizePolicy>::deallocateTable):
(WTF::SizePolicy>::expand):
(WTF::SizePolicy>::computeBestTableSize):
(WTF::SizePolicy>::shrinkToBestSize):
(WTF::SizePolicy>::rehash):
(WTF::SizePolicy>::clear):
(WTF::SizePolicy>::RobinHoodHashTable):
(WTF::SizePolicy>::swap):
(WTF::=):
(WTF::SizePolicy>::checkTableConsistency const):
(WTF::SizePolicy>::checkTableConsistencyExceptSize const):
* wtf/text/AtomStringHash.h:
* wtf/text/AtomStringImpl.cpp:
* wtf/text/AtomStringTable.cpp:
(WTF::AtomStringTable::~AtomStringTable):
* wtf/text/AtomStringTable.h:
(WTF::AtomStringTable::table):
* wtf/text/StringHash.h:
2021-04-01 Kate Cheney <katherine_cheney@apple.com>
Clear network website data when a user clears history/website data
https://bugs.webkit.org/show_bug.cgi?id=224030
<rdar://problem/75288338>
Reviewed by David Kilzer.
* wtf/cocoa/SoftLinking.h:
Add a new soft link macro to link umbrella private frameworks. We need
this to support internal additions we need to clear network domain data.
2021-04-01 Chris Dumez <cdumez@apple.com>
REGRESSION(r275267): [GTK][WPE] 12 new crashes on service-workers layout tests
https://bugs.webkit.org/show_bug.cgi?id=224059
Reviewed by Carlos Alberto Lopez Perez.
Have the glib implementation of FileSystem::writeToFile() return early when the size to
write is 0, instead of calling g_output_stream_write_all(). It appears that passing a
NULL buffer to g_output_stream_write_all() crashes, even if size is 0.
* wtf/glib/FileSystemGlib.cpp:
(WTF::FileSystemImpl::writeToFile):
2021-03-31 Jiewen Tan <jiewen_tan@apple.com>
Allow ASCWebKitSPISupport to be used on macOS
https://bugs.webkit.org/show_bug.cgi?id=224036
<rdar://76028645>
Reviewed by Brent Fulgham.
* wtf/PlatformHave.h:
2021-03-31 Sam Weinig <weinig@apple.com>
Ease experimentation by enabling <model> if SEPARATED_MODEL is being used
https://bugs.webkit.org/show_bug.cgi?id=224011
Reviewed by Tim Horton.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
There is little point to experimenting with SEPARATED_MODEL if <model> is disabled.
2021-03-31 Antoine Quint <graouts@webkit.org>
Remove CA_WHERE_ADDITIVE_TRANSFORMS_ARE_REVERSED
https://bugs.webkit.org/show_bug.cgi?id=224000
Reviewed by Simon Fraser.
Since trunk is no longer maintained on macOS versions earlier than 10.15,
we can remove this compile-time flag.
* wtf/PlatformHave.h:
Service Worker scripts use too much memory in the network process https://bugs.webkit.org/show_bug.cgi?id=223808 <rdar://75637093> Reviewed by Geoff Garen. Source/WebCore: Previously, the network process would store service worker scripts in a SQLite database. When starting to use service workers, we would load all those scripts from the database into memory. This would use a decent amount of memory in the network process. To address the issue, the approach is this patch is to store the scripts as separate files on the filesystem instead. This when, when loading them, we can simply mmap() them and greatly reduce dirty memory usage. Note that the service worker process (which may be the WebContent process) also keeps a copy of the imported service worker scripts for the service workers it is running. More work will be needed in a follow-up but we should be able to extend the approach so that the service worker process would only have a mmap'd version of those scripts. This would reduce dirty memory usage on the WebContent/ServiceWorker process side as well. I am doing this separately though to reduce patch size and facilitate review. No new tests, there should be no Web-facing behavior change, just a decreased dirty memory usage in the network process when service workers are used. I did manual memory testing with a very large service worker that had one ~100MB main script, importing another ~100MB script. Here are the memory results without my change: - Networking (Dirty): 238MB (cold) / 331MB (warm) - WebContent (Dirty): 441MB (cold) / 857MB (warm) Here are the memory results with my change: - Networking (Dirty): 22MB (cold) / 14MB (warm) - WebContent (Dirty): 440MB (cold) / 438MB (warm) This shows that ALL memory from the scripts in the network process is no longer marked as dirty. We also see a significant progression in the WebProcess in the warm case, since the scripts are coming from the network process as shared memory in this case. There is no progression in the WebProcess in the cold case yet, since the script were just downloaded and are coming from the WebProcess to the NetworkProcess. In a follow-up, the network process could send shared memory back to the WebProcess, after saving the scripts to disk, so that the WebProcess can replace the copies of its scripts and save more memory. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: Add new SWScriptStorage class to the project. * inspector/agents/worker/ServiceWorkerAgent.cpp: (WebCore::ServiceWorkerAgent::getInitializationInfo): Convert the script type from SharedBuffer to String. * platform/SharedBuffer.cpp: (WebCore::SharedBuffer::operator== const): Fix assertions that were hitting when comparing to empty SharedBuffers (offset would be 0 and size would be 0). This was caught by API tests since we have some service worker API tests that use empty worker scripts. * workers/WorkerScriptLoader.cpp: (WebCore::WorkerScriptLoader::loadSynchronously): Add some conversion from String to SharedBuffer to the script, and vice-versa, in the service worker case. * workers/service/ServiceWorkerContextData.cpp: (WebCore::ServiceWorkerContextData::isolatedCopy const): (WebCore::scriptBufferToString): (WebCore::stringToScriptBuffer): * workers/service/ServiceWorkerContextData.h: (WebCore::ServiceWorkerContextData::ImportedScript::isolatedCopy const): (WebCore::ServiceWorkerContextData::ImportedScript::decode): (WebCore::ServiceWorkerContextData::decode): - Store scripts as SharedBuffer instead of String, so that they can hold mmap'd data. - Add scriptBufferToString() / stringToScriptBuffer() utility functions to convert script sources between String and SharedBuffer. * workers/service/context/ServiceWorkerThread.cpp: (WebCore::ServiceWorkerThread::ServiceWorkerThread): Convert from script from SharedBuffer to String. * workers/service/server/RegistrationDatabase.cpp: (WebCore::recordsTableSchema): Update database schema and bump version now that we no longer store the service worker script inside the SQLite database. Instead, those scripts are stored separately on the filesystem via SWScriptStorage. (WebCore::ImportedScriptAttributes::encode const): (WebCore::ImportedScriptAttributes::decode): Introduce new ImportedScriptAttributes struct which contains all the data members of ServiceWorkerContextData::ImportedScript, except for the actual script source. We now save a HashMap of ImportedScriptAttributes in the databasae instead of HashMap of ImportedScript since we no longer want to store imported script sources in the database, but rather store them separately on the file system. (WebCore::stripScriptSources): Utility function to convert a HashMap of ServiceWorkerContextData::ImportedScript into a HashMap of ImportedScriptAttributes (identical but without the script source), ready to save in the SQLite database. (WebCore::populateScriptSourcesFromDisk): Utility function to construct a HashMap of ServiceWorkerContextData::ImportedScript from a HasMap of ImportedScriptAttributes, coming from the SQLiteDatabase. The missing script sources are fetched from the disk via SWScriptStorage. (WebCore::RegistrationDatabase::~RegistrationDatabase): Make sure we destroy the SWScriptStorage on the background queue for thread-safety. (WebCore::RegistrationDatabase::scriptStorageDirectory const): Returns the path on the filesystem where service worker scripts are stored. (WebCore::RegistrationDatabase::scriptStorage): Constructs (if necessary) a SWScriptStorage and return it. (WebCore::RegistrationDatabase::clearAll): Make sure we clear all the service worker scripts on disk in addition to the database, now that they are stored separately. (WebCore::RegistrationDatabase::doPushChanges): - Stop storing the script sources in the SQLite database, and instead store them as separate files on the file system via SWScriptStorage. - Improve logging - When done storing the scripts to disk, send these new mmap'd versions back to the SWServerWorker on the main thread, so that it can replace it's heavy script sources with these ones. This helps reduce memory usage. (WebCore::RegistrationDatabase::importRecords): - Load the script sources from the disk via SWScriptStorage, now that they are no longer stored in the SQLite database. - Improve logging. * workers/service/server/RegistrationDatabase.h: * workers/service/server/RegistrationStore.cpp: (WebCore::RegistrationStore::didSaveWorkerScriptsToDisk): * workers/service/server/RegistrationStore.h: Pass scripts that were saved to disk from the store to the SWServerWorker so that it can replace its scripts sources with those new mmap'd version, in order to save memory. * workers/service/server/SWScriptStorage.cpp: Added. (WebCore::hashURL): (WebCore::SWScriptStorage::SWScriptStorage): (WebCore::SWScriptStorage::registrationDirectory const): (WebCore::SWScriptStorage::scriptPath const): (WebCore::SWScriptStorage::store): (WebCore::SWScriptStorage::retrieve): (WebCore::SWScriptStorage::clear): * workers/service/server/SWScriptStorage.h: Added. Add SWScriptStorage to deal with the storage / retrieval of Service Worker scripts to / from disk, as files on the file system. When going a retrieval, we return a script as a SharedBuffer which usually contains mmap'd() data (we don't use mmap() for files that are smaller than the PAGE_SIZE). The scripts reside in a Scripts/ folder, beside the database. The scripts are separated by origin (using SHA256 of the origin as folder name with salt), and then by registration (by using SHA256 of the registration scope as subfolder name with salt). The file name for the script is a SHA256 of the script URL with salt. * workers/service/server/SWServer.cpp: (WebCore::SWServer::didSaveWorkerScriptsToDisk): Pass scripts that were saved to disk from the store to the SWServerWorker so that it can replace its scripts sources with those new mmap'd version, in order to save memory. (WebCore::SWServer::updateWorker): Convert script from String to SharedBuffer. * workers/service/server/SWServerJobQueue.cpp: (WebCore::SWServerJobQueue::scriptFetchFinished): Convert script from SharedBuffer to String. * workers/service/server/SWServerToContextConnection.cpp: (WebCore::SWServerToContextConnection::setScriptResource): * workers/service/server/SWServerToContextConnection.h: Take in a ServiceWorkerContextData::ImportedScript for convenience, instead of taking all its data members as separate parameters. * workers/service/server/SWServerWorker.cpp: (WebCore::SWServerWorker::SWServerWorker): * workers/service/server/SWServerWorker.h: (WebCore::SWServerWorker::script const): Use SharedBuffer type for script instead of String type, so that we can hold on the mmap'd data and reduce memory usage. Source/WebKit: * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in: Pass a ServiceWorkerContextData::ImportedScript struct in the SetScriptResource IPC for convenience. We used to pass the ImportedScript data members separately. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::clearAllCachesFromDisk): (WebKit::CacheStorage::Engine::clearCachesForOriginFromDirectories): (WebKit::CacheStorage::Engine::deleteNonEmptyDirectoryOnBackgroundThread): * NetworkProcess/cache/CacheStorageEngine.h: * NetworkProcess/cache/NetworkCacheFileSystem.cpp: * NetworkProcess/cache/NetworkCacheFileSystem.h: * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::deleteOldVersions): Drop deleteDirectoryRecursively() implementation and use the existing FileSystem::deleteNonEmptyDirectory() in wtf instead. * NetworkProcess/cache/NetworkCacheData.cpp: (WebKit::NetworkCache::Data::mapToFile const): Moved some of the mapToFile() logic to WTF, so that it can be reused. * Shared/WebCoreArgumentCoders.cpp: (IPC::encodeSharedBuffer): (IPC::decodeSharedBuffer): Update SharedBuffer's IPC argument coder to distinguish a null SharedBuffer and an empty one. We now use SharedBuffer to store service worker script sources and it is possible for the script sources to be empty (and they are in some of our API tests). * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::setScriptResource): Pass a ServiceWorkerContextData::ImportedScript struct in the SetScriptResource IPC for convenience. We used to pass the ImportedScript data members separately. Source/WTF: * wtf/FileSystem.cpp: (WTF::FileSystemImpl::deleteNonEmptyDirectory): Add an implementation of FileSystem::deleteNonEmptyDirectory() on all supported platforms. We previously only had implemetations for Cocoa and Windows. (WTF::FileSystemImpl::mapToFile): Moved most of the mapToFile() logic from NetworkCacheData::mapToFile() to FileSystem, so that it can be reused by the new SWScriptStorage class. It creates the destination file, mmap's it, writes the provided data to it and then returns the mmap'd file. (WTF::FileSystemImpl::readOrMakeSalt): Move readOrMakeSalt() from NetworkCacheData to FileSystem so that it can be reused by the new SWScriptStorage. * wtf/FileSystem.h: Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WebKitCocoa/SimpleServiceWorkerRegistrations-4.sqlite3: Removed. Drop outdated pre-baked service worker registration database as it is no longer needed and it is a pain to keep up to date. * TestWebKitAPI/Tests/WTF/FileSystem.cpp: (TestWebKitAPI::TEST_F): Add API test coverage for FileSystem::deleteNonEmptyDirectory(). It is not a new API but it had no tests, it used more in this patch and we now have an implementation on all supported platforms. * TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm: * TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm: - Tweak service worker tests so that they expect a version 6 database instead of version 5, since I updated the database scheme and bumped the version. - Update test that was relying on a pre-baked service worker database file (with old schema) and have it dynamically generate the database instead by loading a page that registers a service worker. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275267 268f45cc-cd09-0410-ab3c-d52691b4dbfc Canonical link: https://commits.webkit.org/235952@main
2021-03-31 04:25:00 +00:00
2021-03-30 Chris Dumez <cdumez@apple.com>
Service Worker scripts use too much memory in the network process
https://bugs.webkit.org/show_bug.cgi?id=223808
<rdar://75637093>
Reviewed by Geoff Garen.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::deleteNonEmptyDirectory):
Add an implementation of FileSystem::deleteNonEmptyDirectory() on all supported platforms.
We previously only had implemetations for Cocoa and Windows.
(WTF::FileSystemImpl::mapToFile):
Moved most of the mapToFile() logic from NetworkCacheData::mapToFile() to FileSystem, so that
it can be reused by the new SWScriptStorage class. It creates the destination file, mmap's it,
writes the provided data to it and then returns the mmap'd file.
(WTF::FileSystemImpl::readOrMakeSalt):
Move readOrMakeSalt() from NetworkCacheData to FileSystem so that it can be reused by the new
SWScriptStorage.
* wtf/FileSystem.h:
JSGlobalObject's m_customGetterFunctionMap and m_customSetterFunctionMap should be sets, not maps, and should use both the identifier and function pointer as the key https://bugs.webkit.org/show_bug.cgi?id=223613 Reviewed by Saam Barati. Source/JavaScriptCore: - Adds a generic WeakGCSet class to go with the existing WeakGCMap. - Renames WeakGCMapBase to WeakGCHashTable, moves it to its own file and now uses it as the base class of both WeakGCSet and WeakGCMap. - Replaces JSGlobalObject's customGetterFunctionMap/customSetterFunctionMap with customGetterFunctionSet/customSetterFunctionSet, using the new WeakGCSet, and updates them to use both the function pointer and property name for the key, rather than just the function pointer which is what the previous code did. This allows multiple custom functions to use the same underlying function pointer as long as they have distinct property names, which is going to be used to optimize the bindings for CSSStyleDeclaration. * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: Add new files. * heap/Heap.cpp: (JSC::Heap::runEndPhase): (JSC::Heap::pruneStaleEntriesFromWeakGCHashTables): (JSC::Heap::registerWeakGCHashTable): (JSC::Heap::unregisterWeakGCHashTable): (JSC::Heap::pruneStaleEntriesFromWeakGCMaps): Deleted. (JSC::Heap::registerWeakGCMap): Deleted. (JSC::Heap::unregisterWeakGCMap): Deleted. * heap/Heap.h: Update for new name. WeakGCMapBase -> WeakGCHashTable. * runtime/JSCInlines.h: Add WeakGCSetInlines.h * runtime/JSCustomGetterFunction.cpp: (JSC::JSC_DEFINE_HOST_FUNCTION): (JSC::JSCustomGetterFunction::JSCustomGetterFunction): (JSC::JSCustomGetterFunction::create): * runtime/JSCustomGetterFunction.h: * runtime/JSCustomSetterFunction.cpp: (JSC::JSC_DEFINE_HOST_FUNCTION): (JSC::JSCustomSetterFunction::JSCustomSetterFunction): (JSC::JSCustomSetterFunction::create): * runtime/JSCustomSetterFunction.h: Add helper type CustomFunctionPointer and helper function customFunctionPointer() to allow some generic hashing code to run on either JSCustomGetterFunction or JSCustomSetterFunction. * runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::JSGlobalObject): * runtime/JSGlobalObject.h: (JSC::JSGlobalObject::WeakCustomGetterOrSetterHash::hash): (JSC::JSGlobalObject::WeakCustomGetterOrSetterHash::equal): (JSC::JSGlobalObject::customGetterFunctionSet): (JSC::JSGlobalObject::customSetterFunctionSet): (JSC::JSGlobalObject::customGetterFunctionMap): Deleted. (JSC::JSGlobalObject::customSetterFunctionMap): Deleted. Replace m_customGetterFunctionMap/m_customSetterFunctionMap with m_customGetterFunctionSet/m_customSetterFunctionSet. As the key is included in the value, it saves space to use a set rather than a map. We now also hash and compare both the function pointer and the property name to allow sharing implementations. * runtime/JSObject.cpp: (JSC::WeakCustomGetterOrSetterHashTranslator::hash): (JSC::WeakCustomGetterOrSetterHashTranslator::equal): (JSC::createCustomGetterFunction): (JSC::createCustomSetterFunction): Update creation functions to use the new sets, making use of the ensureValue function and a HashTranslator allowing the use of a std::pair<PropertyName, FunctionPointer> as an alternative lookup key. This allows us to avoid creating the JSCustomGetterFunction/JSCustomSetterFunction pointer if one with the same property name and function pointer are already in the set. * runtime/WeakGCHashTable.h: Added. (JSC::WeakGCHashTable::~WeakGCHashTable): Moved from WeakGCMap and renamed as it is now the base of both WeakGCMap and WeakGCSet. * runtime/WeakGCMap.h: Update to use new WeakGCHashTable base class. * runtime/WeakGCMapInlines.h: (JSC::KeyTraitsArg>::WeakGCMap): (JSC::KeyTraitsArg>::~WeakGCMap): Update for new Heap function names for WeakGCHashTable. * runtime/WeakGCSet.h: Added. * runtime/WeakGCSetInlines.h: Added. (JSC::TraitsArg>::WeakGCSet): (JSC::TraitsArg>::~WeakGCSet): (JSC::TraitsArg>::find): (JSC::TraitsArg>::find const): (JSC::TraitsArg>::contains const): (JSC::TraitsArg>::pruneStaleEntries): Added a minimal WeakGCSet based on WeakGCMap. Source/WTF: Adds a heterogenous HashSet::ensure, which allows lazy construction of the value to insert into the HashSet only if the heterogenous key (e.g. a key + HashTranslator that are not the same as the HashSet's ValueType) does not match any item in the set. For example given a set of ExpensiveToConstruct, but uniquely identifiable by CheapToConstruct: HashSet<ExpensiveToConstruct> hashSet; ... struct Translator { static unsigned hash(const CheapToConstruct& key) { return key.hash(); } static bool equal(const ExpensiveToConstruct& a, const CheapToConstruct& b) { return a == b; } }; hashSet.ensure<Translator>(CheapToConstruct { ... }, [] { return ExpensiveToConstruct { ... }; }); This will be used by the custom getter/setter sets to avoid constructing the GC objects unless they are really needed. Also took the opertunity to replace some typedefs with usings, and fixed some comments. * wtf/HashSet.h: (WTF::Traits>::ensure): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275261 268f45cc-cd09-0410-ab3c-d52691b4dbfc Canonical link: https://commits.webkit.org/235948@main
2021-03-31 02:55:38 +00:00
2021-03-30 Sam Weinig <weinig@apple.com>
JSGlobalObject's m_customGetterFunctionMap and m_customSetterFunctionMap should be sets, not maps, and should use both the identifier and function pointer as the key
https://bugs.webkit.org/show_bug.cgi?id=223613
Reviewed by Saam Barati.
Adds a heterogenous HashSet::ensure, which allows lazy construction of the value to
insert into the HashSet only if the heterogenous key (e.g. a key + HashTranslator
that are not the same as the HashSet's ValueType) does not match any item in the
set. For example given a set of ExpensiveToConstruct, but uniquely identifiable
by CheapToConstruct:
HashSet<ExpensiveToConstruct> hashSet;
...
struct Translator {
static unsigned hash(const CheapToConstruct& key)
{
return key.hash();
}
static bool equal(const ExpensiveToConstruct& a, const CheapToConstruct& b)
{
return a == b;
}
};
hashSet.ensure<Translator>(CheapToConstruct { ... }, [] {
return ExpensiveToConstruct { ... };
});
This will be used by the custom getter/setter sets to avoid constructing the GC objects
unless they are really needed.
Also took the opertunity to replace some typedefs with usings, and fixed some comments.
* wtf/HashSet.h:
(WTF::Traits>::ensure):
2021-03-30 Mark Lam <mark.lam@apple.com>
Add disableForwardingVPrintfStdErrToOSLog() and use it in the jsc shell.
https://bugs.webkit.org/show_bug.cgi?id=223963
Reviewed by Saam Barati.
* wtf/Assertions.cpp:
(WTF::disableForwardingVPrintfStdErrToOSLog):
* wtf/Assertions.h:
* wtf/WTFConfig.h:
2021-03-29 Alex Christensen <achristensen@webkit.org>
Use terminate_with_reason instead of xpc_connection_kill
https://bugs.webkit.org/show_bug.cgi?id=223618
Reviewed by Darin Adler.
* wtf/spi/darwin/XPCSPI.h:
2021-03-28 Cameron McCormack <heycam@apple.com>
Enable AspectRatioOfImgFromWidthAndHeightEnabled for WebKitLegacy.
https://bugs.webkit.org/show_bug.cgi?id=223815
Reviewed by Sam Weinig.
There's no reason this is enabled for WebKit and not WebKitLegacy.
And set WebCore = true since this feature could conceivably be
used in SVG images.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
Remove ENABLE_INDEXED_DATABASE & ENABLE_INDEXED_DATABASE_IN_WORKERS, it seems like it is on for all ports https://bugs.webkit.org/show_bug.cgi?id=223810 Reviewed by Simon Fraser. Source/JavaScriptCore: * inspector/protocol/IndexedDB.json: Update for remove ENABLE_INDEXED_DATABASE conditional. Source/WebCore: Remove ENABLE_INDEXED_DATABASE & ENABLE_INDEXED_DATABASE_IN_WORKERS conditionals. * Modules/indexeddb/DOMWindow+IndexedDatabase.idl: * Modules/indexeddb/DOMWindowIndexedDatabase.cpp: * Modules/indexeddb/DOMWindowIndexedDatabase.h: * Modules/indexeddb/IDBActiveDOMObject.h: * Modules/indexeddb/IDBCursor.cpp: * Modules/indexeddb/IDBCursor.h: * Modules/indexeddb/IDBCursor.idl: * Modules/indexeddb/IDBCursorDirection.idl: * Modules/indexeddb/IDBCursorWithValue.cpp: * Modules/indexeddb/IDBCursorWithValue.h: * Modules/indexeddb/IDBCursorWithValue.idl: * Modules/indexeddb/IDBDatabase.cpp: * Modules/indexeddb/IDBDatabase.h: * Modules/indexeddb/IDBDatabase.idl: * Modules/indexeddb/IDBDatabaseIdentifier.cpp: * Modules/indexeddb/IDBDatabaseIdentifier.h: * Modules/indexeddb/IDBDatabaseNameAndVersionRequest.cpp: * Modules/indexeddb/IDBDatabaseNameAndVersionRequest.h: * Modules/indexeddb/IDBFactory.cpp: * Modules/indexeddb/IDBFactory.h: * Modules/indexeddb/IDBFactory.idl: * Modules/indexeddb/IDBGetAllResult.cpp: * Modules/indexeddb/IDBGetAllResult.h: * Modules/indexeddb/IDBGetResult.cpp: * Modules/indexeddb/IDBGetResult.h: * Modules/indexeddb/IDBIndex.cpp: * Modules/indexeddb/IDBIndex.h: * Modules/indexeddb/IDBIndex.idl: * Modules/indexeddb/IDBKey.cpp: * Modules/indexeddb/IDBKey.h: * Modules/indexeddb/IDBKeyData.cpp: * Modules/indexeddb/IDBKeyData.h: * Modules/indexeddb/IDBKeyPath.cpp: * Modules/indexeddb/IDBKeyPath.h: * Modules/indexeddb/IDBKeyRange.cpp: * Modules/indexeddb/IDBKeyRange.h: * Modules/indexeddb/IDBKeyRange.idl: * Modules/indexeddb/IDBKeyRangeData.cpp: * Modules/indexeddb/IDBKeyRangeData.h: * Modules/indexeddb/IDBObjectStore.cpp: * Modules/indexeddb/IDBObjectStore.h: * Modules/indexeddb/IDBObjectStore.idl: * Modules/indexeddb/IDBOpenDBRequest.cpp: * Modules/indexeddb/IDBOpenDBRequest.h: * Modules/indexeddb/IDBOpenDBRequest.idl: * Modules/indexeddb/IDBRecordIdentifier.h: * Modules/indexeddb/IDBRequest.cpp: * Modules/indexeddb/IDBRequest.h: * Modules/indexeddb/IDBRequest.idl: * Modules/indexeddb/IDBRequestCompletionEvent.cpp: * Modules/indexeddb/IDBRequestCompletionEvent.h: * Modules/indexeddb/IDBTransaction.cpp: * Modules/indexeddb/IDBTransaction.h: * Modules/indexeddb/IDBTransaction.idl: * Modules/indexeddb/IDBTransactionMode.h: * Modules/indexeddb/IDBTransactionMode.idl: * Modules/indexeddb/IDBValue.cpp: * Modules/indexeddb/IDBValue.h: * Modules/indexeddb/IDBVersionChangeEvent.cpp: * Modules/indexeddb/IDBVersionChangeEvent.h: * Modules/indexeddb/IDBVersionChangeEvent.idl: * Modules/indexeddb/IndexedDB.h: * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp: * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h: * Modules/indexeddb/client/IDBConnectionProxy.cpp: * Modules/indexeddb/client/IDBConnectionProxy.h: * Modules/indexeddb/client/IDBConnectionToServer.cpp: * Modules/indexeddb/client/IDBConnectionToServer.h: * Modules/indexeddb/client/IDBConnectionToServerDelegate.h: * Modules/indexeddb/client/TransactionOperation.cpp: * Modules/indexeddb/client/TransactionOperation.h: * Modules/indexeddb/server/IDBBackingStore.h: * Modules/indexeddb/server/IDBConnectionToClient.cpp: * Modules/indexeddb/server/IDBConnectionToClient.h: * Modules/indexeddb/server/IDBConnectionToClientDelegate.h: * Modules/indexeddb/server/IDBSerialization.cpp: * Modules/indexeddb/server/IDBSerialization.h: * Modules/indexeddb/server/IDBSerializationContext.cpp: * Modules/indexeddb/server/IDBSerializationContext.h: * Modules/indexeddb/server/IDBServer.cpp: * Modules/indexeddb/server/IDBServer.h: * Modules/indexeddb/server/IndexValueEntry.cpp: * Modules/indexeddb/server/IndexValueEntry.h: * Modules/indexeddb/server/IndexValueStore.cpp: * Modules/indexeddb/server/IndexValueStore.h: * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp: * Modules/indexeddb/server/MemoryBackingStoreTransaction.h: * Modules/indexeddb/server/MemoryCursor.cpp: * Modules/indexeddb/server/MemoryCursor.h: * Modules/indexeddb/server/MemoryIDBBackingStore.cpp: * Modules/indexeddb/server/MemoryIDBBackingStore.h: * Modules/indexeddb/server/MemoryIndex.cpp: * Modules/indexeddb/server/MemoryIndex.h: * Modules/indexeddb/server/MemoryIndexCursor.cpp: * Modules/indexeddb/server/MemoryIndexCursor.h: * Modules/indexeddb/server/MemoryObjectStore.cpp: * Modules/indexeddb/server/MemoryObjectStore.h: * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp: * Modules/indexeddb/server/MemoryObjectStoreCursor.h: * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: * Modules/indexeddb/server/SQLiteIDBBackingStore.h: * Modules/indexeddb/server/SQLiteIDBCursor.cpp: * Modules/indexeddb/server/SQLiteIDBCursor.h: * Modules/indexeddb/server/SQLiteIDBTransaction.cpp: * Modules/indexeddb/server/SQLiteIDBTransaction.h: * Modules/indexeddb/server/ServerOpenDBRequest.cpp: * Modules/indexeddb/server/ServerOpenDBRequest.h: * Modules/indexeddb/server/UniqueIDBDatabase.cpp: * Modules/indexeddb/server/UniqueIDBDatabase.h: * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp: * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h: * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp: * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h: * Modules/indexeddb/shared/IDBCursorInfo.cpp: * Modules/indexeddb/shared/IDBCursorInfo.h: * Modules/indexeddb/shared/IDBCursorRecord.h: * Modules/indexeddb/shared/IDBDatabaseInfo.cpp: * Modules/indexeddb/shared/IDBDatabaseInfo.h: * Modules/indexeddb/shared/IDBDatabaseNameAndVersion.h: * Modules/indexeddb/shared/IDBError.cpp: * Modules/indexeddb/shared/IDBError.h: * Modules/indexeddb/shared/IDBGetAllRecordsData.cpp: * Modules/indexeddb/shared/IDBGetAllRecordsData.h: * Modules/indexeddb/shared/IDBGetRecordData.cpp: * Modules/indexeddb/shared/IDBGetRecordData.h: * Modules/indexeddb/shared/IDBIndexInfo.cpp: * Modules/indexeddb/shared/IDBIndexInfo.h: * Modules/indexeddb/shared/IDBIterateCursorData.cpp: * Modules/indexeddb/shared/IDBIterateCursorData.h: * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp: * Modules/indexeddb/shared/IDBObjectStoreInfo.h: * Modules/indexeddb/shared/IDBRequestData.cpp: * Modules/indexeddb/shared/IDBRequestData.h: * Modules/indexeddb/shared/IDBResourceIdentifier.cpp: * Modules/indexeddb/shared/IDBResourceIdentifier.h: * Modules/indexeddb/shared/IDBResultData.cpp: * Modules/indexeddb/shared/IDBResultData.h: * Modules/indexeddb/shared/IDBTransactionInfo.cpp: * Modules/indexeddb/shared/IDBTransactionInfo.h: * Modules/indexeddb/shared/IndexKey.cpp: * Modules/indexeddb/shared/IndexKey.h: * WebCore.xcodeproj/project.pbxproj: * bindings/js/IDBBindingUtilities.cpp: * bindings/js/IDBBindingUtilities.h: * bindings/js/JSDOMConvertIndexedDB.h: * bindings/js/JSDOMGlobalObject.cpp: (WebCore::JSDOMGlobalObject::scriptExecutionContext const): (WebCore::scriptModuleLoader): * bindings/js/JSIDBCursorCustom.cpp: * bindings/js/JSIDBCursorWithValueCustom.cpp: * bindings/js/JSIDBIndexCustom.cpp: * bindings/js/JSIDBObjectStoreCustom.cpp: * bindings/js/JSIDBRequestCustom.cpp: * bindings/js/JSIDBSerializationGlobalObject.cpp: * bindings/js/JSIDBSerializationGlobalObject.h: * bindings/js/JSIDBTransactionCustom.cpp: * bindings/js/SerializedScriptValue.cpp: * bindings/js/SerializedScriptValue.h: * bindings/js/WebCoreJSClientData.cpp: (WebCore::JSVMClientData::JSVMClientData): * bindings/js/WebCoreJSClientData.h: * dom/Document.cpp: (WebCore::Document::idbConnectionProxy): (WebCore::Document::setBackForwardCacheState): * dom/Document.h: * dom/EmptyScriptExecutionContext.h: * dom/EventNames.in: * dom/EventTargetFactory.in: * dom/ScriptExecutionContext.h: * inspector/InspectorController.cpp: (WebCore::InspectorController::createLazyAgents): * inspector/agents/InspectorIndexedDBAgent.cpp: * inspector/agents/InspectorIndexedDBAgent.h: * loader/EmptyClients.cpp: * page/DatabaseProvider.h: * page/Page.cpp: (WebCore::Page::setSessionID): (WebCore::Page::clearIDBConnection): * page/Page.h: * testing/Internals.cpp: (WebCore::Internals::numberOfIDBTransactions const): * testing/Internals.h: * testing/Internals.idl: * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::WorkerGlobalScope): (WebCore::WorkerGlobalScope::prepareForDestruction): (WebCore::WorkerGlobalScope::idbConnectionProxy): (WebCore::WorkerGlobalScope::stopIndexedDatabase): (WebCore::WorkerGlobalScope::suspend): (WebCore::WorkerGlobalScope::resume): * workers/WorkerGlobalScope.h: * workers/WorkerMessagingProxy.cpp: (WebCore::WorkerMessagingProxy::startWorkerGlobalScope): * workers/WorkerThread.cpp: (WebCore::WorkerThread::WorkerThread): (WebCore::WorkerThread::idbConnectionProxy): * workers/WorkerThread.h: * workers/service/context/ServiceWorkerThreadProxy.cpp: (WebCore::idbConnectionProxy): * worklets/WorkletGlobalScope.h: Source/WebInspectorUI: * Versions/Inspector-iOS-14.0.json: * Versions/Inspector-iOS-14.5.json: Update for removed ENABLE_INDEXED_DATABASE conditional. Source/WebKit: Remove ENABLE_INDEXED_DATABASE & ENABLE_INDEXED_DATABASE_IN_WORKERS conditionals. * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp: * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h: * NetworkProcess/IndexedDB/WebIDBServer.cpp: * NetworkProcess/IndexedDB/WebIDBServer.h: * NetworkProcess/IndexedDB/WebIDBServer.messages.in: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::createNetworkConnectionToWebProcess): (WebKit::NetworkProcess::addWebsiteDataStore): (WebKit::NetworkProcess::destroySession): (WebKit::NetworkProcess::fetchWebsiteData): (WebKit::NetworkProcess::deleteWebsiteData): (WebKit::NetworkProcess::deleteWebsiteDataForOrigins): (WebKit::NetworkProcess::deleteAndRestrictWebsiteDataForRegistrableDomains): (WebKit::NetworkProcess::registrableDomainsWithWebsiteData): (WebKit::NetworkProcess::prepareToSuspend): (WebKit::NetworkProcess::resume): (WebKit::NetworkProcess::renameOriginInWebsiteData): (WebKit::NetworkProcess::storageQuotaManager): (WebKit::NetworkProcess::connectionToWebProcessClosed): * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::SessionStorageQuotaManager::idbRootPath const): * Shared/Databases/IndexedDB/IDBUtilities.cpp: * Shared/Databases/IndexedDB/IDBUtilities.h: * Shared/Databases/IndexedDB/WebIDBResult.cpp: * Shared/Databases/IndexedDB/WebIDBResult.h: * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder<IDBKeyPath>::decode): * Shared/WebCoreArgumentCoders.h: * Shared/WebsiteDataStoreParameters.cpp: (WebKit::WebsiteDataStoreParameters::encode const): (WebKit::WebsiteDataStoreParameters::decode): * Shared/WebsiteDataStoreParameters.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::addSession): (WebKit::NetworkProcessProxy::createSymLinkForFileUpgrade): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::parameters): * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp: * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h: * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in: * WebProcess/Databases/WebDatabaseProvider.cpp: (WebKit::WebDatabaseProvider::idbConnectionToServerForSession): * WebProcess/Databases/WebDatabaseProvider.h: * WebProcess/Network/NetworkProcessConnection.cpp: (WebKit::NetworkProcessConnection::didReceiveMessage): (WebKit::NetworkProcessConnection::didClose): (WebKit::NetworkProcessConnection::idbConnectionToServer): * WebProcess/Network/NetworkProcessConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::installServiceWorker): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::networkProcessConnectionClosed): Source/WebKitLegacy: Remove ENABLE_INDEXED_DATABASE & ENABLE_INDEXED_DATABASE_IN_WORKERS conditionals. * Storage/InProcessIDBServer.cpp: (InProcessIDBServer::dispatchTaskReply): * Storage/InProcessIDBServer.h: * Storage/WebDatabaseProvider.cpp: (WebDatabaseProvider::deleteAllDatabases): * Storage/WebDatabaseProvider.h: Source/WebKitLegacy/mac: Remove ENABLE_INDEXED_DATABASE & ENABLE_INDEXED_DATABASE_IN_WORKERS conditionals. * Storage/WebDatabaseManager.mm: (-[WebDatabaseManager deleteAllIndexedDatabases]): Source/WebKitLegacy/win: Remove ENABLE_INDEXED_DATABASE & ENABLE_INDEXED_DATABASE_IN_WORKERS conditionals. * WebDatabaseManager.cpp: (WebDatabaseManager::deleteAllIndexedDatabases): * storage/WebDatabaseProvider.cpp: (WebDatabaseProvider::indexedDatabaseDirectoryPath): Source/WTF: * wtf/PlatformEnable.h: * wtf/PlatformEnableCocoa.h: Remove ENABLE_INDEXED_DATABASE and ENABLE_INDEXED_DATABASE_IN_WORKERS. Tools: * Scripts/webkitperl/FeatureList.pm: Remove ENABLE_INDEXED_DATABASE & ENABLE_INDEXED_DATABASE_IN_WORKERS from FeatureList.pm. Canonical link: https://commits.webkit.org/235854@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275151 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-28 19:14:20 +00:00
2021-03-28 Sam Weinig <weinig@apple.com>
Remove ENABLE_INDEXED_DATABASE & ENABLE_INDEXED_DATABASE_IN_WORKERS, it seems like it is on for all ports
https://bugs.webkit.org/show_bug.cgi?id=223810
Reviewed by Simon Fraser.
* wtf/PlatformEnable.h:
* wtf/PlatformEnableCocoa.h:
Remove ENABLE_INDEXED_DATABASE and ENABLE_INDEXED_DATABASE_IN_WORKERS.
2021-03-27 Chris Dumez <cdumez@apple.com>
wtf/Vector.h:1276:88: runtime error: reference binding to null pointer of type 'const WebCore::Style::RuleFeature'
https://bugs.webkit.org/show_bug.cgi?id=223828
Reviewed by David Kilzer.
Fix issue found by UBSan in Vector::append(const U*, size_t):
wtf/Vector.h:1276:88: runtime error: reference binding to null pointer of type 'const WebCore::Style::RuleFeature'
wtf/Vector.h:1276:88: runtime error: reference binding to null pointer of type 'const WebCore::LayoutRect'
wtf/Vector.h:1276:88: runtime error: reference binding to null pointer of type 'const WTF::RefPtr<WebCore::CSSStyleSheet, WTF::RawPtrTraits<WebCore::CSSStyleSheet>, WTF::DefaultRefDerefTraits<WebCore::CSSStyleSheet> >'
* wtf/Vector.h:
(WTF::Malloc>::append):
Return early if dataSize is 0. For some call sites, the pointer may be null and dataSize is 0. In such cases,
we should just return early instead of proceeding and using the null pointer. I believe this can happen if
you call Vector::appendVector() with an empty Vector for example.
2021-03-26 Chris Dumez <cdumez@apple.com>
REGRESSION (r275038?): Perf test IndexedDB/stress/large-binary-keys.html failing with logging about memory pressure events
https://bugs.webkit.org/show_bug.cgi?id=223826
<rdar://problem/75906134>
Reviewed by Darin Adler.
Use RELEASE_LOG() instead of WTFLogAlways() to log memory pressure events, so that they don't
show on stdout in the performance tests and make them fail.
* wtf/cocoa/MemoryPressureHandlerCocoa.mm:
(WTF::MemoryPressureHandler::install):
Use PUICQuickboardController for text input when HAVE(QUICKBOARD_CONTROLLER) is defined https://bugs.webkit.org/show_bug.cgi?id=223809 <rdar://problem/56730407> Reviewed by Tim Horton. Source/WebKit: Enable `PUICQuickboardController` by default, and remove a runtime preference that previously disabled this feature by default when `HAVE(QUICKBOARD_CONTROLLER)` is defined. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _updateTextInputTraits:]): Add a couple of missing selector checks before attempting to configure smart quotes and smart dash editing behaviors. (-[WKContentView _createQuickboardController:]): Additionally opt into a quickboard controller API to bypass the interstitial Quickboard view controller when using `PUICQuickboardController`. (-[WKContentView presentViewControllerForCurrentFocusedElement]): Remove a check for the (now-removed) preference. Source/WTF: Remove the `QuickboardControllerForTextInputEnabled` WebKit preference, now that the feature is enabled by default behind a build-time flag. * Scripts/Preferences/WebPreferencesInternal.yaml: LayoutTests: Remove some extraneous instancees of `QuickboardControllerForTextInputEnabled=true` from watch-specific layout tests, now that the feature is enabled by default. * fast/forms/watchos/delete-content-in-text-field.html: * fast/forms/watchos/edit-text-field-calls-injected-bundle.html: * fast/forms/watchos/enter-text-with-spellcheck-disabled-expected.txt: Added. * fast/forms/watchos/enter-text-with-spellcheck-disabled.html: Added. Add a new test to exercise the missing selector checks in `-[WKContentView _updateTextInputTraits:]`. * fast/forms/watchos/form-control-label-text.html: * fast/forms/watchos/time-picker-value-change.html: * fast/forms/watchos/username-text-content-type.html: Canonical link: https://commits.webkit.org/235825@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275120 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-26 23:12:25 +00:00
2021-03-26 Wenson Hsieh <wenson_hsieh@apple.com>
Use PUICQuickboardController for text input when HAVE(QUICKBOARD_CONTROLLER) is defined
https://bugs.webkit.org/show_bug.cgi?id=223809
<rdar://problem/56730407>
Reviewed by Tim Horton.
Remove the `QuickboardControllerForTextInputEnabled` WebKit preference, now that the feature is enabled by
default behind a build-time flag.
* Scripts/Preferences/WebPreferencesInternal.yaml:
2021-03-26 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Use new Apple ICU APIs to avoid C++ ICU API usage
https://bugs.webkit.org/show_bug.cgi?id=223783
<rdar://problem/75060240>
Reviewed by Mark Lam.
* wtf/DateMath.h:
(WTF::LocalTimeOffset::LocalTimeOffset):
2021-03-26 Per Arne <pvollan@apple.com>
Enforce notifyd message filtering
https://bugs.webkit.org/show_bug.cgi?id=223601
<rdar://75098580>
Reviewed by Brent Fulgham.
Add ENABLE define for Notify filtering.
* wtf/PlatformEnableCocoa.h:
2021-03-26 Dean Jackson <dino@apple.com>
Enable Metal ANGLE backend for WebGL
https://bugs.webkit.org/show_bug.cgi?id=220076
<rdar://problem/72565020>
Reviewed by Sam Weinig.
Turn the Metal backend for ANGLE on, moving the feature
from Internal to Experimental.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
* Scripts/Preferences/WebPreferencesInternal.yaml:
2021-03-26 Jessie Berlin <jberlin@webkit.org>
Update the BEFORE/SINCE, SYSTEM_VERSION_PREFIX, and MACOSX_DEPLOYMENT_TARGET flags
https://bugs.webkit.org/show_bug.cgi?id=223779
Reviewed by Tim Horton.
* Configurations/DebugRelease.xcconfig:
2021-03-25 Megan Gardner <megan_gardner@apple.com>
Have App Highlights be a Configuration Setting instead of an internal Preference setting.
https://bugs.webkit.org/show_bug.cgi?id=223720
rdar://75196085
Reviewed by Wenson Hsieh.
* Scripts/Preferences/WebPreferences.yaml:
* Scripts/Preferences/WebPreferencesInternal.yaml:
2021-03-25 Jessie Berlin <jberlin@webkit.org>
Remove 10.13 DEPLOYMENT_TARGETs and SYSTEM_VERSION_PREFIXs
https://bugs.webkit.org/show_bug.cgi?id=223765
Reviewed by Tim Horton.
* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
2021-03-25 Commit Queue <commit-queue@webkit.org>
Unreviewed, reverting r275057.
https://bugs.webkit.org/show_bug.cgi?id=223768
Caused build failure
Reverted changeset:
"Enforce notifyd message filtering"
https://bugs.webkit.org/show_bug.cgi?id=223601
https://trac.webkit.org/changeset/275057
2021-03-25 Kate Cheney <katherine_cheney@apple.com>
Some calls in AuthenticatorPresenterCoordinator::selectAssertionResponse are not yet available for mac
https://bugs.webkit.org/show_bug.cgi?id=223752
<rdar://problem/75808515>
Reviewed by Jiewen Tan.
* wtf/PlatformHave.h:
2021-03-25 Per Arne <pvollan@apple.com>
Enforce notifyd message filtering
https://bugs.webkit.org/show_bug.cgi?id=223601
<rdar://75098580>
Reviewed by Brent Fulgham.
Add ENABLE define for Notify filtering.
* wtf/PlatformEnableCocoa.h:
2021-03-25 Don Olmstead <don.olmstead@sony.com>
Embiggen maximum HashTable size when not using ANGLE
https://bugs.webkit.org/show_bug.cgi?id=223757
Reviewed by Alex Christensen.
This is a partial revert of r274603 which cut the maximum size HashTable from 400 to 250.
When not using ANGLE directly for an OpenGL ES implementation there's some code hashing its
sh::ShaderVariable from the shader compiler ANGLE ships with. This type is too big and
triggers the static_assert.
The eventual goal is for ANGLE to be the OpenGL ES implementation for WebKit when enabling
WebGL. On PlayStation we already have a system OpenGL ES and any use of WebGL is in legacy
applications. The WebGL compliance features in ANGLE aren't needed in this case so ideally
we wouldn't even compile out ANGLE.
This patch punts on fixing the actual problem and just resolves this build issue.
* wtf/HashTable.h:
(WTF::KeyTraits>::inlineLookup):
2021-03-25 Chris Dumez <cdumez@apple.com>
Do not do process pre-warming when the system is under memory pressure
https://bugs.webkit.org/show_bug.cgi?id=223717
<rdar://problem/75810423>
Reviewed by Antti Koivisto.
* wtf/cocoa/MemoryPressureHandlerCocoa.mm:
(WTF::MemoryPressureHandler::install):
- Listen to the same memory pressure notifications on macOS and iOS. Previously, macOS would not respond to
non-critical memory pressure notifications for example. Also, since macOS would not listen for the notification
that happens when the memory usage goes back to normal, MemoruPressureHandler::isUnderMemoryPressure() would
start returning true after a critical memory pressure notification and it would never go back to false.
2021-03-25 Alberto Garcia <berto@igalia.com>
REGRESSION(r271560): [Linux] release assert in Thread::initializePlatformThreading
https://bugs.webkit.org/show_bug.cgi?id=223069
Reviewed by Carlos Garcia Campos.
Replace an existing signal handler instead of aborting.
* wtf/posix/ThreadingPOSIX.cpp:
(WTF::Thread::initializePlatformThreading):
2021-03-24 Mark Lam <mark.lam@apple.com>
WTF::setPermissionsOfConfigPage() should allow its VM_FLAGS_PERMANENT workaround unconditionally.
https://bugs.webkit.org/show_bug.cgi?id=223725
rdar://75813316
Reviewed by Saam Barati.
If the OS does not support the flag, then we should not require it.
* wtf/WTFConfig.cpp:
(WTF::setPermissionsOfConfigPage):
2021-03-24 Yusuke Suzuki <ysuzuki@apple.com>
Use StaticStringImpl instead of StringImpl::createStaticStringImpl if it is not dynamic string content
https://bugs.webkit.org/show_bug.cgi?id=223714
Reviewed by Saam Barati.
We should just use StaticStringImpl instead of StringImpl::createStaticStringImpl if the string content is
not dynamically allocated one. Keep in mind that this URL code is strongly assuming that internal StringImpl
is static so that this string (and URL) can be used in multiple threads. And StaticStringImpl meets this requirement.
* wtf/URL.cpp:
(WTF::aboutBlankURL):
(WTF::aboutSrcDocURL):
All string resources from UserAgentStyleSheets / UserAgentScripts should be used as non-copying StringImpl https://bugs.webkit.org/show_bug.cgi?id=223685 Reviewed by Saam Barati. Source/WebCore: We use StringImpl::createWithoutCopying for string resources from UserAgentStyleSheets / UserAgentScripts to make sure that these resources do not allocate heap strings. This patch also fixes HTMLMeterElement's bug (and imageOverlayUserAgentStyleSheet's bug). Previously, we are using String::ConstructFromLiteral, but this only accepts string literal as it says. As a result, we are dropping the last character since UserAgentStyleSheets's last character is not \0. * Modules/plugins/QuickTimePluginReplacement.mm: (WebCore::quickTimePluginReplacementScript): * WebCoreMacros.cmake: * dom/Document.cpp: (WebCore::Document::ensurePlugInsInjectedScript): * html/HTMLElement.cpp: (WebCore::HTMLElement::updateWithImageExtractionResult): * html/HTMLMeterElement.cpp: (WebCore::HTMLMeterElement::didAddUserAgentShadowRoot): * rendering/RenderThemeAdwaita.cpp: (WebCore::RenderThemeAdwaita::extraDefaultStyleSheet): (WebCore::RenderThemeAdwaita::extraMediaControlsStyleSheet): (WebCore::RenderThemeAdwaita::mediaControlsScripts): * rendering/RenderThemeCocoa.mm: (WebCore::RenderThemeCocoa::mediaControlsStyleSheet): (WebCore::RenderThemeCocoa::mediaControlsScripts): * rendering/RenderThemeWin.cpp: (WebCore::RenderThemeWin::extraDefaultStyleSheet): (WebCore::RenderThemeWin::extraQuirksStyleSheet): * style/UserAgentStyle.cpp: (WebCore::Style::UserAgentStyle::initDefaultStyleSheet): (WebCore::Style::UserAgentStyle::ensureDefaultStyleSheetsForElement): Source/WebDriver: * Session.cpp: (WebDriver::Session::fullscreenWindow): (WebDriver::Session::findElements): (WebDriver::Session::isElementSelected): (WebDriver::Session::isElementEnabled): (WebDriver::Session::isElementDisplayed): (WebDriver::Session::getElementAttribute): (WebDriver::Session::elementClear): Source/WTF: Add StringImpl::createWithoutCopying for `const char*`. * wtf/text/StringImpl.h: (WTF::StringImpl::createWithoutCopying): LayoutTests: * fast/dom/HTMLMeterElement/meter-element-markup-expected.txt: Canonical link: https://commits.webkit.org/235738@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274997 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-25 01:55:58 +00:00
2021-03-24 Yusuke Suzuki <ysuzuki@apple.com>
All string resources from UserAgentStyleSheets / UserAgentScripts should be used as non-copying StringImpl
https://bugs.webkit.org/show_bug.cgi?id=223685
Reviewed by Saam Barati.
Add StringImpl::createWithoutCopying for `const char*`.
* wtf/text/StringImpl.h:
(WTF::StringImpl::createWithoutCopying):
[Cocoa] Add Experimental MediaSession coordinator https://bugs.webkit.org/show_bug.cgi?id=222158 <rdar://problem/74508862> Reviewed by Jer Noble. Source/WebCore: Add an experimental MediaSession coordinator, an object that provides an interface that allows script to coordinate changes to MediaSession with the User Agent. Also add an experimental MediaSession playlist interface. The changes are behind new experimental feature flags, MediaSessionCoordinatorEnabled and MediaSessionPlaylistEnabled. Test: media/media-session/mock-coordinator.html * DerivedSources-input.xcfilelist: Add new IDL files. * DerivedSources-output.xcfilelist: Add new derived sources. * DerivedSources.make: Add new IDL. * Modules/mediasession/MediaMetadata.cpp: (WebCore::MediaMetadata::create): Set trackIdentifier from init data. (WebCore::MediaMetadata::setTrackIdentifier): trackIdentifier setter. * Modules/mediasession/MediaMetadata.h: (WebCore::MediaMetadata::trackIdentifier const): * Modules/mediasession/MediaMetadata.idl: * Modules/mediasession/MediaMetadataInit.h: Add trackIdentifier. (WebCore::MediaMetadataInit::encode const): (WebCore::MediaMetadataInit::decode): * Modules/mediasession/MediaMetadataInit.idl: * Modules/mediasession/MediaSession.cpp: (WebCore::MediaSession::MediaSession): Initialize MainThreadGenericEventQueue. (WebCore::MediaSession::setMetadata): metadataUpdated -> notifyMetadataObservers. (WebCore::MediaSession::setReadyState): Session readyState setter. (WebCore::MediaSession::setCoordinator): Coordinator setter. Post 'coordinatorchange' event after change. (WebCore::MediaSession::setPlaylist): Playlist setter. (WebCore::MediaSession::setActionHandler): Call notifyActionHandlerObservers. (WebCore::MediaSession::setPositionState): Call notifyPositionStateObservers. (WebCore::MediaSession::metadataUpdated): Call notifyMetadataObservers. (WebCore::MediaSession::addObserver): New. (WebCore::MediaSession::removeObserver): New. (WebCore::MediaSession::forEachObserver): New. (WebCore::MediaSession::notifyMetadataObservers): New. (WebCore::MediaSession::notifyPositionStateObservers): New. (WebCore::MediaSession::notifyPlaybackStateObservers): New. (WebCore::MediaSession::notifyActionHandlerObservers): New. (WebCore::MediaSession::notifyReadyStateObservers): New. * Modules/mediasession/MediaSession.h: (WebCore::MediaSession::coordinator const): (WebCore::MediaSession::playlist const): (WebCore::MediaSession::logger const): * Modules/mediasession/MediaSession.idl: * Modules/mediasession/MediaSessionAction.h: * Modules/mediasession/MediaSessionAction.idl: * Modules/mediasession/MediaSessionActionDetails.h: * Modules/mediasession/MediaSessionActionDetails.idl: MediaSessionCoordinator proxies calls through the PlatformMediaSessionCoordinator, and then calls the equivalent MediaSession methode if the platform coordinator is successful. * Modules/mediasession/MediaSessionCoordinator.cpp: Added. (WebCore::nextCoordinatorLogIdentifier): (WebCore::MediaSessionCoordinator::create): (WebCore::MediaSessionCoordinator::MediaSessionCoordinator): (WebCore::MediaSessionCoordinator::seekTo): (WebCore::MediaSessionCoordinator::play): (WebCore::MediaSessionCoordinator::pause): (WebCore::MediaSessionCoordinator::setTrack): (WebCore::MediaSessionCoordinator::setMediaSession): (WebCore::MediaSessionCoordinator::logChannel): * Modules/mediasession/MediaSessionCoordinator.h: New. (WebCore::MediaSessionCoordinator::logger const): (WebCore::MediaSessionCoordinator::logIdentifier const): (WebCore::MediaSessionCoordinator::logClassName): * Modules/mediasession/MediaSessionCoordinator.idl: New. * Modules/mediasession/NavigatorMediaSession.h: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: * dom/EventNames.h: * dom/EventTargetFactory.in: * platform/graphics/PlatformMediaSessionCoordinator.h: Added. (WebCore::PlatformMediaSessionCoordinator::setLogger): (WebCore::PlatformMediaSessionCoordinator::loggerPtr const): (WebCore::PlatformMediaSessionCoordinator::logIdentifier const): (WebCore::PlatformMediaSessionCoordinator::logClassName const): (WebCore::PlatformMediaSessionCoordinator::logChannel const): * testing/Internals.cpp: (WebCore::Internals::registerMockMediaSessionCoordinator): Register the mock media session coordinator for testing. * testing/Internals.h: * testing/Internals.idl: * testing/MockMediaSessionCoordinator.cpp: Added. (WebCore::MockMediaSessionCoordinator::create): (WebCore::MockMediaSessionCoordinator::MockMediaSessionCoordinator): (WebCore::MockMediaSessionCoordinator::seekTo): (WebCore::MockMediaSessionCoordinator::play): (WebCore::MockMediaSessionCoordinator::pause): (WebCore::MockMediaSessionCoordinator::setTrack): * testing/MockMediaSessionCoordinator.h: New. Source/WTF: * Scripts/Preferences/WebPreferencesExperimental.yaml: * wtf/PlatformEnableCocoa.h: LayoutTests: * platform/TestExpectations: * media/media-session/mock-coordinator-expected.txt: Added. * media/media-session/mock-coordinator.html: Added. Canonical link: https://commits.webkit.org/235728@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274983 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-24 23:14:51 +00:00
2021-03-24 Eric Carlson <eric.carlson@apple.com>
[Cocoa] Add Experimental MediaSession coordinator
https://bugs.webkit.org/show_bug.cgi?id=222158
<rdar://problem/74508862>
Reviewed by Jer Noble.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
* wtf/PlatformEnableCocoa.h:
2021-03-24 Chris Dumez <cdumez@apple.com>
Address undefined behavior found by UBSan in StringToIntegerConversion.h
https://bugs.webkit.org/show_bug.cgi?id=223694
Reviewed by Geoffrey Garen.
Update StringToIntegerConversion to deal with overflows in a well-defined manner,
by relying on CheckedArithmetics. This addresses undefined behavior reborted by
UBSan:
- wtf/text/StringToIntegerConversion.h:94:30: runtime error: signed integer overflow: 2147483640 + 8 cannot be represented in type 'int'
- wtf/text/StringToIntegerConversion.h:104:17: runtime error: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
* wtf/text/StringToIntegerConversion.h:
(WTF::toIntegralType):
2021-03-24 Truitt Savell <tsavell@apple.com>
Unreviewed, reverting r274927.
Broke many tests in WebGL
Reverted changeset:
"Enable Metal ANGLE backend for WebGL"
https://bugs.webkit.org/show_bug.cgi?id=220076
https://commits.webkit.org/r274927
2021-03-24 Chris Dumez <cdumez@apple.com>
Address undefined behavior found by UBSan in DateMath.h
https://bugs.webkit.org/show_bug.cgi?id=223663
Reviewed by Darin Adler.
Address undefined behavior found by UBSan in DateMath.h
Release/usr/local/include/wtf/DateMath.h:247:39: runtime error: nan is outside the range of representable values of type 'int'
Release/usr/local/include/wtf/DateMath.h:221:29: runtime error: nan is outside the range of representable values of type 'int'
Release/usr/local/include/wtf/DateMath.h:165:38: runtime error: signed integer overflow: -2147483648 - 1 cannot be represented in type 'int'
* wtf/DateMath.h:
(WTF::daysFrom1970ToYear):
Cast year to a double *before* substracting 1 instead of *after*. This works around the fact that INT_MIN-1 would not
fit in an int and would be undefined behavior.
(WTF::dayInYear):
(WTF::msToYear):
Deal with the double potentially being NaN before casting to an int, since
casting NaN to an int type has undefined behavior.
2021-03-23 Dean Jackson <yolo@apple.com>
Enable Metal ANGLE backend for WebGL
https://bugs.webkit.org/show_bug.cgi?id=220076
<rdar://problem/72565020>
Reviewed by Sam Weinig.
Turn the Metal backend for ANGLE on, moving the feature
from Internal to Experimental.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
* Scripts/Preferences/WebPreferencesInternal.yaml:
DerivedSources/WebKitTestRunner/JSAccessibilityUIElement.cpp:802:72: runtime error: -1 is outside the range of representable values of type 'unsigned int' https://bugs.webkit.org/show_bug.cgi?id=223650 Reviewed by Darin Adler. Source/WTF: Update the clampTo() template specialization that converts floating types into integer types so that it deals with NaN inputs in a well-defined manner. Previously, it would simply cast the NaN to the integer type, which was undefined behavior. We now return the minimum range boundary for the output when the input is NaN. * wtf/MathExtras.h: (clampTo): Tools: The bindings generator used by WebKitTestRunner was converting all numbers into double and passing that to the implementation, no matter the IDL type (e.g. unsigned long). As a result, there may be a type mismatch between the value the bindings are passing and the implementation function getting called. This implicit conversion has undefined behavior in some cases and it triggers UBSan errors. To address the issue, we now call clampTo<NativeNumberType>() on the double before passing it to the implementation. This makes sure we pass the implementation the type it expects and that the conversion is well-defined. * WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm: (_generateImplementationFile): (_nativeNumericType): (_platformType): (_platformTypeConstructor): (_platformTypeVariableDeclaration): Canonical link: https://commits.webkit.org/235683@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274919 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-24 00:30:11 +00:00
2021-03-23 Chris Dumez <cdumez@apple.com>
DerivedSources/WebKitTestRunner/JSAccessibilityUIElement.cpp:802:72: runtime error: -1 is outside the range of representable values of type 'unsigned int'
https://bugs.webkit.org/show_bug.cgi?id=223650
Reviewed by Darin Adler.
Update the clampTo() template specialization that converts floating types into integer types so that
it deals with NaN inputs in a well-defined manner. Previously, it would simply cast the NaN to the
integer type, which was undefined behavior. We now return the minimum range boundary for the output
when the input is NaN.
* wtf/MathExtras.h:
(clampTo):
2021-03-23 Saam Barati <sbarati@apple.com>
Don't require VM_FLAGS_PERMANENT on the simulator builds
https://bugs.webkit.org/show_bug.cgi?id=223649
<rdar://problem/75747788>
Reviewed by Alexey Proskuryakov.
Since VM_FLAGS_PERMANENT must be supported by the kernel, let's make
it so that the vm_map that passes this flag in can fail when running
on the simulator. This is to support the use case of running a newer
simulator on an older OS. When the call to vm_map fails when running
on the simulator, we try again without the VM_FLAGS_PERMANENT flag.
* wtf/WTFConfig.cpp:
(WTF::setPermissionsOfConfigPage):
2021-03-23 Alex Christensen <achristensen@webkit.org>
Remove unused WTF::String::percentage
https://bugs.webkit.org/show_bug.cgi?id=223651
Reviewed by Chris Dumez.
* wtf/text/AtomString.h:
* wtf/text/WTFString.cpp:
(WTF::String::percentage const): Deleted.
* wtf/text/WTFString.h:
2021-03-23 Chris Dumez <cdumez@apple.com>
wtf/text/IntegerToStringConversion.h:54:104: runtime error: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
https://bugs.webkit.org/show_bug.cgi?id=223614
Reviewed by Darin Adler.
numberToStringSigned() was calling -number when number is negative. This could trigger undefined behavior
since -number may not be representable in the input type. For example, if the type was int and number was
INT_MIN, -INT_MIN would overflow and the result would be undefined. To address the issue, we now cast
number to the destination *unsigned* type *before* negating it.
* wtf/text/IntegerToStringConversion.h:
(WTF::numberToStringSigned):
2021-03-23 Alex Christensen <achristensen@webkit.org>
Optimize StringView::CodePoints::Iterator
https://bugs.webkit.org/show_bug.cgi?id=162315
Reviewed by Darin Adler.
This stores range pointers in the iterator instead of a pointer to a pointer.
* wtf/text/StringView.h:
(WTF::StringView::CodePoints::Iterator::Iterator):
(WTF::StringView::CodePoints::Iterator::operator++):
(WTF::StringView::CodePoints::Iterator::operator* const):
(WTF::StringView::CodePoints::Iterator::operator== const):
Add assertions to guard against heap allocations on the audio thread https://bugs.webkit.org/show_bug.cgi?id=223226 Reviewed by Darin Adler. Source/WebCore: Add assertions to guard against heap allocations on the audio thread during audio processing, since those are bad for performance. I fixed any of the issues found by these assertions in dependency bugs. Some issues remain and are protected by DisableMallocRestrictionsForCurrentThreadScope to avoid tripping the new assertions. Right now, the assertions only protect audio processing, not pre/post quantum rendering casts. Ideally, we'd expand the scope of these assertions to cover everything that's done on the audio thread but this will require more fixes. * Modules/webaudio/AudioDestinationNode.cpp: (WebCore::AudioDestinationNode::render): * Modules/webaudio/AudioScheduledSourceNode.cpp: (WebCore::AudioScheduledSourceNode::finish): * Modules/webaudio/AudioWorkletNode.cpp: (WebCore::AudioWorkletNode::fireProcessorErrorOnMainThread): * Modules/webaudio/AudioWorkletProcessor.cpp: (WebCore::AudioWorkletProcessor::process): * Modules/webaudio/MediaStreamAudioSourceCocoa.cpp: (WebCore::MediaStreamAudioSource::consumeAudio): * Modules/webaudio/ScriptProcessorNode.cpp: (WebCore::ScriptProcessorNode::process): Source/WTF: Add ForbidMallocUseForCurrentThreadScope to FastMalloc.h to enable assertions guarding against doing heap allocations on the current thread (during the lifetime of the Scope object). Also add a DisableMallocRestrictionsForCurrentThreadScope to temporarily disable those checks to allow for some very specific assertions (either because they are required, or simply because they are not fixed yet). * wtf/FastMalloc.cpp: (WTF::ForbidMallocUseForCurrentThreadScope::ForbidMallocUseForCurrentThreadScope): (WTF::ForbidMallocUseForCurrentThreadScope::~ForbidMallocUseForCurrentThreadScope): (WTF::DisableMallocRestrictionsForCurrentThreadScope::DisableMallocRestrictionsForCurrentThreadScope): (WTF::DisableMallocRestrictionsForCurrentThreadScope::~DisableMallocRestrictionsForCurrentThreadScope): (WTF::tryFastMalloc): (WTF::fastMalloc): (WTF::tryFastCalloc): (WTF::fastCalloc): (WTF::fastRealloc): (WTF::tryFastRealloc): (WTF::fastAlignedMalloc): (WTF::tryFastAlignedMalloc): * wtf/FastMalloc.h: (WTF::ForbidMallocUseForCurrentThreadScope::~ForbidMallocUseForCurrentThreadScope): (WTF::DisableMallocRestrictionsForCurrentThreadScope::~DisableMallocRestrictionsForCurrentThreadScope): Canonical link: https://commits.webkit.org/235653@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274871 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-23 15:33:36 +00:00
2021-03-23 Chris Dumez <cdumez@apple.com>
Add assertions to guard against heap allocations on the audio thread
https://bugs.webkit.org/show_bug.cgi?id=223226
Reviewed by Darin Adler.
Add ForbidMallocUseForCurrentThreadScope to FastMalloc.h to enable assertions guarding against
doing heap allocations on the current thread (during the lifetime of the Scope object).
Also add a DisableMallocRestrictionsForCurrentThreadScope to temporarily disable those checks
to allow for some very specific assertions (either because they are required, or simply because
they are not fixed yet).
* wtf/FastMalloc.cpp:
(WTF::ForbidMallocUseForCurrentThreadScope::ForbidMallocUseForCurrentThreadScope):
(WTF::ForbidMallocUseForCurrentThreadScope::~ForbidMallocUseForCurrentThreadScope):
(WTF::DisableMallocRestrictionsForCurrentThreadScope::DisableMallocRestrictionsForCurrentThreadScope):
(WTF::DisableMallocRestrictionsForCurrentThreadScope::~DisableMallocRestrictionsForCurrentThreadScope):
(WTF::tryFastMalloc):
(WTF::fastMalloc):
(WTF::tryFastCalloc):
(WTF::fastCalloc):
(WTF::fastRealloc):
(WTF::tryFastRealloc):
(WTF::fastAlignedMalloc):
(WTF::tryFastAlignedMalloc):
* wtf/FastMalloc.h:
(WTF::ForbidMallocUseForCurrentThreadScope::~ForbidMallocUseForCurrentThreadScope):
(WTF::DisableMallocRestrictionsForCurrentThreadScope::~DisableMallocRestrictionsForCurrentThreadScope):
Remove unused JS and CSS files of media controls https://bugs.webkit.org/show_bug.cgi?id=214955 <rdar://problem/66604040> Reviewed by Eric Carlson. Source/WebCore: Cocoa platforms are already using modern media controls so there's no reason to keep the old media controls resources/logic around any longer. It just wastes space. The non-iOS Apple controls must be kept though as they are still used on Windows. * Modules/mediacontrols/assets-apple-iOS.svg: Removed. * Modules/mediacontrols/mediaControlsiOS.css: Removed. * Modules/mediacontrols/mediaControlsiOS.js: Removed. * rendering/RenderTheme.h: (WebCore::RenderTheme::modernMediaControlsStyleSheet): Deleted. * rendering/RenderThemeCocoa.h: * rendering/RenderThemeCocoa.mm: (WebCore::RenderThemeCocoa::purgeCaches): Added. (WebCore::RenderThemeCocoa::mediaControlsStyleSheet): Added. (WebCore::RenderThemeCocoa::mediaControlsScripts): Added. (WebCore::RenderThemeCocoa::mediaControlsBase64StringForIconNameAndType): Added. * rendering/RenderThemeIOS.h: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::mediaControlsStyleSheet): Deleted. (WebCore::RenderThemeIOS::modernMediaControlsStyleSheet): Deleted. (WebCore::RenderThemeIOS::purgeCaches): Deleted. (WebCore::RenderThemeIOS::mediaControlsScripts): Deleted. (WebCore::RenderThemeIOS::mediaControlsBase64StringForIconNameAndType): Deleted. * rendering/RenderThemeMac.h: * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::mediaControlsStyleSheet): Deleted. (WebCore::RenderThemeMac::modernMediaControlsStyleSheet): Deleted. (WebCore::RenderThemeMac::purgeCaches): Deleted. (WebCore::RenderThemeMac::mediaControlsScripts): Deleted. (WebCore::RenderThemeMac::mediaControlsBase64StringForIconNameAndType): Deleted. Move media controls functions to `RenderThemeCocoa` since they are identical. * Modules/mediacontrols/MediaControlsHost.idl: * Modules/mediacontrols/MediaControlsHost.h: * Modules/mediacontrols/MediaControlsHost.cpp: (WebCore::MediaControlsHost::shadowRootCSSText): * css/mediaControls.css: * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript): (WebCore::HTMLMediaElement::updateMediaControlsAfterPresentationModeChange): * html/MediaDocument.cpp: (WebCore::MediaDocumentParser::createDocumentStructure): (WebCore::MediaDocument::defaultEventHandler): * style/UserAgentStyle.cpp: (WebCore::Style::UserAgentStyle::ensureDefaultStyleSheetsForElement): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setModernMediaControlsEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::modernMediaControlsEnabled const): Deleted. Replace `ModernMediaControlsEnabled` setting with `ENABLE_MODERN_MEDIA_CONTROLS` build flag. * html/track/TextTrackCueGeneric.cpp: Update the static `DEFAULTCAPTIONFONTSIZE` value for modern media controls. * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css: * Modules/modern-media-controls/controls/text-tracks.css: Update comments. * css/mediaControlsiOS.css: Removed. This file was never included anywhere. * platform/audio/PlatformMediaSessionManager.h: (WebCore::PlatformMediaSessionManager::resetHaveEverRegisteredAsNowPlayingApplicationForTesting): added. * platform/audio/cocoa/MediaSessionManagerCocoa.mm: (WebCore::MediaSessionManagerCocoa::resetHaveEverRegisteredAsNowPlayingApplicationForTesting): added. * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): Drive-by: Reset `haveEverRegisteredAsNowPlayingApplication` to a consistent state between tests. This is expected by `LayoutTests/media/now-playing-status-without-media.html`. * bindings/js/WebCoreBuiltinNames.h: * WebCore.xcodeproj/project.pbxproj: Source/WebKit: Cocoa platforms are already using modern media controls so there's no reason to keep the old media controls resources/logic around any longer. It just wastes space. The non-iOS Apple controls must be kept though as they are still used on Windows. * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetModernMediaControlsEnabled): Deleted. (WKPreferencesGetModernMediaControlsEnabled): Deleted. Replace `ModernMediaControlsEnabled` setting with `ENABLE_MODERN_MEDIA_CONTROLS` build flag. * UIProcess/mac/WKFullScreenWindowController.mm: Update the static `minVideoWidth` value for modern media controls. Source/WebKitLegacy/mac: Cocoa platforms are already using modern media controls so there's no reason to keep the old media controls resources/logic around any longer. It just wastes space. The non-iOS Apple controls must be kept though as they are still used on Windows. * WebView/WebPreferenceKeysPrivate.h: * WebView/WebPreferencesPrivate.h: * WebView/WebPreferences.mm: (-[WebPreferences modernMediaControlsEnabled]): Deleted. (-[WebPreferences setModernMediaControlsEnabled:]): Deleted. Replace `ModernMediaControlsEnabled` setting with `ENABLE_MODERN_MEDIA_CONTROLS` build flag. Source/WebKitLegacy/win: Cocoa platforms are already using modern media controls so there's no reason to keep the old media controls resources/logic around any longer. It just wastes space. The non-iOS Apple controls must be kept though as they are still used on Windows. * Interfaces/IWebPreferencesPrivate.idl: * WebPreferenceKeysPrivate.h: * WebPreferences.h: * WebPreferences.cpp: (WebPreferences::setModernMediaControlsEnabled): Deleted. (WebPreferences::modernMediaControlsEnabled): Deleted. * WebView.cpp: (WebView::notifyPreferencesChanged): Replace `ModernMediaControlsEnabled` setting with `ENABLE_MODERN_MEDIA_CONTROLS` build flag. Source/WTF: Cocoa platforms are already using modern media controls so there's no reason to keep the old media controls resources/logic around any longer. It just wastes space. The non-iOS Apple controls must be kept though as they are still used on Windows. * wtf/PlatformEnable.h: * wtf/PlatformEnableCocoa.h: * Scripts/Preferences/WebPreferences.yaml: Replace `ModernMediaControlsEnabled` setting with `ENABLE_MODERN_MEDIA_CONTROLS` build flag. Tools: Cocoa platforms are already using modern media controls so there's no reason to keep the old media controls resources/logic around any longer. It just wastes space. The non-iOS Apple controls must be kept though as they are still used on Windows. * WebKitTestRunner/gtk/TestControllerGtk.cpp: (WTR::TestController::platformSpecificFeatureDefaultsForTest const): * WebKitTestRunner/wpe/TestControllerWPE.cpp: (WTR::TestController::platformSpecificFeatureDefaultsForTest const): Replace `ModernMediaControlsEnabled` setting with `ENABLE_MODERN_MEDIA_CONTROLS` build flag. LayoutTests: Remove tests (and their expectations) that used `ModernMediaControlsEnabled=false`. * accessibility/ios-simulator/has-touch-event-listener-with-shadow.html: * accessibility/ios-simulator/media-with-aria-label.html: Removed. * accessibility/ios-simulator/media-with-aria-label-expected.txt: Removed. * accessibility/mac/media-emits-object-replacement.html: Removed. * accessibility/mac/media-emits-object-replacement-expected.txt: Removed. * accessibility/mac/video-tag-hit-test.html: Removed. * accessibility/mac/video-tag-hit-test-expected.txt: Removed. * accessibility/mac/video-volume-slider-accessibility.html: Removed. * accessibility/mac/video-volume-slider-accessibility-expected.txt: Removed. * accessibility/media-element.html: Removed. * platform/gtk/accessibility/media-element-expected.txt: Removed. * platform/mac/accessibility/media-element-expected.txt: Removed. * platform/wincairo/accessibility/media-element-expected.txt: Removed. * accessibility/media-emits-object-replacement.html: Removed. * accessibility/media-emits-object-replacement-expected.txt: Removed. * platform/glib/accessibility/media-emits-object-replacement-expected.txt: Removed. * accessibility/media-with-aria-label.html: Removed. * accessibility/media-with-aria-label-expected.txt: Removed. * compositing/video/poster.html: * compositing/video/poster-expected.html: * fast/hidpi/video-controls-in-hidpi.html: Removed. * platform/gtk/fast/hidpi/video-controls-in-hidpi-expected.txt: Removed. * platform/ios/fast/hidpi/video-controls-in-hidpi-expected.txt: Removed. * platform/mac/fast/hidpi/video-controls-in-hidpi-expected.txt: Removed. * platform/win/fast/hidpi/video-controls-in-hidpi-expected.txt: Removed. * platform/wincairo/fast/hidpi/video-controls-in-hidpi-expected.txt: Removed. * platform/wpe/fast/hidpi/video-controls-in-hidpi-expected.txt: Removed. * fast/layers/video-layer.html: Removed. * platform/gtk/fast/layers/video-layer-expected.png: Removed. * platform/gtk/fast/layers/video-layer-expected.txt: Removed. * platform/ios/fast/layers/video-layer-expected.txt: Removed. * platform/mac/fast/layers/video-layer-expected.png: Removed. * platform/mac/fast/layers/video-layer-expected.txt: Removed. * platform/win/fast/layers/video-layer-expected.txt: Removed. * platform/wincairo/fast/layers/video-layer-expected.txt: Removed. * platform/wpe/fast/layers/video-layer-expected.txt: Removed. * fast/mediastream/MediaStream-video-element-video-tracks-disabled.html: * fullscreen/video-controls-drag.html: Removed. * fullscreen/video-controls-drag-expected.txt: Removed. * fullscreen/video-controls-override.html: Removed. * fullscreen/video-controls-override-expected.txt: Removed. * fullscreen/video-controls-rtl.html: Removed. * fullscreen/video-controls-rtl-expected.txt: Removed. * fullscreen/video-controls-timeline.html: Removed. * fullscreen/video-controls-timeline-expected.txt: Removed. * http/tests/media/hls/hls-accessiblity-describes-video-menu.html: Removed. * http/tests/media/hls/hls-accessiblity-describes-video-menu-expected.txt: Removed. * http/tests/media/hls/hls-audio-tracks-has-audio.html: * http/tests/media/hls/hls-audio-tracks-locale-selection.html: * http/tests/media/hls/hls-audio-tracks.html: * http/tests/media/hls/hls-progress.html: * http/tests/media/hls/hls-webvtt-tracks.html: * http/tests/media/hls/range-request.html: * http/tests/media/hls/video-controls-live-stream.html: Removed. * platform/gtk/http/tests/media/hls/video-controls-live-stream-expected.txt: Removed. * platform/mac/http/tests/media/hls/video-controls-live-stream-expected.txt: Removed. * http/tests/media/hls/video-cookie.html: * http/tests/media/hls/video-duration-accessibility.html: Removed. * http/tests/media/hls/video-duration-accessibility-expected.txt: Removed. * http/tests/security/contentSecurityPolicy/userAgentShadowDOM/default-src-object-data-url-allowed.html: * http/tests/security/contentSecurityPolicy/userAgentShadowDOM/default-src-object-data-url-blocked.html: * http/tests/security/contentSecurityPolicy/userAgentShadowDOM/default-src-object-data-url-blocked2.html: * http/tests/security/contentSecurityPolicy/userAgentShadowDOM/video-controls-allowed.html: * inspector/css/pseudo-element-matches.html: * inspector/css/pseudo-element-matches-expected.txt: * media/accessibility-closed-captions-has-aria-owns.html: Removed. * media/accessibility-closed-captions-has-aria-owns-expected.txt: Removed. * media/adopt-node-crash.html: * media/airplay-allows-buffering.html: * media/airplay-autoplay.html: * media/audio-as-video-fullscreen.html: Removed. * media/audio-as-video-fullscreen-expected.txt: Removed. * media/audio-controls-do-not-fade-out.html: Removed. * media/audio-controls-do-not-fade-out-expected.txt: Removed. * media/audio-controls-rendering.html: Removed. * platform/gtk/media/audio-controls-rendering-expected.txt: Removed. * platform/ios/media/audio-controls-rendering-expected.txt: Removed. * platform/mac/media/audio-controls-rendering-expected.txt: Removed. * platform/win/media/audio-controls-rendering-expected.txt: Removed. * platform/wincairo/media/audio-controls-rendering-expected.txt: Removed. * media/audio-controls-timeline-in-media-document.html: Removed. * media/audio-controls-timeline-in-media-document-expected.txt: Removed. * media/audio-delete-while-slider-thumb-clicked.html: Removed. * media/audio-delete-while-slider-thumb-clicked-expected.txt: Removed. * media/audio-delete-while-step-button-clicked.html: Removed. * media/audio-delete-while-step-button-clicked-expected.txt: Removed. * media/audio-repaint.html: Removed. * platform/gtk/media/audio-repaint-expected.txt: Removed. * platform/ios/media/audio-repaint-expected.txt: Removed. * platform/mac/media/audio-repaint-expected.txt: Removed. * platform/wincairo/media/audio-repaint-expected.txt: Removed. * media/click-placeholder-not-pausing.html: Removed. * media/click-placeholder-not-pausing-expected.txt: Removed. * media/click-volume-bar-not-pausing.html: Removed. * media/click-volume-bar-not-pausing-expected.txt: Removed. * media/controls-after-reload.html: Removed. * platform/gtk/media/controls-after-reload-expected.txt: Removed. * platform/mac-catalina/media/controls-after-reload-expected.txt: Removed. * platform/mac/media/controls-after-reload-expected.txt: Removed. * platform/win/media/controls-after-reload-expected.txt: Removed. * platform/wincairo/media/controls-after-reload-expected.txt: Removed. * media/controls-drag-timebar.html: Removed. * media/controls-drag-timebar-expected.txt: Removed. * media/controls-right-click-on-timebar.html: Removed. * media/controls-right-click-on-timebar-expected.txt: Removed. * media/controls-strict.html: Removed. * platform/gtk/media/controls-strict-expected.txt: Removed. * platform/ios/media/controls-strict-expected.txt: Removed. * platform/mac/media/controls-strict-expected.txt: Removed. * platform/mac/media/controls-strict-mode-expected.txt: Removed. * platform/win/media/controls-strict-expected.txt: Removed. * platform/wincairo/media/controls-strict-expected.txt: Removed. * media/controls-styling.html: Removed. * platform/gtk/media/controls-styling-expected.txt: Removed. * platform/mac/media/controls-styling-expected.txt: Removed. * platform/win/media/controls-styling-expected.txt: Removed. * platform/wincairo/media/controls-styling-expected.txt: Removed. * media/controls-styling-strict.html: Removed. * platform/gtk/media/controls-styling-strict-expected.txt: Removed. * platform/mac/media/controls-styling-strict-expected.txt: Removed. * platform/wincairo/media/controls-styling-strict-expected.txt: Removed. * media/controls-without-preload.html: Removed. * platform/gtk/media/controls-without-preload-expected.txt: Removed. * platform/ios/media/controls-without-preload-expected.txt: Removed. * platform/mac/media/controls-without-preload-expected.txt: Removed. * platform/win/media/controls-without-preload-expected.txt: Removed. * platform/wincairo/media/controls-without-preload-expected.txt: Removed. * media/controls/airplay-controls.html: Removed. * media/controls/airplay-controls-expected.txt: Removed. * media/controls/airplay-picker.html: Removed. * media/controls/airplay-picker-expected.txt: Removed. * media/controls/basic.html: Removed. * media/controls/basic-expected.txt: Removed. * media/controls/controls-test-helpers.js: Removed. * media/controls/default-size-should-show-scrubber.html: Removed. * media/controls/default-size-should-show-scrubber-expected.txt: Removed. * media/controls/elementOrder.html: Removed. * media/controls/elementOrder-expected.txt: Removed. * media/controls/forced-tracks-only.html: Removed. * media/controls/forced-tracks-only-expected.txt: Removed. * media/controls/fullscreen-button-inline-layout.html: Removed. * media/controls/fullscreen-button-inline-layout-expected.txt: Removed. * media/controls/inline-elements-dropoff-order.html: Removed. * media/controls/inline-elements-dropoff-order-expected.txt: Removed. * media/controls/picture-in-picture.html: Removed. * media/controls/picture-in-picture-expected.txt: Removed. * media/controls/pip-placeholder-without-video-controls.html: Removed. * media/controls/pip-placeholder-without-video-controls-expected.txt: Removed. * media/controls/showControlsButton.html: Removed. * media/controls/showControlsButton-expected.txt: Removed. * media/controls/statusDisplay.html: Removed. * media/controls/statusDisplay-expected.txt: Removed. * media/controls/statusDisplayBad.html: Removed. * media/controls/statusDisplayBad-expected.txt: Removed. * media/controls/track-menu.html: Removed. * media/controls/track-menu-expected.txt: Removed. * media/in-band-tracks.js: (seeked): Deleted. (testTextTrackMode): Deleted. (testCueStyle.seeked): Deleted. (testCueStyle.canplaythrough): Deleted. (testCueStyle): Deleted. * media/mac/controls-panel-not-clipped-out.html: Removed. * media/mac/controls-panel-not-clipped-out-expected.html: Removed. * media/media-captions-no-controls.html: * media/media-captions-no-controls-expected.txt: * media/media-controller-drag-crash.html: Removed. * media/media-controller-drag-crash-expected.txt: Removed. * media/media-controls-accessibility.html: Removed. * media/media-controls-accessibility-expected.txt: Removed. * media/media-controls-cancel-events.html: Removed. * media/media-controls-cancel-events-expected.txt: Removed. * media/media-controls-clone.html: Removed. * platform/gtk/media/media-controls-clone-expected.txt: Removed. * platform/ios/media/media-controls-clone-expected.txt: Removed. * platform/mac/media/media-controls-clone-expected.txt: Removed. * platform/wincairo/media/media-controls-clone-expected.txt: Removed. * media/media-controls-drag-timeline-set-controls-property.html: Removed. * media/media-controls-drag-timeline-set-controls-property-expected.txt: Removed. * media/media-controls-invalid-url.html: Removed. * media/media-controls-invalid-url-expected.txt: Removed. * platform/win/media/media-controls-invalid-url-expected.txt: Removed. * media/media-controls-play-button-updates.html: Removed. * platform/gtk/media/media-controls-play-button-updates-expected.png: Removed. * platform/gtk/media/media-controls-play-button-updates-expected.txt: Removed. * media/media-controls-play-button-updates-expected.txt: Removed. * media/media-controls-play-button-updates-expected.png: Removed. * media/media-controls-timeline-updates.html: Removed. * media/media-controls-timeline-updates-expected.txt: Removed. * media/media-controls-timeline-updates-after-playing.html: Removed. * media/media-controls-timeline-updates-after-playing-expected.txt: Removed. * media/media-controls-timeline-updates-when-hovered.html: Removed. * media/media-controls-timeline-updates-when-hovered-expected.txt: Removed. * media/media-controls.js: Removed. * media/media-document-audio-controls-visible.html: Removed. * media/media-document-audio-controls-visible-expected.txt: Removed. * media/media-document-audio-repaint.html: Removed. * platform/gtk/media/media-document-audio-repaint-expected.txt: Removed. * platform/mac/media/media-document-audio-repaint-expected.txt: Removed. * media/media-document-audio-repaint-expected.txt: Removed. * media/media-fullscreen-loop-inline.html: * media/media-fullscreen-pause-inline.html: * media/media-fullscreen-return-to-inline.html: * media/media-source/only-bcp47-language-tags-accepted-as-valid.html: * media/media-volume-slider-rendered-below.html: Removed. * media/media-volume-slider-rendered-below-expected.txt: Removed. * media/media-volume-slider-rendered-normal.html: Removed. * media/media-volume-slider-rendered-normal-expected.txt: Removed. * media/nodesFromRect-shadowContent.html: Removed. * media/nodesFromRect-shadowContent-expected.txt: Removed. * media/progress-events-generated-correctly.html: * media/require-user-gesture-to-load-video.html: Removed. * media/require-user-gesture-to-load-video-expected.txt: Removed. * media/tab-focus-inside-media-elements.html: Removed. * media/tab-focus-inside-media-elements-expected.txt: Removed. * media/track/in-band/track-in-band-kate-ogg-mode.html: Removed. * media/track/in-band/track-in-band-kate-ogg-mode-expected.txt: Removed. * media/track/in-band/track-in-band-kate-ogg-style.html: Removed. * media/track/in-band/track-in-band-kate-ogg-style-expected.txt: Removed. * media/track/in-band/track-in-band-srt-mkv-mode.html: Removed. * media/track/in-band/track-in-band-srt-mkv-mode-expected.txt: Removed. * media/track/in-band/track-in-band-srt-mkv-style.html: Removed. * media/track/in-band/track-in-band-srt-mkv-style-expected.txt: Removed. * media/track/regions-webvtt/vtt-region-display.html: Removed. * media/track/regions-webvtt/vtt-region-display-expected.txt: Removed. * media/track/regions-webvtt/vtt-region-dom-layout.html: Removed. * media/track/regions-webvtt/vtt-region-dom-layout-expected.txt: Removed. * media/track/texttrackcue/texttrackcue-addcue.html: * media/track/texttrackcue/texttrackcue-displaycue.html: Removed. * media/track/texttrackcue/texttrackcue-displaycue-expected.txt: Removed. * media/track/track-automatic-subtitles.html: * media/track/track-css-all-cues.html: Removed. * media/track/track-css-all-cues-expected.txt: Removed. * media/track/track-css-cue-lifetime.html: Removed. * media/track/track-css-cue-lifetime-expected.txt: Removed. * media/track/track-css-matching.html: Removed. * media/track/track-css-matching-expected.txt: Removed. * media/track/track-css-matching-default.html: Removed. * media/track/track-css-matching-default-expected.txt: Removed. * media/track/track-css-matching-lang.html: Removed. * media/track/track-css-matching-lang-expected.txt: Removed. * media/track/track-css-matching-timestamps.html: Removed. * media/track/track-css-matching-timestamps-expected.txt: Removed. * media/track/track-css-property-allowlist-expected.txt: Removed. * media/track/track-css-property-allowlist.html: Removed. * media/track/track-css-stroke-cues.html: Removed. * media/track/track-css-stroke-cues-expected.txt: Removed. * media/track/track-css-user-override.html: Removed. * media/track/track-css-user-override-expected.txt: Removed. * media/track/track-css-visible-stroke.html: * media/track/track-cue-container-rendering-position.html: Removed. * media/track/track-cue-container-rendering-position-expected.txt: Removed. * media/track/track-cue-css.html: * media/track/track-cue-css-expected.html: * media/track/track-cue-left-align.html: * media/track/track-cue-left-align-expected-mismatch.html: * media/track/track-cue-line-position.html: * media/track/track-cue-line-position-expected-mismatch.html: * media/track/track-cue-mutable-fragment.html: * media/track/track-cue-mutable-text.html: Removed. * media/track/track-cue-mutable-text-expected.txt: Removed. * media/track/track-cue-nothing-to-render.html: Removed. * media/track/track-cue-nothing-to-render-expected.txt: Removed. * media/track/track-cue-overlap-snap-to-lines-not-set.html: Removed. * media/track/track-cue-overlap-snap-to-lines-not-set-expected.txt: Removed. * media/track/track-cue-rendering.html: Removed. * media/track/track-cue-rendering-expected.txt: Removed. * media/track/track-cue-rendering-horizontal.html: Removed. * platform/gtk/media/track/track-cue-rendering-horizontal-expected.png: Removed. * platform/gtk/media/track/track-cue-rendering-horizontal-expected.txt: Removed. * platform/ios/media/track/track-cue-rendering-horizontal-expected.txt: Removed. * platform/mac/media/track/track-cue-rendering-horizontal-expected.png: Removed. * platform/mac/media/track/track-cue-rendering-horizontal-expected.txt: Removed. * platform/win/media/track/track-cue-rendering-horizontal-expected.txt: Removed. * platform/wincairo/media/track/track-cue-rendering-horizontal-expected.txt: Removed. * media/track/track-cue-rendering-mode-changed.html: Removed. * media/track/track-cue-rendering-mode-changed-expected.txt: Removed. * media/track/track-cue-rendering-on-resize.html: Removed. * media/track/track-cue-rendering-on-resize-expected.txt: Removed. * media/track/track-cue-rendering-rtl.html: Removed. * media/track/track-cue-rendering-rtl-expected.txt: Removed. * media/track/track-cue-rendering-snap-to-lines-not-set.html: Removed. * media/track/track-cue-rendering-snap-to-lines-not-set-expected.txt: Removed. * media/track/track-cue-rendering-tree-is-removed-properly.html: Removed. * media/track/track-cue-rendering-tree-is-removed-properly-expected.txt: Removed. * media/track/track-cue-rendering-vertical.html: Removed. * platform/gtk/media/track/track-cue-rendering-vertical-expected.png: Removed. * platform/gtk/media/track/track-cue-rendering-vertical-expected.txt: Removed. * platform/ios/media/track/track-cue-rendering-vertical-expected.txt: Removed. * platform/mac/media/track/track-cue-rendering-vertical-expected.txt: Removed. * platform/wincairo/media/track/track-cue-rendering-vertical-expected.txt: Removed. * media/track/track-cue-rendering-with-padding.html: Removed. * media/track/track-cue-rendering-with-padding-expected.txt: Removed. * media/track/track-cues-cuechange.html: * media/track/track-cues-enter-exit.html: * media/track/track-forced-subtitles-in-band.html: * media/track/track-forced-subtitles-in-band-expected.txt: * media/track/track-in-band-duplicate-tracks-when-source-changes.html: * media/track/track-in-band-legacy-api.html: * media/track/track-in-band-legacy-api-expected.txt: * media/track/track-in-band-metadata-display-order.html: Removed. * media/track/track-in-band-metadata-display-order-expected.txt: Removed. * media/track/track-in-band-mode.html: * media/track/track-in-band-mode-expected.txt: * media/track/track-in-band-style.html: Removed. * media/track/track-in-band-style-expected.txt: Removed. * media/track/track-in-band-subtitles-too-large.html: Removed. * media/track/track-in-band-subtitles-too-large-expected.txt: Removed. * media/track/track-kind.html: * media/track/track-kind-expected.txt: * media/track/track-legacyapi-with-automatic-mode.html: * media/track/track-legacyapi-with-automatic-mode-expected.txt: * media/track/track-long-word-container-sizing.html: Removed. * media/track/track-long-word-container-sizing-expected.txt: Removed. * media/track/track-manual-mode.html: * media/track/track-manual-mode-expected.txt: * media/track/track-user-preferences.html: Removed. * media/track/track-user-preferences-expected.txt: Removed. * media/track/track-user-stylesheet.html: * media/track/track-user-stylesheet-expected.txt: * media/trackmenu-test.js: Removed. * media/video-click-dblckick-standalone.html: Removed. * media/video-click-dblckick-standalone-expected.txt: Removed. * media/video-controls-audiotracks-trackmenu.html: Removed. * media/video-controls-audiotracks-trackmenu-expected.txt: Removed. * media/video-controls-captions.html: Removed. * media/video-controls-captions-expected.txt: Removed. * media/video-controls-captions-trackmenu.html: Removed. * platform/gtk/media/video-controls-captions-trackmenu-expected.txt: Removed. * platform/ios/media/video-controls-captions-trackmenu-expected.txt: Removed. * platform/mac/media/video-controls-captions-trackmenu-expected.txt: Removed. * platform/wincairo/media/video-controls-captions-trackmenu-expected.txt: Removed. * media/video-controls-captions-trackmenu-hide-on-click.html: Removed. * platform/gtk/media/video-controls-captions-trackmenu-hide-on-click-expected.txt: Removed. * platform/ios/media/video-controls-captions-trackmenu-hide-on-click-expected.txt: Removed. * platform/mac/media/video-controls-captions-trackmenu-hide-on-click-expected.txt: Removed. * platform/wincairo/media/video-controls-captions-trackmenu-hide-on-click-expected.txt: Removed. * media/video-controls-captions-trackmenu-hide-on-click-outside.html: Removed. * media/video-controls-captions-trackmenu-hide-on-click-outside-expected.txt: Removed. * media/video-controls-captions-trackmenu-includes-enabled-track.html: Removed. * media/video-controls-captions-trackmenu-includes-enabled-track-expected.txt: Removed. * media/video-controls-captions-trackmenu-localized.html: Removed. * platform/gtk/media/video-controls-captions-trackmenu-localized-expected.txt: Removed. * platform/ios/media/video-controls-captions-trackmenu-localized-expected.txt: Removed. * platform/mac/media/video-controls-captions-trackmenu-localized-expected.txt: Removed. * platform/wincairo/media/video-controls-captions-trackmenu-localized-expected.txt: Removed. * media/video-controls-captions-trackmenu-only-captions-descriptions-and-subtitles.html: Removed. * media/video-controls-captions-trackmenu-only-captions-descriptions-and-subtitles-expected.txt: Removed. * platform/gtk/media/video-controls-captions-trackmenu-only-captions-descriptions-and-subtitles-expected.txt: Removed. * platform/mac/media/video-controls-captions-trackmenu-only-captions-descriptions-and-subtitles-expected.txt: Removed. * media/video-controls-captions-trackmenu-sorted.html: Removed. * platform/gtk/media/video-controls-captions-trackmenu-sorted-expected.txt: Removed. * platform/ios/media/video-controls-captions-trackmenu-sorted-expected.txt: Removed. * platform/mac/media/video-controls-captions-trackmenu-sorted-expected.txt: Removed. * platform/win/media/video-controls-captions-trackmenu-sorted-expected.txt: Removed. * platform/wincairo/media/video-controls-captions-trackmenu-sorted-expected.txt: Removed. * media/video-controls-drop-and-restore-timeline.html: Removed. * media/video-controls-drop-and-restore-timeline-expected.txt: Removed. * media/video-controls-fullscreen-volume.html: Removed. * media/video-controls-fullscreen-volume-expected.txt: Removed. * media/video-controls-in-media-document.html: Removed. * media/video-controls-in-media-document-expected.txt: Removed. * media/video-controls-no-display-with-text-track.html: Removed. * media/video-controls-no-display-with-text-track-expected.txt: Removed. * media/video-controls-rendering.html: Removed. * platform/gtk/media/video-controls-rendering-expected.txt: Removed. * platform/ios/media/video-controls-rendering-expected.txt: Removed. * platform/mac/media/video-controls-rendering-expected.txt: Removed. * platform/win/media/video-controls-rendering-expected.txt: Removed. * platform/wincairo/media/video-controls-rendering-expected.txt: Removed. * media/video-controls-show-on-kb-or-ax-event.html: Removed. * media/video-controls-show-on-kb-or-ax-event-expected.txt: Removed. * media/video-controls-toggling.html: Removed. * media/video-controls-toggling-expected.txt: Removed. * media/video-controls-transformed.html: Removed. * media/video-controls-transformed-expected.txt: Removed. * media/video-controls-visible-audio-only.html: Removed. * media/video-controls-visible-audio-only-expected.txt: Removed. * media/video-controls-visible-exiting-fullscreen.html: Removed. * media/video-controls-visible-exiting-fullscreen-expected.txt: Removed. * media/video-controls-zoomed.html: Removed. * media/video-controls-zoomed-expected.txt: Removed. * media/video-display-toggle.html: Removed. * platform/gtk/media/video-display-toggle-expected.txt: Removed. * platform/ios/media/video-display-toggle-expected.txt: Removed. * platform/mac-catalina/media/video-display-toggle-expected.txt: Removed. * platform/mac-mojave/media/video-display-toggle-expected.txt: Removed. * platform/mac/media/video-display-toggle-expected.txt: Removed. * platform/win/media/video-display-toggle-expected.txt: Removed. * platform/wincairo/media/video-display-toggle-expected.txt: Removed. * media/video-empty-source.html: Removed. * platform/gtk/media/video-empty-source-expected.txt: Removed. * platform/ios/media/video-empty-source-expected.txt: Removed. * platform/mac/media/video-empty-source-expected.txt: Removed. * platform/win/media/video-empty-source-expected.txt: Removed. * platform/wincairo/media/video-empty-source-expected.txt: Removed. * media/video-fullscreen-only-controls.html: Removed. * media/video-fullscreen-only-controls-expected.txt: Removed. * media/video-fullscreen-only-playback.html: * media/video-initially-hidden-volume-slider-up.html: Removed. * media/video-initially-hidden-volume-slider-up-expected.txt: Removed. * media/video-no-audio.html: Removed. * platform/gtk/media/video-no-audio-expected.txt: Removed. * platform/ios/media/video-no-audio-expected.txt: Removed. * platform/mac-catalina/media/video-no-audio-expected.txt: Removed. * platform/mac/media/video-no-audio-expected.txt: Removed. * platform/win/media/video-no-audio-expected.txt: Removed. * platform/wincairo/media/video-no-audio-expected.txt: Removed. * media/video-play-audio-require-user-gesture.html: Removed. * media/video-play-audio-require-user-gesture-expected.txt: Removed. * media/video-play-require-user-gesture.html: Removed. * media/video-play-require-user-gesture-expected.txt: Removed. * media/video-trackmenu-selection.html: Removed. * media/video-trackmenu-selection-expected.txt: Removed. * media/video-volume-slider.html: Removed. * platform/gtk/media/video-volume-slider-expected.txt: Removed. * platform/ios/media/video-volume-slider-expected.txt: Removed. * platform/mac-catalina/media/video-volume-slider-expected.txt: Removed. * platform/mac-mojave/media/video-volume-slider-expected.txt: Removed. * platform/mac/media/video-volume-slider-expected.txt: Removed. * platform/win/media/video-volume-slider-expected.txt: Removed. * platform/wincairo/media/video-volume-slider-expected.txt: Removed. * media/video-volume-slider-drag.html: Removed. * media/video-volume-slider-drag-expected.txt: Removed. * media/video-zoom-controls.html: Removed. * platform/gtk/media/video-zoom-controls-expected.txt: Removed. * platform/ios/media/video-zoom-controls-expected.txt: Removed. * platform/mac/media/video-zoom-controls-expected.txt: Removed. * platform/win/media/video-zoom-controls-expected.txt: Removed. * platform/wincairo/media/video-zoom-controls-expected.txt: Removed. * media/volume-bar-empty-when-muted.html: Removed. * media/volume-bar-empty-when-muted-expected.txt: Removed. * platform/gtk/media/volume-bar-empty-when-muted-expected.txt: Removed. * platform/mac/media/volume-bar-empty-when-muted-expected.txt: Removed. * platform/ios/media/video-play-glyph-composited-outside-overflow-scrolling-touch-container.html: Removed. * platform/ios/media/video-play-glyph-composited-outside-overflow-scrolling-touch-container-expected.txt: Removed. * platform/mac/media/video-layer-crash-expected.txt: * TestExpectations: * platform/glib/TestExpectations: * platform/gtk/TestExpectations: * platform/gtk-wayland/TestExpectations: * platform/ios/TestExpectations: * platform/ios-device/TestExpectations: * platform/ios-simulator/TestExpectations: * platform/ios-wk2/TestExpectations: * platform/ipad/TestExpectations: * platform/mac/TestExpectations: * platform/mac-wk1/TestExpectations: * platform/mac-wk2/TestExpectations: * platform/win/TestExpectations: * platform/wincairo/TestExpectations: * platform/wincairo-wk1/TestExpectations: * platform/wpe/TestExpectations: Canonical link: https://commits.webkit.org/235609@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274810 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-22 22:17:49 +00:00
2021-03-22 Devin Rousso <drousso@apple.com>
Remove unused JS and CSS files of media controls
https://bugs.webkit.org/show_bug.cgi?id=214955
<rdar://problem/66604040>
Reviewed by Eric Carlson.
Cocoa platforms are already using modern media controls so there's no reason to keep the old
media controls resources/logic around any longer. It just wastes space.
The non-iOS Apple controls must be kept though as they are still used on Windows.
* wtf/PlatformEnable.h:
* wtf/PlatformEnableCocoa.h:
* Scripts/Preferences/WebPreferences.yaml:
Replace `ModernMediaControlsEnabled` setting with `ENABLE_MODERN_MEDIA_CONTROLS` build flag.
[css-contain] Parse CSS contain property https://bugs.webkit.org/show_bug.cgi?id=223252 Patch by Rob Buis <rbuis@igalia.com> on 2021-03-22 Reviewed by Darin Adler. LayoutTests/imported/w3c: Adjust test expectations. * web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt: * web-platform-tests/css/css-contain/content-visibility/content-visibility-026-expected.txt: * web-platform-tests/css/css-contain/inheritance-expected.txt: * web-platform-tests/css/css-contain/parsing/contain-computed-expected.txt: * web-platform-tests/css/css-contain/parsing/contain-valid-expected.txt: * web-platform-tests/css/cssom/cssstyledeclaration-csstext-expected.txt: Source/WebCore: Parse CSS contain property according to the specification [1]. This patch also adds the experimental feature CSSContainment and makes contain invisible from style when disabled. [1] https://drafts.csswg.org/css-contain-1/#contain-property Test: fast/css/contain-invalidate-if-disabled.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): * css/CSSProperties.json: * css/CSSValueKeywords.in: * css/parser/CSSParserContext.cpp: (WebCore::operator==): (WebCore::CSSParserContext::isPropertyRuntimeDisabled const): * css/parser/CSSParserContext.h: (WebCore::CSSParserContextHash::hash): * css/parser/CSSPropertyParser.cpp: (WebCore::consumeContain): (WebCore::CSSPropertyParser::parseSingleValue): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::contain const): (WebCore::RenderStyle::setContain): (WebCore::RenderStyle::initialContainment): (WebCore::RenderStyle::strictContainment): (WebCore::RenderStyle::contentContainment): * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): (WebCore::StyleRareNonInheritedData::operator== const): * rendering/style/StyleRareNonInheritedData.h: * style/StyleBuilderCustom.h: (WebCore::Style::BuilderCustom::applyInitialContain): (WebCore::Style::BuilderCustom::applyInheritContain): (WebCore::Style::BuilderCustom::applyValueContain): Source/WTF: Add experimental feature flag. * Scripts/Preferences/WebPreferencesExperimental.yaml: Tools: Add support for disabling aspect-ratio in win wk1. * DumpRenderTree/TestOptions.cpp: (WTR::TestOptions::defaults): LayoutTests: Add test to verify that contain is invisible from style when disabled. * fast/css/contain-invalidate-if-disabled-expected.txt: Added. * fast/css/contain-invalidate-if-disabled.html: Added. * platform/gtk/imported/w3c/web-platform-tests/css/cssom/cssstyledeclaration-csstext-expected.txt: * platform/ios-wk2/imported/w3c/web-platform-tests/css/cssom/cssstyledeclaration-csstext-expected.txt: * platform/wpe/imported/w3c/web-platform-tests/css/cssom/cssstyledeclaration-csstext-expected.txt: Canonical link: https://commits.webkit.org/235596@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274793 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-22 20:51:10 +00:00
2021-03-22 Rob Buis <rbuis@igalia.com>
[css-contain] Parse CSS contain property
https://bugs.webkit.org/show_bug.cgi?id=223252
Reviewed by Darin Adler.
Add experimental feature flag.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
2021-03-22 Ross Kirsling <ross.kirsling@sony.com>
Unreviewed, fix Mac and non-unified JSCOnly builds
https://bugs.webkit.org/show_bug.cgi?id=223546
* wtf/PlatformJSCOnly.cmake:
Add missing file for JSCOnly build on Mac.
[Cocoa] Make it possible to release a WKWebView on a non-main thread without a crash due to WKScriptMessage race https://bugs.webkit.org/show_bug.cgi?id=222336 Reviewed by Chris Dumez. Source/JavaScriptCore: * API/ObjcRuntimeExtras.h: Removed declarations of objc_initWeak and objc_destroyWeak, since these are already in <wtf/spi/cocoa/objcSPI.h>. Source/WebKit: * Platform/spi/Cocoa/objcSPI.h: Removed this unused file. * UIProcess/API/C/mac/WKPagePrivateMac.mm: (WKPageGetWebView): Use WKPageProxy::cocoaView instead of fromWebPageProxy. * UIProcess/API/Cocoa/WKDownload.mm: (-[WKDownload webView]): Ditto. * UIProcess/API/Cocoa/WKFrameInfo.mm: (-[WKFrameInfo webView]): Ditto. * UIProcess/API/Cocoa/WKUserContentController.mm: (ScriptMessageHandlerDelegate::didPostMessage): Use WKPageProxy::cocoaView instead of fromWebPageProxy and add null checks. (ScriptMessageHandlerDelegate::didPostMessageWithAsyncReply): Ditto. * UIProcess/API/Cocoa/WKWebView.mm: (pageToViewMap): Deleted. (fromWebPageProxy): Deleted. (-[WKWebView _initializeWithConfiguration:]): Use WKPageProxy::setCocoaView instead of adding the page/view pair to a map. (-[WKWebView dealloc]): Removed code that removed the page/view pair from the map. * UIProcess/API/Cocoa/WKWebViewInternal.h: Removed fromWebPageProxy. * UIProcess/API/Cocoa/_WKDownload.mm: (-[_WKDownload originatingWebView]): Use WKPageProxy::cocoaView instead of fromWebPageProxy. * UIProcess/API/Cocoa/_WKFrameTreeNode.mm: (-[_WKFrameTreeNode webView]): Ditto. * UIProcess/API/Cocoa/_WKInspector.mm: (-[_WKInspector webView]): Ditto. * UIProcess/API/Cocoa/_WKInspectorTesting.mm: (-[_WKInspector inspectorWebView]): Ditto. * UIProcess/Cocoa/AutomationSessionClient.mm: (WebKit::AutomationSessionClient::requestSwitchToPage): Use WKPageProxy::cocoaView instead of fromWebPageProxy and add a null check. (WebKit::AutomationSessionClient::requestHideWindowOfPage): Ditto. (WebKit::AutomationSessionClient::requestRestoreWindowOfPage): Ditto. (WebKit::AutomationSessionClient::requestMaximizeWindowOfPage): Ditto. (WebKit::AutomationSessionClient::isShowingJavaScriptDialogOnPage): Ditto. (WebKit::AutomationSessionClient::dismissCurrentJavaScriptDialogOnPage): Ditto. (WebKit::AutomationSessionClient::acceptCurrentJavaScriptDialogOnPage): Ditto. (WebKit::AutomationSessionClient::messageOfCurrentJavaScriptDialogOnPage): Ditto. (WebKit::AutomationSessionClient::setUserInputForCurrentJavaScriptPromptOnPage): Ditto. (WebKit::AutomationSessionClient::typeOfCurrentJavaScriptDialogOnPage): Ditto. (WebKit::AutomationSessionClient::currentPresentationOfPage): Ditto. * UIProcess/Cocoa/MediaPermissionUtilities.mm: (WebKit::alertForPermission): Use WKPageProxy::cocoaView instead of fromWebPageProxy. * UIProcess/Cocoa/SOAuthorization/PopUpSOAuthorizationSession.mm: (WebKit::PopUpSOAuthorizationSession::abortInternal): Added a null check since initSecretWebView is no longer guaranteed to allocate m_secretWebView in the case where the WKWebView is nil. (WebKit::PopUpSOAuthorizationSession::completeInternal): Ditto. (WebKit::PopUpSOAuthorizationSession::initSecretWebView): Use WKPageProxy::cocoaView instead of fromWebPageProxy and added a null check. * UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm: (WebKit::SOAuthorizationSession::continueStartAfterDecidePolicy): Use WKPageProxy::cocoaView instead of fromWebPageProxy. * UIProcess/Cocoa/WebURLSchemeHandlerCocoa.mm: (WebKit::WebURLSchemeHandlerCocoa::platformStartTask): Use WKPageProxy::cocoaView instead of fromWebPageProxy and added a null check. (WebKit::WebURLSchemeHandlerCocoa::platformStopTask): Ditto. Also call the new suppressTaskStoppedExceptions if we are unable to call the delegate method due to the WKWebView already being nil. * UIProcess/PDF/WKPDFHUDView.mm: (-[WKPDFHUDView hitTest:]): Use WKPageProxy::cocoaView instead of fromWebPageProxy. * UIProcess/WebURLSchemeTask.cpp: (WebKit::WebURLSchemeTask::didPerformRedirection): Don't raise the "task stopped" exception if it has been explicitly suppressed. (WebKit::WebURLSchemeTask::didReceiveResponse): Ditto. (WebKit::WebURLSchemeTask::didReceiveData): Ditto. (WebKit::WebURLSchemeTask::didComplete): Ditto. * UIProcess/WebURLSchemeTask.h: Added a suppressTaskStoppedExceptions function, which we use to prevent exceptions in the case where the WKWebView was deallocated. Since we were not able to call the delegate method in that case, the caller can't be expected to refrain from calling methods. Eventually, clients of WKWebView could avoid this by calling the _close method instead of relying for deallocation to do web view teardown, but we need to promote that from SPI to API. * UIProcess/WebPageProxy.h: Tweaked forward declarations a bit, and added one for WKWebView. Marked the class final and use final instead of override. Added Cocoa-only cocoaView and setCocoaView function members, and m_cocoaView data member. Also added inline implementations but only compile them when included from an Objective-C source file. * WebKit.xcodeproj/project.pbxproj: Removed objcSPI.h. Source/WTF: * wtf/spi/cocoa/objcSPI.h: Removed unnecessary #if so functions are correctly compiled for non-Objective-C source files. Added include of <objc/objc.h> so that "id" is defined. Tools: * TestWebKitAPI/Tests/WebKitCocoa/WKURLSchemeHandler-1.mm: Use _close instead of WKWebView deallocation to trigger a call to stopURLSchemeTask, since such delegate methods will intentionally no longer be delivered if triggered by deallocation. Canonical link: https://commits.webkit.org/235574@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274764 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-22 18:45:13 +00:00
2021-03-19 Darin Adler <darin@apple.com>
[Cocoa] Make it possible to release a WKWebView on a non-main thread without a crash due to WKScriptMessage race
https://bugs.webkit.org/show_bug.cgi?id=222336
Reviewed by Chris Dumez.
* wtf/spi/cocoa/objcSPI.h: Removed unnecessary #if so functions are correctly compiled for
non-Objective-C source files. Added include of <objc/objc.h> so that "id" is defined.
Add PropertyName parameter to custom setters to allow shared implementations to do late name lookup https://bugs.webkit.org/show_bug.cgi?id=223413 Reviewed by Alexey Shvayka. Source/JavaScriptCore: Make custom setters match custom getters by adding a PropertyName parameter. This will be used by the CSSStyleDeclaration bindings to avoid > 1000 copies of the same getter/setter code, which will instead be able to differentiate using the name. * bytecode/AccessCase.cpp: (JSC::AccessCase::generateImpl): * jsc.cpp: (JSC_DEFINE_CUSTOM_SETTER): * runtime/CustomGetterSetter.cpp: (JSC::callCustomSetter): * runtime/CustomGetterSetter.h: * runtime/JSCJSValue.cpp: (JSC::JSValue::putToPrimitive): * runtime/JSCustomSetterFunction.cpp: (JSC::JSC_DEFINE_HOST_FUNCTION): (JSC::JSCustomSetterFunction::JSCustomSetterFunction): (JSC::JSCustomSetterFunction::create): * runtime/JSCustomSetterFunction.h: * runtime/JSObject.cpp: (JSC::JSObject::putInlineSlow): * runtime/Lookup.h: (JSC::putEntry): * runtime/PropertySlot.h: * runtime/RegExpConstructor.cpp: (JSC::JSC_DEFINE_CUSTOM_SETTER): * runtime/RegExpObject.cpp: (JSC::JSC_DEFINE_CUSTOM_SETTER): * tools/JSDollarVM.cpp: Source/WebCore: Update bindings to account for new PropertyName parameter being passed to custom setters. * bindings/scripts/CodeGeneratorJS.pm: (GenerateAttributeSetterTrampolineDefinition): * bindings/scripts/test/JS/JSDOMWindow.cpp: (WebCore::JSC_DEFINE_CUSTOM_SETTER): * bindings/scripts/test/JS/JSDedicatedWorkerGlobalScope.cpp: (WebCore::JSC_DEFINE_CUSTOM_SETTER): * bindings/scripts/test/JS/JSPaintWorkletGlobalScope.cpp: (WebCore::JSC_DEFINE_CUSTOM_SETTER): * bindings/scripts/test/JS/JSServiceWorkerGlobalScope.cpp: (WebCore::JSC_DEFINE_CUSTOM_SETTER): * bindings/scripts/test/JS/JSTestCEReactions.cpp: (WebCore::JSC_DEFINE_CUSTOM_SETTER): * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp: (WebCore::JSC_DEFINE_CUSTOM_SETTER): * bindings/scripts/test/JS/JSTestCSSProperty.cpp: (WebCore::JSC_DEFINE_CUSTOM_SETTER): * bindings/scripts/test/JS/JSTestCallTracer.cpp: (WebCore::JSC_DEFINE_CUSTOM_SETTER): * bindings/scripts/test/JS/JSTestConditionalIncludes.cpp: (WebCore::JSC_DEFINE_CUSTOM_SETTER): * bindings/scripts/test/JS/JSTestConditionallyReadWrite.cpp: (WebCore::JSC_DEFINE_CUSTOM_SETTER): * bindings/scripts/test/JS/JSTestDefaultToJSON.cpp: (WebCore::JSC_DEFINE_CUSTOM_SETTER): * bindings/scripts/test/JS/JSTestDefaultToJSONInherit.cpp: (WebCore::JSC_DEFINE_CUSTOM_SETTER): * bindings/scripts/test/JS/JSTestDefaultToJSONInheritFinal.cpp: (WebCore::JSC_DEFINE_CUSTOM_SETTER): * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp: (WebCore::JSC_DEFINE_CUSTOM_SETTER): * bindings/scripts/test/JS/JSTestEnabledForContext.cpp: (WebCore::JSC_DEFINE_CUSTOM_SETTER): * bindings/scripts/test/JS/JSTestGlobalObject.cpp: (WebCore::JSC_DEFINE_CUSTOM_SETTER): * bindings/scripts/test/JS/JSTestInterface.cpp: (WebCore::JSC_DEFINE_CUSTOM_SETTER): * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp: (WebCore::JSC_DEFINE_CUSTOM_SETTER): * bindings/scripts/test/JS/JSTestLegacyNoInterfaceObject.cpp: (WebCore::JSC_DEFINE_CUSTOM_SETTER): * bindings/scripts/test/JS/JSTestMapLikeWithOverriddenOperations.cpp: (WebCore::JSC_DEFINE_CUSTOM_SETTER): * bindings/scripts/test/JS/JSTestNode.cpp: (WebCore::JSC_DEFINE_CUSTOM_SETTER): * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::JSC_DEFINE_CUSTOM_SETTER): * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: (WebCore::JSC_DEFINE_CUSTOM_SETTER): * bindings/scripts/test/JS/JSTestSetLikeWithOverriddenOperations.cpp: (WebCore::JSC_DEFINE_CUSTOM_SETTER): * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp: (WebCore::JSC_DEFINE_CUSTOM_SETTER): * bindings/scripts/test/JS/JSTestTypedefs.cpp: (WebCore::JSC_DEFINE_CUSTOM_SETTER): * bindings/scripts/test/JS/JSWorkerGlobalScope.cpp: (WebCore::JSC_DEFINE_CUSTOM_SETTER): * bindings/scripts/test/JS/JSWorkletGlobalScope.cpp: (WebCore::JSC_DEFINE_CUSTOM_SETTER): Source/WTF: * wtf/PlatformCallingConventions.h: Update JSC_DECLARE_CUSTOM_SETTER to account for the new PropertyName parameter. Canonical link: https://commits.webkit.org/235544@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274724 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-19 17:24:14 +00:00
2021-03-19 Sam Weinig <weinig@apple.com>
Add PropertyName parameter to custom setters to allow shared implementations to do late name lookup
https://bugs.webkit.org/show_bug.cgi?id=223413
Reviewed by Alexey Shvayka.
* wtf/PlatformCallingConventions.h:
Update JSC_DECLARE_CUSTOM_SETTER to account for the new PropertyName parameter.
== Rolled over to ChangeLog-2021-03-18 ==