Bug 1919123 - part2 : ensure EME information is captured by markers as well. r=media-playback-reviewers,padenot

Differential Revision: https://phabricator.services.mozilla.com/D222566
This commit is contained in:
alwu
2024-09-24 19:12:25 +00:00
parent e4d4c60203
commit c6f4c143f3
6 changed files with 151 additions and 101 deletions

View File

@@ -34,6 +34,7 @@
#include "MediaError.h"
#include "MediaManager.h"
#include "MediaMetadataManager.h"
#include "MediaProfilerMarkers.h"
#include "MediaResource.h"
#include "MediaShutdownManager.h"
#include "MediaSourceDecoder.h"
@@ -7056,6 +7057,15 @@ void HTMLMediaElement::MakeAssociationWithCDMResolved() {
// 5.6 Resolve promise.
mSetMediaKeysDOMPromise->MaybeResolveWithUndefined();
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());
}
}
bool HTMLMediaElement::TryMakeAssociationWithCDM(CDMProxy* aProxy) {
@@ -7221,6 +7231,10 @@ void HTMLMediaElement::DispatchEncrypted(const nsTArray<uint8_t>& aInitData,
RefPtr<AsyncEventDispatcher> asyncDispatcher =
new AsyncEventDispatcher(this, event.forget());
asyncDispatcher->PostDOMEvent();
if (profiler_is_collecting_markers()) {
nsPrintfCString markerName{"%p:encrypted", this};
PROFILER_MARKER_UNTYPED(markerName, MEDIA_PLAYBACK);
}
}
bool HTMLMediaElement::IsEventAttributeNameInternal(nsAtom* aName) {