-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Migrate HTML media/video element logs to efficient version #46881
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
base: main
Are you sure you want to change the base?
Migrate HTML media/video element logs to efficient version #46881
Conversation
EWS run on previous version of this PR (hash c0510b1) |
c0510b1
to
8a67724
Compare
EWS run on previous version of this PR (hash 8a67724) |
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.
Is there a possibility to update LoggerHelper
log
, logVerbose
... implementation to fix the potential inefficiencies?
@@ -319,7 +319,7 @@ bool HTMLVideoElement::shouldDisplayPosterImage() const | |||
|
|||
void HTMLVideoElement::mediaPlayerFirstVideoFrameAvailable() | |||
{ | |||
ALWAYS_LOG(LOGIDENTIFIER, "m_showPoster = ", showPosterFlag()); | |||
HTMLVIDEOELEMENT_RELEASE_LOG(HTMLVIDEOELEMENT_MEDIAPLAYERFIRSTVIDEOFRAMEAVAILABLE, showPosterFlag()); |
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.
This is rather verbose, is there a way we could make things shorter somehow?
Can we use __FILE__
and __func__
?
Also we have twice the HTMLVIDEOELEMENT_
, maybe we could have it only once?
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.
That is a good point! I will look closer into this.
Thanks for reviewing!
@@ -9441,7 +9440,7 @@ void HTMLMediaElement::visibilityAdjustmentStateDidChange() | |||
void HTMLMediaElement::sceneIdentifierDidChange() | |||
{ | |||
if (RefPtr page = document().page()) { | |||
ALWAYS_LOG(LOGIDENTIFIER, page->sceneIdentifier()); | |||
HTMLMEDIAELEMENT_RELEASE_LOG(HTMLMEDIAELEMENT_SCENEIDENTIFIERDIDCHANGE, page->sceneIdentifier().utf8().data()); |
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.
It is somehow unfortunate to have to call utf8 here?
Ideally, we would do it like ALWAYS_LOG, not sure whether feasible.
@@ -3194,7 +3193,7 @@ void HTMLMediaElement::setReadyState(MediaPlayer::ReadyState state) | |||
|
|||
m_tracksAreReady = tracksAreReady; | |||
|
|||
ALWAYS_LOG(LOGIDENTIFIER, "new state = ", state, ", current state = ", m_readyState); | |||
HTMLMEDIAELEMENT_RELEASE_LOG(HTMLMEDIAELEMENT_SETREADYSTATE, convertEnumerationToString(state).utf8().data(), convertEnumerationToString(m_readyState).utf8().data()); |
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.
Ideally, we would do the conversion if we are actually logging.
ALWAYS_LOG / Logger::logAlwaysVerbose
will do the conversion only if willLog
will return true.
We are losing some efficiency here.
8a67724
to
d9afc86
Compare
EWS run on previous version of this PR (hash d9afc86) |
d9afc86
to
48cacdb
Compare
EWS run on previous version of this PR (hash 48cacdb) |
48cacdb
to
a2f8b00
Compare
EWS run on previous version of this PR (hash a2f8b00) |
a2f8b00
to
14ab8c6
Compare
EWS run on previous version of this PR (hash 14ab8c6) |
14ab8c6
to
7dba585
Compare
EWS run on previous version of this PR (hash 7dba585) |
7dba585
to
b331d17
Compare
EWS run on previous version of this PR (hash b331d17) |
https://bugs.webkit.org/show_bug.cgi?id=294648 rdar://153696898 Reviewed by NOBODY (OOPS!). Migrate HTML media/video element logs to efficient version for log forwarding. * Source/WebCore/html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::prepareForLoad): (WebCore::HTMLMediaElement::selectMediaResource): (WebCore::HTMLMediaElement::setNetworkState): (WebCore::HTMLMediaElement::setReadyState): (WebCore::HTMLMediaElement::setPlaybackRate): (WebCore::HTMLMediaElement::pause): (WebCore::HTMLMediaElement::pauseInternal): (WebCore::HTMLMediaElement::setVolume): (WebCore::HTMLMediaElement::setMutedInternal): (WebCore::HTMLMediaElement::removeAudioTrack): (WebCore::HTMLMediaElement::scheduleConfigureTextTracks): (WebCore::HTMLMediaElement::mediaPlayerDurationChanged): (WebCore::HTMLMediaElement::mediaPlayerSizeChanged): (WebCore::HTMLMediaElement::scheduleMediaEngineWasUpdated): (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged): (WebCore::HTMLMediaElement::setAutoplayEventPlaybackState): (WebCore::HTMLMediaElement::sceneIdentifierDidChange): (WebCore::HTMLMediaElement::setShowPosterFlag): * Source/WebCore/html/HTMLVideoElement.cpp: (WebCore::HTMLVideoElement::scheduleResizeEvent): (WebCore::HTMLVideoElement::mediaPlayerFirstVideoFrameAvailable): * Source/WebCore/platform/LogMessages.in:
b331d17
to
dfa213d
Compare
EWS run on current version of this PR (hash dfa213d) |
dfa213d
dfa213d