Title: [185890] trunk/Source/WebKit2
Revision
185890
Author
m...@apple.com
Date
2015-06-23 17:21:04 -0700 (Tue, 23 Jun 2015)

Log Message

Restore binary compatibility with iOS 8 Safari after r185877
https://bugs.webkit.org/show_bug.cgi?id=146263

Reviewed by Anders Carlsson.

* Platform/spi/Cocoa: Added.
* Platform/spi/Cocoa/NSInvocationSPI.h: Added.

* UIProcess/API/Cocoa/WKSecurityOrigin.mm:
(-[WKSecurityOrigin methodSignatureForSelector:]): Override to check _WKSecurityOrigin for
possible category methods with the specified selector.
(-[WKSecurityOrigin forwardInvocation:]): Invoke using the implementation of the
_WKSecurityOrigin category method.

* WebKit2.xcodeproj/project.pbxproj:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (185889 => 185890)


--- trunk/Source/WebKit2/ChangeLog	2015-06-23 23:36:57 UTC (rev 185889)
+++ trunk/Source/WebKit2/ChangeLog	2015-06-24 00:21:04 UTC (rev 185890)
@@ -1,3 +1,21 @@
+2015-06-23  Dan Bernstein  <m...@apple.com>
+
+        Restore binary compatibility with iOS 8 Safari after r185877
+        https://bugs.webkit.org/show_bug.cgi?id=146263
+
+        Reviewed by Anders Carlsson.
+
+        * Platform/spi/Cocoa: Added.
+        * Platform/spi/Cocoa/NSInvocationSPI.h: Added.
+
+        * UIProcess/API/Cocoa/WKSecurityOrigin.mm:
+        (-[WKSecurityOrigin methodSignatureForSelector:]): Override to check _WKSecurityOrigin for
+        possible category methods with the specified selector.
+        (-[WKSecurityOrigin forwardInvocation:]): Invoke using the implementation of the
+        _WKSecurityOrigin category method.
+
+        * WebKit2.xcodeproj/project.pbxproj:
+
 2015-06-23  Anders Carlsson  <ander...@apple.com>
 
         Add operator! and copy/move constructors to WeakObjCPtr

Added: trunk/Source/WebKit2/Platform/spi/Cocoa/NSInvocationSPI.h (0 => 185890)


--- trunk/Source/WebKit2/Platform/spi/Cocoa/NSInvocationSPI.h	                        (rev 0)
+++ trunk/Source/WebKit2/Platform/spi/Cocoa/NSInvocationSPI.h	2015-06-24 00:21:04 UTC (rev 185890)
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#if USE(APPLE_INTERNAL_SDK)
+
+#import <Foundation/NSPrivateDecls.h>
+
+#else
+
+@interface NSInvocation ()
+- (void)invokeUsingIMP:(IMP)imp;
+@end
+
+#endif // USE(APPLE_INTERNAL_SDK)

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKSecurityOrigin.mm (185889 => 185890)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKSecurityOrigin.mm	2015-06-23 23:36:57 UTC (rev 185889)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKSecurityOrigin.mm	2015-06-24 00:21:04 UTC (rev 185890)
@@ -28,6 +28,8 @@
 
 #if WK_API_ENABLED
 
+#import "NSInvocationSPI.h"
+#import "_WKSecurityOrigin.h"
 #import <WebCore/ResourceRequest.h>
 #import <WebCore/SecurityOrigin.h>
 #import <wtf/RefPtr.h>
@@ -68,6 +70,22 @@
     return *_securityOrigin;
 }
 
+#pragma mark iOS 8 Safari binary compatibility
+
+#if PLATFORM(IOS)
+
+- (NSMethodSignature *)methodSignatureForSelector:(SEL)selector
+{
+    return [_WKSecurityOrigin instanceMethodSignatureForSelector:selector];
+}
+
+- (void)forwardInvocation:(NSInvocation *)invocation
+{
+    [invocation invokeUsingIMP:[_WKSecurityOrigin instanceMethodForSelector:invocation.selector]];
+}
+
+#endif
+
 @end
 
 #endif // WK_API_ENABLED

Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (185889 => 185890)


--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2015-06-23 23:36:57 UTC (rev 185889)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2015-06-24 00:21:04 UTC (rev 185890)
@@ -758,6 +758,7 @@
 		373D122D18A4B6EB0066D9CC /* WKWebProcessPlugInFramePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 373D122C18A4B6A80066D9CC /* WKWebProcessPlugInFramePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		3743925818BC4C60001C8675 /* WKUIDelegatePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 3743925718BC4C60001C8675 /* WKUIDelegatePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		374436881820E7240049579F /* WKObject.mm in Sources */ = {isa = PBXBuildFile; fileRef = 374436871820E7240049579F /* WKObject.mm */; };
+		3754D5451B3A29FD003A4C7F /* NSInvocationSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 3754D5441B3A29FD003A4C7F /* NSInvocationSPI.h */; };
 		3760881E150413E900FC82C7 /* WebRenderObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3760881C150413E900FC82C7 /* WebRenderObject.cpp */; };
 		3760881F150413E900FC82C7 /* WebRenderObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 3760881D150413E900FC82C7 /* WebRenderObject.h */; };
 		37608822150414F700FC82C7 /* WKRenderObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37608820150414F700FC82C7 /* WKRenderObject.cpp */; };
@@ -2904,6 +2905,7 @@
 		373D122C18A4B6A80066D9CC /* WKWebProcessPlugInFramePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebProcessPlugInFramePrivate.h; sourceTree = "<group>"; };
 		3743925718BC4C60001C8675 /* WKUIDelegatePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKUIDelegatePrivate.h; sourceTree = "<group>"; };
 		374436871820E7240049579F /* WKObject.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKObject.mm; sourceTree = "<group>"; };
+		3754D5441B3A29FD003A4C7F /* NSInvocationSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NSInvocationSPI.h; path = Cocoa/NSInvocationSPI.h; sourceTree = "<group>"; };
 		375FB4731883415600BE34D4 /* Info-iOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-iOS.plist"; sourceTree = "<group>"; };
 		3760881C150413E900FC82C7 /* WebRenderObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebRenderObject.cpp; sourceTree = "<group>"; };
 		3760881D150413E900FC82C7 /* WebRenderObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebRenderObject.h; sourceTree = "<group>"; };
@@ -5256,6 +5258,14 @@
 			path = posix;
 			sourceTree = "<group>";
 		};
+		3754D5411B3A2998003A4C7F /* Cocoa */ = {
+			isa = PBXGroup;
+			children = (
+				3754D5441B3A29FD003A4C7F /* NSInvocationSPI.h */,
+			);
+			name = Cocoa;
+			sourceTree = "<group>";
+		};
 		37C4C08318149C2A003688B9 /* Cocoa */ = {
 			isa = PBXGroup;
 			children = (
@@ -7314,6 +7324,7 @@
 		CE1A0BCA1A48E6C60054EF74 /* spi */ = {
 			isa = PBXGroup;
 			children = (
+				3754D5411B3A2998003A4C7F /* Cocoa */,
 				CE1A0BCB1A48E6C60054EF74 /* ios */,
 			);
 			path = spi;
@@ -7536,6 +7547,7 @@
 				7C89D2981A6753B2003A5FDE /* APIPageConfiguration.h in Headers */,
 				E4E864931B16750700C82F40 /* VersionChecks.h in Headers */,
 				1AC1336C18565C7A00F3EC05 /* APIPageHandle.h in Headers */,
+				3754D5451B3A29FD003A4C7F /* NSInvocationSPI.h in Headers */,
 				1AFDD3151891B54000153970 /* APIPolicyClient.h in Headers */,
 				7CE4D2201A4914CA00C7F152 /* APIProcessPoolConfiguration.h in Headers */,
 				F634445612A885C8000612D8 /* APISecurityOrigin.h in Headers */,
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to