Title: [234740] tags/Safari-607.1.2
Revision
234740
Author
[email protected]
Date
2018-08-09 15:51:44 -0700 (Thu, 09 Aug 2018)

Log Message

Cherry-pick r234739. rdar://problem/43102553

    REGRESSION(234640) Loading stalls in environments without SafariSafeBrowsing framework
    https://bugs.webkit.org/show_bug.cgi?id=188453
    <rdar://problem/43102553>

    Source/WebKit:

    Reviewed by Chris Dumez.

    * UIProcess/Cocoa/WebPageProxyCocoa.mm:
    (WebKit::WebPageProxy::beginSafeBrowsingCheck):

    Tools:

    Reviewed by Chris Dumez

    * TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm:
    (TEST):
    (+[NullLookupContext sharedLookupContext]):
    (TestWebKitAPI::TEST): Deleted.

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234739 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: tags/Safari-607.1.2/Source/WebKit/ChangeLog (234739 => 234740)


--- tags/Safari-607.1.2/Source/WebKit/ChangeLog	2018-08-09 22:37:52 UTC (rev 234739)
+++ tags/Safari-607.1.2/Source/WebKit/ChangeLog	2018-08-09 22:51:44 UTC (rev 234740)
@@ -1,3 +1,42 @@
+2018-08-09  Kocsen Chung  <[email protected]>
+
+        Cherry-pick r234739. rdar://problem/43102553
+
+    REGRESSION(234640) Loading stalls in environments without SafariSafeBrowsing framework
+    https://bugs.webkit.org/show_bug.cgi?id=188453
+    <rdar://problem/43102553>
+    
+    Source/WebKit:
+    
+    Reviewed by Chris Dumez.
+    
+    * UIProcess/Cocoa/WebPageProxyCocoa.mm:
+    (WebKit::WebPageProxy::beginSafeBrowsingCheck):
+    
+    Tools:
+    
+    Reviewed by Chris Dumez
+    
+    * TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm:
+    (TEST):
+    (+[NullLookupContext sharedLookupContext]):
+    (TestWebKitAPI::TEST): Deleted.
+    
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234739 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2018-08-09  Alex Christensen  <[email protected]>
+
+            REGRESSION(234640) Loading stalls in environments without SafariSafeBrowsing framework
+            https://bugs.webkit.org/show_bug.cgi?id=188453
+            <rdar://problem/43102553>
+
+            Reviewed by Chris Dumez.
+
+            * UIProcess/Cocoa/WebPageProxyCocoa.mm:
+            (WebKit::WebPageProxy::beginSafeBrowsingCheck):
+
 2018-08-08  Kocsen Chung  <[email protected]>
 
         Revert r234314. rdar://problem/43057703

Modified: tags/Safari-607.1.2/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm (234739 => 234740)


--- tags/Safari-607.1.2/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm	2018-08-09 22:37:52 UTC (rev 234739)
+++ tags/Safari-607.1.2/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm	2018-08-09 22:51:44 UTC (rev 234740)
@@ -74,7 +74,10 @@
 void WebPageProxy::beginSafeBrowsingCheck(const URL& url, WebFramePolicyListenerProxy& listener)
 {
 #if HAVE(SAFE_BROWSING)
-    [[SSBLookupContext sharedLookupContext] lookUpURL:url completionHandler:BlockPtr<void(SSBLookupResult *, NSError *)>::fromCallable([listener = makeRef(listener)] (SSBLookupResult *result, NSError *error) mutable {
+    SSBLookupContext *context = [SSBLookupContext sharedLookupContext];
+    if (!context)
+        return listener.didReceiveSafeBrowsingResults({ });
+    [context lookUpURL:url completionHandler:BlockPtr<void(SSBLookupResult *, NSError *)>::fromCallable([listener = makeRef(listener)] (SSBLookupResult *result, NSError *error) mutable {
         RunLoop::main().dispatch([listener = WTFMove(listener), result = retainPtr(result), error = retainPtr(error)] {
             if (error) {
                 listener->didReceiveSafeBrowsingResults({ });

Modified: tags/Safari-607.1.2/Tools/ChangeLog (234739 => 234740)


--- tags/Safari-607.1.2/Tools/ChangeLog	2018-08-09 22:37:52 UTC (rev 234739)
+++ tags/Safari-607.1.2/Tools/ChangeLog	2018-08-09 22:51:44 UTC (rev 234740)
@@ -1,3 +1,44 @@
+2018-08-09  Kocsen Chung  <[email protected]>
+
+        Cherry-pick r234739. rdar://problem/43102553
+
+    REGRESSION(234640) Loading stalls in environments without SafariSafeBrowsing framework
+    https://bugs.webkit.org/show_bug.cgi?id=188453
+    <rdar://problem/43102553>
+    
+    Source/WebKit:
+    
+    Reviewed by Chris Dumez.
+    
+    * UIProcess/Cocoa/WebPageProxyCocoa.mm:
+    (WebKit::WebPageProxy::beginSafeBrowsingCheck):
+    
+    Tools:
+    
+    Reviewed by Chris Dumez
+    
+    * TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm:
+    (TEST):
+    (+[NullLookupContext sharedLookupContext]):
+    (TestWebKitAPI::TEST): Deleted.
+    
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234739 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2018-08-09  Alex Christensen  <[email protected]>
+
+            REGRESSION(234640) Loading stalls in environments without SafariSafeBrowsing framework
+            https://bugs.webkit.org/show_bug.cgi?id=188453
+            <rdar://problem/43102553>
+
+            Reviewed by Chris Dumez
+
+            * TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm:
+            (TEST):
+            (+[NullLookupContext sharedLookupContext]):
+            (TestWebKitAPI::TEST): Deleted.
+
 2018-08-08  Kocsen Chung  <[email protected]>
 
         Revert r234321. rdar://problem/43057703

Modified: tags/Safari-607.1.2/Tools/TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm (234739 => 234740)


--- tags/Safari-607.1.2/Tools/TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm	2018-08-09 22:37:52 UTC (rev 234739)
+++ tags/Safari-607.1.2/Tools/TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm	2018-08-09 22:51:44 UTC (rev 234740)
@@ -29,6 +29,7 @@
 
 #import "ClassMethodSwizzler.h"
 #import "PlatformUtilities.h"
+#import "TestWKWebView.h"
 #import <WebKit/WKNavigationDelegate.h>
 #import <WebKit/WKWebViewPrivate.h>
 #import <wtf/RetainPtr.h>
@@ -143,11 +144,9 @@
 
 @end
 
-namespace TestWebKitAPI {
-
 TEST(WebKit, SafeBrowsing)
 {
-    ClassMethodSwizzler swizzler(objc_getClass("SSBLookupContext"), @selector(sharedLookupContext), [TestLookupContext methodForSelector:@selector(sharedLookupContext)]);
+    TestWebKitAPI::ClassMethodSwizzler swizzler(objc_getClass("SSBLookupContext"), @selector(sharedLookupContext), [TestLookupContext methodForSelector:@selector(sharedLookupContext)]);
 
     auto navigationDelegate = adoptNS([[SafeBrowsingNavigationDelegate alloc] init]);
     auto webView = adoptNS([[WKWebView alloc] init]);
@@ -158,7 +157,21 @@
 
     TestWebKitAPI::Util::run(&done);
 }
-    
-} // namespace TestWebKitAPI
 
+@interface NullLookupContext : NSObject
+@end
+@implementation NullLookupContext
++ (NullLookupContext *)sharedLookupContext
+{
+    return nil;
+}
+@end
+
+TEST(WebKit, NoSafeBrowsing)
+{
+    TestWebKitAPI::ClassMethodSwizzler swizzler(objc_getClass("SSBLookupContext"), @selector(sharedLookupContext), [NullLookupContext methodForSelector:@selector(sharedLookupContext)]);
+    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 800, 600)]);
+    [webView synchronouslyLoadTestPageNamed:@"simple"];
+}
+
 #endif // WK_API_ENABLED
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to