haikuwebkit/Source/WTF/wtf/cocoa
Myles C. Maxfield 90d4d2118d Create a Language log channel
https://bugs.webkit.org/show_bug.cgi?id=228764

Reviewed by Simon Fraser.

Source/WebKit:

* Platform/Logging.h:
* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
(WebKit::setAppleLanguagesPreference):
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::setOverrideLanguages):
(WebKit::WebProcessPool::initializeNewWebProcess):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::getLaunchOptions):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
(WebKit::WebProcess::userPreferredLanguagesChanged const):

Source/WTF:

There have been a variety of bug reports over the past months/years about the procedure
by which we determine navigator.language. It's actually somewhat convoluted, so this
patch adds a (debug) log channel for it so we can follow what it's doing easily.

To enable all the logging, run these commands:

% defaults write com.apple.WebKit.WebContent.Development WTFLogging Language
% defaults write com.apple.WebKit.WebContent.Development WebKit2Logging Language
% defaults write com.apple.WebKit.WebContent WTFLogging Language
% defaults write com.apple.WebKit.WebContent WebKit2Logging Language
% defaults write -g WTFLogging Language
% defaults write -g WebKit2Logging Language
% defaults write /Users/$USER/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari.plist WTFLogging Language
% defaults write /Users/$USER/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari.plist WebKit2Logging Language

* wtf/Language.cpp:
(WTF::defaultLanguage):
(WTF::overrideUserPreferredLanguages):
(WTF::userPreferredLanguages):
* wtf/Logging.cpp:
* wtf/Logging.h:
* wtf/cf/LanguageCF.cpp:
(WTF::platformUserPreferredLanguages):
* wtf/cocoa/LanguageCocoa.mm:
(WTF::minimizedLanguagesFromLanguages):

Canonical link: https://commits.webkit.org/240381@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280811 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-08-10 00:07:45 +00:00
..
AutodrainedPool.cpp
CrashReporter.cpp
CrashReporter.h
Entitlements.h [Cocoa] Harden WebAuthn process by restricting to browser-entitled processes 2021-06-15 16:46:14 +00:00
Entitlements.mm [Cocoa] Harden WebAuthn process by restricting to browser-entitled processes 2021-06-15 16:46:14 +00:00
FileSystemCocoa.mm Unreviewed build fix after r277881. 2021-06-03 23:45:43 +00:00
LanguageCocoa.mm Create a Language log channel 2021-08-10 00:07:45 +00:00
LoggingCocoa.mm Support WTF logging channels 2021-08-09 21:14:53 +00:00
MachSendRight.cpp Support WTF logging channels 2021-08-09 21:14:53 +00:00
MainThreadCocoa.mm Support WTF logging channels 2021-08-09 21:14:53 +00:00
MemoryFootprintCocoa.cpp
MemoryPressureHandlerCocoa.mm Support WTF logging channels 2021-08-09 21:14:53 +00:00
NSURLExtras.h
NSURLExtras.mm Use Checked aliases instead of Checked<T, RecordOverflow> 2021-06-02 15:42:27 +00:00
ResourceUsageCocoa.cpp
RuntimeApplicationChecksCocoa.cpp Remove <wtf/Optional.h> 2021-06-02 06:45:51 +00:00
RuntimeApplicationChecksCocoa.h
SoftLinking.h [macOS] Adopt QLItem in WKImageExtractionPreviewController 2021-05-22 01:33:40 +00:00
SpanCocoa.h Add helpers to create Spans from CFDataRef and NSData 2021-06-28 15:34:32 +00:00
SystemTracingCocoa.cpp
URLCocoa.mm Reduce use of reinterpret_cast<> in the codebase 2021-06-08 17:35:15 +00:00
VectorCocoa.h Remove WTF::Optional synonym for std::optional, using that class template directly instead 2021-05-30 16:11:40 +00:00
WorkQueueCocoa.cpp Functions dispatched to WorkQueue are sometimes destroyed in the calling thread due to block refcounting 2021-06-22 13:25:03 +00:00