Title: [258128] trunk/Source/WebKit
Revision
258128
Author
[email protected]
Date
2020-03-08 20:35:19 -0700 (Sun, 08 Mar 2020)

Log Message

CAN_SECURELY_ARCHIVE_FILE_WRAPPER incorrectly excludes watchOS and tvOS
https://bugs.webkit.org/show_bug.cgi?id=208791

Reviewed by Tim Horton.

This is one of several places where a __IPHONE_OS_VERSION_MIN_REQUIRED check unintentionally caused a compiler
flag to not be defined on watchOS, when it really should apply to all iOS family targets. Now that we don't
care about building for any iOS family targets aligned with iOS 11 or prior, and also don't build for 10.13 and
prior, we can simply remove the !CAN_SECURELY_ARCHIVE_FILE_WRAPPER codepath.

* UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
(API::Attachment::createSerializedRepresentation const):
(API::Attachment::updateFromSerializedRepresentation):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (258127 => 258128)


--- trunk/Source/WebKit/ChangeLog	2020-03-09 01:32:25 UTC (rev 258127)
+++ trunk/Source/WebKit/ChangeLog	2020-03-09 03:35:19 UTC (rev 258128)
@@ -1,3 +1,19 @@
+2020-03-08  Wenson Hsieh  <[email protected]>
+
+        CAN_SECURELY_ARCHIVE_FILE_WRAPPER incorrectly excludes watchOS and tvOS
+        https://bugs.webkit.org/show_bug.cgi?id=208791
+
+        Reviewed by Tim Horton.
+
+        This is one of several places where a __IPHONE_OS_VERSION_MIN_REQUIRED check unintentionally caused a compiler
+        flag to not be defined on watchOS, when it really should apply to all iOS family targets. Now that we don't
+        care about building for any iOS family targets aligned with iOS 11 or prior, and also don't build for 10.13 and
+        prior, we can simply remove the !CAN_SECURELY_ARCHIVE_FILE_WRAPPER codepath.
+
+        * UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
+        (API::Attachment::createSerializedRepresentation const):
+        (API::Attachment::updateFromSerializedRepresentation):
+
 2020-03-08  Brent Fulgham  <[email protected]>
 
         Revise In-App Browser Privacy checks to better reflect the meaning of the flag

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/APIAttachmentCocoa.mm (258127 => 258128)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/APIAttachmentCocoa.mm	2020-03-09 01:32:25 UTC (rev 258127)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/APIAttachmentCocoa.mm	2020-03-09 03:35:19 UTC (rev 258128)
@@ -36,8 +36,6 @@
 #import <CoreServices/CoreServices.h>
 #endif
 
-#define CAN_SECURELY_ARCHIVE_FILE_WRAPPER (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 120000)
-
 namespace API {
 
 static WTF::String mimeTypeInferredFromFileExtension(const API::Attachment& attachment)
@@ -160,12 +158,7 @@
     if (!fileWrapper || !m_webPage)
         return nullptr;
 
-#if CAN_SECURELY_ARCHIVE_FILE_WRAPPER
-    constexpr BOOL secureCoding = YES;
-#else
-    constexpr BOOL secureCoding = NO;
-#endif
-    NSData *serializedData = [NSKeyedArchiver archivedDataWithRootObject:fileWrapper requiringSecureCoding:secureCoding error:nullptr];
+    NSData *serializedData = [NSKeyedArchiver archivedDataWithRootObject:fileWrapper requiringSecureCoding:YES error:nullptr];
     if (!serializedData)
         return nullptr;
 
@@ -181,13 +174,7 @@
     if (!serializedData)
         return;
 
-#if CAN_SECURELY_ARCHIVE_FILE_WRAPPER
     NSFileWrapper *fileWrapper = [NSKeyedUnarchiver unarchivedObjectOfClasses:m_webPage->pageClient().serializableFileWrapperClasses() fromData:serializedData.get() error:nullptr];
-#else
-    ALLOW_DEPRECATED_DECLARATIONS_BEGIN
-    NSFileWrapper *fileWrapper = [NSKeyedUnarchiver unarchiveObjectWithData:serializedData.get()];
-    ALLOW_DEPRECATED_DECLARATIONS_END
-#endif
     if (![fileWrapper isKindOfClass:NSFileWrapper.class])
         return;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to