Diff
Modified: trunk/Source/WebKit/ChangeLog (277834 => 277835)
--- trunk/Source/WebKit/ChangeLog 2021-05-20 23:03:12 UTC (rev 277834)
+++ trunk/Source/WebKit/ChangeLog 2021-05-20 23:06:01 UTC (rev 277835)
@@ -1,3 +1,26 @@
+2021-05-20 Eric Carlson <[email protected]>
+
+ Allow GPU process log channels to be configured
+ https://bugs.webkit.org/show_bug.cgi?id=226036
+ <rdar://problem/78271211>
+
+ Reviewed by Jer Noble.
+
+ * GPUProcess/GPUConnectionToWebProcess.cpp:
+ (WebKit::GPUConnectionToWebProcess::configureLoggingChannel): Configure WebCore and
+ WebKit logging channels because classes used in the GPU process use both.
+ * GPUProcess/GPUConnectionToWebProcess.h:
+ * GPUProcess/GPUConnectionToWebProcess.messages.in:
+
+ * WebProcess/GPU/GPUProcessConnection.cpp:
+ (WebKit::GPUProcessConnection::configureLoggingChannel): Send configureLoggingChannel
+ message to the GPU process.
+ * WebProcess/GPU/GPUProcessConnection.h:
+
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::configureLoggingChannel): Send configureLoggingChannel to the
+ GPU process connection, if there is one.
+
2021-05-20 Brent Fulgham <[email protected]>
[Cocoa] Adopt "com.apple.QuartzCore.webkit-limited-types" entitlement
Modified: trunk/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp (277834 => 277835)
--- trunk/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp 2021-05-20 23:03:12 UTC (rev 277834)
+++ trunk/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp 2021-05-20 23:06:01 UTC (rev 277835)
@@ -63,6 +63,7 @@
#include "WebCoreArgumentCoders.h"
#include "WebErrors.h"
#include "WebProcessMessages.h"
+#include <WebCore/Logging.h>
#include <WebCore/MockRealtimeMediaSourceCenter.h>
#include <WebCore/NowPlayingManager.h>
#include <wtf/Language.h>
@@ -278,6 +279,27 @@
}
#endif
+void GPUConnectionToWebProcess::configureLoggingChannel(const String& channelName, WTFLogChannelState state, WTFLogLevel level)
+{
+#if !RELEASE_LOG_DISABLED
+ if (auto* channel = WebCore::getLogChannel(channelName)) {
+ channel->state = state;
+ channel->level = level;
+ }
+
+ auto* channel = getLogChannel(channelName);
+ if (!channel)
+ return;
+
+ channel->state = state;
+ channel->level = level;
+#else
+ UNUSED_PARAM(channelName);
+ UNUSED_PARAM(state);
+ UNUSED_PARAM(level);
+#endif
+}
+
bool GPUConnectionToWebProcess::allowsExitUnderMemoryPressure() const
{
for (auto& remoteRenderingBackend : m_remoteRenderingBackendMap.values()) {
Modified: trunk/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.h (277834 => 277835)
--- trunk/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.h 2021-05-20 23:03:12 UTC (rev 277834)
+++ trunk/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.h 2021-05-20 23:06:01 UTC (rev 277835)
@@ -201,6 +201,7 @@
void releaseRemoteCommandListener(RemoteRemoteCommandListenerIdentifier);
void setMediaOverridesForTesting(MediaOverridesForTesting);
void setUserPreferredLanguages(const Vector<String>&);
+ void configureLoggingChannel(const String&, WTFLogChannelState, WTFLogLevel);
// IPC::Connection::Client
void didClose(IPC::Connection&) final;
Modified: trunk/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.messages.in (277834 => 277835)
--- trunk/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.messages.in 2021-05-20 23:03:12 UTC (rev 277834)
+++ trunk/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.messages.in 2021-05-20 23:06:01 UTC (rev 277835)
@@ -50,6 +50,7 @@
CreateRemoteCommandListener(WebKit::RemoteRemoteCommandListenerIdentifier identifier)
ReleaseRemoteCommandListener(WebKit::RemoteRemoteCommandListenerIdentifier identifier)
SetUserPreferredLanguages(Vector<String> languages)
+ ConfigureLoggingChannel(String channelName, enum:uint8_t WTFLogChannelState state, enum:uint8_t WTFLogLevel level)
}
#endif // ENABLE(GPU_PROCESS)
Modified: trunk/Source/WebKit/WebProcess/GPU/GPUProcessConnection.cpp (277834 => 277835)
--- trunk/Source/WebKit/WebProcess/GPU/GPUProcessConnection.cpp 2021-05-20 23:03:12 UTC (rev 277834)
+++ trunk/Source/WebKit/WebProcess/GPU/GPUProcessConnection.cpp 2021-05-20 23:06:01 UTC (rev 277835)
@@ -245,6 +245,11 @@
}
#endif
+void GPUProcessConnection::configureLoggingChannel(const String& channelName, WTFLogChannelState state, WTFLogLevel level)
+{
+ connection().send(Messages::GPUConnectionToWebProcess::ConfigureLoggingChannel(channelName, state, level), { });
+}
+
#if ENABLE(VP9)
void GPUProcessConnection::enableVP9Decoders(bool enableVP8Decoder, bool enableVP9Decoder, bool enableVP9SWDecoder)
{
Modified: trunk/Source/WebKit/WebProcess/GPU/GPUProcessConnection.h (277834 => 277835)
--- trunk/Source/WebKit/WebProcess/GPU/GPUProcessConnection.h 2021-05-20 23:03:12 UTC (rev 277834)
+++ trunk/Source/WebKit/WebProcess/GPU/GPUProcessConnection.h 2021-05-20 23:06:01 UTC (rev 277835)
@@ -85,6 +85,8 @@
void destroyVisibilityPropagationContextForPage(WebPage&);
#endif
+ void configureLoggingChannel(const String&, WTFLogChannelState, WTFLogLevel);
+
class Client : public CanMakeWeakPtr<Client> {
public:
virtual ~Client() = default;
Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (277834 => 277835)
--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2021-05-20 23:03:12 UTC (rev 277834)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2021-05-20 23:06:01 UTC (rev 277835)
@@ -7263,6 +7263,11 @@
void WebPage::configureLoggingChannel(const String& channelName, WTFLogChannelState state, WTFLogLevel level)
{
+#if ENABLE(GPU_PROCESS)
+ if (auto* gpuProcessConnection = WebProcess::singleton().existingGPUProcessConnection())
+ gpuProcessConnection->configureLoggingChannel(channelName, state, level);
+#endif
+
send(Messages::WebPageProxy::ConfigureLoggingChannel(channelName, state, level));
}