WebKit Bugzilla
Attachment 348719 Details for
Bug 189222
: [Cocoa] Crash using KVO for 'serverTrust' property of WKWebView - "this class is not key value coding-compliant for the key serverTrust"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Override -valueForUndefinedKey: to handle "serverTrust"
bug-189222-20180901160231.patch (text/plain), 8.08 KB, created by
mitz
on 2018-09-01 16:02:32 PDT
(
hide
)
Description:
Override -valueForUndefinedKey: to handle "serverTrust"
Filename:
MIME Type:
Creator:
mitz
Created:
2018-09-01 16:02:32 PDT
Size:
8.08 KB
patch
obsolete
>Index: Source/WebKit/ChangeLog >=================================================================== >--- Source/WebKit/ChangeLog (revision 235583) >+++ Source/WebKit/ChangeLog (working copy) >@@ -1,3 +1,18 @@ >+2018-09-01 Dan Bernstein <mitz@apple.com> >+ >+ [Cocoa] Crash using KVO for 'serverTrust' property of WKWebView - "this class is not key value coding-compliant for the key serverTrust" >+ https://bugs.webkit.org/show_bug.cgi?id=189222 >+ <rdar://problem/33283179> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Test: TestWebKitAPI/Tests/WebKitCocoa/WKWebViewServerTrustKVC.mm >+ >+ * UIProcess/API/Cocoa/WKWebView.mm: >+ (-[WKWebView valueForUndefinedKey:]): Override to handle the "serverTrust" key, which is not >+ handled automatically by the KVC machinery since the getterâs return type is not an >+ Objective-C type. >+ > 2018-08-31 John Wilander <wilander@apple.com> > > Storage Access API: Maintain access through same-site navigations >Index: Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm >=================================================================== >--- Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (revision 235583) >+++ Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (working copy) >@@ -820,6 +820,13 @@ - (void)dealloc > [super dealloc]; > } > >+- (id)valueForUndefinedKey:(NSString *)key { >+ if ([key isEqualToString:@"serverTrust"]) >+ return (__bridge id)[self serverTrust]; >+ >+ return [super valueForUndefinedKey:key]; >+} >+ > - (WKWebViewConfiguration *)configuration > { > return [[_configuration copy] autorelease]; >Index: Tools/ChangeLog >=================================================================== >--- Tools/ChangeLog (revision 235583) >+++ Tools/ChangeLog (working copy) >@@ -1,3 +1,15 @@ >+2018-09-01 Dan Bernstein <mitz@apple.com> >+ >+ [Cocoa] Crash using KVO for 'serverTrust' property of WKWebView - "this class is not key value coding-compliant for the key serverTrust" >+ https://bugs.webkit.org/show_bug.cgi?id=189222 >+ <rdar://problem/33283179> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: >+ * TestWebKitAPI/Tests/WebKitCocoa/WKWebViewServerTrustKVC.mm: Added. >+ (TEST): >+ > 2018-08-31 Aditya Keerthi <akeerthi@apple.com> > > Unreviewed, add an alternate email for Aditya Keerthi. >Index: Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj >=================================================================== >--- Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (revision 235583) >+++ Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (working copy) >@@ -142,6 +142,7 @@ > 37A22AA71DCAA27200AFBFC4 /* ObservedRenderingProgressEventsAfterCrash.mm in Sources */ = {isa = PBXBuildFile; fileRef = 37A22AA51DCAA27200AFBFC4 /* ObservedRenderingProgressEventsAfterCrash.mm */; }; > 37A709AE1E3EA8B000CA5969 /* BundleRangeHandle.mm in Sources */ = {isa = PBXBuildFile; fileRef = 37A709AD1E3EA8B000CA5969 /* BundleRangeHandle.mm */; }; > 37A709AF1E3EA97E00CA5969 /* BundleRangeHandlePlugIn.mm in Sources */ = {isa = PBXBuildFile; fileRef = 37A709AA1E3EA79000CA5969 /* BundleRangeHandlePlugIn.mm */; }; >+ 37A9DBE9213B4C9300D261A2 /* WKWebViewServerTrustKVC.mm in Sources */ = {isa = PBXBuildFile; fileRef = 37A9DBE7213B4C9300D261A2 /* WKWebViewServerTrustKVC.mm */; }; > 37B47E301D64E7CA005F4EFF /* WKObject.mm in Sources */ = {isa = PBXBuildFile; fileRef = 37B47E2E1D64E7CA005F4EFF /* WKObject.mm */; }; > 37BCA61C1B596BA9002012CA /* ShouldOpenExternalURLsInNewWindowActions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 37BCA61B1B596BA9002012CA /* ShouldOpenExternalURLsInNewWindowActions.mm */; }; > 37C7CC2D1EA4146B007BD956 /* WeakLinking.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37C7CC2B1EA4146B007BD956 /* WeakLinking.cpp */; }; >@@ -1397,6 +1398,7 @@ > 37A709AA1E3EA79000CA5969 /* BundleRangeHandlePlugIn.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = BundleRangeHandlePlugIn.mm; sourceTree = "<group>"; }; > 37A709AC1E3EA7E800CA5969 /* BundleRangeHandleProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BundleRangeHandleProtocol.h; sourceTree = "<group>"; }; > 37A709AD1E3EA8B000CA5969 /* BundleRangeHandle.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = BundleRangeHandle.mm; sourceTree = "<group>"; }; >+ 37A9DBE7213B4C9300D261A2 /* WKWebViewServerTrustKVC.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = WKWebViewServerTrustKVC.mm; sourceTree = "<group>"; }; > 37B47E2E1D64E7CA005F4EFF /* WKObject.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKObject.mm; sourceTree = "<group>"; }; > 37BCA61B1B596BA9002012CA /* ShouldOpenExternalURLsInNewWindowActions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ShouldOpenExternalURLsInNewWindowActions.mm; sourceTree = "<group>"; }; > 37C784DE197C8F2E0010A496 /* RenderedImageFromDOMNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RenderedImageFromDOMNode.mm; sourceTree = "<group>"; }; >@@ -2444,6 +2446,7 @@ > 2DB647871F4161F70051A89E /* WKWebViewDoesNotLogDuringInitialization.mm */, > 0F3B94A51A77266C00DE3272 /* WKWebViewEvaluateJavaScript.mm */, > D3BE5E341E4CE85E00FD563A /* WKWebViewGetContents.mm */, >+ 37A9DBE7213B4C9300D261A2 /* WKWebViewServerTrustKVC.mm */, > 93F56DA81E5F9181003EDE84 /* WKWebViewSnapshot.mm */, > 9984FACA1CFFAEEE008D198C /* WKWebViewTextInput.mm */, > ); >@@ -4068,6 +4071,7 @@ > 0F3B94A71A77267400DE3272 /* WKWebViewEvaluateJavaScript.mm in Sources */, > D34E08761E4E42E1005FF14A /* WKWebViewGetContents.mm in Sources */, > F4FA91811E61849B007B8C1D /* WKWebViewMacEditingTests.mm in Sources */, >+ 37A9DBE9213B4C9300D261A2 /* WKWebViewServerTrustKVC.mm in Sources */, > 93F56DA91E5F919D003EDE84 /* WKWebViewSnapshot.mm in Sources */, > 9984FACC1CFFAF60008D198C /* WKWebViewTextInput.mm in Sources */, > 9C64DC321D76198A004B598E /* YouTubePluginReplacement.cpp in Sources */, >Index: Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewServerTrustKVC.mm >=================================================================== >--- Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewServerTrustKVC.mm (nonexistent) >+++ Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewServerTrustKVC.mm (working copy) >@@ -0,0 +1,39 @@ >+/* >+ * Copyright (C) 2018 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. >+ */ >+ >+#import "config.h" >+ >+#if WK_API_ENABLED >+ >+#import "Test.h" >+#import <wtf/RetainPtr.h> >+ >+TEST(WKWebView, ServerTrustKVC) >+{ >+ auto webView = adoptNS([[WKWebView alloc] init]); >+ EXPECT_NULL([webView valueForKey:@"serverTrust"]); >+} >+ >+#endif
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
sam
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 189222
: 348719