-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Grab stats and libwebrtc logs from WebInspector directly #24330
Grab stats and libwebrtc logs from WebInspector directly #24330
Conversation
EWS run on previous version of this PR (hash 246987f) |
246987f
to
1151853
Compare
EWS run on previous version of this PR (hash 1151853) |
1151853
to
ea27326
Compare
EWS run on previous version of this PR (hash ea27326) |
ea27326
to
19de337
Compare
EWS run on previous version of this PR (hash 19de337) |
19de337
to
a7fc526
Compare
EWS run on previous version of this PR (hash a7fc526) |
a7fc526
to
a388c40
Compare
EWS run on previous version of this PR (hash a388c40) |
i realize this is still in draft, but just wanted to give you a heads up on a few things :) the Console API is (somewhat) standardized, so if you want to add something to also, generally speaking it's strongly preferred (and potentially actually required) that all for what it's worth, this is why Web Inspector (as well as developer tooling in most other browsers) has special functions that are exposed when evaluating in the Console (e.g. the Console Command Line API), as that's a way of ensuring that the new functionality is only exposed within Web Inspector and initiated by the developer (since the page cannot access any of the specially exposed functions). i would strongly suggest considering this approach as it does require any sort of standardization and will not undesirably expose anything about Web Inspector |
@dcrousso, thanks for looking into this. |
a388c40
to
2f5589f
Compare
EWS run on previous version of this PR (hash 2f5589f) |
2f5589f
to
4dcb75e
Compare
EWS run on previous version of this PR (hash 4dcb75e) |
4dcb75e
to
4bf0d09
Compare
EWS run on previous version of this PR (hash 4bf0d09) |
4bf0d09
to
be4ef99
Compare
EWS run on previous version of this PR (hash be4ef99) |
be4ef99
to
48ba0a8
Compare
EWS run on previous version of this PR (hash 48ba0a8) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r+ given Devin's previous reviews
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me for the Web Inspector bits. thanks for iterating on this with me :)
@@ -189,6 +189,8 @@ if (inspectedGlobalObject.document && inspectedGlobalObject.Node) { | |||
}; | |||
} | |||
|
|||
CommandLineAPI.methods["gatherRTCLogs"] = function() { return CommandLineAPIHost.gatherRTCLogs(arguments[0]); }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we may want to conditionalize this just in case ENABLE_WEB_RTC
is false
so either this
if (CommandLineAPIHost.gatherRTCLogs) {
CommandLineAPI.methods["gatherRTCLogs"] = function(callback) {
return CommandLineAPIHost.gatherRTCLogs(callback);
};
}
or this
CommandLineAPI.methods["gatherRTCLogs"] = function(callback) {
return CommandLineAPIHost.gatherRTCLogs?.(callback);
};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
48ba0a8
to
6fdacdd
Compare
EWS run on current version of this PR (hash 6fdacdd) |
rdar://122803271 https://bugs.webkit.org/show_bug.cgi?id=269196 Reviewed by Eric Carlson and Devin Rousso. To help web developpers, it is convenient to get access to WebRTC stats and logs. We add a Web Inspector new function that allows to pass a JS callback to get those logs. This can be extended in the future to rtc event logs as well. This new function is called gatherRTCLogs and is only available in Web Inspector command line. * LayoutTests/http/tests/inspector/gatherWebInspectorRTCLogs-expected.txt: Added. * LayoutTests/http/tests/inspector/gatherWebInspectorRTCLogs.html: Added. * LayoutTests/platform/glib/TestExpectations: * LayoutTests/platform/mac-wk1/TestExpectations: * Source/ThirdParty/libwebrtc/Configurations/libwebrtc.exp: * Source/WebCore/CMakeLists.txt: * Source/WebCore/DerivedSources-input.xcfilelist: * Source/WebCore/DerivedSources-output.xcfilelist: * Source/WebCore/DerivedSources.make: * Source/WebCore/Modules/mediastream/PeerConnectionBackend.h: (WebCore::PeerConnectionBackend::startGatheringStatLogs): (WebCore::PeerConnectionBackend::stopGatheringStatLogs): * Source/WebCore/Modules/mediastream/RTCController.cpp: (WebCore::RTCController::RTCController): (WebCore::RTCController::~RTCController): (WebCore::RTCController::add): (WebCore::RTCController::startGatheringLogs): (WebCore::RTCController::stopGatheringLogs): (WebCore::RTCController::startGatheringStatLogs): (WebCore::RTCController::stopLoggingLibWebRTCLogs): * Source/WebCore/Modules/mediastream/RTCController.h: * Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp: (WebCore::RTCPeerConnection::startGatheringStatLogs): (WebCore::RTCPeerConnection::stopGatheringStatLogs): * Source/WebCore/Modules/mediastream/RTCPeerConnection.h: * Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::RTCStatsLogger::toJSONString const): (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered): (WebCore::LibWebRTCMediaEndpoint::statsLogInterval const): (WebCore::LibWebRTCMediaEndpoint::startRTCLogs): (WebCore::LibWebRTCMediaEndpoint::stopRTCLogs): * Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h: * Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::LibWebRTCPeerConnectionBackend::startGatheringStatLogs): (WebCore::LibWebRTCPeerConnectionBackend::stopGatheringStatLogs): (WebCore::LibWebRTCPeerConnectionBackend::provideStatLogs): * Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h: * Source/WebCore/Sources.txt: * Source/WebCore/WebCore.xcodeproj/project.pbxproj: * Source/WebCore/dom/Document.cpp: (WebCore::Document::startGatheringRTCLogs): (WebCore::Document::stopGatheringRTCLogs): * Source/WebCore/dom/Document.h: * Source/WebCore/inspector/CommandLineAPIHost.cpp: (WebCore::CommandLineAPIHost::gatherRTCLogs): * Source/WebCore/inspector/CommandLineAPIHost.h: * Source/WebCore/inspector/CommandLineAPIHost.idl: * Source/WebCore/inspector/CommandLineAPIModuleSource.js: (injectModule): * Source/WebCore/inspector/RTCLogsCallback.h: Added. * Source/WebCore/inspector/RTCLogsCallback.idl: Added. * Source/WebCore/platform/SourcesLibWebRTC.txt: * Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCLogSink.cpp: Added. (WebCore::LibWebRTCLogSink::LibWebRTCLogSink): (WebCore::LibWebRTCLogSink::~LibWebRTCLogSink): (WebCore::toWebRTCLogLevel): (WebCore::LibWebRTCLogSink::logMessage): (WebCore::LibWebRTCLogSink::start): (WebCore::LibWebRTCLogSink::stop): * Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCLogSink.h: Added. * Source/WebInspectorUI/UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js: (WI.JavaScriptRuntimeCompletionProvider.get _commandLineAPIKeys): Canonical link: https://commits.webkit.org/274946@main
6fdacdd
to
7533deb
Compare
Committed 274946@main (7533deb): https://commits.webkit.org/274946@main Reviewed commits have been landed. Closing PR #24330 and removing active labels. |
7533deb
6fdacdd