[WTF] Add environment variable helpers
https://bugs.webkit.org/show_bug.cgi?id=192405
Reviewed by Michael Catanzaro.
Source/JavaScriptCore:
- inspector/remote/glib/RemoteInspectorGlib.cpp:
(Inspector::RemoteInspector::RemoteInspector):
(Inspector::RemoteInspector::start):
(startTimeoutThreadIfNeeded):
(JSC::overrideOptionWithHeuristic):
(JSC::Options::overrideAliasedOptionWithHeuristic):
(JSC::Options::initialize):
(JSC::enableAssembler):
(JSC::VM::VM):
(JSC::CodeProfiling::notifyAllocator):
Utilize WTF::Environment where possible.
Source/WebCore:
- platform/NotImplemented.h:
- platform/cocoa/SystemVersion.mm:
(WebCore::createSystemMarketingVersion):
- platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::initializeGStreamer):
- platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
- platform/graphics/nicosia/NicosiaPaintingEngine.cpp:
(Nicosia::PaintingEngine::create):
- platform/graphics/texmap/TextureMapperFPSCounter.cpp:
(WebCore::TextureMapperFPSCounter::TextureMapperFPSCounter):
- platform/graphics/x11/PlatformDisplayX11.cpp:
(WebCore::PlatformDisplayX11::create):
- platform/gtk/RenderThemeWidget.cpp:
(WebCore::RenderThemeScrollbar::RenderThemeScrollbar):
- platform/gtk/ScrollbarThemeGtk.cpp:
(WebCore::ScrollbarThemeGtk::ScrollbarThemeGtk):
- platform/network/curl/CurlContext.cpp:
(WebCore::CurlContext::CurlContext):
(WebCore::EnvironmentVariableReader::read): Deleted.
(WebCore::EnvironmentVariableReader::defined): Deleted.
(WebCore::EnvironmentVariableReader::readAs): Deleted.
(WebCore::EnvironmentVariableReader::sscanTemplate): Deleted.
(WebCore::EnvironmentVariableReader::sscanTemplate<signed>): Deleted.
(WebCore::EnvironmentVariableReader::sscanTemplate<unsigned>): Deleted.
- platform/network/curl/NetworkStorageSessionCurl.cpp:
(WebCore::defaultCookieJarPath):
- platform/network/playstation/CurlSSLHandlePlayStation.cpp:
(WebCore::getCACertPathEnv):
- platform/network/win/CurlSSLHandleWin.cpp:
(WebCore::getCACertPathEnv):
- platform/text/hyphen/HyphenationLibHyphen.cpp:
(WebCore::topLevelPath):
(WebCore::webkitBuildDirectory):
- platform/unix/LoggingUnix.cpp:
(WebCore::logLevelString):
- platform/win/LoggingWin.cpp:
(WebCore::logLevelString):
Utilize WTF::Environment where possible.
Source/WebCore/PAL:
- pal/unix/LoggingUnix.cpp:
(PAL::logLevelString):
(PAL::logLevelString):
Utilize WTF::Environment where possible.
Source/WebKit:
- NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp:
(main):
- Platform/unix/EnvironmentUtilities.cpp:
(WebKit::EnvironmentUtilities::stripValuesEndingWithString):
- Platform/unix/LoggingUnix.cpp:
(WebKit::logLevelString):
- Platform/win/LoggingWin.cpp:
(WebKit::logLevelString):
- PluginProcess/mac/PluginProcessMac.mm:
(WebKit::shouldCallRealDebugger):
- Shared/Plugins/unix/PluginSearchPath.cpp:
(WebKit::pluginsDirectories):
- Shared/glib/ProcessExecutablePathGLib.cpp:
(WebKit::findWebKitProcess):
- UIProcess/API/glib/WebKitSettings.cpp:
(webKitSettingsConstructed):
(webKitSettingsSetProperty):
- UIProcess/API/glib/WebKitWebContext.cpp:
(injectedBundleDirectory):
(webkitWebContextConstructed):
- UIProcess/API/gtk/WebKitWebViewGtk.cpp:
(webkitWebViewMaximizeWindow):
(webkitWebViewRestoreWindow):
- UIProcess/API/wpe/WPEView.cpp:
(WKWPE::m_backend):
- UIProcess/AuxiliaryProcessProxy.cpp:
(WebKit::AuxiliaryProcessProxy::getLaunchOptions):
- UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
(WebKit::XDGDBusProxyLauncher::launch):
(WebKit::bindDBusSession):
(WebKit::bindX11):
(WebKit::bindWayland):
(WebKit::bindPulse):
(WebKit::bindPathVar):
(WebKit::bindGStreamerData):
(WebKit::bubblewrapSpawn):
- UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
(WebKit::ProcessLauncher::launchProcess):
- UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::systemDirectoryPath):
(WebKit::ProcessLauncher::launchProcess):
- UIProcess/glib/WebProcessPoolGLib.cpp:
(WebKit::memoryPressureMonitorDisabled):
(WebKit::WebProcessPool::platformInitialize):
(WebKit::WebProcessPool::platformInitializeWebProcess):
- UIProcess/gtk/HardwareAccelerationManager.cpp:
(WebKit::HardwareAccelerationManager::HardwareAccelerationManager):
- WebProcess/EntryPoint/unix/WebProcessMain.cpp:
(main):
- WebProcess/gtk/WebProcessMainGtk.cpp:
- WebProcess/wpe/WebProcessMainWPE.cpp:
Utilize WTF::Environment where possible.
Source/WebKitLegacy/ios:
(WebKitPlatformSystemRootDirectory):
Utilize WTF::Environment where possible.
Source/WebKitLegacy/mac:
(-[WebView _initWithFrame:frameName:groupName:]):
Utilize WTF::Environment where possible.
Source/WTF:
Create a new Environment API as a platform-independent, thread-safe(r)
way to get and set environment variables.
- WTF.xcodeproj/project.pbxproj:
- wtf/CMakeLists.txt:
- wtf/Environment.h: Added.
- wtf/PlatformGTK.cmake:
- wtf/PlatformJSCOnly.cmake:
- wtf/PlatformMac.cmake:
- wtf/PlatformPlayStation.cmake:
- wtf/PlatformWPE.cmake:
- wtf/PlatformWin.cmake:
- wtf/posix/EnvironmentPOSIX.cpp: Added.
- wtf/win/EnvironmentWin.cpp: Added.
Introduce WTF::Environment.
(WTF::threadingIsInitialized):
(WTF::initializeThreading):
Introduce WTF::threadingIsInitialized() so that we can ASSERT that it's
false before setting an environment variable through the new API.
(WTF::initializeLogFileOnce):
(WTF::numberOfProcessorCores):
- wtf/posix/FileSystemPOSIX.cpp:
(WTF::FileSystemImpl::openTemporaryFile):
Utilize WTF::Environment where possible.
Tools:
- DumpRenderTree/mac/DumpRenderTree.mm:
(libraryPathForDumpRenderTree):
- DumpRenderTree/win/DumpRenderTree.cpp:
(libraryPathForDumpRenderTree):
- TestRunnerShared/IOSLayoutTestCommunication.cpp:
(setUpIOSLayoutTestCommunication):
- TestWebKitAPI/Tests/WebKit/EnvironmentUtilitiesTest.cpp:
(TestWebKitAPI::strip):
- TestWebKitAPI/Tests/WebKitGLib/TestAutomationSession.cpp:
(beforeAll):
- TestWebKitAPI/glib/WebKitGLib/TestMain.cpp:
(main):
- TestWebKitAPI/glib/WebKitGLib/WebKitTestBus.cpp:
(WebKitTestBus::run):
- WebKitTestRunner/InjectedBundle/gtk/ActivateFontsGtk.cpp:
(WTR::getOutputDir):
(WTR::initializeFontConfigSetting):
- WebKitTestRunner/InjectedBundle/gtk/InjectedBundleGtk.cpp:
(WTR::InjectedBundle::platformInitialize):
- WebKitTestRunner/InjectedBundle/gtk/InjectedBundleUtilities.cpp:
(WTR::topLevelPath):
- WebKitTestRunner/InjectedBundle/wpe/ActivateFontsWPE.cpp:
(WTR::topLevelPath):
(WTR::getOutputDir):
(WTR::activateFonts):
- WebKitTestRunner/TestController.cpp:
(WTR::TestController::libraryPathForTesting):
(WTR::TestController::generateContextConfiguration const):
(WTR::TestController::generatePageConfiguration):
(WTR::TestController::decideDestinationWithSuggestedFilename):
(WTR::TestController::platformAdjustContext):
- WebKitTestRunner/TestController.h:
- WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::cocoaPlatformInitialize):
(WTR::TestController::platformAdjustContext):
- WebKitTestRunner/gtk/main.cpp:
(main):
- WebKitTestRunner/mac/TestControllerMac.mm:
(WTR::TestController::configureContentExtensionForTest):
- WebKitTestRunner/wpe/main.cpp:
(main):
Utilize WTF::Environment where possible.