Consolidate RuntimeApplicationChecks and RuntimeApplicationChecksIOS
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 6 Mar 2016 03:28:54 +0000 (03:28 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 6 Mar 2016 03:28:54 +0000 (03:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=155035

Reviewed by Darin Adler.

Source/WebCore:

Consolidate RuntimeApplicationChecks and RuntimeApplicationChecksIOS into
one file. The following changes were made:
- The checks now all rely on applicationBundleIdentifier(), which has the
  benefit of working in WK1 and WK2 UI/WebContent/Networking processes.
- Use namespaces to distinguish Mac and iOS applications instead of relying
  on the method name. So, applicationIsIBooksForIOS() becomes
  IOSApplication::isIBooks().
- Use NSBundle API on both iOS and Mac instead of using the CF API on Mac
  and the NS API on iOS.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper _accessibilityWebDocumentView]):
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::commonVM):
* bindings/js/JSLocationCustom.cpp:
(WebCore::JSLocation::putDelegate):
* html/HTMLMediaElement.cpp:
* html/HTMLObjectElement.cpp:
(WebCore::shouldNotPerformURLAdjustment):
* html/MediaElementSession.cpp:
* inspector/InspectorTimelineAgent.cpp:
(WebCore::currentRunLoop):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::willLoadMediaElementURL):
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::create):
(WebCore::SubresourceLoader::startLoading):
* loader/cache/CachedScript.cpp:
(WebCore::CachedScript::shouldIgnoreHTTPStatusCodeErrors):
* platform/RuntimeApplicationChecks.cpp: Removed.
* platform/RuntimeApplicationChecks.h:
* platform/RuntimeApplicationChecks.mm: Added.
(WebCore::applicationBundleIdentifier):
(WebCore::applicationBundleIsEqualTo):
(WebCore::MacApplication::isSafari):
(WebCore::MacApplication::isAppleMail):
(WebCore::MacApplication::isIBooks):
(WebCore::MacApplication::isITunes):
(WebCore::MacApplication::isMicrosoftMessenger):
(WebCore::MacApplication::isAdobeInstaller):
(WebCore::MacApplication::isAOLInstantMessenger):
(WebCore::MacApplication::isMicrosoftMyDay):
(WebCore::MacApplication::isMicrosoftOutlook):
(WebCore::MacApplication::isQuickenEssentials):
(WebCore::MacApplication::isAperture):
(WebCore::MacApplication::isVersions):
(WebCore::MacApplication::isHRBlock):
(WebCore::MacApplication::isSolidStateNetworksDownloader):
(WebCore::MacApplication::isHipChat):
(WebCore::IOSApplication::isMobileMail):
(WebCore::IOSApplication::isMobileSafari):
(WebCore::IOSApplication::isDumpRenderTree):
(WebCore::IOSApplication::isMobileStore):
(WebCore::IOSApplication::isWebApp):
(WebCore::IOSApplication::isOkCupid):
(WebCore::IOSApplication::isFacebook):
(WebCore::IOSApplication::isDaijisenDictionary):
(WebCore::IOSApplication::isNASAHD):
(WebCore::IOSApplication::isTheEconomistOnIphone):
(WebCore::IOSApplication::isWebProcess):
(WebCore::IOSApplication::isIBooks):
(WebCore::setApplicationBundleIdentifier):
* platform/RuntimeApplicationChecksIOS.h: Removed.
* platform/RuntimeApplicationChecksIOS.mm: Removed.
* platform/audio/ios/AudioDestinationIOS.cpp:
* platform/cf/URLCF.cpp:
* platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp:
(WebCore::currentRunLoop):
* platform/ios/PasteboardIOS.mm:
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
* platform/ios/wak/WebCoreThread.mm:
(WebThreadEnable):
* platform/mac/WidgetMac.mm:
(WebCore::Widget::paint):
* platform/network/ios/QuickLook.mm:
* platform/network/mac/ResourceHandleMac.mm:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::needsIOSDumpRenderTreeMainFrameRenderViewLayerIsAlwaysOpaqueHack):

Source/WebKit:

Update runtime application checks.

* WebCoreSupport/WebResourceLoadScheduler.cpp:
(WebResourceLoadScheduler::servePendingRequests):

Source/WebKit/ios:

Update runtime application checks.

* WebCoreSupport/WebChromeClientIOS.mm:

Source/WebKit/mac:

Update runtime application checks.

* Plugins/WebPluginController.mm:
(initializeAudioSession):
* WebCoreSupport/WebFrameLoaderClient.mm:
* WebView/WebFrame.mm:
(needsMicrosoftMessengerDOMDocumentWorkaround):
* WebView/WebImmediateActionController.mm:
(-[WebImmediateActionController _updateImmediateActionItem]):
* WebView/WebView.mm:
(WebKitInitializeApplicationCachePathIfNecessary):
(shouldEnableLoadDeferring):
(shouldRestrictWindowFocus):
(needsOutlookQuirksScript):
(shouldTransformsAffectOverflow):
(shouldDispatchJavaScriptWindowOnErrorEvents):
(shouldUseLegacyBackgroundSizeShorthandBehavior):
(-[WebView _commonInitializationWithFrameName:groupName:]):
(+[WebView enableWebThread]):
(+[WebView registerForMemoryNotifications]):
(-[WebView _needsKeyboardEventDisambiguationQuirks]):
(needsSelfRetainWhileLoadingQuirk):
(-[WebView _needsPreHTML5ParserQuirks]):

Source/WebKit2:

Update runtime application checks.

* UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
(API::WebsiteDataStore::defaultApplicationCacheDirectory):
* UIProcess/Cocoa/VersionChecks.mm:
(WebKit::linkedOnOrAfter):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess):
(WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory):
* UIProcess/ios/WKContentViewInteraction.mm:
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::expectsLegacyImplicitRubberBandControl):
(WebKit::WebPageProxy::appleMailPaginationQuirkEnabled):

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

44 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm
Source/WebCore/bindings/js/JSDOMWindowBase.cpp
Source/WebCore/bindings/js/JSLocationCustom.cpp
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLObjectElement.cpp
Source/WebCore/html/MediaElementSession.cpp
Source/WebCore/inspector/InspectorTimelineAgent.cpp
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/loader/SubresourceLoader.cpp
Source/WebCore/loader/cache/CachedScript.cpp
Source/WebCore/platform/RuntimeApplicationChecks.cpp [deleted file]
Source/WebCore/platform/RuntimeApplicationChecks.h
Source/WebCore/platform/RuntimeApplicationChecks.mm [new file with mode: 0644]
Source/WebCore/platform/RuntimeApplicationChecksIOS.h [deleted file]
Source/WebCore/platform/RuntimeApplicationChecksIOS.mm [deleted file]
Source/WebCore/platform/audio/ios/AudioDestinationIOS.cpp
Source/WebCore/platform/cf/URLCF.cpp
Source/WebCore/platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp
Source/WebCore/platform/ios/PasteboardIOS.mm
Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm
Source/WebCore/platform/ios/wak/WebCoreThread.mm
Source/WebCore/platform/mac/WidgetMac.mm
Source/WebCore/platform/network/ios/QuickLook.mm
Source/WebCore/platform/network/mac/ResourceHandleMac.mm
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebKit/ChangeLog
Source/WebKit/WebCoreSupport/WebResourceLoadScheduler.cpp
Source/WebKit/ios/ChangeLog
Source/WebKit/ios/WebCoreSupport/WebChromeClientIOS.mm
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Plugins/WebPluginController.mm
Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
Source/WebKit/mac/WebView/WebFrame.mm
Source/WebKit/mac/WebView/WebImmediateActionController.mm
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm
Source/WebKit2/UIProcess/Cocoa/VersionChecks.mm
Source/WebKit2/UIProcess/Cocoa/WebProcessPoolCocoa.mm
Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm
Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm

index c463bf0..4febc49 100644 (file)
@@ -2120,7 +2120,6 @@ set(WebCore_SOURCES
     platform/PlatformSpeechSynthesizer.cpp
     platform/PlatformStrategies.cpp
     platform/RemoteCommandListener.cpp
-    platform/RuntimeApplicationChecks.cpp
     platform/SchemeRegistry.cpp
     platform/ScrollAnimator.cpp
     platform/ScrollView.cpp
index d066f3b..9b8f530 100644 (file)
@@ -1,3 +1,91 @@
+2016-03-05  Chris Dumez  <cdumez@apple.com>
+
+        Consolidate RuntimeApplicationChecks and RuntimeApplicationChecksIOS
+        https://bugs.webkit.org/show_bug.cgi?id=155035
+
+        Reviewed by Darin Adler.
+
+        Consolidate RuntimeApplicationChecks and RuntimeApplicationChecksIOS into
+        one file. The following changes were made:
+        - The checks now all rely on applicationBundleIdentifier(), which has the
+          benefit of working in WK1 and WK2 UI/WebContent/Networking processes.
+        - Use namespaces to distinguish Mac and iOS applications instead of relying
+          on the method name. So, applicationIsIBooksForIOS() becomes
+          IOSApplication::isIBooks().
+        - Use NSBundle API on both iOS and Mac instead of using the CF API on Mac
+          and the NS API on iOS.
+
+        * CMakeLists.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
+        (-[WebAccessibilityObjectWrapper _accessibilityWebDocumentView]):
+        * bindings/js/JSDOMWindowBase.cpp:
+        (WebCore::JSDOMWindowBase::commonVM):
+        * bindings/js/JSLocationCustom.cpp:
+        (WebCore::JSLocation::putDelegate):
+        * html/HTMLMediaElement.cpp:
+        * html/HTMLObjectElement.cpp:
+        (WebCore::shouldNotPerformURLAdjustment):
+        * html/MediaElementSession.cpp:
+        * inspector/InspectorTimelineAgent.cpp:
+        (WebCore::currentRunLoop):
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::willLoadMediaElementURL):
+        * loader/SubresourceLoader.cpp:
+        (WebCore::SubresourceLoader::create):
+        (WebCore::SubresourceLoader::startLoading):
+        * loader/cache/CachedScript.cpp:
+        (WebCore::CachedScript::shouldIgnoreHTTPStatusCodeErrors):
+        * platform/RuntimeApplicationChecks.cpp: Removed.
+        * platform/RuntimeApplicationChecks.h:
+        * platform/RuntimeApplicationChecks.mm: Added.
+        (WebCore::applicationBundleIdentifier):
+        (WebCore::applicationBundleIsEqualTo):
+        (WebCore::MacApplication::isSafari):
+        (WebCore::MacApplication::isAppleMail):
+        (WebCore::MacApplication::isIBooks):
+        (WebCore::MacApplication::isITunes):
+        (WebCore::MacApplication::isMicrosoftMessenger):
+        (WebCore::MacApplication::isAdobeInstaller):
+        (WebCore::MacApplication::isAOLInstantMessenger):
+        (WebCore::MacApplication::isMicrosoftMyDay):
+        (WebCore::MacApplication::isMicrosoftOutlook):
+        (WebCore::MacApplication::isQuickenEssentials):
+        (WebCore::MacApplication::isAperture):
+        (WebCore::MacApplication::isVersions):
+        (WebCore::MacApplication::isHRBlock):
+        (WebCore::MacApplication::isSolidStateNetworksDownloader):
+        (WebCore::MacApplication::isHipChat):
+        (WebCore::IOSApplication::isMobileMail):
+        (WebCore::IOSApplication::isMobileSafari):
+        (WebCore::IOSApplication::isDumpRenderTree):
+        (WebCore::IOSApplication::isMobileStore):
+        (WebCore::IOSApplication::isWebApp):
+        (WebCore::IOSApplication::isOkCupid):
+        (WebCore::IOSApplication::isFacebook):
+        (WebCore::IOSApplication::isDaijisenDictionary):
+        (WebCore::IOSApplication::isNASAHD):
+        (WebCore::IOSApplication::isTheEconomistOnIphone):
+        (WebCore::IOSApplication::isWebProcess):
+        (WebCore::IOSApplication::isIBooks):
+        (WebCore::setApplicationBundleIdentifier):
+        * platform/RuntimeApplicationChecksIOS.h: Removed.
+        * platform/RuntimeApplicationChecksIOS.mm: Removed.
+        * platform/audio/ios/AudioDestinationIOS.cpp:
+        * platform/cf/URLCF.cpp:
+        * platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp:
+        (WebCore::currentRunLoop):
+        * platform/ios/PasteboardIOS.mm:
+        * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
+        * platform/ios/wak/WebCoreThread.mm:
+        (WebThreadEnable):
+        * platform/mac/WidgetMac.mm:
+        (WebCore::Widget::paint):
+        * platform/network/ios/QuickLook.mm:
+        * platform/network/mac/ResourceHandleMac.mm:
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::needsIOSDumpRenderTreeMainFrameRenderViewLayerIsAlwaysOpaqueHack):
+
 2016-03-05  Zalan Bujtas  <zalan@apple.com>
 
         Make table collapsed borders subpixel aware.
index c3be910..3f972b8 100644 (file)
                2934940A16C02C0700901318 /* PlatformSpeechSynthesisVoice.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2527CC9316BF92EC009DDAC0 /* PlatformSpeechSynthesisVoice.cpp */; };
                2934940B16C02C0A00901318 /* PlatformSpeechSynthesisUtterance.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2527CC9516BF95DD009DDAC0 /* PlatformSpeechSynthesisUtterance.cpp */; };
                293EAE1F1356B2FE0067ACF9 /* RuntimeApplicationChecks.h in Headers */ = {isa = PBXBuildFile; fileRef = 293EAE1E1356B2FE0067ACF9 /* RuntimeApplicationChecks.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               293EAE211356B32E0067ACF9 /* RuntimeApplicationChecks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 293EAE201356B32E0067ACF9 /* RuntimeApplicationChecks.cpp */; };
                29489FC712C00F0300D83F0F /* AccessibilityScrollView.h in Headers */ = {isa = PBXBuildFile; fileRef = 29489FC512C00F0300D83F0F /* AccessibilityScrollView.h */; };
                29498683195341940072D2BD /* TextUndoInsertionMarkupMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 29498681195341940072D2BD /* TextUndoInsertionMarkupMac.mm */; };
                297BE3D516C03C08003316BD /* PlatformSpeechSynthesisUtterance.h in Headers */ = {isa = PBXBuildFile; fileRef = 2527CC9116BF8BA1009DDAC0 /* PlatformSpeechSynthesisUtterance.h */; };
                44A20DB90F84166C00B3E1FE /* WebCoreURLResponseIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 44A20DB80F84166C00B3E1FE /* WebCoreURLResponseIOS.h */; settings = {ATTRIBUTES = (Private, ); }; };
                44A28AAC12DFB8AC00AE923B /* MathMLElementFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 44A28AAB12DFB8AC00AE923B /* MathMLElementFactory.h */; };
                44A28AAF12DFB8BF00AE923B /* MathMLNames.h in Headers */ = {isa = PBXBuildFile; fileRef = 44A28AAE12DFB8BF00AE923B /* MathMLNames.h */; };
-               44C363F00FAA7BB30097F8CC /* RuntimeApplicationChecksIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 44C363EE0FAA7BB30097F8CC /* RuntimeApplicationChecksIOS.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               44C363F10FAA7BB30097F8CC /* RuntimeApplicationChecksIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 44C363EF0FAA7BB30097F8CC /* RuntimeApplicationChecksIOS.mm */; };
                44C991820F3D1E0D00586670 /* ScrollbarThemeIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 44C991810F3D1E0D00586670 /* ScrollbarThemeIOS.mm */; };
                44C991860F3D1EBE00586670 /* ScrollbarThemeIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 44C991850F3D1EBE00586670 /* ScrollbarThemeIOS.h */; };
                44C9919F0F3D210E00586670 /* ThemeIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 44C9919D0F3D210E00586670 /* ThemeIOS.h */; };
                4634592C1AC2271000ECB71C /* PowerObserverMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4634592B1AC2271000ECB71C /* PowerObserverMac.cpp */; };
                463EB6221B8789E00096ED51 /* TagCollection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 463EB6201B8789CB0096ED51 /* TagCollection.cpp */; };
                463EB6231B8789E00096ED51 /* TagCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 463EB6211B8789CB0096ED51 /* TagCollection.h */; };
+               465A8E791C8A24CE00E7D3E4 /* RuntimeApplicationChecks.mm in Sources */ = {isa = PBXBuildFile; fileRef = 465A8E781C8A24CE00E7D3E4 /* RuntimeApplicationChecks.mm */; };
                4669B2871B852A0B000F905F /* JSDOMNamedFlowCollectionCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46F2768E1B85297F005C2556 /* JSDOMNamedFlowCollectionCustom.cpp */; };
                467302021C4EFE7800BCB357 /* IgnoreOpensDuringUnloadCountIncrementer.h in Headers */ = {isa = PBXBuildFile; fileRef = 467302011C4EFE6600BCB357 /* IgnoreOpensDuringUnloadCountIncrementer.h */; };
                4689F1AF1267BAE100E8D380 /* FileMetadata.h in Headers */ = {isa = PBXBuildFile; fileRef = 4689F1AE1267BAE100E8D380 /* FileMetadata.h */; };
                2917B5601473496C0052C9D0 /* LayerFlushSchedulerClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayerFlushSchedulerClient.h; sourceTree = "<group>"; };
                2917B565147349950052C9D0 /* LayerFlushSchedulerMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LayerFlushSchedulerMac.cpp; sourceTree = "<group>"; };
                293EAE1E1356B2FE0067ACF9 /* RuntimeApplicationChecks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RuntimeApplicationChecks.h; sourceTree = "<group>"; };
-               293EAE201356B32E0067ACF9 /* RuntimeApplicationChecks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RuntimeApplicationChecks.cpp; sourceTree = "<group>"; };
                29489FC512C00F0300D83F0F /* AccessibilityScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityScrollView.h; sourceTree = "<group>"; };
                29498681195341940072D2BD /* TextUndoInsertionMarkupMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TextUndoInsertionMarkupMac.mm; sourceTree = "<group>"; };
                297BE3D916C043D8003316BD /* PlatformSpeechSynthesizer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformSpeechSynthesizer.cpp; sourceTree = "<group>"; };
                44A20DB80F84166C00B3E1FE /* WebCoreURLResponseIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreURLResponseIOS.h; sourceTree = "<group>"; };
                44A28AAB12DFB8AC00AE923B /* MathMLElementFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathMLElementFactory.h; sourceTree = "<group>"; };
                44A28AAE12DFB8BF00AE923B /* MathMLNames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathMLNames.h; sourceTree = "<group>"; };
-               44C363EE0FAA7BB30097F8CC /* RuntimeApplicationChecksIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RuntimeApplicationChecksIOS.h; sourceTree = "<group>"; };
-               44C363EF0FAA7BB30097F8CC /* RuntimeApplicationChecksIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RuntimeApplicationChecksIOS.mm; sourceTree = "<group>"; };
                44C991810F3D1E0D00586670 /* ScrollbarThemeIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ScrollbarThemeIOS.mm; sourceTree = "<group>"; };
                44C991850F3D1EBE00586670 /* ScrollbarThemeIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollbarThemeIOS.h; sourceTree = "<group>"; };
                44C9919D0F3D210E00586670 /* ThemeIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThemeIOS.h; sourceTree = "<group>"; };
                4634592B1AC2271000ECB71C /* PowerObserverMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PowerObserverMac.cpp; sourceTree = "<group>"; };
                463EB6201B8789CB0096ED51 /* TagCollection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TagCollection.cpp; sourceTree = "<group>"; };
                463EB6211B8789CB0096ED51 /* TagCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TagCollection.h; sourceTree = "<group>"; };
+               465A8E781C8A24CE00E7D3E4 /* RuntimeApplicationChecks.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RuntimeApplicationChecks.mm; sourceTree = "<group>"; };
                467302011C4EFE6600BCB357 /* IgnoreOpensDuringUnloadCountIncrementer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IgnoreOpensDuringUnloadCountIncrementer.h; sourceTree = "<group>"; };
                4689F1AE1267BAE100E8D380 /* FileMetadata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileMetadata.h; sourceTree = "<group>"; };
                46B63F6B1C6E8CDF002E914B /* JSEventTargetCustom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSEventTargetCustom.h; sourceTree = "<group>"; };
                                9831AE49154225A200FE2644 /* ReferrerPolicy.h */,
                                CDFC360318CA61C20026E56F /* RemoteCommandListener.cpp */,
                                CDFC360418CA61C20026E56F /* RemoteCommandListener.h */,
-                               293EAE201356B32E0067ACF9 /* RuntimeApplicationChecks.cpp */,
+                               465A8E781C8A24CE00E7D3E4 /* RuntimeApplicationChecks.mm */,
                                293EAE1E1356B2FE0067ACF9 /* RuntimeApplicationChecks.h */,
-                               44C363EE0FAA7BB30097F8CC /* RuntimeApplicationChecksIOS.h */,
-                               44C363EF0FAA7BB30097F8CC /* RuntimeApplicationChecksIOS.mm */,
                                5162C7F211F77EFA00612EFE /* SchemeRegistry.cpp */,
                                5162C7F311F77EFB00612EFE /* SchemeRegistry.h */,
                                5141298F1C601A890059E714 /* ScopeGuard.h */,
                                1A569D230D7E2B82007C3983 /* runtime_object.h in Headers */,
                                1A569D250D7E2B82007C3983 /* runtime_root.h in Headers */,
                                293EAE1F1356B2FE0067ACF9 /* RuntimeApplicationChecks.h in Headers */,
-                               44C363F00FAA7BB30097F8CC /* RuntimeApplicationChecksIOS.h in Headers */,
                                8C6EA61A11EF7E0400FD8EE3 /* RuntimeEnabledFeatures.h in Headers */,
                                CDD7089718359F6F002B3DC6 /* SampleMap.h in Headers */,
                                49E911CB0EF86D47009D0CAF /* ScaleTransformOperation.h in Headers */,
                                1A569D200D7E2B82007C3983 /* runtime_method.cpp in Sources */,
                                1A569D220D7E2B82007C3983 /* runtime_object.cpp in Sources */,
                                1A569D240D7E2B82007C3983 /* runtime_root.cpp in Sources */,
-                               293EAE211356B32E0067ACF9 /* RuntimeApplicationChecks.cpp in Sources */,
-                               44C363F10FAA7BB30097F8CC /* RuntimeApplicationChecksIOS.mm in Sources */,
                                8C6EA61911EF7E0400FD8EE3 /* RuntimeEnabledFeatures.cpp in Sources */,
                                CDD7089618359F6F002B3DC6 /* SampleMap.cpp in Sources */,
                                49E911CA0EF86D47009D0CAF /* ScaleTransformOperation.cpp in Sources */,
                                C5A1EA7C152BCF04004D00B6 /* SimplifyMarkupCommand.cpp in Sources */,
                                572A7F231C6E5A66009C6149 /* SimulatedClick.cpp in Sources */,
                                FD00D7A414A3F61900734011 /* SincResampler.cpp in Sources */,
+                               465A8E791C8A24CE00E7D3E4 /* RuntimeApplicationChecks.mm in Sources */,
                                51327D6111A33A2B004F9D65 /* SinkDocument.cpp in Sources */,
                                49E911CC0EF86D47009D0CAF /* SkewTransformOperation.cpp in Sources */,
                                4150F9F212B6E0E70008C860 /* SliderThumbElement.cpp in Sources */,
index 5a7fe33..4d76cb0 100644 (file)
@@ -48,7 +48,7 @@
 #import "Page.h"
 #import "Range.h"
 #import "RenderView.h"
-#import "RuntimeApplicationChecksIOS.h"
+#import "RuntimeApplicationChecks.h"
 #import "SVGNames.h"
 #import "SVGElement.h"
 #import "TextIterator.h"
@@ -1554,7 +1554,7 @@ static void appendStringToResult(NSMutableString *result, NSString *string)
     // The parentView should have an accessibilityContainer, if the UIKit accessibility bundle was loaded. 
     // The exception is DRT, which tests accessibility without the entire system turning accessibility on. Hence,
     // this check should be valid for everything except DRT.
-    ASSERT([parentView accessibilityContainer] || applicationIsDumpRenderTree());
+    ASSERT([parentView accessibilityContainer] || IOSApplication::isDumpRenderTree());
     
     return [parentView accessibilityContainer];
 }
index 19fca25..01496ee 100644 (file)
@@ -264,7 +264,7 @@ VM& JSDOMWindowBase::commonVM()
 #endif
 
 #if PLATFORM(MAC)
-        if (applicationIsITunes() || applicationIsIBooks() || Settings::shouldRewriteConstAsVar())
+        if (MacApplication::isITunes() || MacApplication::isIBooks() || Settings::shouldRewriteConstAsVar())
             vm->setShouldRewriteConstAsVar(true);
 #endif
 
index b33ad4f..570f9cf 100644 (file)
@@ -87,7 +87,7 @@ bool JSLocation::putDelegate(ExecState* exec, PropertyName propertyName, JSValue
 
 #if PLATFORM(MAC)
     // FIXME: HipChat tries to set Location.reload which causes an exception to be thrown in strict mode (see <rdar://problem/24931959>).
-    if (applicationIsHipChat())
+    if (MacApplication::isHipChat())
         slot.setStrictMode(false);
 #endif
 
index 4adc51d..59e685a 100644 (file)
 #endif
 
 #if PLATFORM(IOS)
-#include "RuntimeApplicationChecksIOS.h"
+#include "RuntimeApplicationChecks.h"
 #include "WebVideoFullscreenInterfaceAVKit.h"
 #endif
 
index b16928f..794b123 100644 (file)
@@ -56,7 +56,7 @@
 
 #if PLATFORM(IOS)
 #include "DynamicLinkerSPI.h"
-#include "RuntimeApplicationChecksIOS.h"
+#include "RuntimeApplicationChecks.h"
 #endif
 
 namespace WebCore {
@@ -158,7 +158,7 @@ static void mapDataParamToSrc(Vector<String>& paramNames, Vector<String>& paramV
 #if PLATFORM(IOS)
 static bool shouldNotPerformURLAdjustment()
 {
-    static bool shouldNotPerformURLAdjustment = applicationIsNASAHD() && dyld_get_program_sdk_version() < DYLD_IOS_VERSION_5_0;
+    static bool shouldNotPerformURLAdjustment = IOSApplication::isNASAHD() && dyld_get_program_sdk_version() < DYLD_IOS_VERSION_5_0;
     return shouldNotPerformURLAdjustment;
 }
 #endif
index a4704d2..76cb8d2 100644 (file)
@@ -46,7 +46,7 @@
 
 #if PLATFORM(IOS)
 #include "AudioSession.h"
-#include "RuntimeApplicationChecksIOS.h"
+#include "RuntimeApplicationChecks.h"
 #endif
 
 namespace WebCore {
index 69327a4..c76cc21 100644 (file)
@@ -47,7 +47,7 @@
 #include <wtf/Stopwatch.h>
 
 #if PLATFORM(IOS)
-#include "RuntimeApplicationChecksIOS.h"
+#include "RuntimeApplicationChecks.h"
 #include <WebCore/WebCoreThread.h>
 #endif
 
@@ -70,7 +70,7 @@ static CFRunLoopRef currentRunLoop()
     // we still allow this, see <rdar://problem/7403328>. Since the race condition and subsequent
     // crash are especially troublesome for iBooks, we never allow the observer to be added to the
     // main run loop in iBooks.
-    if (applicationIsIBooksOnIOS())
+    if (IOSApplication::isIBooks())
         return WebThreadRunLoop();
 #endif
     return CFRunLoopGetCurrent();
index 1eefb33..daa7534 100644 (file)
 #include "DocumentType.h"
 #include "MemoryPressureHandler.h"
 #include "ResourceLoader.h"
-#include "RuntimeApplicationChecksIOS.h"
+#include "RuntimeApplicationChecks.h"
 #include "SystemMemory.h"
 #include "WKContentObservation.h"
 #endif
@@ -1475,7 +1475,7 @@ bool FrameLoader::willLoadMediaElementURL(URL& url)
 #if PLATFORM(IOS)
     // MobileStore depends on the iOS 4.0 era client delegate method because webView:resource:willSendRequest:redirectResponse:fromDataSource
     // doesn't let them tell when a load request is coming from a media element. See <rdar://problem/8266916> for more details.
-    if (applicationIsMobileStore())
+    if (IOSApplication::isMobileStore())
         return m_client.shouldLoadMediaElementURL(url);
 #endif
 
index 7e417b6..e2a2931 100644 (file)
@@ -49,7 +49,7 @@
 #include <wtf/text/CString.h>
 
 #if PLATFORM(IOS)
-#include <RuntimeApplicationChecksIOS.h>
+#include <RuntimeApplicationChecks.h>
 #endif
 
 #if ENABLE(CONTENT_EXTENSIONS)
@@ -100,7 +100,7 @@ RefPtr<SubresourceLoader> SubresourceLoader::create(Frame* frame, CachedResource
 {
     RefPtr<SubresourceLoader> subloader(adoptRef(new SubresourceLoader(frame, resource, options)));
 #if PLATFORM(IOS)
-    if (!applicationIsWebProcess()) {
+    if (!IOSApplication::isWebProcess()) {
         // On iOS, do not invoke synchronous resource load delegates while resource load scheduling
         // is disabled to avoid re-entering style selection from a different thread (see <rdar://problem/9121719>).
         // FIXME: This should be fixed for all ports in <https://bugs.webkit.org/show_bug.cgi?id=56647>.
@@ -116,7 +116,7 @@ RefPtr<SubresourceLoader> SubresourceLoader::create(Frame* frame, CachedResource
 #if PLATFORM(IOS)
 bool SubresourceLoader::startLoading()
 {
-    ASSERT(!applicationIsWebProcess());
+    ASSERT(!IOSApplication::isWebProcess());
     if (!init(m_iOSOriginalRequest))
         return false;
     m_iOSOriginalRequest = ResourceRequest();
index edcecf8..13ac301 100644 (file)
@@ -131,14 +131,16 @@ bool CachedScript::mimeTypeAllowedByNosniff() const
 
 bool CachedScript::shouldIgnoreHTTPStatusCodeErrors() const
 {
+#if PLATFORM(MAC)
     // This is a workaround for <rdar://problem/13916291>
     // REGRESSION (r119759): Adobe Flash Player "smaller" installer relies on the incorrect firing
     // of a load event and needs an app-specific hack for compatibility.
     // The installer in question tries to load .js file that doesn't exist, causing the server to
     // return a 404 response. Normally, this would trigger an error event to be dispatched, but the
     // installer expects a load event instead so we work around it here.
-    if (applicationIsSolidStateNetworksDownloader())
+    if (MacApplication::isSolidStateNetworksDownloader())
         return true;
+#endif
 
     return CachedResource::shouldIgnoreHTTPStatusCodeErrors();
 }
diff --git a/Source/WebCore/platform/RuntimeApplicationChecks.cpp b/Source/WebCore/platform/RuntimeApplicationChecks.cpp
deleted file mode 100644 (file)
index 48b4f65..0000000
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "RuntimeApplicationChecks.h"
-
-#include <wtf/NeverDestroyed.h>
-#include <wtf/RunLoop.h>
-#include <wtf/text/WTFString.h>
-
-#if USE(CF)
-#include <CoreFoundation/CoreFoundation.h>
-#include <wtf/RetainPtr.h>
-#endif
-
-namespace WebCore {
-
-#if USE(CF)
-static CFStringRef mainBundleIdentifier()
-{
-    CFBundleRef mainBundle = CFBundleGetMainBundle();
-    if (!mainBundle)
-        return nullptr;
-
-    return CFBundleGetIdentifier(mainBundle);
-}
-#endif
-
-// The application bundle identifier gets set to the UIProcess bundle identifier by the WebProcess and
-// the networking process upon initialization.
-// If not explicitly set, this will return the main bundle identifier which is accurate for WK1 or
-// the WK2 UIProcess.
-static String& applicationBundleIdentifier()
-{
-    ASSERT(RunLoop::isMain());
-
-#if USE(CF)
-    static NeverDestroyed<String> identifier(mainBundleIdentifier());
-#else
-    static NeverDestroyed<String> identifier;
-#endif
-
-    return identifier;
-}
-
-// FIXME: This should probably be renamed to applicationBundleIsEqualTo() and use applicationBundleIdentifier()
-// instead of mainBundleIdentifier() internally. This would have the benefit of working for both WebKit1 and
-// WebKit2.
-static bool mainBundleIsEqualTo(const String& bundleIdentifierString)
-{
-    // FIXME: We should consider merging this file with RuntimeApplicationChecksIOS.mm.
-    // Then we can remove the PLATFORM(IOS)-guard.
-#if USE(CF) && !PLATFORM(IOS)
-    CFStringRef bundleIdentifier = mainBundleIdentifier();
-    if (!bundleIdentifier)
-        return false;
-
-    return CFStringCompare(bundleIdentifier, bundleIdentifierString.createCFString().get(), 0) == kCFCompareEqualTo;
-#else
-    UNUSED_PARAM(bundleIdentifierString);
-    return false;
-#endif
-}
-
-bool applicationIsSafari()
-{
-    static bool isSafari = mainBundleIsEqualTo("com.apple.Safari");
-    return isSafari;
-}
-
-bool applicationIsAppleMail()
-{
-    static bool isAppleMail = mainBundleIsEqualTo("com.apple.mail");
-    return isAppleMail;
-}
-
-bool applicationIsIBooks()
-{
-    static bool isIBooks = mainBundleIsEqualTo("com.apple.iBooksX");
-    return isIBooks;
-}
-
-bool applicationIsITunes()
-{
-    static bool isITunes = mainBundleIsEqualTo("com.apple.iTunes");
-    return isITunes;
-}
-
-bool applicationIsMicrosoftMessenger()
-{
-    static bool isMicrosoftMessenger = mainBundleIsEqualTo("com.microsoft.Messenger");
-    return isMicrosoftMessenger;
-}
-
-bool applicationIsAdobeInstaller()
-{
-    static bool isAdobeInstaller = mainBundleIsEqualTo("com.adobe.Installers.Setup");
-    return isAdobeInstaller;
-}
-
-bool applicationIsAOLInstantMessenger()
-{
-    static bool isAOLInstantMessenger = mainBundleIsEqualTo("com.aol.aim.desktop");
-    return isAOLInstantMessenger;
-}
-
-bool applicationIsMicrosoftMyDay()
-{
-    static bool isMicrosoftMyDay = mainBundleIsEqualTo("com.microsoft.myday");
-    return isMicrosoftMyDay;
-}
-
-bool applicationIsMicrosoftOutlook()
-{
-    static bool isMicrosoftOutlook = mainBundleIsEqualTo("com.microsoft.Outlook");
-    return isMicrosoftOutlook;
-}
-
-bool applicationIsQuickenEssentials()
-{
-    static bool isQuickenEssentials = mainBundleIsEqualTo("com.intuit.QuickenEssentials");
-    return isQuickenEssentials;
-}
-
-bool applicationIsAperture()
-{
-    static bool isAperture = mainBundleIsEqualTo("com.apple.Aperture");
-    return isAperture;
-}
-
-bool applicationIsVersions()
-{
-    static bool isVersions = mainBundleIsEqualTo("com.blackpixel.versions");
-    return isVersions;
-}
-
-bool applicationIsHRBlock()
-{
-    static bool isHRBlock = mainBundleIsEqualTo("com.hrblock.tax.2010");
-    return isHRBlock;
-}
-
-bool applicationIsSolidStateNetworksDownloader()
-{
-    static bool isSolidStateNetworksDownloader = mainBundleIsEqualTo("com.solidstatenetworks.awkhost");
-    return isSolidStateNetworksDownloader;
-}
-
-bool applicationIsHipChat()
-{
-    static bool isHipChat = applicationBundleIdentifier() == "com.hipchat.HipChat";
-    ASSERT_WITH_MESSAGE(isHipChat == (applicationBundleIdentifier() == "com.hipchat.HipChat"), "Should not be called before setApplicationBundleIdentifier()");
-    return isHipChat;
-}
-
-void setApplicationBundleIdentifier(const String& bundleIdentifier)
-{
-    applicationBundleIdentifier() = bundleIdentifier;
-}
-
-} // namespace WebCore
index 5c7fed0..db423b2 100644 (file)
 #ifndef RuntimeApplicationChecks_h
 #define RuntimeApplicationChecks_h
 
+#if PLATFORM(COCOA)
 #include <wtf/Forward.h>
 
 namespace WebCore {
 
-WEBCORE_EXPORT bool applicationIsAOLInstantMessenger();
-WEBCORE_EXPORT bool applicationIsAdobeInstaller();
-WEBCORE_EXPORT bool applicationIsAperture();
-WEBCORE_EXPORT bool applicationIsAppleMail();
-WEBCORE_EXPORT bool applicationIsIBooks();
-WEBCORE_EXPORT bool applicationIsITunes();
-WEBCORE_EXPORT bool applicationIsMicrosoftMessenger();
-WEBCORE_EXPORT bool applicationIsMicrosoftMyDay();
-WEBCORE_EXPORT bool applicationIsMicrosoftOutlook();
-bool applicationIsQuickenEssentials();
-WEBCORE_EXPORT bool applicationIsSafari();
-bool applicationIsSolidStateNetworksDownloader();
-WEBCORE_EXPORT bool applicationIsVersions();
-WEBCORE_EXPORT bool applicationIsHRBlock();
-WEBCORE_EXPORT bool applicationIsHipChat();
-
 WEBCORE_EXPORT void setApplicationBundleIdentifier(const String&);
 
+#if PLATFORM(MAC)
+
+namespace MacApplication {
+
+WEBCORE_EXPORT bool isAOLInstantMessenger();
+WEBCORE_EXPORT bool isAdobeInstaller();
+WEBCORE_EXPORT bool isAperture();
+WEBCORE_EXPORT bool isAppleMail();
+WEBCORE_EXPORT bool isIBooks();
+WEBCORE_EXPORT bool isITunes();
+WEBCORE_EXPORT bool isMicrosoftMessenger();
+WEBCORE_EXPORT bool isMicrosoftMyDay();
+WEBCORE_EXPORT bool isMicrosoftOutlook();
+bool isQuickenEssentials();
+WEBCORE_EXPORT bool isSafari();
+bool isSolidStateNetworksDownloader();
+WEBCORE_EXPORT bool isVersions();
+WEBCORE_EXPORT bool isHRBlock();
+WEBCORE_EXPORT bool isHipChat();
+
+} // MacApplication
+
+#endif // PLATFORM(MAC)
+
+#if PLATFORM(IOS)
+
+namespace IOSApplication {
+
+WEBCORE_EXPORT bool isMobileMail();
+WEBCORE_EXPORT bool isMobileSafari();
+bool isDumpRenderTree();
+bool isMobileStore();
+WEBCORE_EXPORT bool isWebApp();
+WEBCORE_EXPORT bool isOkCupid();
+WEBCORE_EXPORT bool isFacebook();
+WEBCORE_EXPORT bool isDaijisenDictionary();
+bool isNASAHD();
+WEBCORE_EXPORT bool isTheEconomistOnIphone();
+WEBCORE_EXPORT bool isWebProcess();
+bool isIBooks();
+
+} // IOSApplication
+
+#endif // PLATFORM(IOS)
+
 } // namespace WebCore
 
+#endif // PLATFORM(COCOA)
+
 #endif // RuntimeApplicationChecks_h
diff --git a/Source/WebCore/platform/RuntimeApplicationChecks.mm b/Source/WebCore/platform/RuntimeApplicationChecks.mm
new file mode 100644 (file)
index 0000000..b76bb2e
--- /dev/null
@@ -0,0 +1,261 @@
+/*
+ * Copyright (C) 2011, 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "RuntimeApplicationChecks.h"
+
+#import <Foundation/NSBundle.h>
+#import <wtf/NeverDestroyed.h>
+#import <wtf/RunLoop.h>
+#import <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+// The application bundle identifier gets set to the UIProcess bundle identifier by the WebProcess and
+// the networking process upon initialization.
+// If not explicitly set, this will return the main bundle identifier which is accurate for WK1 or
+// the WK2 UIProcess.
+static String& applicationBundleIdentifier()
+{
+    ASSERT(RunLoop::isMain());
+
+    static NeverDestroyed<String> identifier([[NSBundle mainBundle] bundleIdentifier]);
+
+    return identifier;
+}
+
+void setApplicationBundleIdentifier(const String& bundleIdentifier)
+{
+    applicationBundleIdentifier() = bundleIdentifier;
+}
+
+static bool applicationBundleIsEqualTo(const String& bundleIdentifierString)
+{
+    return applicationBundleIdentifier() == bundleIdentifierString;
+}
+
+#if PLATFORM(MAC)
+
+bool MacApplication::isSafari()
+{
+    static bool isSafari = applicationBundleIsEqualTo("com.apple.Safari");
+    ASSERT_WITH_MESSAGE(isSafari == applicationBundleIsEqualTo("com.apple.Safari"), "Should not be called before setApplicationBundleIdentifier()");
+    return isSafari;
+}
+
+bool MacApplication::isAppleMail()
+{
+    static bool isAppleMail = applicationBundleIsEqualTo("com.apple.mail");
+    ASSERT_WITH_MESSAGE(isAppleMail == applicationBundleIsEqualTo("com.apple.mail"), "Should not be called before setApplicationBundleIdentifier()");
+    return isAppleMail;
+}
+
+bool MacApplication::isIBooks()
+{
+    static bool isIBooks = applicationBundleIsEqualTo("com.apple.iBooksX");
+    ASSERT_WITH_MESSAGE(isIBooks == applicationBundleIsEqualTo("com.apple.iBooksX"), "Should not be called before setApplicationBundleIdentifier()");
+    return isIBooks;
+}
+
+bool MacApplication::isITunes()
+{
+    static bool isITunes = applicationBundleIsEqualTo("com.apple.iTunes");
+    ASSERT_WITH_MESSAGE(isITunes == applicationBundleIsEqualTo("com.apple.iTunes"), "Should not be called before setApplicationBundleIdentifier()");
+    return isITunes;
+}
+
+bool MacApplication::isMicrosoftMessenger()
+{
+    static bool isMicrosoftMessenger = applicationBundleIsEqualTo("com.microsoft.Messenger");
+    ASSERT_WITH_MESSAGE(isMicrosoftMessenger == applicationBundleIsEqualTo("com.microsoft.Messenger"), "Should not be called before setApplicationBundleIdentifier()");
+    return isMicrosoftMessenger;
+}
+
+bool MacApplication::isAdobeInstaller()
+{
+    static bool isAdobeInstaller = applicationBundleIsEqualTo("com.adobe.Installers.Setup");
+    ASSERT_WITH_MESSAGE(isAdobeInstaller == applicationBundleIsEqualTo("com.adobe.Installers.Setup"), "Should not be called before setApplicationBundleIdentifier()");
+    return isAdobeInstaller;
+}
+
+bool MacApplication::isAOLInstantMessenger()
+{
+    static bool isAOLInstantMessenger = applicationBundleIsEqualTo("com.aol.aim.desktop");
+    ASSERT_WITH_MESSAGE(isAOLInstantMessenger == applicationBundleIsEqualTo("com.aol.aim.desktop"), "Should not be called before setApplicationBundleIdentifier()");
+    return isAOLInstantMessenger;
+}
+
+bool MacApplication::isMicrosoftMyDay()
+{
+    static bool isMicrosoftMyDay = applicationBundleIsEqualTo("com.microsoft.myday");
+    ASSERT_WITH_MESSAGE(isMicrosoftMyDay == applicationBundleIsEqualTo("com.microsoft.myday"), "Should not be called before setApplicationBundleIdentifier()");
+    return isMicrosoftMyDay;
+}
+
+bool MacApplication::isMicrosoftOutlook()
+{
+    static bool isMicrosoftOutlook = applicationBundleIsEqualTo("com.microsoft.Outlook");
+    ASSERT_WITH_MESSAGE(isMicrosoftOutlook == applicationBundleIsEqualTo("com.microsoft.Outlook"), "Should not be called before setApplicationBundleIdentifier()");
+    return isMicrosoftOutlook;
+}
+
+bool MacApplication::isQuickenEssentials()
+{
+    static bool isQuickenEssentials = applicationBundleIsEqualTo("com.intuit.QuickenEssentials");
+    ASSERT_WITH_MESSAGE(isQuickenEssentials == applicationBundleIsEqualTo("com.intuit.QuickenEssentials"), "Should not be called before setApplicationBundleIdentifier()");
+    return isQuickenEssentials;
+}
+
+bool MacApplication::isAperture()
+{
+    static bool isAperture = applicationBundleIsEqualTo("com.apple.Aperture");
+    ASSERT_WITH_MESSAGE(isAperture == applicationBundleIsEqualTo("com.apple.Aperture"), "Should not be called before setApplicationBundleIdentifier()");
+    return isAperture;
+}
+
+bool MacApplication::isVersions()
+{
+    static bool isVersions = applicationBundleIsEqualTo("com.blackpixel.versions");
+    ASSERT_WITH_MESSAGE(isVersions == applicationBundleIsEqualTo("com.blackpixel.versions"), "Should not be called before setApplicationBundleIdentifier()");
+    return isVersions;
+}
+
+bool MacApplication::isHRBlock()
+{
+    static bool isHRBlock = applicationBundleIsEqualTo("com.hrblock.tax.2010");
+    ASSERT_WITH_MESSAGE(isHRBlock == applicationBundleIsEqualTo("com.hrblock.tax.2010"), "Should not be called before setApplicationBundleIdentifier()");
+    return isHRBlock;
+}
+
+bool MacApplication::isSolidStateNetworksDownloader()
+{
+    static bool isSolidStateNetworksDownloader = applicationBundleIsEqualTo("com.solidstatenetworks.awkhost");
+    ASSERT_WITH_MESSAGE(isSolidStateNetworksDownloader == applicationBundleIsEqualTo("com.solidstatenetworks.awkhost"), "Should not be called before setApplicationBundleIdentifier()");
+
+    return isSolidStateNetworksDownloader;
+}
+
+bool MacApplication::isHipChat()
+{
+    static bool isHipChat = applicationBundleIsEqualTo("com.hipchat.HipChat");
+    ASSERT_WITH_MESSAGE(isHipChat == applicationBundleIsEqualTo("com.hipchat.HipChat"), "Should not be called before setApplicationBundleIdentifier()");
+    return isHipChat;
+}
+
+#endif // PLATFORM(MAC)
+
+#if PLATFORM(IOS)
+
+bool IOSApplication::isMobileMail()
+{
+    static bool isMobileMail = applicationBundleIsEqualTo("com.apple.mobilemail");
+    ASSERT_WITH_MESSAGE(isMobileMail == applicationBundleIsEqualTo("com.apple.mobilemail"), "Should not be called before setApplicationBundleIdentifier()");
+    return isMobileMail;
+}
+
+bool IOSApplication::isMobileSafari()
+{
+    static bool isMobileSafari = applicationBundleIsEqualTo("com.apple.mobilesafari");
+    ASSERT_WITH_MESSAGE(isMobileSafari == applicationBundleIsEqualTo("com.apple.mobilesafari"), "Should not be called before setApplicationBundleIdentifier()");
+    return isMobileSafari;
+}
+
+bool IOSApplication::isDumpRenderTree()
+{
+    // We use a prefix match instead of strict equality since LayoutTestRelay may launch multiple instances of
+    // DumpRenderTree where the bundle identifier of each instance has a unique suffix.
+    static bool isDumpRenderTree = applicationBundleIsEqualTo("org.webkit.DumpRenderTree"); // e.g. org.webkit.DumpRenderTree0
+    ASSERT_WITH_MESSAGE(isDumpRenderTree == applicationBundleIsEqualTo("org.webkit.DumpRenderTree"), "Should not be called before setApplicationBundleIdentifier()");
+    return isDumpRenderTree;
+}
+
+bool IOSApplication::isMobileStore()
+{
+    static bool isMobileStore = applicationBundleIsEqualTo("com.apple.MobileStore");
+    ASSERT_WITH_MESSAGE(isMobileStore == applicationBundleIsEqualTo("com.apple.MobileStore"), "Should not be called before setApplicationBundleIdentifier()");
+    return isMobileStore;
+}
+
+bool IOSApplication::isWebApp()
+{
+    static bool isWebApp = applicationBundleIsEqualTo("com.apple.webapp");
+    ASSERT_WITH_MESSAGE(isWebApp == applicationBundleIsEqualTo("com.apple.webapp"), "Should not be called before setApplicationBundleIdentifier()");
+    return isWebApp;
+}
+
+bool IOSApplication::isOkCupid()
+{
+    static bool isOkCupid = applicationBundleIsEqualTo("com.okcupid.app");
+    ASSERT_WITH_MESSAGE(isOkCupid == applicationBundleIsEqualTo("com.okcupid.app"), "Should not be called before setApplicationBundleIdentifier()");
+    return isOkCupid;
+}
+
+bool IOSApplication::isFacebook()
+{
+    static bool isFacebook = applicationBundleIsEqualTo("com.facebook.Facebook");
+    ASSERT_WITH_MESSAGE(isFacebook == applicationBundleIsEqualTo("com.facebook.Facebook"), "Should not be called before setApplicationBundleIdentifier()");
+    return isFacebook;
+}
+
+bool IOSApplication::isDaijisenDictionary()
+{
+    static bool isDaijisenDictionary = applicationBundleIsEqualTo("jp.co.shogakukan.daijisen2009i");
+    ASSERT_WITH_MESSAGE(isDaijisenDictionary == applicationBundleIsEqualTo("jp.co.shogakukan.daijisen2009i"), "Should not be called before setApplicationBundleIdentifier()");
+    return isDaijisenDictionary;
+}
+
+bool IOSApplication::isNASAHD()
+{
+    static bool isNASAHD = applicationBundleIsEqualTo("gov.nasa.NASAHD");
+    ASSERT_WITH_MESSAGE(isNASAHD == applicationBundleIsEqualTo("gov.nasa.NASAHD"), "Should not be called before setApplicationBundleIdentifier()");
+    return isNASAHD;
+}
+
+bool IOSApplication::isTheEconomistOnIphone()
+{
+    static bool isTheEconomistOnIphone = applicationBundleIsEqualTo("com.economist.iphone");
+    ASSERT_WITH_MESSAGE(isTheEconomistOnIphone == applicationBundleIsEqualTo("com.economist.iphone"), "Should not be called before setApplicationBundleIdentifier()");
+    return isTheEconomistOnIphone;
+}
+
+// FIXME: this needs to be changed when the WebProcess is changed to an XPC service.
+bool IOSApplication::isWebProcess()
+{
+    static bool isWebProcess = [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.WebKit.WebContent.Development"]
+        || [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.WebKit.WebContent"]
+        || [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.WebProcess"];
+    return isWebProcess;
+}
+
+bool IOSApplication::isIBooks()
+{
+    static bool isIBooks = applicationBundleIsEqualTo("com.apple.iBooks");
+    ASSERT_WITH_MESSAGE(isIBooks == applicationBundleIsEqualTo("com.apple.iBooks"), "Should not be called before setApplicationBundleIdentifier()");
+    return isIBooks;
+}
+
+#endif
+
+} // namespace WebCore
diff --git a/Source/WebCore/platform/RuntimeApplicationChecksIOS.h b/Source/WebCore/platform/RuntimeApplicationChecksIOS.h
deleted file mode 100644 (file)
index 5bd7178..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2009 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer. 
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution. 
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef RuntimeApplicationChecksIOS_h
-#define RuntimeApplicationChecksIOS_h
-
-// FIXME: We should consider merging this file with RuntimeApplicationChecks.h.
-namespace WebCore {
-
-WEBCORE_EXPORT bool applicationIsMobileMail();
-WEBCORE_EXPORT bool applicationIsMobileSafari();
-bool applicationIsDumpRenderTree();
-bool applicationIsMobileStore();
-WEBCORE_EXPORT bool applicationIsWebApp();
-WEBCORE_EXPORT bool applicationIsOkCupid();
-WEBCORE_EXPORT bool applicationIsFacebook();
-WEBCORE_EXPORT bool applicationIsDaijisenDictionary();
-bool applicationIsNASAHD();
-WEBCORE_EXPORT bool applicationIsTheEconomistOnIPhone();
-WEBCORE_EXPORT bool applicationIsWebProcess();
-bool applicationIsIBooksOnIOS();
-
-} // namespace WebCore
-
-#endif // RuntimeApplicationChecksIOS_h
diff --git a/Source/WebCore/platform/RuntimeApplicationChecksIOS.mm b/Source/WebCore/platform/RuntimeApplicationChecksIOS.mm
deleted file mode 100644 (file)
index 61a7376..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (C) 2009 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer. 
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution. 
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import "config.h"
-#import "RuntimeApplicationChecksIOS.h"
-
-// FIXME: We should consider merging this file with RuntimeApplicationChecks.cpp.
-#if PLATFORM(IOS)
-
-namespace WebCore {
-
-bool applicationIsMobileMail()
-{
-    static const bool isMobileMail = [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.mobilemail"];
-    return isMobileMail;
-}
-
-bool applicationIsMobileSafari()
-{
-    static const bool isMobileSafari = [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.mobilesafari"];
-    return isMobileSafari;
-}
-
-bool applicationIsDumpRenderTree()
-{
-    // We use a prefix match instead of strict equality since LayoutTestRelay may launch multiple instances of
-    // DumpRenderTree where the bundle identifier of each instance has a unique suffix.
-    static const bool isDumpRenderTree = [[[NSBundle mainBundle] bundleIdentifier] hasPrefix:@"org.webkit.DumpRenderTree"]; // e.g. org.webkit.DumpRenderTree0
-    return isDumpRenderTree;
-}
-
-bool applicationIsMobileStore()
-{
-    static const bool isMobileStore = [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.MobileStore"];
-    return isMobileStore;
-}
-
-bool applicationIsWebApp()
-{
-    static const bool isWebApp = [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.webapp"];
-    return isWebApp;
-}
-
-bool applicationIsOkCupid()
-{
-    static const bool isOkCupid = [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.okcupid.app"];
-    return isOkCupid;
-}
-
-bool applicationIsFacebook()
-{
-    static const bool isFacebook = [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.facebook.Facebook"];
-    return isFacebook;
-}
-
-bool applicationIsDaijisenDictionary()
-{
-    static const bool isDaijisenDictionary = [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"jp.co.shogakukan.daijisen2009i"];
-    return isDaijisenDictionary;
-}
-
-bool applicationIsNASAHD()
-{
-    static const bool isNASAHD = [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"gov.nasa.NASAHD"];
-    return isNASAHD;
-}
-
-bool applicationIsTheEconomistOnIPhone()
-{
-    static const bool isTheEconomistOnIPhone = [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.economist.iphone"];
-    return isTheEconomistOnIPhone;
-}
-
-// FIXME: this needs to be changed when the WebProcess is changed to an XPC service.
-bool applicationIsWebProcess()
-{
-    static const bool isWebProcess = [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.WebKit.WebContent.Development"] || [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.WebKit.WebContent"] || [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.WebProcess"];
-    return isWebProcess;
-}
-
-bool applicationIsIBooksOnIOS()
-{
-    static const bool isIBooksOnIOS = [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.iBooks"];
-    return isIBooksOnIOS;
-}
-
-} // namespace WebCore
-
-#endif // PLATFORM(IOS)
index addb524..27a45fc 100644 (file)
@@ -40,7 +40,7 @@
 #include "Page.h"
 #include "SoftLinking.h"
 #include <AudioToolbox/AudioServices.h>
-#include <WebCore/RuntimeApplicationChecksIOS.h>
+#include <WebCore/RuntimeApplicationChecks.h>
 #include <wtf/HashSet.h>
 #include <wtf/NeverDestroyed.h>
 
index a1faea5..04def84 100644 (file)
@@ -31,7 +31,7 @@
 #include <wtf/text/CString.h>
 
 #if PLATFORM(IOS)
-#include "RuntimeApplicationChecksIOS.h"
+#include "RuntimeApplicationChecks.h"
 #endif
 
 namespace WebCore {
index 444b4c6..1b23b6a 100644 (file)
@@ -29,7 +29,7 @@
 #include <wtf/AutodrainedPool.h>
 
 #if PLATFORM(IOS)
-#include "RuntimeApplicationChecksIOS.h"
+#include "RuntimeApplicationChecks.h"
 #include <CoreFoundation/CFBundle.h>
 #include <WebCore/WebCoreThread.h>
 #endif
@@ -46,7 +46,7 @@ static CFRunLoopRef currentRunLoop()
     // we still allow this, see <rdar://problem/7403328>. Since the race condition and subsequent
     // crash are especially troublesome for iBooks, we never allow the observer to be added to the
     // main run loop in iBooks.
-    if (applicationIsIBooksOnIOS())
+    if (IOSApplication::isIBooks())
         return WebThreadRunLoop();
 #endif
     return CFRunLoopGetCurrent();
index 932d352..89cb0d6 100644 (file)
@@ -44,7 +44,7 @@
 #import "PasteboardStrategy.h"
 #import "PlatformStrategies.h"
 #import "RenderImage.h"
-#import "RuntimeApplicationChecksIOS.h"
+#import "RuntimeApplicationChecks.h"
 #import "SharedBuffer.h"
 #import "SoftLinking.h"
 #import "Text.h"
index 2a4d56c..5ba1a48 100644 (file)
@@ -35,7 +35,7 @@
 #import "AVKitSPI.h"
 #import "GeometryUtilities.h"
 #import "Logging.h"
-#import "RuntimeApplicationChecksIOS.h"
+#import "RuntimeApplicationChecks.h"
 #import "TimeRanges.h"
 #import "WebCoreSystemInterface.h"
 #import "WebVideoFullscreenChangeObserver.h"
index e9a6323..b2ed94d 100644 (file)
@@ -30,8 +30,8 @@
 
 #import "FloatingPointEnvironment.h"
 #import "JSDOMWindowBase.h"
+#import "RuntimeApplicationChecks.h"
 #import "ThreadGlobalData.h"
-#import "RuntimeApplicationChecksIOS.h"
 #import "WebCoreThreadInternal.h"
 #import "WebCoreThreadMessage.h"
 #import "WebCoreThreadRun.h"
@@ -1000,7 +1000,7 @@ void WebThreadSetDelegateSourceRunLoopMode(CFStringRef mode)
 
 void WebThreadEnable(void)
 {
-    RELEASE_ASSERT_WITH_MESSAGE(!WebCore::applicationIsWebProcess(), "The WebProcess should never run a Web Thread");
+    RELEASE_ASSERT_WITH_MESSAGE(!WebCore::IOSApplication::isWebProcess(), "The WebProcess should never run a Web Thread");
 
     static pthread_once_t initControl = PTHREAD_ONCE_INIT;
     pthread_once(&initControl, StartWebThread);
index b30fd81..5ba2821 100644 (file)
@@ -194,9 +194,13 @@ void Widget::paint(GraphicsContext& p, const IntRect& r)
     // We don't want to paint the view at all if it's layer backed, because then we'll end up
     // with multiple copies of the view contents, one in the view's layer itself and one in the
     // WebHTMLView's backing store (either a layer or the window backing store).
-    // However, Quicken Essentials has a plug-in that depends on drawing to update the layer (see <rdar://problem/15221231>).
-    if (view.layer && !applicationIsQuickenEssentials())
+    if (view.layer) {
+#if PLATFORM(MAC)
+        // However, Quicken Essentials has a plug-in that depends on drawing to update the layer (see <rdar://problem/15221231>).
+        if (!MacApplication::isQuickenEssentials())
+#endif
         return;
+    }
 
     // Take a reference to this Widget, because sending messages to the views can invoke arbitrary
     // code, which can deref it.
index a1ea9c8..13d1ddc 100644 (file)
@@ -35,7 +35,7 @@
 #import "ResourceError.h"
 #import "ResourceHandle.h"
 #import "ResourceLoader.h"
-#import "RuntimeApplicationChecksIOS.h"
+#import "RuntimeApplicationChecks.h"
 #import "SynchronousResourceHandleCFURLConnectionDelegate.h"
 #import "WebCoreResourceHandleAsDelegate.h"
 #import "WebCoreURLResponseIOS.h"
index c3bde8a..8a26888 100644 (file)
@@ -70,7 +70,7 @@ CFDictionaryRef _CFURLConnectionCopyTimingData(CFURLConnectionRef);
 
 #if PLATFORM(IOS)
 #import "CFNetworkSPI.h"
-#import "RuntimeApplicationChecksIOS.h"
+#import "RuntimeApplicationChecks.h"
 #import "WebCoreThreadRun.h"
 
 @interface NSURLRequest ()
index d14d030..20d3847 100644 (file)
@@ -69,7 +69,7 @@
 #endif
 
 #if PLATFORM(IOS)
-#include "RuntimeApplicationChecksIOS.h"
+#include "RuntimeApplicationChecks.h"
 #endif
 
 namespace WebCore {
@@ -352,7 +352,7 @@ void RenderLayerBacking::layerWillBeDestroyed()
 
 bool RenderLayerBacking::needsIOSDumpRenderTreeMainFrameRenderViewLayerIsAlwaysOpaqueHack(const GraphicsLayer& layer) const
 {
-    if (m_isMainFrameRenderViewLayer && applicationIsDumpRenderTree()) {
+    if (m_isMainFrameRenderViewLayer && IOSApplication::isDumpRenderTree()) {
         // In iOS WebKit1 the main frame's RenderView layer is always transparent. We lie that it is opaque so that
         // internals.layerTreeAsText() tests succeed.
         ASSERT_UNUSED(layer, !layer.contentsOpaque());
index 45bce97..b30b667 100644 (file)
@@ -1,3 +1,15 @@
+2016-03-05  Chris Dumez  <cdumez@apple.com>
+
+        Consolidate RuntimeApplicationChecks and RuntimeApplicationChecksIOS
+        https://bugs.webkit.org/show_bug.cgi?id=155035
+
+        Reviewed by Darin Adler.
+
+        Update runtime application checks.
+
+        * WebCoreSupport/WebResourceLoadScheduler.cpp:
+        (WebResourceLoadScheduler::servePendingRequests):
+
 2016-03-04  Alex Christensen  <achristensen@webkit.org>
 
         Remove vcxproj build system
index 2546d54..4d618e9 100644 (file)
@@ -41,7 +41,7 @@
 #include <wtf/text/CString.h>
 
 #if PLATFORM(IOS)
-#include <WebCore/RuntimeApplicationChecksIOS.h>
+#include <WebCore/RuntimeApplicationChecks.h>
 #endif
 
 #if USE(QUICK_LOOK)
@@ -261,7 +261,7 @@ void WebResourceLoadScheduler::servePendingRequests(HostInformation* host, Resou
             requestsPending.removeFirst();
             host->addLoadInProgress(resourceLoader.get());
 #if PLATFORM(IOS)
-            if (!applicationIsWebProcess()) {
+            if (!IOSApplication::isWebProcess()) {
                 resourceLoader->startLoading();
                 return;
             }
index b4bd4e5..3f4212e 100644 (file)
@@ -1,3 +1,14 @@
+2016-03-05  Chris Dumez  <cdumez@apple.com>
+
+        Consolidate RuntimeApplicationChecks and RuntimeApplicationChecksIOS
+        https://bugs.webkit.org/show_bug.cgi?id=155035
+
+        Reviewed by Darin Adler.
+
+        Update runtime application checks.
+
+        * WebCoreSupport/WebChromeClientIOS.mm:
+
 2016-02-17  David Kilzer  <ddkilzer@apple.com>
 
         [iOS WK1] NSTimer in WebGeolocationProviderIOS.mm fires on the main thread without the WebThreadLock
index d2825af..7774694 100644 (file)
@@ -57,7 +57,7 @@
 #import <WebCore/PlatformScreen.h>
 #import <WebCore/RenderBox.h>
 #import <WebCore/RenderObject.h>
-#import <WebCore/RuntimeApplicationChecksIOS.h>
+#import <WebCore/RuntimeApplicationChecks.h>
 #import <WebCore/ScrollingConstraints.h>
 #import <WebCore/WAKWindow.h>
 #import <WebCore/WebCoreThreadMessage.h>
index 0498396..dfa2a7a 100644 (file)
@@ -1,3 +1,34 @@
+2016-03-05  Chris Dumez  <cdumez@apple.com>
+
+        Consolidate RuntimeApplicationChecks and RuntimeApplicationChecksIOS
+        https://bugs.webkit.org/show_bug.cgi?id=155035
+
+        Reviewed by Darin Adler.
+
+        Update runtime application checks.
+
+        * Plugins/WebPluginController.mm:
+        (initializeAudioSession):
+        * WebCoreSupport/WebFrameLoaderClient.mm:
+        * WebView/WebFrame.mm:
+        (needsMicrosoftMessengerDOMDocumentWorkaround):
+        * WebView/WebImmediateActionController.mm:
+        (-[WebImmediateActionController _updateImmediateActionItem]):
+        * WebView/WebView.mm:
+        (WebKitInitializeApplicationCachePathIfNecessary):
+        (shouldEnableLoadDeferring):
+        (shouldRestrictWindowFocus):
+        (needsOutlookQuirksScript):
+        (shouldTransformsAffectOverflow):
+        (shouldDispatchJavaScriptWindowOnErrorEvents):
+        (shouldUseLegacyBackgroundSizeShorthandBehavior):
+        (-[WebView _commonInitializationWithFrameName:groupName:]):
+        (+[WebView enableWebThread]):
+        (+[WebView registerForMemoryNotifications]):
+        (-[WebView _needsKeyboardEventDisambiguationQuirks]):
+        (needsSelfRetainWhileLoadingQuirk):
+        (-[WebView _needsPreHTML5ParserQuirks]):
+
 2016-03-05  Yusuke Suzuki  <utatane.tea@gmail.com>
 
         [ES6] Support Reflect.construct
index 40b02b6..8406c15 100644 (file)
@@ -68,7 +68,7 @@
 #import <WebCore/FrameView.h>
 #import <WebCore/GraphicsLayer.h>
 #import <WebCore/Page.h>
-#import <WebCore/RuntimeApplicationChecksIOS.h>
+#import <WebCore/RuntimeApplicationChecks.h>
 #import <WebCore/SoftLinking.h>
 #import <WebCore/WebCoreThreadRun.h>
 #endif
@@ -110,7 +110,7 @@ static void initializeAudioSession()
         return;
 
     wasAudioSessionInitialized = true;
-    if (!WebCore::applicationIsMobileSafari())
+    if (!WebCore::IOSApplication::isMobileSafari())
         return;
 
     AudioSession::sharedSession().setCategory(AudioSession::MediaPlayback);
index 49b7193..23ff375 100644 (file)
 #import <WebCore/FileSystemIOS.h>
 #import <WebCore/NSFileManagerSPI.h>
 #import <WebCore/QuickLook.h>
-#import <WebCore/RuntimeApplicationChecksIOS.h>
+#import <WebCore/RuntimeApplicationChecks.h>
 #endif
 
 #if HAVE(APP_LINKS)
@@ -2239,7 +2239,7 @@ void WebFrameLoaderClient::didCreateQuickLookHandle(WebCore::QuickLookHandle& ha
             : m_firstRequestURL(handle.firstRequestURL())
         {
             NSURL *previewRequestURL = handle.previewRequestURL();
-            if (!applicationIsMobileSafari()) {
+            if (!IOSApplication::isMobileSafari()) {
                 // This keeps the QLPreviewConverter alive to serve any subresource requests.
                 // It is removed by -[WebDataSource dealloc].
                 addQLPreviewConverterWithFileForURL(previewRequestURL, handle.converter(), nil);
index 0564c5f..cbbf24f 100644 (file)
@@ -2411,8 +2411,12 @@ static WebFrameLoadType toWebFrameLoadType(FrameLoadType frameLoadType)
 
 static bool needsMicrosoftMessengerDOMDocumentWorkaround()
 {
-    static bool needsWorkaround = applicationIsMicrosoftMessenger() && [[[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleVersionKey] compare:@"7.1" options:NSNumericSearch] == NSOrderedAscending;
+#if PLATFORM(IOS)
+    return false;
+#else
+    static bool needsWorkaround = MacApplication::isMicrosoftMessenger() && [[[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleVersionKey] compare:@"7.1" options:NSNumericSearch] == NSOrderedAscending;
     return needsWorkaround;
+#endif
 }
 
 - (DOMDocument *)DOMDocument
index dbb23b0..23e623d 100644 (file)
@@ -318,11 +318,19 @@ using namespace WebCore;
         customClientAnimationController = [(id)[_webView UIDelegate] _webView:_webView immediateActionAnimationControllerForHitTestResult:webHitTestResult.get() withType:_type];
     }
 
+    if (customClientAnimationController == [NSNull null]) {
+        [self _cancelImmediateAction];
+        return;
+    }
+
+#if PLATFORM(MAC)
     // FIXME: We should not permanently disable this for iTunes. rdar://problem/19461358
-    if (customClientAnimationController == [NSNull null] || applicationIsITunes()) {
+    if (MacApplication::isITunes()) {
         [self _cancelImmediateAction];
         return;
     }
+#endif
+
     if (customClientAnimationController && [customClientAnimationController conformsToProtocol:@protocol(NSImmediateActionAnimationController)])
         [_immediateActionRecognizer setAnimationController:(id <NSImmediateActionAnimationController>)customClientAnimationController];
     else
index 49136e9..691f4c5 100644 (file)
 #import <WebCore/PlatformScreen.h>
 #import <WebCore/ResourceLoadStatistics.h>
 #import <WebCore/ResourceLoadStatisticsStore.h>
-#import <WebCore/RuntimeApplicationChecksIOS.h>
 #import <WebCore/SQLiteDatabaseTracker.h>
 #import <WebCore/SmartReplace.h>
 #import <WebCore/TextRun.h>
@@ -741,7 +740,7 @@ static void WebKitInitializeApplicationCachePathIfNecessary()
     if (!appName)
         appName = [[NSProcessInfo processInfo] processName];
 #if PLATFORM(IOS)
-    if (WebCore::applicationIsMobileSafari() || WebCore::applicationIsWebApp())
+    if (WebCore::IOSApplication::isMobileSafari() || WebCore::IOSApplication::isWebApp())
         appName = @"com.apple.WebAppCache";
 #endif
 
@@ -776,7 +775,11 @@ static void WebKitInitializeApplicationStatisticsStoragePathIfNecessary()
 
 static bool shouldEnableLoadDeferring()
 {
-    return !applicationIsAdobeInstaller();
+#if PLATFORM(IOS)
+    return true;
+#else
+    return !MacApplication::isAdobeInstaller();
+#endif
 }
 
 static bool shouldRestrictWindowFocus()
@@ -784,7 +787,7 @@ static bool shouldRestrictWindowFocus()
 #if PLATFORM(IOS)
     return true;
 #else
-    return !applicationIsHRBlock();
+    return !MacApplication::isHRBlock();
 #endif
 }
 
@@ -807,7 +810,7 @@ static bool shouldRestrictWindowFocus()
 static bool needsOutlookQuirksScript()
 {
     static bool isOutlookNeedingQuirksScript = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_HTML5_PARSER)
-        && applicationIsMicrosoftOutlook();
+        && MacApplication::isMicrosoftOutlook();
     return isOutlookNeedingQuirksScript;
 }
 
@@ -842,13 +845,13 @@ static bool shouldRespectPriorityInCSSAttributeSetters()
 #if PLATFORM(IOS)
 static bool shouldTransformsAffectOverflow()
 {
-    static bool shouldTransformsAffectOverflow = !applicationIsOkCupid() || WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_CSS_TRANSFORMS_AFFECTING_OVERFLOW);
+    static bool shouldTransformsAffectOverflow = !IOSApplication::isOkCupid() || WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_CSS_TRANSFORMS_AFFECTING_OVERFLOW);
     return shouldTransformsAffectOverflow;
 }
 
 static bool shouldDispatchJavaScriptWindowOnErrorEvents()
 {
-    static bool shouldDispatchJavaScriptWindowOnErrorEvents = !applicationIsFacebook() || WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_WINDOW_ON_ERROR);
+    static bool shouldDispatchJavaScriptWindowOnErrorEvents = !IOSApplication::isFacebook() || WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_WINDOW_ON_ERROR);
     return shouldDispatchJavaScriptWindowOnErrorEvents;
 }
 
@@ -866,7 +869,7 @@ static bool shouldUseLegacyBackgroundSizeShorthandBehavior()
 #if PLATFORM(IOS)
     static bool shouldUseLegacyBackgroundSizeShorthandBehavior = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITHOUT_LEGACY_BACKGROUNDSIZE_SHORTHAND_BEHAVIOR);
 #else
-    static bool shouldUseLegacyBackgroundSizeShorthandBehavior = applicationIsVersions()
+    static bool shouldUseLegacyBackgroundSizeShorthandBehavior = MacApplication::isVersions()
         && !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITHOUT_LEGACY_BACKGROUNDSIZE_SHORTHAND_BEHAVIOR);
 #endif
     return shouldUseLegacyBackgroundSizeShorthandBehavior;
@@ -976,7 +979,7 @@ static void WebKitInitializeGamepadProviderIfNecessary()
         Settings::setShouldRespectPriorityInCSSAttributeSetters(shouldRespectPriorityInCSSAttributeSetters());
 
 #if PLATFORM(IOS)
-        if (applicationIsMobileSafari())
+        if (IOSApplication::isMobileSafari())
             Settings::setShouldManageAudioSessionCategory(true);
 #endif
 
@@ -1201,7 +1204,7 @@ static void WebKitInitializeGamepadProviderIfNecessary()
         WebCoreObjCDeallocOnWebThread([WebPolicyDecisionListener class]);
         WebCoreObjCDeallocOnWebThread([WebView class]);
         WebCoreObjCDeallocOnWebThread([WebVisiblePosition class]);
-        if (applicationIsTheEconomistOnIPhone() && !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_DELEGATE_CALLS_IN_COMMON_RUNLOOP_MODES))
+        if (IOSApplication::isTheEconomistOnIphone() && !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_DELEGATE_CALLS_IN_COMMON_RUNLOOP_MODES))
             WebThreadSetDelegateSourceRunLoopMode(kCFRunLoopDefaultMode);
         WebThreadEnable();
         isWebThreadEnabled = YES;
@@ -1327,7 +1330,7 @@ static void WebKitInitializeGamepadProviderIfNecessary()
 
 + (void)registerForMemoryNotifications
 {
-    BOOL shouldAutoClearPressureOnMemoryRelease = !WebCore::applicationIsMobileSafari();
+    BOOL shouldAutoClearPressureOnMemoryRelease = !WebCore::IOSApplication::isMobileSafari();
 
     MemoryPressureHandler::singleton().installMemoryReleaseBlock(^{
         [WebView _handleMemoryWarning];
@@ -2148,7 +2151,7 @@ static bool fastDocumentTeardownEnabled()
 
 - (BOOL)_needsKeyboardEventDisambiguationQuirks
 {
-    static BOOL needsQuirks = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_IE_COMPATIBLE_KEYBOARD_EVENT_DISPATCH) && !applicationIsSafari();
+    static BOOL needsQuirks = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_IE_COMPATIBLE_KEYBOARD_EVENT_DISPATCH) && !MacApplication::isSafari();
     return needsQuirks;
 }
 
@@ -2160,7 +2163,7 @@ static bool fastDocumentTeardownEnabled()
 
 static bool needsSelfRetainWhileLoadingQuirk()
 {
-    static bool needsQuirk = applicationIsAperture();
+    static bool needsQuirk = MacApplication::isAperture();
     return needsQuirk;
 }
 #endif // !PLATFORM(IOS)
@@ -2175,10 +2178,10 @@ static bool needsSelfRetainWhileLoadingQuirk()
     // <https://bugs.webkit.org/show_bug.cgi?id=46134> and
     // <https://bugs.webkit.org/show_bug.cgi?id=46334>.
     static bool isApplicationNeedingParserQuirks = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_HTML5_PARSER)
-        && (applicationIsAOLInstantMessenger() || applicationIsMicrosoftMyDay());
+        && (MacApplication::isAOLInstantMessenger() || MacApplication::isMicrosoftMyDay());
     
     // Mail.app must continue to display HTML email that contains quirky markup.
-    static bool isAppleMail = applicationIsAppleMail();
+    static bool isAppleMail = MacApplication::isAppleMail();
 
     return isApplicationNeedingParserQuirks
         || isAppleMail
@@ -2189,7 +2192,7 @@ static bool needsSelfRetainWhileLoadingQuirk()
 #endif
         || [[self preferences] usePreHTML5ParserQuirks];
 #else
-    static bool isApplicationNeedingParserQuirks = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_HTML5_PARSER) && applicationIsDaijisenDictionary();
+    static bool isApplicationNeedingParserQuirks = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_HTML5_PARSER) && IOSApplication::isDaijisenDictionary();
     return isApplicationNeedingParserQuirks || [[self preferences] usePreHTML5ParserQuirks];
 #endif
 }
index 84cbaf7..674d6aa 100644 (file)
@@ -1,3 +1,24 @@
+2016-03-05  Chris Dumez  <cdumez@apple.com>
+
+        Consolidate RuntimeApplicationChecks and RuntimeApplicationChecksIOS
+        https://bugs.webkit.org/show_bug.cgi?id=155035
+
+        Reviewed by Darin Adler.
+
+        Update runtime application checks.
+
+        * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
+        (API::WebsiteDataStore::defaultApplicationCacheDirectory):
+        * UIProcess/Cocoa/VersionChecks.mm:
+        (WebKit::linkedOnOrAfter):
+        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
+        (WebKit::WebProcessPool::platformInitializeWebProcess):
+        (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory):
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        * UIProcess/mac/WebPageProxyMac.mm:
+        (WebKit::expectsLegacyImplicitRubberBandControl):
+        (WebKit::WebPageProxy::appleMailPaginationQuirkEnabled):
+
 2016-03-05  Sam Weinig  <sam@webkit.org>
 
         Add support for processing the autofill field name out of form control elements ultimately to aid input methods
index 5382736..8231abb 100644 (file)
@@ -30,7 +30,7 @@
 #include "SandboxUtilities.h"
 
 #if PLATFORM(IOS)
-#import <WebCore/RuntimeApplicationChecksIOS.h>
+#import <WebCore/RuntimeApplicationChecks.h>
 #endif
 
 namespace API {
@@ -42,7 +42,7 @@ String WebsiteDataStore::defaultApplicationCacheDirectory()
     // Preserving it avoids the need to migrate data when upgrading.
     // FIXME: Ideally we should just have Safari and WebApp create a data store with
     // this application cache path, but that's not supported as of right now.
-    if (WebCore::applicationIsMobileSafari() || WebCore::applicationIsWebApp()) {
+    if (WebCore::IOSApplication::isMobileSafari() || WebCore::IOSApplication::isWebApp()) {
         NSString *cachePath = [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Caches/com.apple.WebAppCache"];
 
         return WebKit::stringByResolvingSymlinksInPath(cachePath.stringByStandardizingPath);
index b46d007..2e0dfed 100644 (file)
@@ -29,7 +29,7 @@
 #import <mach-o/dyld.h>
 
 #if PLATFORM(IOS)
-#import <WebCore/RuntimeApplicationChecksIOS.h>
+#import <WebCore/RuntimeApplicationChecks.h>
 #endif
 
 namespace WebKit {
@@ -43,7 +43,7 @@ bool linkedOnOrAfter(LibraryVersion version)
 {
 #if PLATFORM(IOS)
     // Always make new features available for Safari.
-    if (WebCore::applicationIsMobileSafari())
+    if (WebCore::IOSApplication::isMobileSafari())
         return true;
 #endif
 
index 21dd84f..2662a4a 100644 (file)
@@ -52,7 +52,6 @@
 #if PLATFORM(IOS)
 #import "ArgumentCodersCF.h"
 #import "WebMemoryPressureHandlerIOS.h"
-#import <WebCore/RuntimeApplicationChecksIOS.h>
 #else
 #import <QuartzCore/CARemoteLayerServer.h>
 #endif
@@ -180,7 +179,7 @@ void WebProcessPool::platformInitializeWebProcess(WebProcessCreationParameters&
     parameters.shouldSuppressMemoryPressureHandler = [defaults boolForKey:WebKitSuppressMemoryPressureHandlerDefaultsKey];
 
 #if PLATFORM(MAC)
-    parameters.shouldRewriteConstAsVar = applicationIsIBooks();
+    parameters.shouldRewriteConstAsVar = MacApplication::isIBooks();
 #endif
 
 #if HAVE(HOSTED_CORE_ANIMATION)
@@ -365,7 +364,7 @@ String WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory()
 #if PLATFORM(IOS)
     // This quirk used to make these apps share application cache storage, but doesn't accomplish that any more.
     // Preserving it avoids the need to migrate data when upgrading.
-    if (applicationIsMobileSafari() || applicationIsWebApp())
+    if (IOSApplication::isMobileSafari() || IOSApplication::isWebApp())
         appName = @"com.apple.WebAppCache";
 #endif
 
index 783af82..f46c4d3 100644 (file)
@@ -66,7 +66,7 @@
 #import <WebCore/Pasteboard.h>
 #import <WebCore/Path.h>
 #import <WebCore/PathUtilities.h>
-#import <WebCore/RuntimeApplicationChecksIOS.h>
+#import <WebCore/RuntimeApplicationChecks.h>
 #import <WebCore/Scrollbar.h>
 #import <WebCore/SoftLinking.h>
 #import <WebCore/TextIndicator.h>
index 67858f2..a9b4329 100644 (file)
@@ -67,7 +67,7 @@ namespace WebKit {
 
 static inline bool expectsLegacyImplicitRubberBandControl()
 {
-    if (applicationIsSafari()) {
+    if (MacApplication::isSafari()) {
         const int32_t firstVersionOfSafariNotExpectingImplicitRubberBandControl = 0x021A0F00; // 538.15.0
         bool linkedAgainstSafariExpectingImplicitRubberBandControl = NSVersionOfLinkTimeLibrary("Safari") < firstVersionOfSafariNotExpectingImplicitRubberBandControl;
         return linkedAgainstSafariExpectingImplicitRubberBandControl;
@@ -547,7 +547,7 @@ CGRect WebPageProxy::boundsOfLayerInLayerBackedWindowCoordinates(CALayer *layer)
 
 bool WebPageProxy::appleMailPaginationQuirkEnabled()
 {
-    return applicationIsAppleMail();
+    return MacApplication::isAppleMail();
 }
 
 void WebPageProxy::setFont(const String& fontFamily, double fontSize, uint64_t fontTraits)