Diff
Modified: trunk/LayoutTests/ChangeLog (243327 => 243328)
--- trunk/LayoutTests/ChangeLog 2019-03-21 21:06:35 UTC (rev 243327)
+++ trunk/LayoutTests/ChangeLog 2019-03-21 21:15:29 UTC (rev 243328)
@@ -1,3 +1,14 @@
+2019-03-21 Eric Carlson <[email protected]>
+
+ Add UI process WebRTC runtime logging.
+ https://bugs.webkit.org/show_bug.cgi?id=196020
+ <rdar://problem/49071443>
+
+ Reviewed by Youenn Fablet.
+
+ * inspector/console/webcore-logging.html:
+ * inspector/console/webcore-logging-expected.txt:
+
2019-03-21 Alex Christensen <[email protected]>
Add SPI to inform applications of WKContentRuleList actions
Modified: trunk/LayoutTests/inspector/console/webcore-logging-expected.txt (243327 => 243328)
--- trunk/LayoutTests/inspector/console/webcore-logging-expected.txt 2019-03-21 21:06:35 UTC (rev 243327)
+++ trunk/LayoutTests/inspector/console/webcore-logging-expected.txt 2019-03-21 21:15:29 UTC (rev 243328)
@@ -16,9 +16,6 @@
PASS: Log channel has known source.
PASS: Log channel disabled by default.
--- Running test case: Console.Logging.InvalidChannel
-PASS: Logging channel not found
-
-- Running test case: Console.Logging.InvalidLevel
PASS: Invalid logging level
Modified: trunk/LayoutTests/inspector/console/webcore-logging.html (243327 => 243328)
--- trunk/LayoutTests/inspector/console/webcore-logging.html 2019-03-21 21:06:35 UTC (rev 243327)
+++ trunk/LayoutTests/inspector/console/webcore-logging.html 2019-03-21 21:15:29 UTC (rev 243328)
@@ -69,22 +69,6 @@
});
suite.addTestCase({
- name: "Console.Logging.InvalidChannel",
- description: "setLoggingChannelLevel should reject invalid log channel name.",
- test(resolve, reject) {
- ConsoleAgent.setLoggingChannelLevel("DOES_NOT_EXIST", WI.LoggingChannel.Level.Off, (error) => {
- if (!error) {
- InspectorTest.fail("Should have an error with invalid channel.");
- reject();
- return;
- }
- InspectorTest.pass(error);
- resolve();
- });
- }
- });
-
- suite.addTestCase({
name: "Console.Logging.InvalidLevel",
description: "setLoggingChannelLevel should reject invalid log channel level.",
test(resolve, reject) {
Modified: trunk/Source/WTF/ChangeLog (243327 => 243328)
--- trunk/Source/WTF/ChangeLog 2019-03-21 21:06:35 UTC (rev 243327)
+++ trunk/Source/WTF/ChangeLog 2019-03-21 21:15:29 UTC (rev 243328)
@@ -1,3 +1,14 @@
+2019-03-21 Eric Carlson <[email protected]>
+
+ Add UI process WebRTC runtime logging.
+ https://bugs.webkit.org/show_bug.cgi?id=196020
+ <rdar://problem/49071443>
+
+ Reviewed by Youenn Fablet.
+
+ * wtf/Logger.h:
+ (WTF::LogArgument::toString): Add long long and unsigned long long variants.
+
2019-03-20 Simon Fraser <[email protected]>
Rename ENABLE_ACCELERATED_OVERFLOW_SCROLLING macro to ENABLE_OVERFLOW_SCROLLING_TOUCH
Modified: trunk/Source/WTF/wtf/Logger.h (243327 => 243328)
--- trunk/Source/WTF/wtf/Logger.h 2019-03-21 21:06:35 UTC (rev 243327)
+++ trunk/Source/WTF/wtf/Logger.h 2019-03-21 21:15:29 UTC (rev 243328)
@@ -36,6 +36,8 @@
template<typename U = T> static typename std::enable_if<std::is_same<U, unsigned>::value, String>::type toString(unsigned argument) { return String::number(argument); }
template<typename U = T> static typename std::enable_if<std::is_same<U, unsigned long>::value, String>::type toString(unsigned long argument) { return String::number(argument); }
template<typename U = T> static typename std::enable_if<std::is_same<U, long>::value, String>::type toString(long argument) { return String::number(argument); }
+ template<typename U = T> static typename std::enable_if<std::is_same<U, unsigned long long>::value, String>::type toString(unsigned long argument) { return String::number(argument); }
+ template<typename U = T> static typename std::enable_if<std::is_same<U, long long>::value, String>::type toString(long argument) { return String::number(argument); }
template<typename U = T> static typename std::enable_if<std::is_enum<U>::value, String>::type toString(U argument) { return String::number(static_cast<typename std::underlying_type<U>::type>(argument)); }
template<typename U = T> static typename std::enable_if<std::is_same<U, float>::value, String>::type toString(float argument) { return String::numberToStringFixedPrecision(argument); }
template<typename U = T> static typename std::enable_if<std::is_same<U, double>::value, String>::type toString(double argument) { return String::numberToStringFixedPrecision(argument); }
Modified: trunk/Source/WebCore/ChangeLog (243327 => 243328)
--- trunk/Source/WebCore/ChangeLog 2019-03-21 21:06:35 UTC (rev 243327)
+++ trunk/Source/WebCore/ChangeLog 2019-03-21 21:15:29 UTC (rev 243328)
@@ -1,3 +1,29 @@
+2019-03-21 Eric Carlson <[email protected]>
+
+ Add UI process WebRTC runtime logging.
+ https://bugs.webkit.org/show_bug.cgi?id=196020
+ <rdar://problem/49071443>
+
+ Reviewed by Youenn Fablet.
+
+ * inspector/agents/WebConsoleAgent.cpp:
+ (WebCore::WebConsoleAgent::getLoggingChannels): Deleted.
+ (WebCore::channelConfigurationForString): Deleted.
+ (WebCore::WebConsoleAgent::setLoggingChannelLevel): Deleted.
+ * inspector/agents/WebConsoleAgent.h:
+ * inspector/agents/page/PageConsoleAgent.cpp:
+ (WebCore::PageConsoleAgent::PageConsoleAgent): Change 'context' parameter from
+ WebAgentContext to PageAgentContext. Store the inspected page for later use.
+ (WebCore::PageConsoleAgent::getLoggingChannels): Moved from WebConsoleAgent.
+ (WebCore::channelConfigurationForString): Ditto.
+ (WebCore::PageConsoleAgent::setLoggingChannelLevel): Moved from WebConsoleAgent.
+ Call the inspected page to actually change the log channel configuration.
+ * inspector/agents/page/PageConsoleAgent.h:
+ * page/ChromeClient.h:
+ * page/Page.cpp:
+ (WebCore::Page::configureLoggingChannel): New.
+ * page/Page.h:
+
2019-03-21 Andy Estes <[email protected]>
[iOS] Apple Pay should be available in documents with no user agent scripts
Modified: trunk/Source/WebCore/inspector/agents/WebConsoleAgent.cpp (243327 => 243328)
--- trunk/Source/WebCore/inspector/agents/WebConsoleAgent.cpp 2019-03-21 21:06:35 UTC (rev 243327)
+++ trunk/Source/WebCore/inspector/agents/WebConsoleAgent.cpp 2019-03-21 21:15:29 UTC (rev 243328)
@@ -48,87 +48,6 @@
{
}
-void WebConsoleAgent::getLoggingChannels(ErrorString&, RefPtr<JSON::ArrayOf<Inspector::Protocol::Console::Channel>>& channels)
-{
- static const struct ChannelTable {
- NeverDestroyed<String> name;
- Inspector::Protocol::Console::ChannelSource source;
- } channelTable[] = {
- { MAKE_STATIC_STRING_IMPL("WebRTC"), Inspector::Protocol::Console::ChannelSource::WebRTC },
- { MAKE_STATIC_STRING_IMPL("Media"), Inspector::Protocol::Console::ChannelSource::Media },
- { MAKE_STATIC_STRING_IMPL("MediaSource"), Inspector::Protocol::Console::ChannelSource::MediaSource },
- };
-
- channels = JSON::ArrayOf<Inspector::Protocol::Console::Channel>::create();
-
- size_t length = WTF_ARRAY_LENGTH(channelTable);
- for (size_t i = 0; i < length; ++i) {
- auto* logChannel = getLogChannel(channelTable[i].name);
- if (!logChannel)
- return;
-
- auto level = Inspector::Protocol::Console::ChannelLevel::Off;
- if (logChannel->state != WTFLogChannelState::Off) {
- switch (logChannel->level) {
- case WTFLogLevel::Always:
- case WTFLogLevel::Error:
- case WTFLogLevel::Warning:
- case WTFLogLevel::Info:
- level = Inspector::Protocol::Console::ChannelLevel::Basic;
- break;
- case WTFLogLevel::Debug:
- level = Inspector::Protocol::Console::ChannelLevel::Verbose;
- break;
- }
- }
-
- auto channel = Inspector::Protocol::Console::Channel::create()
- .setSource(channelTable[i].source)
- .setLevel(level)
- .release();
- channels->addItem(WTFMove(channel));
- }
-}
-
-static Optional<std::pair<WTFLogChannelState, WTFLogLevel>> channelConfigurationForString(const String& levelString)
-{
- WTFLogChannelState state;
- WTFLogLevel level;
-
- if (equalIgnoringASCIICase(levelString, "off")) {
- state = WTFLogChannelState::Off;
- level = WTFLogLevel::Error;
- } else {
- state = WTFLogChannelState::On;
- if (equalIgnoringASCIICase(levelString, "basic"))
- level = WTFLogLevel::Warning;
- else if (equalIgnoringASCIICase(levelString, "verbose"))
- level = WTFLogLevel::Debug;
- else
- return WTF::nullopt;
- }
-
- return { { state, level } };
-}
-
-void WebConsoleAgent::setLoggingChannelLevel(ErrorString& errorString, const String& channelName, const String& channelLevel)
-{
- auto* channel = getLogChannel(channelName.utf8().data());
- if (!channel) {
- errorString = "Logging channel not found"_s;
- return;
- }
-
- auto configuration = channelConfigurationForString(channelLevel);
- if (!configuration) {
- errorString = "Invalid logging level"_s;
- return;
- }
-
- channel->state = configuration.value().first;
- channel->level = configuration.value().second;
-}
-
void WebConsoleAgent::frameWindowDiscarded(DOMWindow* window)
{
for (auto& message : m_consoleMessages) {
Modified: trunk/Source/WebCore/inspector/agents/WebConsoleAgent.h (243327 => 243328)
--- trunk/Source/WebCore/inspector/agents/WebConsoleAgent.h 2019-03-21 21:06:35 UTC (rev 243327)
+++ trunk/Source/WebCore/inspector/agents/WebConsoleAgent.h 2019-03-21 21:15:29 UTC (rev 243328)
@@ -43,9 +43,6 @@
void frameWindowDiscarded(DOMWindow*);
- void getLoggingChannels(ErrorString&, RefPtr<JSON::ArrayOf<Inspector::Protocol::Console::Channel>>&) final;
- void setLoggingChannelLevel(ErrorString&, const String& channel, const String& level) final;
-
void didReceiveResponse(unsigned long requestIdentifier, const ResourceResponse&);
void didFailLoading(unsigned long requestIdentifier, const ResourceError&);
};
Modified: trunk/Source/WebCore/inspector/agents/page/PageConsoleAgent.cpp (243327 => 243328)
--- trunk/Source/WebCore/inspector/agents/page/PageConsoleAgent.cpp 2019-03-21 21:06:35 UTC (rev 243327)
+++ trunk/Source/WebCore/inspector/agents/page/PageConsoleAgent.cpp 2019-03-21 21:15:29 UTC (rev 243328)
@@ -42,9 +42,10 @@
using namespace Inspector;
-PageConsoleAgent::PageConsoleAgent(WebAgentContext& context)
+PageConsoleAgent::PageConsoleAgent(PageAgentContext& context)
: WebConsoleAgent(context)
, m_instrumentingAgents(context.instrumentingAgents)
+ , m_inspectedPage(context.inspectedPage)
{
}
@@ -56,4 +57,71 @@
WebConsoleAgent::clearMessages(errorString);
}
+void PageConsoleAgent::getLoggingChannels(ErrorString&, RefPtr<JSON::ArrayOf<Inspector::Protocol::Console::Channel>>& channels)
+{
+ static const struct ChannelTable {
+ NeverDestroyed<String> name;
+ Inspector::Protocol::Console::ChannelSource source;
+ } channelTable[] = {
+ { MAKE_STATIC_STRING_IMPL("WebRTC"), Inspector::Protocol::Console::ChannelSource::WebRTC },
+ { MAKE_STATIC_STRING_IMPL("Media"), Inspector::Protocol::Console::ChannelSource::Media },
+ { MAKE_STATIC_STRING_IMPL("MediaSource"), Inspector::Protocol::Console::ChannelSource::MediaSource },
+ };
+
+ channels = JSON::ArrayOf<Inspector::Protocol::Console::Channel>::create();
+
+ size_t length = WTF_ARRAY_LENGTH(channelTable);
+ for (size_t i = 0; i < length; ++i) {
+ auto* logChannel = getLogChannel(channelTable[i].name);
+ if (!logChannel)
+ return;
+
+ auto level = Inspector::Protocol::Console::ChannelLevel::Off;
+ if (logChannel->state != WTFLogChannelState::Off) {
+ switch (logChannel->level) {
+ case WTFLogLevel::Always:
+ case WTFLogLevel::Error:
+ case WTFLogLevel::Warning:
+ case WTFLogLevel::Info:
+ level = Inspector::Protocol::Console::ChannelLevel::Basic;
+ break;
+ case WTFLogLevel::Debug:
+ level = Inspector::Protocol::Console::ChannelLevel::Verbose;
+ break;
+ }
+ }
+
+ auto channel = Inspector::Protocol::Console::Channel::create()
+ .setSource(channelTable[i].source)
+ .setLevel(level)
+ .release();
+ channels->addItem(WTFMove(channel));
+ }
+}
+
+static Optional<std::pair<WTFLogChannelState, WTFLogLevel>> channelConfigurationForString(const String& levelString)
+{
+ if (equalIgnoringASCIICase(levelString, "off"))
+ return { { WTFLogChannelState::Off, WTFLogLevel::Error } };
+
+ if (equalIgnoringASCIICase(levelString, "basic"))
+ return { { WTFLogChannelState::On, WTFLogLevel::Info } };
+
+ if (equalIgnoringASCIICase(levelString, "verbose"))
+ return { { WTFLogChannelState::On, WTFLogLevel::Debug } };
+
+ return WTF::nullopt;
+}
+
+void PageConsoleAgent::setLoggingChannelLevel(ErrorString& errorString, const String& channelName, const String& channelLevel)
+{
+ auto configuration = channelConfigurationForString(channelLevel);
+ if (!configuration) {
+ errorString = "Invalid logging level"_s;
+ return;
+ }
+
+ m_inspectedPage.configureLoggingChannel(channelName, configuration.value().first, configuration.value().second);
+}
+
} // namespace WebCore
Modified: trunk/Source/WebCore/inspector/agents/page/PageConsoleAgent.h (243327 => 243328)
--- trunk/Source/WebCore/inspector/agents/page/PageConsoleAgent.h 2019-03-21 21:06:35 UTC (rev 243327)
+++ trunk/Source/WebCore/inspector/agents/page/PageConsoleAgent.h 2019-03-21 21:15:29 UTC (rev 243328)
@@ -40,13 +40,17 @@
WTF_MAKE_NONCOPYABLE(PageConsoleAgent);
WTF_MAKE_FAST_ALLOCATED;
public:
- PageConsoleAgent(WebAgentContext&);
+ PageConsoleAgent(PageAgentContext&);
virtual ~PageConsoleAgent() = default;
+ void getLoggingChannels(ErrorString&, RefPtr<JSON::ArrayOf<Inspector::Protocol::Console::Channel>>&) final;
+ void setLoggingChannelLevel(ErrorString&, const String& channel, const String& level) final;
+
private:
void clearMessages(ErrorString&) override;
InstrumentingAgents& m_instrumentingAgents;
+ Page& m_inspectedPage;
};
} // namespace WebCore
Modified: trunk/Source/WebCore/page/ChromeClient.h (243327 => 243328)
--- trunk/Source/WebCore/page/ChromeClient.h 2019-03-21 21:06:35 UTC (rev 243327)
+++ trunk/Source/WebCore/page/ChromeClient.h 2019-03-21 21:15:29 UTC (rev 243328)
@@ -45,6 +45,7 @@
#include "SearchPopupMenu.h"
#include "WebCoreKeyboardUIMode.h"
#include <_javascript_Core/ConsoleTypes.h>
+#include <wtf/Assertions.h>
#include <wtf/CompletionHandler.h>
#include <wtf/Forward.h>
#include <wtf/Seconds.h>
@@ -498,6 +499,8 @@
virtual void didCreateEditableImage(GraphicsLayer::EmbeddedViewID) { }
virtual void didDestroyEditableImage(GraphicsLayer::EmbeddedViewID) { }
+ virtual void configureLoggingChannel(const String&, WTFLogChannelState, WTFLogLevel) { }
+
protected:
virtual ~ChromeClient() = default;
};
Modified: trunk/Source/WebCore/page/Page.cpp (243327 => 243328)
--- trunk/Source/WebCore/page/Page.cpp 2019-03-21 21:06:35 UTC (rev 243327)
+++ trunk/Source/WebCore/page/Page.cpp 2019-03-21 21:15:29 UTC (rev 243328)
@@ -2910,4 +2910,20 @@
}
#endif
+void Page::configureLoggingChannel(const String& channelName, WTFLogChannelState state, WTFLogLevel level)
+{
+#if !RELEASE_LOG_DISABLED
+ if (auto* channel = getLogChannel(channelName)) {
+ channel->state = state;
+ channel->level = level;
+ }
+
+ chrome().client().configureLoggingChannel(channelName, state, level);
+#else
+ UNUSED_PARAM(channelName);
+ UNUSED_PARAM(state);
+ UNUSED_PARAM(level);
+#endif
+}
+
} // namespace WebCore
Modified: trunk/Source/WebCore/page/Page.h (243327 => 243328)
--- trunk/Source/WebCore/page/Page.h 2019-03-21 21:06:35 UTC (rev 243327)
+++ trunk/Source/WebCore/page/Page.h 2019-03-21 21:15:29 UTC (rev 243328)
@@ -42,6 +42,7 @@
#include "WheelEventTestTrigger.h"
#include <memory>
#include <pal/SessionID.h>
+#include <wtf/Assertions.h>
#include <wtf/Forward.h>
#include <wtf/Function.h>
#include <wtf/HashSet.h>
@@ -704,6 +705,8 @@
PerformanceLogging& performanceLogging() const { return *m_performanceLogging; }
+ void configureLoggingChannel(const String&, WTFLogChannelState, WTFLogLevel);
+
private:
struct Navigation {
RegistrableDomain domain;
Modified: trunk/Source/WebKit/ChangeLog (243327 => 243328)
--- trunk/Source/WebKit/ChangeLog 2019-03-21 21:06:35 UTC (rev 243327)
+++ trunk/Source/WebKit/ChangeLog 2019-03-21 21:15:29 UTC (rev 243328)
@@ -1,3 +1,59 @@
+2019-03-21 Eric Carlson <[email protected]>
+
+ Add UI process WebRTC runtime logging.
+ https://bugs.webkit.org/show_bug.cgi?id=196020
+ <rdar://problem/49071443>
+
+ Reviewed by Youenn Fablet.
+
+ * Platform/Logging.cpp:
+ (WebKit::getLogChannel): New.
+ * Platform/Logging.h:
+ * Shared/WebCoreArgumentCoders.h: Add coders for WTFLogChannelState and WTFLogLevel.
+
+ Add runtime logging.
+ * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
+ (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy):
+ (WebKit::UserMediaPermissionRequestManagerProxy::stopCapture):
+ (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged):
+ (WebKit::UserMediaPermissionRequestManagerProxy::clearCachedState):
+ (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied):
+ (WebKit::UserMediaPermissionRequestManagerProxy::denyRequest):
+ (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
+ (WebKit::UserMediaPermissionRequestManagerProxy::resetAccess):
+ (WebKit::UserMediaPermissionRequestManagerProxy::grantAccess):
+ (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
+ (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionRequest):
+ (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionInvalidRequest):
+ (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionValidRequest):
+ (WebKit::UserMediaPermissionRequestManagerProxy::computeFilteredDeviceList):
+ (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
+ (WebKit::UserMediaPermissionRequestManagerProxy::captureStateChanged):
+ (WebKit::UserMediaPermissionRequestManagerProxy::watchdogTimerFired):
+ (WebKit::UserMediaPermissionRequestManagerProxy::logChannel const):
+ (WebKit::convertEnumerationToString):
+
+ * UIProcess/UserMediaPermissionRequestManagerProxy.h:
+ (WTF::LogArgument<WebKit::UserMediaPermissionRequestManagerProxy::RequestAction>::toString):
+ * UIProcess/UserMediaPermissionRequestProxy.cpp:
+ (WebKit::convertEnumerationToString): Add an enum specialization for logging.
+
+ * UIProcess/UserMediaPermissionRequestProxy.h:
+ (WTF::LogArgument<WebKit::UserMediaPermissionRequestProxy::UserMediaAccessDenialReason>::toString): Ditto.
+
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::logger):
+ (WebKit::WebPageProxy::configureLoggingChannel):
+ * UIProcess/WebPageProxy.h:
+ * UIProcess/WebPageProxy.messages.in:
+
+ * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+ (WebKit::WebChromeClient::configureLoggingChannel):
+ * WebProcess/WebCoreSupport/WebChromeClient.h:
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::configureLoggingChannel):
+ * WebProcess/WebPage/WebPage.h:
+
2019-03-21 Alex Christensen <[email protected]>
Stop using LegacySync messages in WebPageProxy
Modified: trunk/Source/WebKit/Platform/Logging.cpp (243327 => 243328)
--- trunk/Source/WebKit/Platform/Logging.cpp 2019-03-21 21:06:35 UTC (rev 243327)
+++ trunk/Source/WebKit/Platform/Logging.cpp 2019-03-21 21:15:29 UTC (rev 243328)
@@ -55,6 +55,11 @@
WTFInitializeLogChannelStatesFromString(logChannels, logChannelCount, enabledChannelsString.utf8().data());
}
+WTFLogChannel* getLogChannel(const String& name)
+{
+ return WTFLogChannelByName(logChannels, logChannelCount, name.utf8().data());
+}
+
} // namespace WebKit
#endif // !LOG_DISABLED || !RELEASE_LOG_DISABLED
Modified: trunk/Source/WebKit/Platform/Logging.h (243327 => 243328)
--- trunk/Source/WebKit/Platform/Logging.h 2019-03-21 21:06:35 UTC (rev 243327)
+++ trunk/Source/WebKit/Platform/Logging.h 2019-03-21 21:15:29 UTC (rev 243328)
@@ -92,6 +92,10 @@
#undef DECLARE_LOG_CHANNEL
+namespace WebKit {
+WTFLogChannel* getLogChannel(const String&);
+} // namespace WebKit
+
#ifdef __cplusplus
}
#endif
Modified: trunk/Source/WebKit/Shared/WebCoreArgumentCoders.h (243327 => 243328)
--- trunk/Source/WebKit/Shared/WebCoreArgumentCoders.h 2019-03-21 21:06:35 UTC (rev 243327)
+++ trunk/Source/WebKit/Shared/WebCoreArgumentCoders.h 2019-03-21 21:15:29 UTC (rev 243328)
@@ -865,4 +865,25 @@
};
#endif
+template<> struct EnumTraits<WTFLogChannelState> {
+ using values = EnumValues<
+ WTFLogChannelState,
+ WTFLogChannelState::Off,
+ WTFLogChannelState::On,
+ WTFLogChannelState::OnWithAccumulation
+ >;
+};
+
+#undef Always
+template<> struct EnumTraits<WTFLogLevel> {
+ using values = EnumValues<
+ WTFLogLevel,
+ WTFLogLevel::Always,
+ WTFLogLevel::Error,
+ WTFLogLevel::Warning,
+ WTFLogLevel::Info,
+ WTFLogLevel::Debug
+ >;
+};
+
} // namespace WTF
Modified: trunk/Source/WebKit/UIProcess/UserMediaPermissionRequestManagerProxy.cpp (243327 => 243328)
--- trunk/Source/WebKit/UIProcess/UserMediaPermissionRequestManagerProxy.cpp 2019-03-21 21:06:35 UTC (rev 243327)
+++ trunk/Source/WebKit/UIProcess/UserMediaPermissionRequestManagerProxy.cpp 2019-03-21 21:15:29 UTC (rev 243328)
@@ -23,6 +23,7 @@
#include "APISecurityOrigin.h"
#include "APIUIClient.h"
#include "DeviceIdHashSaltStorage.h"
+#include "Logging.h"
#include "UserMediaPermissionRequestManager.h"
#include "UserMediaProcessManager.h"
#include "WebAutomationSession.h"
@@ -69,6 +70,10 @@
: m_page(page)
, m_rejectionTimer(RunLoop::main(), this, &UserMediaPermissionRequestManagerProxy::rejectionTimerFired)
, m_watchdogTimer(RunLoop::main(), this, &UserMediaPermissionRequestManagerProxy::watchdogTimerFired)
+#if !RELEASE_LOG_DISABLED
+ , m_logger(page.logger())
+ , m_logIdentifier(uniqueLogIdentifier())
+#endif
{
#if ENABLE(MEDIA_STREAM)
proxies().add(this);
@@ -95,6 +100,7 @@
void UserMediaPermissionRequestManagerProxy::stopCapture()
{
+ ALWAYS_LOG(LOGIDENTIFIER);
invalidatePendingRequests();
m_page.stopMediaCapture();
}
@@ -102,6 +108,7 @@
void UserMediaPermissionRequestManagerProxy::captureDevicesChanged()
{
#if ENABLE(MEDIA_STREAM)
+ ALWAYS_LOG(LOGIDENTIFIER);
if (!m_page.hasRunningProcess() || !m_page.mainFrame())
return;
@@ -122,6 +129,7 @@
void UserMediaPermissionRequestManagerProxy::clearCachedState()
{
+ ALWAYS_LOG(LOGIDENTIFIER);
invalidatePendingRequests();
}
@@ -155,6 +163,8 @@
if (!m_page.hasRunningProcess())
return;
+ ALWAYS_LOG(LOGIDENTIFIER, userMediaID, ", reason: ", reason);
+
auto request = m_pendingUserMediaRequests.take(userMediaID);
if (!request)
return;
@@ -169,6 +179,8 @@
{
ASSERT(m_page.hasRunningProcess());
+ ALWAYS_LOG(LOGIDENTIFIER, userMediaID, ", reason: ", reason);
+
#if ENABLE(MEDIA_STREAM)
m_page.process().send(Messages::WebPage::UserMediaAccessWasDenied(userMediaID, toWebCore(reason), invalidConstraint), m_page.pageID());
#else
@@ -185,6 +197,9 @@
return;
#if ENABLE(MEDIA_STREAM)
+ auto logSiteIdentifier = LOGIDENTIFIER;
+ ALWAYS_LOG(logSiteIdentifier, userMediaID, ", video: ", videoDevice ? videoDevice.label() : "", ", audio: ", audioDevice ? audioDevice.label() : " ");
+
auto request = m_pendingUserMediaRequests.take(userMediaID);
if (!request)
return;
@@ -191,12 +206,13 @@
auto& userMediaDocumentSecurityOrigin = request->userMediaDocumentSecurityOrigin();
auto& topLevelDocumentSecurityOrigin = request->topLevelDocumentSecurityOrigin();
- m_page.websiteDataStore().deviceIdHashSaltStorage().deviceIdHashSaltForOrigin(userMediaDocumentSecurityOrigin, topLevelDocumentSecurityOrigin, [this, weakThis = makeWeakPtr(*this), request = request.releaseNonNull()] (String&& deviceIDHashSalt) mutable {
+ m_page.websiteDataStore().deviceIdHashSaltStorage().deviceIdHashSaltForOrigin(userMediaDocumentSecurityOrigin, topLevelDocumentSecurityOrigin, [this, weakThis = makeWeakPtr(*this), request = request.releaseNonNull(), logSiteIdentifier] (String&& deviceIDHashSalt) mutable {
if (!weakThis)
return;
if (!grantAccess(request))
return;
+ ALWAYS_LOG(logSiteIdentifier, deviceIDHashSalt);
m_grantedRequests.append(WTFMove(request));
if (m_hasFilteredDeviceList)
captureDevicesChanged();
@@ -212,6 +228,7 @@
#if ENABLE(MEDIA_STREAM)
void UserMediaPermissionRequestManagerProxy::resetAccess(uint64_t frameID)
{
+ ALWAYS_LOG(LOGIDENTIFIER, frameID);
m_grantedRequests.removeAllMatching([frameID](const auto& grantedRequest) {
return grantedRequest->mainFrameID() == frameID;
});
@@ -272,6 +289,7 @@
bool UserMediaPermissionRequestManagerProxy::grantAccess(const UserMediaPermissionRequestProxy& request)
{
+ ALWAYS_LOG(LOGIDENTIFIER, request.userMediaID());
if (!UserMediaProcessManager::singleton().willCreateMediaStream(*this, request.hasAudioDevice(), request.hasVideoDevice())) {
denyRequest(request.userMediaID(), UserMediaPermissionRequestProxy::UserMediaAccessDenialReason::OtherFailure, "Unable to extend sandbox.");
return false;
@@ -322,7 +340,10 @@
void UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame(uint64_t userMediaID, uint64_t frameID, Ref<SecurityOrigin>&& userMediaDocumentOrigin, Ref<SecurityOrigin>&& topLevelDocumentOrigin, MediaStreamRequest&& userRequest)
{
#if ENABLE(MEDIA_STREAM)
+ auto logSiteIdentifier = LOGIDENTIFIER;
+
if (!UserMediaProcessManager::singleton().captureEnabled()) {
+ ALWAYS_LOG(logSiteIdentifier, "capture disabled");
m_pendingRejections.append(userMediaID);
scheduleNextRejection();
return;
@@ -331,11 +352,13 @@
if (!m_page.hasRunningProcess())
return;
+ ALWAYS_LOG(logSiteIdentifier, userMediaID);
+
auto request = m_pendingUserMediaRequests.add(userMediaID, UserMediaPermissionRequestProxy::create(*this, userMediaID, m_page.mainFrame()->frameID(), frameID, WTFMove(userMediaDocumentOrigin), WTFMove(topLevelDocumentOrigin), { }, { }, WTFMove(userRequest))).iterator->value.copyRef();
auto& userMediaOrigin = request->userMediaDocumentSecurityOrigin();
auto& topLevelOrigin = request->topLevelDocumentSecurityOrigin();
- getUserMediaPermissionInfo(frameID, userMediaOrigin, topLevelOrigin, [this, request = request.releaseNonNull()](Optional<bool> hasPersistentAccess) mutable {
+ getUserMediaPermissionInfo(frameID, userMediaOrigin, topLevelOrigin, [this, request = request.releaseNonNull(), logSiteIdentifier](Optional<bool> hasPersistentAccess) mutable {
if (!request->isPending())
return;
@@ -344,6 +367,7 @@
return;
}
+ ALWAYS_LOG(logSiteIdentifier, request->userMediaID(), ", persistent access: ", *hasPersistentAccess);
processUserMediaPermissionRequest(WTFMove(request), *hasPersistentAccess);
});
}
@@ -350,6 +374,8 @@
void UserMediaPermissionRequestManagerProxy::processUserMediaPermissionRequest(Ref<UserMediaPermissionRequestProxy>&& request, bool hasPersistentAccess)
{
+ ALWAYS_LOG(LOGIDENTIFIER, request->userMediaID());
+
if (hasPersistentAccess)
request->setHasPersistentAccess();
@@ -395,6 +421,7 @@
#if ENABLE(MEDIA_STREAM)
void UserMediaPermissionRequestManagerProxy::processUserMediaPermissionInvalidRequest(const UserMediaPermissionRequestProxy& request, const String& invalidConstraint)
{
+ ALWAYS_LOG(LOGIDENTIFIER, request.userMediaID());
bool filterConstraint = !request.hasPersistentAccess() && !wasGrantedVideoOrAudioAccess(request.frameID(), request.userMediaDocumentSecurityOrigin(), request.topLevelDocumentSecurityOrigin());
denyRequest(request.userMediaID(), UserMediaPermissionRequestProxy::UserMediaAccessDenialReason::InvalidConstraint, filterConstraint ? String { } : invalidConstraint);
@@ -402,6 +429,7 @@
void UserMediaPermissionRequestManagerProxy::processUserMediaPermissionValidRequest(Ref<UserMediaPermissionRequestProxy>&& request, Vector<CaptureDevice>&& audioDevices, Vector<CaptureDevice>&& videoDevices, String&& deviceIdentifierHashSalt)
{
+ ALWAYS_LOG(LOGIDENTIFIER, request->userMediaID(), ", video:, ", videoDevices.size(), " audio: ", audioDevices.size());
if (videoDevices.isEmpty() && audioDevices.isEmpty()) {
denyRequest(request->userMediaID(), UserMediaPermissionRequestProxy::UserMediaAccessDenialReason::NoConstraints, emptyString());
return;
@@ -412,6 +440,8 @@
request->setEligibleAudioDeviceUIDs(WTFMove(audioDevices));
auto action = ""
+ ALWAYS_LOG(LOGIDENTIFIER, request->userMediaID(), ", action: ", action);
+
if (action == RequestAction::Deny) {
denyRequest(request->userMediaID(), UserMediaPermissionRequestProxy::UserMediaAccessDenialReason::PermissionDenied, emptyString());
return;
@@ -430,6 +460,7 @@
if (m_page.isControlledByAutomation()) {
if (WebAutomationSession* automationSession = m_page.process().processPool().automationSession()) {
+ ALWAYS_LOG(LOGIDENTIFIER, request->userMediaID(), ", page controlled by automation");
if (automationSession->shouldAllowGetUserMediaForPage(m_page))
request->allow();
else
@@ -440,6 +471,7 @@
}
if (m_page.preferences().mockCaptureDevicesEnabled() && !m_page.preferences().mockCaptureDevicesPromptEnabled()) {
+ ALWAYS_LOG(LOGIDENTIFIER, request->userMediaID(), ", mock devices don't require prompt");
request->allow();
return;
}
@@ -541,6 +573,8 @@
}
m_hasFilteredDeviceList = !revealIdsAndLabels;
+
+ ALWAYS_LOG(LOGIDENTIFIER, filteredDevices.size(), " devices revealed");
return filteredDevices;
}
#endif
@@ -548,6 +582,8 @@
void UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame(uint64_t userMediaID, uint64_t frameID, Ref<SecurityOrigin>&& userMediaDocumentOrigin, Ref<SecurityOrigin>&& topLevelDocumentOrigin)
{
#if ENABLE(MEDIA_STREAM)
+ ALWAYS_LOG(LOGIDENTIFIER, userMediaID);
+
auto completionHandler = [this, userMediaID, frameID, userMediaDocumentOrigin = userMediaDocumentOrigin.copyRef(), topLevelDocumentOrigin = topLevelDocumentOrigin.copyRef()](Optional<bool> originHasPersistentAccess) mutable {
if (!originHasPersistentAccess)
return;
@@ -611,6 +647,7 @@
if (m_captureState == (newState & activeCaptureMask))
return;
+ ALWAYS_LOG(LOGIDENTIFIER, "state was: ", m_captureState, ", is now: ", newState & activeCaptureMask);
m_captureState = newState & activeCaptureMask;
Seconds interval;
@@ -622,6 +659,7 @@
if (interval == m_currentWatchdogInterval)
return;
+ ALWAYS_LOG(LOGIDENTIFIER, "watchdog set to ", interval.value());
m_currentWatchdogInterval = interval;
m_watchdogTimer.startOneShot(m_currentWatchdogInterval);
#endif
@@ -636,6 +674,7 @@
void UserMediaPermissionRequestManagerProxy::watchdogTimerFired()
{
+ ALWAYS_LOG(LOGIDENTIFIER);
m_grantedRequests.clear();
m_pregrantedRequests.clear();
m_currentWatchdogInterval = 0_s;
@@ -642,4 +681,30 @@
m_hasFilteredDeviceList = false;
}
+#if !RELEASE_LOG_DISABLED
+WTFLogChannel& UserMediaPermissionRequestManagerProxy::logChannel() const
+{
+ return WebKit2LogWebRTC;
+}
+
+const Logger& UserMediaPermissionRequestManagerProxy::logger() const
+{
+ return m_page.logger();
+}
+#endif
+
+String convertEnumerationToString(UserMediaPermissionRequestManagerProxy::RequestAction enumerationValue)
+{
+ static const NeverDestroyed<String> values[] = {
+ MAKE_STATIC_STRING_IMPL("Deny"),
+ MAKE_STATIC_STRING_IMPL("Grant"),
+ MAKE_STATIC_STRING_IMPL("Prompt"),
+ };
+ static_assert(static_cast<size_t>(UserMediaPermissionRequestManagerProxy::RequestAction::Deny) == 0, "UserMediaPermissionRequestManagerProxy::RequestAction::Deny is not 0 as expected");
+ static_assert(static_cast<size_t>(UserMediaPermissionRequestManagerProxy::RequestAction::Grant) == 1, "UserMediaPermissionRequestManagerProxy::RequestAction::Grant is not 1 as expected");
+ static_assert(static_cast<size_t>(UserMediaPermissionRequestManagerProxy::RequestAction::Prompt) == 2, "UserMediaPermissionRequestManagerProxy::RequestAction::Prompt is not 2 as expected");
+ ASSERT(static_cast<size_t>(enumerationValue) < WTF_ARRAY_LENGTH(values));
+ return values[static_cast<size_t>(enumerationValue)];
+}
+
} // namespace WebKit
Modified: trunk/Source/WebKit/UIProcess/UserMediaPermissionRequestManagerProxy.h (243327 => 243328)
--- trunk/Source/WebKit/UIProcess/UserMediaPermissionRequestManagerProxy.h 2019-03-21 21:06:35 UTC (rev 243327)
+++ trunk/Source/WebKit/UIProcess/UserMediaPermissionRequestManagerProxy.h 2019-03-21 21:15:29 UTC (rev 243328)
@@ -25,6 +25,7 @@
#include <WebCore/SecurityOrigin.h>
#include <wtf/CompletionHandler.h>
#include <wtf/HashMap.h>
+#include <wtf/LoggerHelper.h>
#include <wtf/RunLoop.h>
#include <wtf/Seconds.h>
#include <wtf/WeakPtr.h>
@@ -40,7 +41,12 @@
class WebPageProxy;
-class UserMediaPermissionRequestManagerProxy : public CanMakeWeakPtr<UserMediaPermissionRequestManagerProxy> {
+class UserMediaPermissionRequestManagerProxy
+ : public CanMakeWeakPtr<UserMediaPermissionRequestManagerProxy>
+#if !RELEASE_LOG_DISABLED
+ , private LoggerHelper
+#endif
+{
public:
explicit UserMediaPermissionRequestManagerProxy(WebPageProxy&);
~UserMediaPermissionRequestManagerProxy();
@@ -72,7 +78,20 @@
void captureStateChanged(WebCore::MediaProducer::MediaStateFlags oldState, WebCore::MediaProducer::MediaStateFlags newState);
void syncWithWebCorePrefs() const;
+ enum class RequestAction {
+ Deny,
+ Grant,
+ Prompt
+ };
+
private:
+#if !RELEASE_LOG_DISABLED
+ const Logger& logger() const final;
+ const void* logIdentifier() const final { return m_logIdentifier; }
+ const char* logClassName() const override { return "UserMediaPermissionRequestManagerProxy"; }
+ WTFLogChannel& logChannel() const final;
+#endif
+
Ref<UserMediaPermissionRequestProxy> createPermissionRequest(uint64_t userMediaID, uint64_t mainFrameID, uint64_t frameID, Ref<WebCore::SecurityOrigin>&& userMediaDocumentOrigin, Ref<WebCore::SecurityOrigin>&& topLevelDocumentOrigin, Vector<WebCore::CaptureDevice>&& audioDevices, Vector<WebCore::CaptureDevice>&& videoDevices, WebCore::MediaStreamRequest&&);
void denyRequest(uint64_t userMediaID, UserMediaPermissionRequestProxy::UserMediaAccessDenialReason, const String& invalidConstraint);
#if ENABLE(MEDIA_STREAM)
@@ -83,11 +102,6 @@
void getUserMediaPermissionInfo(uint64_t frameID, Ref<WebCore::SecurityOrigin>&& userMediaDocumentOrigin, Ref<WebCore::SecurityOrigin>&& topLevelDocumentOrigin, CompletionHandler<void(Optional<bool>)>&&);
- enum class RequestAction {
- Deny,
- Grant,
- Prompt
- };
RequestAction getRequestAction(const UserMediaPermissionRequestProxy&);
bool wasGrantedVideoOrAudioAccess(uint64_t, const WebCore::SecurityOrigin& userMediaDocumentOrigin, const WebCore::SecurityOrigin& topLevelDocumentOrigin);
@@ -125,8 +139,30 @@
WebCore::MediaProducer::MediaStateFlags m_captureState { WebCore::MediaProducer::IsNotPlaying };
RunLoop::Timer<UserMediaPermissionRequestManagerProxy> m_watchdogTimer;
Seconds m_currentWatchdogInterval;
+#if !RELEASE_LOG_DISABLED
+ Ref<const Logger> m_logger;
+ const void* m_logIdentifier;
+#endif
bool m_hasFilteredDeviceList { false };
};
+String convertEnumerationToString(UserMediaPermissionRequestManagerProxy::RequestAction);
+
} // namespace WebKit
+#if ENABLE(MEDIA_STREAM)
+namespace WTF {
+
+template<typename Type>
+struct LogArgument;
+
+template <>
+struct LogArgument<WebKit::UserMediaPermissionRequestManagerProxy::RequestAction> {
+ static String toString(const WebKit::UserMediaPermissionRequestManagerProxy::RequestAction type)
+ {
+ return convertEnumerationToString(type);
+ }
+};
+
+}; // namespace WTF
+#endif
Modified: trunk/Source/WebKit/UIProcess/UserMediaPermissionRequestProxy.cpp (243327 => 243328)
--- trunk/Source/WebKit/UIProcess/UserMediaPermissionRequestProxy.cpp 2019-03-21 21:06:35 UTC (rev 243327)
+++ trunk/Source/WebKit/UIProcess/UserMediaPermissionRequestProxy.cpp 2019-03-21 21:15:29 UTC (rev 243328)
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2014 Igalia S.L.
- * Copyright (C) 2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2016-2019 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -136,4 +136,26 @@
});
}
+String convertEnumerationToString(UserMediaPermissionRequestProxy::UserMediaAccessDenialReason enumerationValue)
+{
+ static const NeverDestroyed<String> values[] = {
+ MAKE_STATIC_STRING_IMPL("NoConstraints"),
+ MAKE_STATIC_STRING_IMPL("UserMediaDisabled"),
+ MAKE_STATIC_STRING_IMPL("NoCaptureDevices"),
+ MAKE_STATIC_STRING_IMPL("InvalidConstraint"),
+ MAKE_STATIC_STRING_IMPL("HardwareError"),
+ MAKE_STATIC_STRING_IMPL("PermissionDenied"),
+ MAKE_STATIC_STRING_IMPL("OtherFailure"),
+ };
+ static_assert(static_cast<size_t>(UserMediaPermissionRequestProxy::UserMediaAccessDenialReason::NoConstraints) == 0, "UserMediaPermissionRequestProxy::UserMediaAccessDenialReason::NoConstraints is not 0 as expected");
+ static_assert(static_cast<size_t>(UserMediaPermissionRequestProxy::UserMediaAccessDenialReason::UserMediaDisabled) == 1, "UserMediaPermissionRequestProxy::UserMediaAccessDenialReason::UserMediaDisabled is not 1 as expected");
+ static_assert(static_cast<size_t>(UserMediaPermissionRequestProxy::UserMediaAccessDenialReason::NoCaptureDevices) == 2, "UserMediaPermissionRequestProxy::UserMediaAccessDenialReason::NoCaptureDevices is not 2 as expected");
+ static_assert(static_cast<size_t>(UserMediaPermissionRequestProxy::UserMediaAccessDenialReason::InvalidConstraint) == 3, "UserMediaPermissionRequestProxy::UserMediaAccessDenialReason::InvalidConstraint is not 3 as expected");
+ static_assert(static_cast<size_t>(UserMediaPermissionRequestProxy::UserMediaAccessDenialReason::HardwareError) == 4, "UserMediaPermissionRequestProxy::UserMediaAccessDenialReason::HardwareError is not 4 as expected");
+ static_assert(static_cast<size_t>(UserMediaPermissionRequestProxy::UserMediaAccessDenialReason::PermissionDenied) == 5, "UserMediaPermissionRequestProxy::UserMediaAccessDenialReason::PermissionDenied is not 5 as expected");
+ static_assert(static_cast<size_t>(UserMediaPermissionRequestProxy::UserMediaAccessDenialReason::OtherFailure) == 6, "UserMediaPermissionRequestProxy::UserMediaAccessDenialReason::OtherFailure is not 6 as expected");
+ ASSERT(static_cast<size_t>(enumerationValue) < WTF_ARRAY_LENGTH(values));
+ return values[static_cast<size_t>(enumerationValue)];
+}
+
} // namespace WebKit
Modified: trunk/Source/WebKit/UIProcess/UserMediaPermissionRequestProxy.h (243327 => 243328)
--- trunk/Source/WebKit/UIProcess/UserMediaPermissionRequestProxy.h 2019-03-21 21:06:35 UTC (rev 243327)
+++ trunk/Source/WebKit/UIProcess/UserMediaPermissionRequestProxy.h 2019-03-21 21:15:29 UTC (rev 243328)
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2014 Igalia S.L.
- * Copyright (C) 2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2016-2019 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -100,4 +100,22 @@
String m_deviceIdentifierHashSalt;
};
+String convertEnumerationToString(UserMediaPermissionRequestProxy::UserMediaAccessDenialReason);
+
} // namespace WebKit
+
+namespace WTF {
+
+template<typename Type>
+struct LogArgument;
+
+template <>
+struct LogArgument<WebKit::UserMediaPermissionRequestProxy::UserMediaAccessDenialReason> {
+ static String toString(const WebKit::UserMediaPermissionRequestProxy::UserMediaAccessDenialReason type)
+ {
+ return convertEnumerationToString(type);
+ }
+};
+
+}; // namespace WTF
+
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (243327 => 243328)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2019-03-21 21:06:35 UTC (rev 243327)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2019-03-21 21:15:29 UTC (rev 243328)
@@ -798,6 +798,9 @@
m_process = WTFMove(process);
m_websiteDataStore = m_process->websiteDataStore();
+ if (m_logger)
+ m_logger->setEnabled(this, isAlwaysOnLoggingAllowed());
+
ASSERT(!m_drawingArea);
setDrawingArea(WTFMove(drawingArea));
ASSERT(!m_mainFrame);
@@ -8946,6 +8949,32 @@
m_process->connection()->sendWithAsyncReply(Messages::WebPage::FocusTextInputContext(context), WTFMove(completionHandler), m_pageID);
}
+Logger& WebPageProxy::logger()
+{
+ if (!m_logger) {
+ m_logger = Logger::create(this);
+ m_logger->setEnabled(this, isAlwaysOnLoggingAllowed());
+ }
+
+ return *m_logger;
+}
+
+void WebPageProxy::configureLoggingChannel(const String& channelName, WTFLogChannelState state, WTFLogLevel level)
+{
+#if !RELEASE_LOG_DISABLED
+ auto* channel = getLogChannel(channelName);
+ if (!channel)
+ return;
+
+ channel->state = state;
+ channel->level = level;
+#else
+ UNUSED_PARAM(channelName);
+ UNUSED_PARAM(state);
+ UNUSED_PARAM(level);
+#endif
+}
+
} // namespace WebKit
#undef MERGE_WHEEL_EVENTS
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.h (243327 => 243328)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.h 2019-03-21 21:06:35 UTC (rev 243327)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h 2019-03-21 21:15:29 UTC (rev 243328)
@@ -95,6 +95,7 @@
#include <wtf/CompletionHandler.h>
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
+#include <wtf/Logger.h>
#include <wtf/MonotonicTime.h>
#include <wtf/Optional.h>
#include <wtf/ProcessID.h>
@@ -1500,6 +1501,8 @@
void speechSynthesisResume(CompletionHandler<void()>&&);
#endif
+ void configureLoggingChannel(const String&, WTFLogChannelState, WTFLogLevel);
+
void addObserver(WebViewDidMoveToWindowObserver&);
void removeObserver(WebViewDidMoveToWindowObserver&);
void webViewDidMoveToWindow();
@@ -1508,6 +1511,8 @@
WEBPAGEPROXY_LOADOPTIMIZER_ADDITIONS_1
#endif
+ Logger& logger();
+
// IPC::MessageReceiver
// Implemented in generated WebPageProxyMessageReceiver.cpp
void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override;
@@ -2458,7 +2463,9 @@
#endif
HashMap<WebViewDidMoveToWindowObserver*, WeakPtr<WebViewDidMoveToWindowObserver>> m_webViewDidMoveToWindowObservers;
-
+
+ mutable RefPtr<Logger> m_logger;
+
#if ENABLE(SPEECH_SYNTHESIS)
struct SpeechSynthesisData {
std::unique_ptr<WebCore::PlatformSpeechSynthesizer> synthesizer;
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in (243327 => 243328)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in 2019-03-21 21:06:35 UTC (rev 243327)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in 2019-03-21 21:15:29 UTC (rev 243328)
@@ -558,4 +558,6 @@
SpeechSynthesisPause() -> () Async
SpeechSynthesisResume() -> () Async
#endif
+
+ ConfigureLoggingChannel(String channelName, enum:uint8_t WTFLogChannelState state, enum:uint8_t WTFLogLevel level)
}
Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp (243327 => 243328)
--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp 2019-03-21 21:06:35 UTC (rev 243327)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp 2019-03-21 21:15:29 UTC (rev 243328)
@@ -1325,4 +1325,9 @@
}
#endif
+void WebChromeClient::configureLoggingChannel(const String& channelName, WTFLogChannelState state, WTFLogLevel level)
+{
+ m_page.configureLoggingChannel(channelName, state, level);
+}
+
} // namespace WebKit
Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h (243327 => 243328)
--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h 2019-03-21 21:06:35 UTC (rev 243327)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h 2019-03-21 21:15:29 UTC (rev 243328)
@@ -370,6 +370,8 @@
void shouldAllowDeviceOrientationAndMotionAccess(WebCore::Frame&, CompletionHandler<void(bool)>&&) final;
#endif
+ void configureLoggingChannel(const String&, WTFLogChannelState, WTFLogLevel) final;
+
String m_cachedToolTip;
mutable RefPtr<WebFrame> m_cachedFrameSetLargestFrame;
mutable bool m_cachedMainFrameHasHorizontalScrollbar { false };
Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (243327 => 243328)
--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2019-03-21 21:06:35 UTC (rev 243327)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2019-03-21 21:15:29 UTC (rev 243328)
@@ -6608,6 +6608,11 @@
}());
}
+void WebPage::configureLoggingChannel(const String& channelName, WTFLogChannelState state, WTFLogLevel level)
+{
+ send(Messages::WebPageProxy::ConfigureLoggingChannel(channelName, state, level));
+}
+
} // namespace WebKit
#undef RELEASE_LOG_IF_ALLOWED
Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.h (243327 => 243328)
--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.h 2019-03-21 21:06:35 UTC (rev 243327)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.h 2019-03-21 21:15:29 UTC (rev 243328)
@@ -1164,6 +1164,8 @@
void suspendAllMediaBuffering();
void resumeAllMediaBuffering();
+ void configureLoggingChannel(const String&, WTFLogChannelState, WTFLogLevel);
+
#if ENABLE(APPLE_PAY)
WebPaymentCoordinator* paymentCoordinator();
#endif