WebKit.UnavailablePlugIn API test is crashing in debug
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Nov 2018 19:00:50 +0000 (19:00 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Nov 2018 19:00:50 +0000 (19:00 +0000)
https://bugs.webkit.org/show_bug.cgi?id=191753

Reviewed by Alex Christensen.

Add missing early returns. Those were mistakenly dropped in r235200.

* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::decidePolicyForPluginLoad):

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

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/Cocoa/NavigationState.mm

index 8a127ec..19d5416 100644 (file)
@@ -1,5 +1,17 @@
 2018-11-16  Chris Dumez  <cdumez@apple.com>
 
+        WebKit.UnavailablePlugIn API test is crashing in debug
+        https://bugs.webkit.org/show_bug.cgi?id=191753
+
+        Reviewed by Alex Christensen.
+
+        Add missing early returns. Those were mistakenly dropped in r235200.
+
+        * UIProcess/Cocoa/NavigationState.mm:
+        (WebKit::NavigationState::NavigationClient::decidePolicyForPluginLoad):
+
+2018-11-16  Chris Dumez  <cdumez@apple.com>
+
         [Mac] Regression: WebContent process's display name is no longer set
         https://bugs.webkit.org/show_bug.cgi?id=191722
         <rdar://problem/45960550>
index 9a17b4c..9c540d5 100644 (file)
@@ -362,12 +362,16 @@ static _WKPluginModuleLoadPolicy wkPluginModuleLoadPolicy(WebKit::PluginModuleLo
 
 void NavigationState::NavigationClient::decidePolicyForPluginLoad(WebKit::WebPageProxy&, WebKit::PluginModuleLoadPolicy currentPluginLoadPolicy, API::Dictionary& pluginInformation, CompletionHandler<void(WebKit::PluginModuleLoadPolicy, const String&)>&& completionHandler)
 {
-    if (!m_navigationState.m_navigationDelegateMethods.webViewDecidePolicyForPluginLoadWithCurrentPolicyPluginInfoCompletionHandler)
+    if (!m_navigationState.m_navigationDelegateMethods.webViewDecidePolicyForPluginLoadWithCurrentPolicyPluginInfoCompletionHandler) {
         completionHandler(currentPluginLoadPolicy, { });
+        return;
+    }
     
     auto navigationDelegate = m_navigationState.m_navigationDelegate.get();
-    if (!navigationDelegate)
+    if (!navigationDelegate) {
         completionHandler(currentPluginLoadPolicy, { });
+        return;
+    }
 
     auto checker = CompletionHandlerCallChecker::create(navigationDelegate.get(), @selector(_webView:decidePolicyForPluginLoadWithCurrentPolicy:pluginInfo:completionHandler:));
     [(id <WKNavigationDelegatePrivate>)navigationDelegate _webView:m_navigationState.m_webView decidePolicyForPluginLoadWithCurrentPolicy:wkPluginModuleLoadPolicy(currentPluginLoadPolicy) pluginInfo:wrapper(pluginInformation) completionHandler:BlockPtr<void(_WKPluginModuleLoadPolicy, NSString *)>::fromCallable([completionHandler = WTFMove(completionHandler), checker = WTFMove(checker)](_WKPluginModuleLoadPolicy policy, NSString *unavailabilityDescription) mutable {