Files
Sandor Molnar 93c2d8bfca Revert "Bug 1972836 - Remove lateWrites r=dthayer" for causing mochitest failures @ test_notification_crossorigin_iframe.html
This reverts commit d62c33a0e8.

Revert "Bug 1972836 - Migrate main ping startup io figures r=TravisLong"

This reverts commit b73a0d5f23.

Revert "Bug 1972836 - Migrate failedProfileLockCount to Glean r=mossop,jhirsch,profiles-reviewers"

This reverts commit 835b6affbd.

Revert "Bug 1972836 - Migrate AddonManager simpleMeasurements to Glean r=TravisLong"

This reverts commit 2bf4324c94.

Revert "Bug 1972836 - Add global startup timeline instrumentation r=TravisLong,extension-reviewers,sessionstore-reviewers,firefox-desktop-core-reviewers ,sfoster,robwu"

This reverts commit 223c4696f1.

Revert "Bug 1972836 - Migrate browser timeline probes to Glean r=TravisLong,firefox-desktop-core-reviewers"

This reverts commit 110be71b34.

Revert "Bug 1972836 - Migrate sessionstore timeline probes to Glean r=TravisLong,sessionstore-reviewers,sfoster"

This reverts commit 432e582561.

Revert "Bug 1972836 - Migrate extensions timeline probes to Glean r=TravisLong,robwu"

This reverts commit e1f34dcb09.

Revert "Bug 1972836 - Migrate startup timeline to Glean r=TravisLong"

This reverts commit b320f56f4d.

Revert "Bug 1972836 - Migrate 'main' ping session info to Glean r=TravisLong"

This reverts commit a5fd38a201.
2025-07-16 16:54:58 +00:00

61 lines
1.8 KiB
C++

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "StartupTimeline.h"
#include "mozilla/glean/StartupMetrics.h"
#include "mozilla/TimeStamp.h"
#include "nsXULAppAPI.h"
namespace mozilla {
TimeStamp StartupTimeline::sStartupTimeline[StartupTimeline::MAX_EVENT_ID];
const char*
StartupTimeline::sStartupTimelineDesc[StartupTimeline::MAX_EVENT_ID] = {
#define mozilla_StartupTimeline_Event(ev, desc) desc,
#include "StartupTimeline.h"
#undef mozilla_StartupTimeline_Event
};
} /* namespace mozilla */
using mozilla::StartupTimeline;
using mozilla::TimeStamp;
/**
* The XRE_StartupTimeline_Record function is to be used by embedding
* applications that can't use mozilla::StartupTimeline::Record() directly.
*
* @param aEvent The event to be recorded, must correspond to an element of the
* mozilla::StartupTimeline::Event enumartion
* @param aWhen The time at which the event happened
*/
void XRE_StartupTimelineRecord(int aEvent, TimeStamp aWhen) {
StartupTimeline::Record((StartupTimeline::Event)aEvent, aWhen);
}
void StartupTimeline::RecordOnce(Event ev) { RecordOnce(ev, TimeStamp::Now()); }
void StartupTimeline::RecordOnce(Event ev, const TimeStamp& aWhen) {
if (HasRecord(ev)) {
return;
}
Record(ev, aWhen);
// Record first paint timestamp as a scalar in the parent process.
if (!XRE_IsParentProcess()) {
return;
}
if (ev == FIRST_PAINT || ev == FIRST_PAINT2) {
uint32_t firstPaintTime =
(uint32_t)(aWhen - TimeStamp::ProcessCreation()).ToMilliseconds();
if (ev == FIRST_PAINT) {
glean::timestamps::first_paint.Set(firstPaintTime);
} else {
glean::timestamps::first_paint_two.Set(firstPaintTime);
}
}
}