Title: [222797] branches/safari-604-branch

Diff

Modified: branches/safari-604-branch/LayoutTests/ChangeLog (222796 => 222797)


--- branches/safari-604-branch/LayoutTests/ChangeLog	2017-10-03 19:02:35 UTC (rev 222796)
+++ branches/safari-604-branch/LayoutTests/ChangeLog	2017-10-03 19:09:14 UTC (rev 222797)
@@ -1,3 +1,22 @@
+2017-10-03  Jason Marcell  <[email protected]>
+
+        Cherry-pick r222779. rdar://problem/34706688
+
+    2017-10-03  Brent Fulgham  <[email protected]>
+
+            [Mac] Use safer decoding practices for NSKeyedUnarchiver
+            https://bugs.webkit.org/show_bug.cgi?id=175887
+            <rdar://problem/33435281>
+
+            Reviewed by Daniel Bates.
+
+            Mark two tests as flaky for now, until the relevant CFNetwork changes are available on the test systems.
+            1. webarchive/loading/cache-expired-subresource.html
+            2. webarchive/loading/test-loading-archive-subresource-null-mimetype.html
+
+            * platform/ios/TestExpectations:
+            * platform/mac/TestExpectations:
+
 2017-10-01  Jason Marcell  <[email protected]>
 
         Cherry-pick r222588. rdar://problem/34717517
@@ -1716,6 +1735,22 @@
 
 2017-07-10  Brent Fulgham  <[email protected]>
 
+        Reset cookie partitioning state after network process crashes
+        https://bugs.webkit.org/show_bug.cgi?id=174306
+        <rdar://problem/33171605>
+
+        Reviewed by Daniel Bates.
+
+        * http/tests/loading/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-with-network-process-crash-expected.txt: Added.
+        * http/tests/loading/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-with-network-process-crash.html: Added.
+        * http/tests/loading/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-deletion-expected.txt: Rebaselined.
+        * http/tests/loading/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-with-partitioning-timeout-expected.txt: Rebaselined.
+        * http/tests/loading/resourceLoadStatistics/partitioned-cookies-with-and-without-user-interaction-expected.txt: Rebaselined.
+        * http/tests/loading/resourceLoadStatistics/resources/get-cookies.php:
+        * http/tests/loading/resourceLoadStatistics/resources/set-cookie.php:
+
+2017-07-10  Brent Fulgham  <[email protected]>
+
         Resource Load Statistics: Prune statistics in orders of importance
         https://bugs.webkit.org/show_bug.cgi?id=174215
         <rdar://problem/33164403>

Modified: branches/safari-604-branch/LayoutTests/platform/ios/TestExpectations (222796 => 222797)


--- branches/safari-604-branch/LayoutTests/platform/ios/TestExpectations	2017-10-03 19:02:35 UTC (rev 222796)
+++ branches/safari-604-branch/LayoutTests/platform/ios/TestExpectations	2017-10-03 19:09:14 UTC (rev 222797)
@@ -1119,6 +1119,10 @@
 webarchive/test-css-url-resources-inline-styles.html [ Failure ]
 webarchive/test-link-rel-icon.html [ Failure ]
 
+# The following two tests are expected to fail until <rdar://problem/34063313> is available on test systems.
+webarchive/loading/cache-expired-subresource.html [ Failure ]
+webarchive/loading/test-loading-archive-subresource-null-mimetype.html [ Crash ]
+
 # Webarchive tests that fail due to <https://bugs.webkit.org/show_bug.cgi?id=82665>:
 http/tests/webarchive/test-css-url-encoding-shift-jis.html
 http/tests/webarchive/test-css-url-encoding-utf-8.html

Modified: branches/safari-604-branch/LayoutTests/platform/mac/TestExpectations (222796 => 222797)


--- branches/safari-604-branch/LayoutTests/platform/mac/TestExpectations	2017-10-03 19:02:35 UTC (rev 222796)
+++ branches/safari-604-branch/LayoutTests/platform/mac/TestExpectations	2017-10-03 19:09:14 UTC (rev 222797)
@@ -221,6 +221,10 @@
 
 webkit.org/b/56685 webarchive/test-link-rel-icon.html [ Failure ]
 
+# The following two tests are expected to fail until <rdar://problem/34063313> is available on test systems.
+webarchive/loading/cache-expired-subresource.html [ Failure ]
+webarchive/loading/test-loading-archive-subresource-null-mimetype.html [ Crash ]
+
 # Quota API is not supported.
 storage/storageinfo-missing-arguments.html
 storage/storageinfo-no-callbacks.html

Modified: branches/safari-604-branch/Source/WebCore/ChangeLog (222796 => 222797)


--- branches/safari-604-branch/Source/WebCore/ChangeLog	2017-10-03 19:02:35 UTC (rev 222796)
+++ branches/safari-604-branch/Source/WebCore/ChangeLog	2017-10-03 19:09:14 UTC (rev 222797)
@@ -1,3 +1,21 @@
+2017-10-03  Jason Marcell  <[email protected]>
+
+        Cherry-pick r222779. rdar://problem/34706688
+
+    2017-10-03  Brent Fulgham  <[email protected]>
+
+            [Mac] Use safer decoding practices for NSKeyedUnarchiver
+            https://bugs.webkit.org/show_bug.cgi?id=175887
+            <rdar://problem/33435281>
+
+            Reviewed by Daniel Bates.
+
+            * loader/archive/cf/LegacyWebArchiveMac.mm:
+            (WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Use NSSecureCoding to unarchive.
+            (WebCore::LegacyWebArchive::createPropertyListRepresentation): Ditto for archiving.
+            * testing/cocoa/WebArchiveDumpSupport.mm:
+            (WebCoreTestSupport::createCFURLResponseFromResponseData): Update to use NSSecureCoding if possible.
+
 2017-10-01  Jason Marcell  <[email protected]>
 
         Cherry-pick r222588. rdar://problem/34717517

Modified: branches/safari-604-branch/Source/WebCore/loader/archive/cf/LegacyWebArchiveMac.mm (222796 => 222797)


--- branches/safari-604-branch/Source/WebCore/loader/archive/cf/LegacyWebArchiveMac.mm	2017-10-03 19:02:35 UTC (rev 222796)
+++ branches/safari-604-branch/Source/WebCore/loader/archive/cf/LegacyWebArchiveMac.mm	2017-10-03 19:09:14 UTC (rev 222797)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2008-2017 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -43,12 +43,20 @@
     
     NSURLResponse *response = nil;
     NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:(NSData *)responseData];
+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || PLATFORM(IOS)
+    // Because of <rdar://problem/34063313> we can't use this for decoding in older OS's.
+    [unarchiver setRequiresSecureCoding:YES];
     @try {
+        response = [unarchiver decodeObjectOfClass:[NSURLResponse class] forKey:LegacyWebArchiveResourceResponseKey];
+#else
+    @try {
         id responseObject = [unarchiver decodeObjectForKey:LegacyWebArchiveResourceResponseKey];
         if ([responseObject isKindOfClass:[NSURLResponse class]])
             response = responseObject;
+#endif
         [unarchiver finishDecoding];
-    } @catch(id) {
+    } @catch (NSException *exception) {
+        LOG_ERROR("Failed to decode NS(HTTP)URLResponse: %@", exception);
         response = nil;
     }
     [unarchiver release];
@@ -66,6 +74,10 @@
     CFMutableDataRef responseData = CFDataCreateMutable(0, 0);
 
     NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:(NSMutableData *)responseData];
+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || PLATFORM(IOS)
+    // Because of <rdar://problem/34063313> we can't use this for encoding in older OS's.
+    [archiver setRequiresSecureCoding:YES];
+#endif
     [archiver encodeObject:nsResponse forKey:LegacyWebArchiveResourceResponseKey];
     [archiver finishEncoding];
     [archiver release];

Modified: branches/safari-604-branch/Source/WebCore/testing/cocoa/WebArchiveDumpSupport.mm (222796 => 222797)


--- branches/safari-604-branch/Source/WebCore/testing/cocoa/WebArchiveDumpSupport.mm	2017-10-03 19:02:35 UTC (rev 222796)
+++ branches/safari-604-branch/Source/WebCore/testing/cocoa/WebArchiveDumpSupport.mm	2017-10-03 19:09:14 UTC (rev 222797)
@@ -41,8 +41,20 @@
 static CFURLResponseRef createCFURLResponseFromResponseData(CFDataRef responseData)
 {
     RetainPtr<NSKeyedUnarchiver> unarchiver = adoptNS([[NSKeyedUnarchiver alloc] initForReadingWithData:(NSData *)responseData]);
-    NSURLResponse *response = [unarchiver decodeObjectForKey:@"WebResourceResponse"]; // WebResourceResponseKey in WebResource.m
-    [unarchiver finishDecoding];
+    [unarchiver setRequiresSecureCoding:YES];
+    NSURLResponse *response;
+    @try {
+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || PLATFORM(IOS)
+        // Because of <rdar://problem/34063313> we can't use this for decoding in older OS's.
+        response = [unarchiver decodeObjectOfClass:[NSURLResponse class] forKey:@"WebResourceResponse"]; // WebResourceResponseKey in WebResource.m
+#else
+        response = [unarchiver decodeObjectForKey:@"WebResourceResponse"]; // WebResourceResponseKey in WebResource.m
+#endif
+        [unarchiver finishDecoding];
+    } @catch (NSException *exception) {
+        LOG_ERROR("Failed to decode NS(HTTP)URLResponse: %@", exception);
+        response = nil;
+    }
 
     if (![response isKindOfClass:[NSHTTPURLResponse class]])
         return CFURLResponseCreate(kCFAllocatorDefault, (CFURLRef)response.URL, (CFStringRef)response.MIMEType, response.expectedContentLength, (CFStringRef)response.textEncodingName, kCFURLCacheStorageAllowed);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to