Bug 1919123 - part6 : add markers to show load details. r=media-playback-reviewers,aosmond

Differential Revision: https://phabricator.services.mozilla.com/D222895
This commit is contained in:
alwu
2024-09-24 19:12:26 +00:00
parent d615012f9a
commit 2674ede387
2 changed files with 38 additions and 0 deletions

View File

@@ -2695,6 +2695,13 @@ void HTMLMediaElement::SelectResource() {
if (NS_SUCCEEDED(rv)) {
LOG(LogLevel::Debug, ("%p Trying load from src=%s", this,
NS_ConvertUTF16toUTF8(src).get()));
if (profiler_is_collecting_markers()) {
nsPrintfCString markerName{"%p:mozloadresource", this};
profiler_add_marker(markerName, geckoprofiler::category::MEDIA_PLAYBACK,
{}, LoadSourceMarker{}, nsString{src}, nsString{},
nsString{});
}
NS_ASSERTION(
!mIsLoadingFromSourceChildren,
"Should think we're not loading from source children by default");
@@ -2975,6 +2982,13 @@ void HTMLMediaElement::LoadFromSourceChildren() {
NS_ConvertUTF16toUTF8(src).get(), NS_ConvertUTF16toUTF8(type).get(),
NS_ConvertUTF16toUTF8(media).get()));
if (profiler_is_collecting_markers()) {
nsPrintfCString markerName{"%p:mozloadresource", this};
profiler_add_marker(markerName, geckoprofiler::category::MEDIA_PLAYBACK,
{}, LoadSourceMarker{}, nsString{src}, nsString{type},
nsString{media});
}
nsCOMPtr<nsIURI> uri;
NewURIFromString(src, getter_AddRefs(uri));
if (!uri) {