Bug 1776796 - Rename MarkAsContentSource r=media-playback-reviewers,alwu

`HTMLMediaElement::MarkAsContentSource` [1] was added in Bug 1299718 to
monitor the visibility / invisibility of various usage of video element.
However, that telemetry had been removed in Bug 1356046.
`MarkAsContentSource` is only used for logging currently. It's better to
reword its name and related comments to bring the code in line with the
current status.

[1] https://searchfox.org/mozilla-central/rev/5b2d2863bd315f232a3f769f76e0eb16cdca7cb0/dom/html/HTMLMediaElement.h#799

Differential Revision: https://phabricator.services.mozilla.com/D150434
This commit is contained in:
Chun-Min Chang
2022-07-27 00:20:45 +00:00
parent a0bed0e91b
commit 5bd99e209b
4 changed files with 13 additions and 15 deletions

View File

@@ -3803,7 +3803,7 @@ already_AddRefed<DOMMediaStream> HTMLMediaElement::CaptureStreamInternal(
MediaTrackGraph* aGraph) {
MOZ_ASSERT(CanBeCaptured(aStreamCaptureType));
MarkAsContentSource(CallerAPI::CAPTURE_STREAM);
LogVisibility(CallerAPI::CAPTURE_STREAM);
MarkAsTainted();
if (mTracksCaptured.Ref() &&
@@ -7291,18 +7291,15 @@ void HTMLMediaElement::NotifyCueDisplayStatesChanged() {
mTextTrackManager->DispatchUpdateCueDisplay();
}
void HTMLMediaElement::MarkAsContentSource(CallerAPI aAPI) {
void HTMLMediaElement::LogVisibility(CallerAPI aAPI) {
const bool isVisible = mVisibilityState == Visibility::ApproximatelyVisible;
LOG(LogLevel::Debug,
("%p Log VIDEO_AS_CONTENT_SOURCE: visibility = %u, API: '%d' and 'All'",
this, isVisible, static_cast<int>(aAPI)));
LOG(LogLevel::Debug, ("%p visibility = %u, API: '%d' and 'All'", this,
isVisible, static_cast<int>(aAPI)));
if (!isVisible) {
LOG(LogLevel::Debug,
("%p Log VIDEO_AS_CONTENT_SOURCE_IN_TREE_OR_NOT: inTree = %u, API: "
"'%d' and 'All'",
this, IsInComposedDoc(), static_cast<int>(aAPI)));
LOG(LogLevel::Debug, ("%p inTree = %u, API: '%d' and 'All'", this,
IsInComposedDoc(), static_cast<int>(aAPI)));
}
}