Add UI process WebRTC runtime logging.
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Mar 2019 21:15:29 +0000 (21:15 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Mar 2019 21:15:29 +0000 (21:15 +0000)
commite05c74dd92d86f68b49e75200f9ba9caede71a99
tree08040cbc6e7e56faef4939ccc9b336cdbbd5b702
parent3dd9a13a3bf90aba80e929960d092fd8680c9742
Add UI process WebRTC runtime logging.
https://bugs.webkit.org/show_bug.cgi?id=196020
<rdar://problem/49071443>

Reviewed by Youenn Fablet.

Source/WebCore:

* 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:

Source/WebKit:

* 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:

Source/WTF:

* wtf/Logger.h:
(WTF::LogArgument::toString): Add long long and unsigned long long variants.

LayoutTests:

* inspector/console/webcore-logging.html:
* inspector/console/webcore-logging-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243328 268f45cc-cd09-0410-ab3c-d52691b4dbfc
28 files changed:
LayoutTests/ChangeLog
LayoutTests/inspector/console/webcore-logging-expected.txt
LayoutTests/inspector/console/webcore-logging.html
Source/WTF/ChangeLog
Source/WTF/wtf/Logger.h
Source/WebCore/ChangeLog
Source/WebCore/inspector/agents/WebConsoleAgent.cpp
Source/WebCore/inspector/agents/WebConsoleAgent.h
Source/WebCore/inspector/agents/page/PageConsoleAgent.cpp
Source/WebCore/inspector/agents/page/PageConsoleAgent.h
Source/WebCore/page/ChromeClient.h
Source/WebCore/page/Page.cpp
Source/WebCore/page/Page.h
Source/WebKit/ChangeLog
Source/WebKit/Platform/Logging.cpp
Source/WebKit/Platform/Logging.h
Source/WebKit/Shared/WebCoreArgumentCoders.h
Source/WebKit/UIProcess/UserMediaPermissionRequestManagerProxy.cpp
Source/WebKit/UIProcess/UserMediaPermissionRequestManagerProxy.h
Source/WebKit/UIProcess/UserMediaPermissionRequestProxy.cpp
Source/WebKit/UIProcess/UserMediaPermissionRequestProxy.h
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/UIProcess/WebPageProxy.h
Source/WebKit/UIProcess/WebPageProxy.messages.in
Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp
Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h
Source/WebKit/WebProcess/WebPage/WebPage.cpp
Source/WebKit/WebProcess/WebPage/WebPage.h