Changeset 234169 in webkit


Ignore:
Timestamp:
Jul 24, 2018 1:14:32 PM (6 years ago)
Author:
achristensen@apple.com
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):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r234168 r234169  
     12018-07-24  Alex Christensen  <achristensen@webkit.org>
     2
     3        Modernize NavigationState
     4        https://bugs.webkit.org/show_bug.cgi?id=187966
     5
     6        Reviewed by Andy Estes.
     7
     8        Don't ignore switch warnings any more.
     9        Use BlockPtr.
     10
     11        * UIProcess/Cocoa/NavigationState.mm:
     12        (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
     13        (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):
     14
    1152018-07-24  Alex Christensen  <achristensen@webkit.org>
    216
  • trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.mm

    r234168 r234169  
    543543        switch (actionPolicy) {
    544544        case WKNavigationActionPolicyAllow:
    545 // FIXME: Once we have a new enough compiler everywhere we don't need to ignore -Wswitch.
    546 #pragma clang diagnostic push
    547 #pragma clang diagnostic ignored "-Wswitch"
    548545        case _WKNavigationActionPolicyAllowInNewProcess:
    549 #pragma clang diagnostic pop
    550546            tryAppLink(WTFMove(navigationAction), mainFrameURLString, [actionPolicy, localListener = WTFMove(localListener), websitePolicies = WTFMove(apiWebsitePolicies)](bool followedLinkToApp) mutable {
    551547                if (followedLinkToApp) {
     
    563559            break;
    564560
    565 // FIXME: Once we have a new enough compiler everywhere we don't need to ignore -Wswitch.
    566 #pragma clang diagnostic push
    567 #pragma clang diagnostic ignored "-Wswitch"
    568561        case _WKNavigationActionPolicyDownload:
    569562            localListener->download();
    570563            break;
    571564        case _WKNavigationActionPolicyAllowWithoutTryingAppLink:
    572 #pragma clang diagnostic pop
    573565            localListener->use(apiWebsitePolicies.get());
    574566            break;
     
    638630        return;
    639631
    640     RefPtr<WebFramePolicyListenerProxy> localListener = WTFMove(listener);
    641     RefPtr<CompletionHandlerCallChecker> checker = CompletionHandlerCallChecker::create(navigationDelegate.get(), @selector(webView:decidePolicyForNavigationResponse:decisionHandler:));
    642     RefPtr<API::NavigationResponse> navigationResponseRefPtr(navigationResponse.ptr());
    643     [navigationDelegate webView:m_navigationState.m_webView decidePolicyForNavigationResponse:wrapper(navigationResponse) decisionHandler:[localListener, checker](WKNavigationResponsePolicy responsePolicy) {
     632    auto checker = CompletionHandlerCallChecker::create(navigationDelegate.get(), @selector(webView:decidePolicyForNavigationResponse:decisionHandler:));
     633    [navigationDelegate webView:m_navigationState.m_webView decidePolicyForNavigationResponse:wrapper(navigationResponse) decisionHandler:BlockPtr<void(WKNavigationResponsePolicy)>::fromCallable([localListener = WTFMove(listener), checker = WTFMove(checker)](WKNavigationResponsePolicy responsePolicy) {
    644634        if (checker->completionHandlerHasBeenCalled())
    645635            return;
     
    655645            break;
    656646
    657 // FIXME: Once we have a new enough compiler everywhere we don't need to ignore -Wswitch.
    658 #pragma clang diagnostic push
    659 #pragma clang diagnostic ignored "-Wswitch"
    660647        case _WKNavigationResponsePolicyBecomeDownload:
    661648            localListener->download();
    662 #pragma clang diagnostic pop
    663649            break;
    664650        }
    665     }];
     651    }).get()];
    666652}
    667653
Note: See TracChangeset for help on using the changeset viewer.