Title: [234169] trunk/Source/WebKit
Revision
234169
Author
[email protected]
Date
2018-07-24 13:14:32 -0700 (Tue, 24 Jul 2018)

Log Message

Modernize NavigationState
https://bugs.webkit.org/show_bug.cgi?id=187966

Reviewed by Andy Estes.

Don't ignore switch warnings any more.
Use BlockPtr.

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

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (234168 => 234169)


--- trunk/Source/WebKit/ChangeLog	2018-07-24 20:11:44 UTC (rev 234168)
+++ trunk/Source/WebKit/ChangeLog	2018-07-24 20:14:32 UTC (rev 234169)
@@ -1,5 +1,19 @@
 2018-07-24  Alex Christensen  <[email protected]>
 
+        Modernize NavigationState
+        https://bugs.webkit.org/show_bug.cgi?id=187966
+
+        Reviewed by Andy Estes.
+
+        Don't ignore switch warnings any more.
+        Use BlockPtr.
+
+        * UIProcess/Cocoa/NavigationState.mm:
+        (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
+        (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):
+
+2018-07-24  Alex Christensen  <[email protected]>
+
         Remove WebFramePolicyListenerProxy::changeWebsiteDataStore
         https://bugs.webkit.org/show_bug.cgi?id=187967
 

Modified: trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.mm (234168 => 234169)


--- trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.mm	2018-07-24 20:11:44 UTC (rev 234168)
+++ trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.mm	2018-07-24 20:14:32 UTC (rev 234169)
@@ -542,11 +542,7 @@
 
         switch (actionPolicy) {
         case WKNavigationActionPolicyAllow:
-// FIXME: Once we have a new enough compiler everywhere we don't need to ignore -Wswitch.
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wswitch"
         case _WKNavigationActionPolicyAllowInNewProcess:
-#pragma clang diagnostic pop
             tryAppLink(WTFMove(navigationAction), mainFrameURLString, [actionPolicy, localListener = WTFMove(localListener), websitePolicies = WTFMove(apiWebsitePolicies)](bool followedLinkToApp) mutable {
                 if (followedLinkToApp) {
                     localListener->ignore();
@@ -562,14 +558,10 @@
             localListener->ignore();
             break;
 
-// FIXME: Once we have a new enough compiler everywhere we don't need to ignore -Wswitch.
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wswitch"
         case _WKNavigationActionPolicyDownload:
             localListener->download();
             break;
         case _WKNavigationActionPolicyAllowWithoutTryingAppLink:
-#pragma clang diagnostic pop
             localListener->use(apiWebsitePolicies.get());
             break;
         }
@@ -637,10 +629,8 @@
     if (!navigationDelegate)
         return;
 
-    RefPtr<WebFramePolicyListenerProxy> localListener = WTFMove(listener);
-    RefPtr<CompletionHandlerCallChecker> checker = CompletionHandlerCallChecker::create(navigationDelegate.get(), @selector(webView:decidePolicyForNavigationResponse:decisionHandler:));
-    RefPtr<API::NavigationResponse> navigationResponseRefPtr(navigationResponse.ptr());
-    [navigationDelegate webView:m_navigationState.m_webView decidePolicyForNavigationResponse:wrapper(navigationResponse) decisionHandler:[localListener, checker](WKNavigationResponsePolicy responsePolicy) {
+    auto checker = CompletionHandlerCallChecker::create(navigationDelegate.get(), @selector(webView:decidePolicyForNavigationResponse:decisionHandler:));
+    [navigationDelegate webView:m_navigationState.m_webView decidePolicyForNavigationResponse:wrapper(navigationResponse) decisionHandler:BlockPtr<void(WKNavigationResponsePolicy)>::fromCallable([localListener = WTFMove(listener), checker = WTFMove(checker)](WKNavigationResponsePolicy responsePolicy) {
         if (checker->completionHandlerHasBeenCalled())
             return;
         checker->didCallCompletionHandler();
@@ -654,15 +644,11 @@
             localListener->ignore();
             break;
 
-// FIXME: Once we have a new enough compiler everywhere we don't need to ignore -Wswitch.
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wswitch"
         case _WKNavigationResponsePolicyBecomeDownload:
             localListener->download();
-#pragma clang diagnostic pop
             break;
         }
-    }];
+    }).get()];
 }
 
 void NavigationState::NavigationClient::didStartProvisionalNavigation(WebPageProxy& page, API::Navigation* navigation, API::Object* userInfo)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to