Bug 1923774 - handle the case for removing media key. r=media-playback-reviewers,chunmin

Differential Revision: https://phabricator.services.mozilla.com/D225161
This commit is contained in:
alwu
2024-10-10 18:12:52 +00:00
parent 7143f87381
commit 737d334301

View File

@@ -7156,12 +7156,17 @@ void HTMLMediaElement::MakeAssociationWithCDMResolved() {
mSetMediaKeysDOMPromise = nullptr;
if (profiler_is_collecting_markers()) {
nsString keySystem;
mMediaKeys->GetKeySystem(keySystem);
profiler_add_marker(nsPrintfCString("%p:mozcdmresolved", this),
geckoprofiler::category::MEDIA_PLAYBACK, {},
CDMResolvedMarker{}, keySystem,
mMediaKeys->GetMediaKeySystemConfigurationString());
if (mMediaKeys) {
nsString keySystem;
mMediaKeys->GetKeySystem(keySystem);
profiler_add_marker(nsPrintfCString("%p:mozcdmresolved", this),
geckoprofiler::category::MEDIA_PLAYBACK, {},
CDMResolvedMarker{}, keySystem,
mMediaKeys->GetMediaKeySystemConfigurationString());
} else {
nsPrintfCString markerName{"%p:mozremovemediakey", this};
PROFILER_MARKER_UNTYPED(markerName, MEDIA_PLAYBACK);
}
}
}