<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[279591] trunk/Source/WebKit</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/279591">279591</a></dd>
<dt>Author</dt> <dd>pvollan@apple.com</dd>
<dt>Date</dt> <dd>2021-07-06 10:25:05 -0700 (Tue, 06 Jul 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>Collect Accessibility preferences on a background queue
https://bugs.webkit.org/show_bug.cgi?id=227617
<rdar://80055168>

Reviewed by Brent Fulgham.

To avoid blocking the main thread of the UI process, collect Media Accessibility preferences on a background thread,
and send them to the WebContent process(es).

* Shared/AccessibilityPreferences.cpp:
(IPC::ArgumentCoder<WebKit::AccessibilityPreferences>::encode):
(IPC::ArgumentCoder<WebKit::AccessibilityPreferences>::decode):
* Shared/AccessibilityPreferences.h:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::accessibilityPreferences):
(WebKit::WebProcessPool::setMediaAccessibilityPreferences):
(WebKit::WebProcessPool::mediaAccessibilityPreferencesChangedCallback):
(WebKit::WebProcessPool::registerNotificationObservers):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::initializeNewWebProcess):
* UIProcess/WebProcessPool.h:
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::accessibilityPreferencesDidChange):
(WebKit::WebProcess::setMediaAccessibilityPreferences):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitSharedAccessibilityPreferencescpp">trunk/Source/WebKit/Shared/AccessibilityPreferences.cpp</a></li>
<li><a href="#trunkSourceWebKitSharedAccessibilityPreferencesh">trunk/Source/WebKit/Shared/AccessibilityPreferences.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessCocoaWebProcessPoolCocoamm">trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm</a></li>
<li><a href="#trunkSourceWebKitUIProcessWebProcessPoolcpp">trunk/Source/WebKit/UIProcess/WebProcessPool.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessWebProcessPoolh">trunk/Source/WebKit/UIProcess/WebProcessPool.h</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebProcessh">trunk/Source/WebKit/WebProcess/WebProcess.h</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebProcessmessagesin">trunk/Source/WebKit/WebProcess/WebProcess.messages.in</a></li>
<li><a href="#trunkSourceWebKitWebProcesscocoaWebProcessCocoamm">trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (279590 => 279591)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2021-07-06 17:24:22 UTC (rev 279590)
+++ trunk/Source/WebKit/ChangeLog       2021-07-06 17:25:05 UTC (rev 279591)
</span><span class="lines">@@ -1,3 +1,32 @@
</span><ins>+2021-07-06  Per Arne  <pvollan@apple.com>
+
+        Collect Accessibility preferences on a background queue
+        https://bugs.webkit.org/show_bug.cgi?id=227617
+        <rdar://80055168>
+
+        Reviewed by Brent Fulgham.
+
+        To avoid blocking the main thread of the UI process, collect Media Accessibility preferences on a background thread,
+        and send them to the WebContent process(es).
+
+        * Shared/AccessibilityPreferences.cpp:
+        (IPC::ArgumentCoder<WebKit::AccessibilityPreferences>::encode):
+        (IPC::ArgumentCoder<WebKit::AccessibilityPreferences>::decode):
+        * Shared/AccessibilityPreferences.h:
+        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
+        (WebKit::accessibilityPreferences):
+        (WebKit::WebProcessPool::setMediaAccessibilityPreferences):
+        (WebKit::WebProcessPool::mediaAccessibilityPreferencesChangedCallback):
+        (WebKit::WebProcessPool::registerNotificationObservers):
+        * UIProcess/WebProcessPool.cpp:
+        (WebKit::WebProcessPool::initializeNewWebProcess):
+        * UIProcess/WebProcessPool.h:
+        * WebProcess/WebProcess.h:
+        * WebProcess/WebProcess.messages.in:
+        * WebProcess/cocoa/WebProcessCocoa.mm:
+        (WebKit::WebProcess::accessibilityPreferencesDidChange):
+        (WebKit::WebProcess::setMediaAccessibilityPreferences):
+
</ins><span class="cx"> 2021-07-06  Youenn Fablet  <youenn@apple.com>
</span><span class="cx"> 
</span><span class="cx">         REGRESSION: [iOS] ASSERTION FAILED: !m_messageReceiverMapCount under WebKit::RemoteRemoteCommandListener::~RemoteRemoteCommandListener()
</span></span></pre></div>
<a id="trunkSourceWebKitSharedAccessibilityPreferencescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/AccessibilityPreferences.cpp (279590 => 279591)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/AccessibilityPreferences.cpp  2021-07-06 17:24:22 UTC (rev 279590)
+++ trunk/Source/WebKit/Shared/AccessibilityPreferences.cpp     2021-07-06 17:25:05 UTC (rev 279591)
</span><span class="lines">@@ -37,10 +37,6 @@
</span><span class="cx">     encoder << preferences.darkenSystemColors;
</span><span class="cx">     encoder << preferences.invertColorsEnabled;
</span><span class="cx"> #endif
</span><del>-#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
-    encoder << preferences.captionDisplayMode;
-    encoder << preferences.preferredLanguages;
-#endif
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> std::optional<WebKit::AccessibilityPreferences> ArgumentCoder<WebKit::AccessibilityPreferences>::decode(Decoder& decoder)
</span><span class="lines">@@ -58,12 +54,6 @@
</span><span class="cx">     if (!decoder.decode(preferences.invertColorsEnabled))
</span><span class="cx">         return std::nullopt;
</span><span class="cx"> #endif
</span><del>-#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
-    if (!decoder.decode(preferences.captionDisplayMode))
-        return std::nullopt;
-    if (!decoder.decode(preferences.preferredLanguages))
-        return std::nullopt;
-#endif
</del><span class="cx">     return preferences;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitSharedAccessibilityPreferencesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/AccessibilityPreferences.h (279590 => 279591)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/AccessibilityPreferences.h    2021-07-06 17:24:22 UTC (rev 279590)
+++ trunk/Source/WebKit/Shared/AccessibilityPreferences.h       2021-07-06 17:25:05 UTC (rev 279591)
</span><span class="lines">@@ -27,10 +27,6 @@
</span><span class="cx"> 
</span><span class="cx"> #include "ArgumentCoders.h"
</span><span class="cx"> 
</span><del>-#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
-#include <WebCore/CaptionUserPreferences.h>
-#endif
-
</del><span class="cx"> #if HAVE(PER_APP_ACCESSIBILITY_PREFERENCES)
</span><span class="cx"> #include "AccessibilitySupportSPI.h"
</span><span class="cx"> #endif
</span><span class="lines">@@ -45,10 +41,6 @@
</span><span class="cx">     AXValueState darkenSystemColors { AXValueStateEmpty };
</span><span class="cx">     AXValueState invertColorsEnabled { AXValueStateEmpty };
</span><span class="cx"> #endif
</span><del>-#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
-    WebCore::CaptionUserPreferences::CaptionDisplayMode captionDisplayMode;
-    Vector<String> preferredLanguages;
-#endif
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessCocoaWebProcessPoolCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm (279590 => 279591)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm       2021-07-06 17:24:22 UTC (rev 279590)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm  2021-07-06 17:25:05 UTC (rev 279591)
</span><span class="lines">@@ -168,6 +168,35 @@
</span><span class="cx">     return m_bundleParameters.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static AccessibilityPreferences accessibilityPreferences()
+{
+    AccessibilityPreferences preferences;
+#if HAVE(PER_APP_ACCESSIBILITY_PREFERENCES)
+    auto appId = WebCore::applicationBundleIdentifier().createCFString();
+
+    preferences.reduceMotionEnabled = _AXSReduceMotionEnabledApp(appId.get());
+    preferences.increaseButtonLegibility = _AXSIncreaseButtonLegibilityApp(appId.get());
+    preferences.enhanceTextLegibility = _AXSEnhanceTextLegibilityEnabledApp(appId.get());
+    preferences.darkenSystemColors = _AXDarkenSystemColorsApp(appId.get());
+    preferences.invertColorsEnabled = _AXSInvertColorsEnabledApp(appId.get());
+#endif
+    return preferences;
+}
+
+#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
+void WebProcessPool::setMediaAccessibilityPreferences(WebProcessProxy& process)
+{
+    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), [weakProcess = makeWeakPtr(process)] {
+        auto captionDisplayMode = WebCore::CaptionUserPreferencesMediaAF::platformCaptionDisplayMode();
+        auto preferredLanguages = WebCore::CaptionUserPreferencesMediaAF::platformPreferredLanguages();
+        callOnMainRunLoop([weakProcess, captionDisplayMode, preferredLanguages] {
+            if (weakProcess)
+                weakProcess->send(Messages::WebProcess::SetMediaAccessibilityPreferences(captionDisplayMode, preferredLanguages), 0);
+        });
+    });
+}
+#endif
+
</ins><span class="cx"> void WebProcessPool::platformInitialize()
</span><span class="cx"> {
</span><span class="cx">     registerUserDefaultsIfNeeded();
</span><span class="lines">@@ -273,25 +302,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static AccessibilityPreferences accessibilityPreferences()
-{
-    AccessibilityPreferences preferences;
-#if HAVE(PER_APP_ACCESSIBILITY_PREFERENCES)
-    auto appId = WebCore::applicationBundleIdentifier().createCFString();
-
-    preferences.reduceMotionEnabled = _AXSReduceMotionEnabledApp(appId.get());
-    preferences.increaseButtonLegibility = _AXSIncreaseButtonLegibilityApp(appId.get());
-    preferences.enhanceTextLegibility = _AXSEnhanceTextLegibilityEnabledApp(appId.get());
-    preferences.darkenSystemColors = _AXDarkenSystemColorsApp(appId.get());
-    preferences.invertColorsEnabled = _AXSInvertColorsEnabledApp(appId.get());
-#endif
-#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
-    preferences.captionDisplayMode = WebCore::CaptionUserPreferencesMediaAF::platformCaptionDisplayMode();
-    preferences.preferredLanguages = WebCore::CaptionUserPreferencesMediaAF::platformPreferredLanguages();
-#endif
-    return preferences;
-}
-
</del><span class="cx"> void WebProcessPool::platformInitializeWebProcess(const WebProcessProxy& process, WebProcessCreationParameters& parameters)
</span><span class="cx"> {
</span><span class="cx">     parameters.mediaMIMETypes = process.mediaMIMETypes();
</span><span class="lines">@@ -598,6 +608,16 @@
</span><span class="cx">     pool->sendToAllProcesses(Messages::WebProcess::AccessibilityPreferencesDidChange(accessibilityPreferences()));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
+void WebProcessPool::mediaAccessibilityPreferencesChangedCallback(CFNotificationCenterRef, void *observer, CFStringRef name, const void *, CFDictionaryRef userInfo)
+{
+    auto* pool = reinterpret_cast<WebProcessPool*>(observer);
+    auto captionDisplayMode = WebCore::CaptionUserPreferencesMediaAF::platformCaptionDisplayMode();
+    auto preferredLanguages = WebCore::CaptionUserPreferencesMediaAF::platformPreferredLanguages();
+    pool->sendToAllProcesses(Messages::WebProcess::SetMediaAccessibilityPreferences(captionDisplayMode, preferredLanguages));
+}
+#endif
+
</ins><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx"> void WebProcessPool::colorPreferencesDidChangeCallback(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo)
</span><span class="cx"> {
</span><span class="lines">@@ -735,7 +755,7 @@
</span><span class="cx">     CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), this, accessibilityPreferencesChangedCallback, kAXSInvertColorsEnabledNotification, nullptr, CFNotificationSuspensionBehaviorCoalesce);
</span><span class="cx"> #endif
</span><span class="cx"> #if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
</span><del>-    CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), this, accessibilityPreferencesChangedCallback, kMAXCaptionAppearanceSettingsChangedNotification, nullptr, CFNotificationSuspensionBehaviorCoalesce);
</del><ins>+    CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), this, mediaAccessibilityPreferencesChangedCallback, kMAXCaptionAppearanceSettingsChangedNotification, nullptr, CFNotificationSuspensionBehaviorCoalesce);
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessWebProcessPoolcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.cpp (279590 => 279591)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/WebProcessPool.cpp 2021-07-06 17:24:22 UTC (rev 279590)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.cpp    2021-07-06 17:25:05 UTC (rev 279591)
</span><span class="lines">@@ -814,6 +814,10 @@
</span><span class="cx"> 
</span><span class="cx">     process.send(Messages::WebProcess::InitializeWebProcess(parameters), 0);
</span><span class="cx"> 
</span><ins>+#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
+    setMediaAccessibilityPreferences(process);
+#endif
+
</ins><span class="cx">     if (m_automationSession)
</span><span class="cx">         process.send(Messages::WebProcess::EnsureAutomationSessionProxy(m_automationSession->sessionIdentifier()), 0);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessWebProcessPoolh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.h (279590 => 279591)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/WebProcessPool.h   2021-07-06 17:24:22 UTC (rev 279590)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.h      2021-07-06 17:25:05 UTC (rev 279591)
</span><span class="lines">@@ -575,6 +575,10 @@
</span><span class="cx">     static void accessibilityPreferencesChangedCallback(CFNotificationCenterRef, void *observer, CFStringRef name, const void *, CFDictionaryRef userInfo);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
+    static void mediaAccessibilityPreferencesChangedCallback(CFNotificationCenterRef, void *observer, CFStringRef name, const void *, CFDictionaryRef userInfo);
+#endif
+
</ins><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx">     static void colorPreferencesDidChangeCallback(CFNotificationCenterRef, void *observer, CFStringRef name, const void *, CFDictionaryRef userInfo);
</span><span class="cx"> #endif
</span><span class="lines">@@ -591,6 +595,10 @@
</span><span class="cx">     void systemDidWake() final;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
+    void setMediaAccessibilityPreferences(WebProcessProxy&);
+#endif
+
</ins><span class="cx">     Ref<API::ProcessPoolConfiguration> m_configuration;
</span><span class="cx"> 
</span><span class="cx">     IPC::MessageReceiverMap m_messageReceiverMap;
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebProcessh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebProcess.h (279590 => 279591)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebProcess.h      2021-07-06 17:24:22 UTC (rev 279590)
+++ trunk/Source/WebKit/WebProcess/WebProcess.h 2021-07-06 17:25:05 UTC (rev 279591)
</span><span class="lines">@@ -71,6 +71,10 @@
</span><span class="cx"> #include <WebCore/PlatformDisplayLibWPE.h>
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
+#include <WebCore/CaptionUserPreferences.h>
+#endif
+
</ins><span class="cx"> namespace API {
</span><span class="cx"> class Object;
</span><span class="cx"> }
</span><span class="lines">@@ -567,6 +571,9 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     void accessibilityPreferencesDidChange(const AccessibilityPreferences&);
</span><ins>+#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
+    void setMediaAccessibilityPreferences(WebCore::CaptionUserPreferences::CaptionDisplayMode, const Vector<String>&);
+#endif
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC) || PLATFORM(MACCATALYST)
</span><span class="cx">     void colorPreferencesDidChange();
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebProcessmessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebProcess.messages.in (279590 => 279591)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebProcess.messages.in    2021-07-06 17:24:22 UTC (rev 279590)
+++ trunk/Source/WebKit/WebProcess/WebProcess.messages.in       2021-07-06 17:25:05 UTC (rev 279591)
</span><span class="lines">@@ -202,4 +202,8 @@
</span><span class="cx">     ConsumeAudioComponentRegistrations(IPC::SharedBufferDataReference registrationData)
</span><span class="cx">     AccessibilityPreferencesDidChange(struct WebKit::AccessibilityPreferences accessibilityPreferences)
</span><span class="cx"> #endif
</span><ins>+
+#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
+    SetMediaAccessibilityPreferences(WebCore::CaptionUserPreferences::CaptionDisplayMode displayMode, Vector<String> languages)
+#endif
</ins><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcesscocoaWebProcessCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm (279590 => 279591)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm  2021-07-06 17:24:22 UTC (rev 279590)
+++ trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm     2021-07-06 17:25:05 UTC (rev 279591)
</span><span class="lines">@@ -1111,11 +1111,15 @@
</span><span class="cx">     if (_AXSInvertColorsEnabledApp(appID) != invertColorsEnabled)
</span><span class="cx">         _AXSInvertColorsSetEnabledApp(invertColorsEnabled, appID);
</span><span class="cx"> #endif
</span><ins>+}
+
</ins><span class="cx"> #if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
</span><del>-    WebCore::CaptionUserPreferencesMediaAF::setCachedCaptionDisplayMode(preferences.captionDisplayMode);
-    WebCore::CaptionUserPreferencesMediaAF::setCachedPreferredLanguages(preferences.preferredLanguages);
</del><ins>+void WebProcess::setMediaAccessibilityPreferences(WebCore::CaptionUserPreferences::CaptionDisplayMode captionDisplayMode, const Vector<String>& preferredLanguages)
+{
+    WebCore::CaptionUserPreferencesMediaAF::setCachedCaptionDisplayMode(captionDisplayMode);
+    WebCore::CaptionUserPreferencesMediaAF::setCachedPreferredLanguages(preferredLanguages);
+}
</ins><span class="cx"> #endif
</span><del>-}
</del><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC) || PLATFORM(MACCATALYST)
</span><span class="cx"> void WebProcess::colorPreferencesDidChange()
</span></span></pre>
</div>
</div>

</body>
</html>