haikuwebkit/Source/WTF/wtf/cocoa/RuntimeApplicationChecksCoc...

44 lines
1.9 KiB
C
Raw Permalink Normal View History

[Cocoa] Push applicationSDKVersion() down from WebCore into WTF https://bugs.webkit.org/show_bug.cgi?id=209030 Reviewed by Simon Fraser. Source/JavaScriptCore: dyld_get_program_sdk_version() gives you the wrong answer in the Web Process (or at least not the answer you actually want). There are already facilities for the UI Process to tell the Web Process what the real value is, but those functions are currently in WebCore, which is inaccessible to WTF. This patch is in preparation for https://bugs.webkit.org/show_bug.cgi?id=208969 which needs to know this information in WTF. I also found a few places which were calling dyld_get_program_sdk_version() in JavaScriptCore and WebCore (which is wrong because those libraries exist in the Web Process), and have fixed them up to use applicationSDKVersion() instead. * API/JSWrapperMap.mm: (supportsInitMethodConstructors): Source/WebCore: * html/HTMLObjectElement.cpp: * html/MediaElementSession.cpp: (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback const): * loader/DocumentThreadableLoader.cpp: (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest): * platform/RuntimeApplicationChecks.h: * platform/Timer.cpp: (WebCore::shouldSuppressThreadSafetyCheck): * platform/cocoa/RuntimeApplicationChecksCocoa.mm: (WebCore::applicationSDKVersionOverride): Deleted. (WebCore::setApplicationSDKVersion): Deleted. (WebCore::applicationSDKVersion): Deleted. Source/WebKit: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): * Shared/WebPreferencesDefaultValues.cpp: (WebKit::defaultCSSOMViewScrollingAPIEnabled): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): Source/WTF: * WTF.xcodeproj/project.pbxproj: * wtf/PlatformMac.cmake: * wtf/cocoa/RuntimeApplicationChecksCocoa.cpp: Added. * wtf/cocoa/RuntimeApplicationChecksCocoa.h: Added. (WTF::applicationSDKVersionOverride): (WTF::setApplicationSDKVersion): (WTF::applicationSDKVersion): Canonical link: https://commits.webkit.org/221992@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258447 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-03-13 23:33:33 +00:00
/*
* Copyright (C) 2009-2020 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.
*/
#pragma once
#include <wtf/Forward.h>
// This contains the values with which to compare the return value of applicationSDKVersion().
#include <wtf/spi/darwin/dyldSPI.h>
namespace WTF {
// dyld_get_program_sdk_version() gives you the wrong answer in any process other than the UI process.
// These functions are hooked up to give you the right answer.
WTF_EXPORT_PRIVATE void setApplicationSDKVersion(uint32_t);
WTF_EXPORT_PRIVATE uint32_t applicationSDKVersion();
}
using WTF::setApplicationSDKVersion;
using WTF::applicationSDKVersion;