Skip to content

Commit

Permalink
Update serialization for NSURLRequest
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=278024
rdar://133775452

Reviewed by Alex Christensen.

Increase platforms to WatchOS and tvOS.

* Source/WTF/wtf/PlatformHave.h:
* Source/WebKit/Shared/Cocoa/CoreIPCNSURLRequest.mm:
(WebKit::CoreIPCNSURLRequest::toID const):

Canonical link: https://commits.webkit.org/282499@main
  • Loading branch information
sheeparegreat authored and achristensen07 committed Aug 20, 2024
1 parent 1aedd1d commit 3df65b3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Source/WTF/wtf/PlatformHave.h
Original file line number Diff line number Diff line change
Expand Up @@ -1437,7 +1437,9 @@

#if ((PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 150000) \
|| ((PLATFORM(IOS) || PLATFORM(MACCATALYST)) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 180000) \
|| (PLATFORM(VISION) && __VISION_OS_VERSION_MIN_REQUIRED >= 20000))
|| (PLATFORM(VISION) && __VISION_OS_VERSION_MIN_REQUIRED >= 20000)) \
|| (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 110000) \
|| (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 180000)
#define HAVE_WK_SECURE_CODING_NSURLREQUEST 1
#endif

Expand Down
4 changes: 2 additions & 2 deletions Source/WebKit/Shared/Cocoa/CoreIPCNSURLRequest.mm
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ - (instancetype)_initWithWebKitPropertyListData:(NSDictionary *)plist;

RetainPtr<id> CoreIPCNSURLRequest::toID() const
{
auto dict = adoptNS([[NSMutableDictionary alloc] initWithCapacity:19]);
auto dict = adoptNS([[NSMutableDictionary alloc] initWithCapacity:43]); // Initialized with the count of members in CoreIPCNSURLRequestData

SET_DICT_FROM_OPTIONAL_MEMBER(protocolProperties);
SET_DICT_FROM_PRIMITIVE(isMutable, NSNumber, Bool);
Expand Down Expand Up @@ -310,7 +310,7 @@ - (instancetype)_initWithWebKitPropertyListData:(NSDictionary *)plist;
SET_DICT_FROM_PRIMITIVE(isWebSearchContent, NSInteger, Bool);

if (m_data.contentDispositionEncodingFallbackArray) {
auto array = adoptNS([[NSMutableArray alloc] initWithCapacity:(*m_data.contentDispositionEncodingFallbackArray).size()]);
auto array = adoptNS([[NSMutableArray alloc] initWithCapacity:m_data.contentDispositionEncodingFallbackArray->size()]);
for (auto& value : *m_data.contentDispositionEncodingFallbackArray)
[array addObject:value.toID().get()];
[dict setObject:array.get() forKey:@"contentDispositionEncodingFallbackArray"];
Expand Down

0 comments on commit 3df65b3

Please sign in to comment.