[Cocoa] Some -respondsToSelector: checks are unnecessary
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 12 Feb 2017 22:01:24 +0000 (22:01 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 12 Feb 2017 22:01:24 +0000 (22:01 +0000)
commita4aa4f33dc9d2547f75f928c84b0c23ca6275f9b
tree551dab9a8049661f51f5b3d63d7b89c3e6147694
parentd4b409c0a24056cbd755cb5a167ed65d83e41503
[Cocoa] Some -respondsToSelector: checks are unnecessary
https://bugs.webkit.org/show_bug.cgi?id=168183

Reviewed by Tim Horton.

Source/WebCore:

* English.lproj/Localizable.strings: Removed a string that’s no longer needed after the
  change to WebKit2/Platform/mac/MenuUtilities.mm.

* editing/mac/DictionaryLookup.mm:
(WebCore::showPopupOrCreateAnimationController): Removed check whether
  LULookupDefinitionModule responds to +showDefinitionForTerm:relativeToRect:ofView:options:.

* platform/cocoa/NetworkExtensionContentFilter.mm:
(WebCore::NetworkExtensionContentFilter::initialize): Changed to use
  -[NEFilterSource setSourceAppIdentifier:], without checking, instead of
  -setSourceAppBundleID:, which does not exist.

* platform/cocoa/ScrollController.mm:
(systemUptime): Deleted.
(WebCore::ScrollController::snapRubberBand): Use -[NSProcessInfo systemUptime] directly.

* platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
(WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker): Remove unnecessary check.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer): Ditto.
(WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenMode): Ditto.
(WebCore::MediaPlayerPrivateAVFoundationObjC::didPassCORSAccessCheck): Replaced
  -respondsToSelector: check with -isKindOfClass: check corresponding to the above cast.
(WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep): Removed unnecessary
  check.

* platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm:
(WebCore::VideoFullscreenLayerManager::setVideoFullscreenLayer): Removed unnecessary checks.

* platform/graphics/mac/WebGLLayer.mm:
(-[WebGLLayer initWithGraphicsContext3D:]): Ditto.

* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::typeForEvent): Removed check whether NSMenu responds to +menuTypeForEvent: and
  all code to handle that case that it doesn’t.

* platform/mac/WebVideoFullscreenController.mm:
(-[WebVideoFullscreenController applicationDidResignActive:]): Removed check whether
  NSWindow responds to -isOnActiveSpace.
(-[WebVideoFullscreenController updateMenuAndDockForFullscreen]): Removed check whether
  NSApplication responds to -setPresentationOptions:

* platform/mac/WebVideoFullscreenInterfaceMac.mm:
(-[WebVideoFullscreenInterfaceMacObjC updateIsPlaying:newPlaybackRate:]): Removed
  unnecessary -respondsToSelector: check.
(-[WebVideoFullscreenInterfaceMacObjC setVideoDimensions:]): Ditto.
(-[WebVideoFullscreenInterfaceMacObjC setUpPIPForVideoView:withFrame:inWindow:]): Ditto.

* platform/spi/cf/CFNetworkSPI.h: Moved declarations of
  -[NSURLCache _initWithMemoryCapacity:diskCapacity:relativePath:] and
  -[NSURLCache _CFURLCache] to the !USE(APPLE_INTERNAL_SDK) section.

* platform/spi/cocoa/NEFilterSourceSPI.h: Added declaration of NEFilterSource’
  sourceAppIdentifier property to the !USE(APPLE_INTERNAL_SDK) section and deleted
  unconditional declaration of sourceAppBundleID property, which doesn’t exist.

* platform/spi/cocoa/QuartzCoreSPI.h: Removed redundant declarations.

* platform/spi/ios/DataDetectorsUISPI.h: Moved declarations of DDDetectionController methods
  from WebKit2/UIProcess/ios/{WKActionSheetAssistant,WKContentViewInteraction}.mm to here.
  Removed an unused declaration.

* platform/spi/mac/LookupSPI.h: Moved redundant declarations into the
  !USE(APPLE_INTERNAL_SDK) section.

* platform/spi/mac/NSMenuSPI.h: Changed to import NSMenu_Private.h when using the
  Apple internal SDK. Cleaned up the declarations for the other case.

* platform/spi/mac/TUCallSPI.h: Changed to import TUCall_Strings.h when use the Apple
  internal SDK.

Source/WebKit/mac:

* WebView/WebFullScreenController.mm:
(-[WebFullScreenController applicationDidResignActive:]): Removed check whether NSWindow
  responds to -isOnActiveSpace.
(-[WebFullScreenController exitFullScreen]): Ditto.
(-[WebFullScreenController _updateMenuAndDockForFullScreen]): Removed check whether
  NSApplication responds to -setPresentationOptions.

* WebView/WebHTMLView.mm:
(createShareMenuItem): Removed unnecessary -respondsToSelector: check.
(-[WebHTMLView otherMouseDown:]): Ditto.

* WebView/WebImmediateActionController.mm:
(-[WebImmediateActionController _clearImmediateActionState]): Ditto.
(-[WebImmediateActionController _animationControllerForDataDetectedText]): Ditto.

* WebView/WebView.mm:
(-[WebView _didStartProvisionalLoadForFrame:]): Removed redundant nil check.
(+[WebView _setCacheModel:]): Removed unnecessary -respondsToSelector: check.

Source/WebKit2:

* Platform/mac/LayerHostingContext.mm:
(WebKit::LayerHostingContext::setColorMatchUntaggedContent): Removed unnecessary
  -respondsToSelector: check.
(WebKit::LayerHostingContext::colorMatchUntaggedContent): Ditto.

* Platform/mac/MenuUtilities.mm:
(WebKit::menuItemTitleForTelephoneNumberGroup): Ditto.

* Platform/spi/ios/UIKitSPI.h: Moved declaration of
  -[UIScrollView _isInterruptingDeceleration] from WKWebView.mm to the
  !USE(APPLE_INTERNAL_SDK) section here.

* Shared/mac/ChildProcessMac.mm:
(WebKit::ChildProcess::setSharedHTTPCookieStorage): Removed unnecessary -respondsToSelector:
  check.

* Shared/mac/WebEventFactory.mm:
(WebKit::typeForEvent): Ditto.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _updateVisibleContentRectAfterScrollInView:]): Ditto.

* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::WebPaymentCoordinatorProxy::platformOpenPaymentSetup): Ditto.

* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::dismissContentRelativeChildWindowsFromViewOnly): Ditto.

* UIProcess/WKImagePreviewViewController.mm:
(-[WKImagePreviewViewController previewActions]): Removed check whether _WKElementAction
  responds to -runActionWithElementInfo:.

* UIProcess/ios/WKActionSheetAssistant.mm:
(-[WKActionSheetAssistant showDataDetectorsSheet]): Ditto.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _lookup:]): Ditto.
(-[WKContentView _share:]): Ditto.
(-[WKContentView _addShortcut:]): Ditto.
(-[WKContentView _promptForReplace:]): Ditto.
(-[WKContentView _transliterateChinese:]): Ditto.
(-[WKContentView _didHandleKeyEvent:eventWasHandled:]): Removed call to
  -[UIKeyboardImpl didHandleWebKeyEvent], which is a no-op.
(-[WKContentView _interpretKeyEvent:isCharEvent:]): Removed unnecessary -respondsToSelector:
  check.
(-[WKContentView _dataForPreviewItemController:atPosition:type:]): Ditto.

* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
(WebKit::TiledCoreAnimationDrawingAreaProxy::createFence): Ditto.

* UIProcess/mac/WKImmediateActionController.mm:
(-[WKImmediateActionController _animationControllerForDataDetectedText]): Ditto.

* UIProcess/mac/WebContextMenuProxyMac.mm:
(WebKit::WebContextMenuProxyMac::createShareMenuItem): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212211 268f45cc-cd09-0410-ab3c-d52691b4dbfc
39 files changed:
Source/WebCore/ChangeLog
Source/WebCore/English.lproj/Localizable.strings
Source/WebCore/editing/mac/DictionaryLookup.mm
Source/WebCore/platform/cocoa/NetworkExtensionContentFilter.mm
Source/WebCore/platform/cocoa/ScrollController.mm
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
Source/WebCore/platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm
Source/WebCore/platform/graphics/mac/WebGLLayer.mm
Source/WebCore/platform/mac/PlatformEventFactoryMac.mm
Source/WebCore/platform/mac/WebVideoFullscreenController.mm
Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.mm
Source/WebCore/platform/spi/cf/CFNetworkSPI.h
Source/WebCore/platform/spi/cocoa/NEFilterSourceSPI.h
Source/WebCore/platform/spi/cocoa/QuartzCoreSPI.h
Source/WebCore/platform/spi/ios/DataDetectorsUISPI.h
Source/WebCore/platform/spi/mac/LookupSPI.h
Source/WebCore/platform/spi/mac/NSMenuSPI.h
Source/WebCore/platform/spi/mac/TUCallSPI.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebFullScreenController.mm
Source/WebKit/mac/WebView/WebHTMLView.mm
Source/WebKit/mac/WebView/WebImmediateActionController.mm
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit2/ChangeLog
Source/WebKit2/Platform/mac/LayerHostingContext.mm
Source/WebKit2/Platform/mac/MenuUtilities.mm
Source/WebKit2/Platform/spi/ios/UIKitSPI.h
Source/WebKit2/Shared/mac/ChildProcessMac.mm
Source/WebKit2/Shared/mac/WebEventFactory.mm
Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm
Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm
Source/WebKit2/UIProcess/WKImagePreviewViewController.mm
Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm
Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm
Source/WebKit2/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm
Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm
Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.mm