Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 62b32a176f306013c753c4c506237d3967eff21c
https://github.com/WebKit/WebKit/commit/62b32a176f306013c753c4c506237d3967eff21c
Author: Kimmo Kinnunen <[email protected]>
Date: 2022-10-15 (Sat, 15 Oct 2022)
Changed paths:
M Source/WTF/wtf/CompletionHandler.h
M Source/WTF/wtf/ThreadAssertions.h
M Tools/TestWebKitAPI/CMakeLists.txt
M Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
A Tools/TestWebKitAPI/Tests/WTF/CompletionHandlerTests.cpp
M Tools/TestWebKitAPI/Tests/WTF/RunLoop.cpp
M Tools/TestWebKitAPI/Utilities.h
Log Message:
-----------
CompletionHandler cannot be called from arbitrary thread
https://bugs.webkit.org/show_bug.cgi?id=246271
rdar://problem/100969234
Reviewed by Chris Dumez.
Add CompletionHandlerCallThread::AnyThread so that one can pass
completion handlers that can be called from an arbitrary thread.
Implement with ThreadLikeAssertion, so that the thread check is
exact.
Add symbolic thread names for specifying the ThreadAssertions.
Make the symbolic thread names as their own types (AnyThreadLike,
... ) so that most of the ThreadLikeAssertion constructing callchains
can be constexpr. Also in future APIs, these can be used in the type
definititions instead of relying on assertions. Example:
CompletionHandler<void(), AnyThreadLike> (if this turns out
to make sense).
* Source/WTF/wtf/CompletionHandler.h:
(WTF::CompletionHandler<Out):
(WTF::CompletionHandlerWithFinalizer<Out):
* Source/WTF/wtf/ThreadAssertions.h:
(WTF::MainThreadLike::operator uint32_t const):
(WTF::CurrentThreadLike::operator uint32_t const):
(WTF::AnyThreadLike::operator uint32_t const):
(WTF::NoneThreadLike::operator uint32_t const):
(WTF::ThreadLikeAssertion::ThreadLikeAssertion):
(WTF::ThreadLikeAssertion::operator=):
(WTF::ThreadLikeAssertion::isCurrent const):
(WTF::WTF_ASSERTS_ACQUIRED_CAPABILITY):
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/WTF/CompletionHandlerTests.cpp: Added.
(TestWebKitAPI::TEST_F):
(TestWebKitAPI::TEST):
* Tools/TestWebKitAPI/Tests/WTF/RunLoop.cpp:
(TestWebKitAPI::TEST):
* Tools/TestWebKitAPI/Utilities.h:
Canonical link: https://commits.webkit.org/255576@main
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes