Title: [234739] trunk
Revision
234739
Author
[email protected]
Date
2018-08-09 15:37:52 -0700 (Thu, 09 Aug 2018)

Log Message

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.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (234738 => 234739)


--- trunk/Source/WebKit/ChangeLog	2018-08-09 22:03:03 UTC (rev 234738)
+++ trunk/Source/WebKit/ChangeLog	2018-08-09 22:37:52 UTC (rev 234739)
@@ -1,5 +1,16 @@
 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-09  Alex Christensen  <[email protected]>
+
         WKURLSchemeHandler crashes when sent errors with sync XHR
         https://bugs.webkit.org/show_bug.cgi?id=188358
 

Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm (234738 => 234739)


--- trunk/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm	2018-08-09 22:03:03 UTC (rev 234738)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm	2018-08-09 22:37:52 UTC (rev 234739)
@@ -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: trunk/Tools/ChangeLog (234738 => 234739)


--- trunk/Tools/ChangeLog	2018-08-09 22:03:03 UTC (rev 234738)
+++ trunk/Tools/ChangeLog	2018-08-09 22:37:52 UTC (rev 234739)
@@ -1,5 +1,18 @@
 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-09  Alex Christensen  <[email protected]>
+
         WKURLSchemeHandler crashes when sent errors with sync XHR
         https://bugs.webkit.org/show_bug.cgi?id=188358
 

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm (234738 => 234739)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm	2018-08-09 22:03:03 UTC (rev 234738)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm	2018-08-09 22:37:52 UTC (rev 234739)
@@ -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