[webkit-changes] [WebKit/WebKit] 2f9450: [WTF] Implement convenience functions for CFArray ...
EWS
noreply at github.com
Tue Sep 20 01:23:15 PDT 2022
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 2f9450c601c6090870dcfe81c870bc54d880ebda
https://github.com/WebKit/WebKit/commit/2f9450c601c6090870dcfe81c870bc54d880ebda
Author: David Kilzer <ddkilzer at apple.com>
Date: 2022-09-20 (Tue, 20 Sep 2022)
Changed paths:
M Source/WTF/WTF.xcodeproj/project.pbxproj
M Source/WTF/wtf/PlatformMac.cmake
M Source/WTF/wtf/PlatformWin.cmake
A Source/WTF/wtf/cf/VectorCF.h
M Source/WTF/wtf/text/WTFString.h
M Source/WTF/wtf/text/cf/StringCF.cpp
M Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp
M Source/WebCore/platform/graphics/ca/win/PlatformCAAnimationWin.cpp
M Source/WebKit/NetworkProcess/webrtc/NetworkRTCResolverCocoa.cpp
M Source/WebKit/Shared/cf/CookieStorageUtilsCF.mm
M Source/WebKitLegacy/win/WebHistoryItem.cpp
M Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
A Tools/TestWebKitAPI/Tests/WTF/cf/VectorCF.cpp
Log Message:
-----------
[WTF] Implement convenience functions for CFArray <-> Vector conversions
https://bugs.webkit.org/show_bug.cgi?id=245284
<rdar://100032945>
Reviewed by Darin Adler.
* Source/WTF/WTF.xcodeproj/project.pbxproj:
* Source/WTF/wtf/PlatformMac.cmake:
* Source/WTF/wtf/PlatformWin.cmake:
- Add VectorCF.h to project files.
* Source/WTF/wtf/cf/VectorCF.h: Copied from Source/WTF/wtf/cocoa/VectorCocoa.h.
- Add convenience functions for CFArray <-> Vector conversions.
(WTF::ParameterTypeTraits): Add.
- Get the type of the first parameter of a lambda.
(WTF::LambdaTypeTraits): Add.
- Get type traits for a lambda like the return type and
parameter count.
(WTF::addUnlessNil): Add.
(WTF::createCFArray): Add.
- This uses Checked<> to convert from size_t to CFIndex.
(WTF::makeVector<String>): Add specialization.
(WTF::makeVector): Add.
- Use dynamic_cf_cast<>() to avoid having to do it at the call
site, and take a CFType template parameter so that helper
functions use a specific CF type.
(WTF::vectorFromCFData): Add.
- Use Checked<> to convert from CFData to Vector<uint8_t>.
(WTF::makeVectorElement): Add.
(WTF::makeCFArrayElement): Add.
- Add convenience function for float <-> CFNumberRef.
* Source/WTF/wtf/text/WTFString.h:
(WTF::makeCFArrayElement):
(WTF::makeVectorElement):
* Source/WTF/wtf/text/cf/StringCF.cpp:
(WTF::makeCFArrayElement):
(WTF::makeVectorElement):
- Add helper functions for CFString <-> String conversions.
* Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp:
(WebCore::CaptionUserPreferencesMediaAF::platformPreferredLanguages):
(WebCore::CaptionUserPreferencesMediaAF::preferredAudioCharacteristics const):
- Use makeVector<String>().
* Source/WebCore/platform/graphics/ca/win/PlatformCAAnimationWin.cpp:
(PlatformCAAnimationWin::setValues):
(PlatformCAAnimationWin::setKeyTimes):
(PlatformCAAnimationWin::setTimingFunctions):
(PlatformCAAnimationWin::setAnimations):
- Use createCFArray().
* Source/WebKit/NetworkProcess/webrtc/NetworkRTCResolverCocoa.cpp:
(WebKit::resolvedName):
- Use makeVector<WebCore::IPAddress, CFDataRef>().
* Source/WebKit/Shared/cf/CookieStorageUtilsCF.mm:
(WebKit::identifyingDataFromCookieStorage):
- Use vectorFromCFData().
* Source/WebKitLegacy/win/WebHistoryItem.cpp:
(WebHistoryItem::initFromDictionaryRepresentation):
- Use makeVector<String>().
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
- Add missing RetainPtrHashing.cpp tests!
- Move tests for code in WTF into the TestWTF target.
- Add VectorCF.cpp tests.
* Tools/TestWebKitAPI/Tests/WTF/cf/VectorCF.cpp: Add.
(TestWebKitAPI::TEST):
- Add tests for VectorCF.h.
Canonical link: https://commits.webkit.org/254665@main
More information about the webkit-changes
mailing list