mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 22:32:46 +00:00
Bug 1911448 - Remove DOMContentFlushed. r=smaug,perftest-reviewers,sparky
As per comments in bug 1910411's patches and others, it's not a useful metric, specially now that we have LCP and so on. Actually there doesn't seem to be any consumer of it since bug 1892001. Differential Revision: https://phabricator.services.mozilla.com/D218489
This commit is contained in:
parent
4dd2648bb4
commit
467b70eda8
@ -8376,9 +8376,6 @@ void Document::UnblockDOMContentLoaded() {
|
||||
("DOCUMENT %p UnblockDOMContentLoaded", this));
|
||||
|
||||
mDidFireDOMContentLoaded = true;
|
||||
if (PresShell* presShell = GetPresShell()) {
|
||||
presShell->GetRefreshDriver()->NotifyDOMContentLoaded();
|
||||
}
|
||||
|
||||
MOZ_ASSERT(mReadyState == READYSTATE_INTERACTIVE);
|
||||
if (!mSynchronousDOMContentLoaded) {
|
||||
|
@ -488,37 +488,6 @@ void nsDOMNavigationTiming::NotifyLargestContentfulRenderForRootContentDocument(
|
||||
mNavigationStart + TimeDuration::FromMilliseconds(aRenderTime);
|
||||
}
|
||||
|
||||
void nsDOMNavigationTiming::NotifyDOMContentFlushedForRootContentDocument() {
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
MOZ_ASSERT(!mNavigationStart.IsNull());
|
||||
|
||||
if (!mDOMContentFlushed.IsNull()) {
|
||||
return;
|
||||
}
|
||||
|
||||
mDOMContentFlushed = TimeStamp::Now();
|
||||
|
||||
if (profiler_thread_is_being_profiled_for_markers() ||
|
||||
PAGELOAD_LOG_ENABLED()) {
|
||||
TimeDuration elapsed = mDOMContentFlushed - mNavigationStart;
|
||||
nsPrintfCString marker(
|
||||
"DOMContentFlushed after %dms for URL %s, %s",
|
||||
int(elapsed.ToMilliseconds()),
|
||||
nsContentUtils::TruncatedURLForDisplay(mLoadedURI).get(),
|
||||
mDocShellHasBeenActiveSinceNavigationStart
|
||||
? "foreground tab"
|
||||
: "this tab was inactive some of the time between navigation start "
|
||||
"and DOMContentFlushed");
|
||||
PAGELOAD_LOG(("%s", marker.get()));
|
||||
PROFILER_MARKER_TEXT(
|
||||
"DOMContentFlushed", DOM,
|
||||
MarkerOptions(
|
||||
MarkerTiming::Interval(mNavigationStart, mDOMContentFlushed),
|
||||
MarkerInnerWindowIdFromDocShell(mDocShell)),
|
||||
marker);
|
||||
}
|
||||
}
|
||||
|
||||
void nsDOMNavigationTiming::NotifyDocShellStateChanged(
|
||||
DocShellState aDocShellState) {
|
||||
mDocShellHasBeenActiveSinceNavigationStart &=
|
||||
@ -595,7 +564,6 @@ nsDOMNavigationTiming::nsDOMNavigationTiming(nsDocShell* aDocShell,
|
||||
mNavigationStart(aOther->mNavigationStart),
|
||||
mNonBlankPaint(aOther->mNonBlankPaint),
|
||||
mContentfulComposite(aOther->mContentfulComposite),
|
||||
mDOMContentFlushed(aOther->mDOMContentFlushed),
|
||||
mBeforeUnloadStart(aOther->mBeforeUnloadStart),
|
||||
mUnloadStart(aOther->mUnloadStart),
|
||||
mUnloadEnd(aOther->mUnloadEnd),
|
||||
@ -629,7 +597,6 @@ void mozilla::ipc::IPDLParamTraits<nsDOMNavigationTiming*>::Write(
|
||||
WriteIPDLParam(aWriter, aActor, aParam->mNavigationStart);
|
||||
WriteIPDLParam(aWriter, aActor, aParam->mNonBlankPaint);
|
||||
WriteIPDLParam(aWriter, aActor, aParam->mContentfulComposite);
|
||||
WriteIPDLParam(aWriter, aActor, aParam->mDOMContentFlushed);
|
||||
WriteIPDLParam(aWriter, aActor, aParam->mBeforeUnloadStart);
|
||||
WriteIPDLParam(aWriter, aActor, aParam->mUnloadStart);
|
||||
WriteIPDLParam(aWriter, aActor, aParam->mUnloadEnd);
|
||||
@ -669,7 +636,6 @@ bool mozilla::ipc::IPDLParamTraits<nsDOMNavigationTiming*>::Read(
|
||||
!ReadIPDLParam(aReader, aActor, &timing->mNavigationStart) ||
|
||||
!ReadIPDLParam(aReader, aActor, &timing->mNonBlankPaint) ||
|
||||
!ReadIPDLParam(aReader, aActor, &timing->mContentfulComposite) ||
|
||||
!ReadIPDLParam(aReader, aActor, &timing->mDOMContentFlushed) ||
|
||||
!ReadIPDLParam(aReader, aActor, &timing->mBeforeUnloadStart) ||
|
||||
!ReadIPDLParam(aReader, aActor, &timing->mUnloadStart) ||
|
||||
!ReadIPDLParam(aReader, aActor, &timing->mUnloadEnd) ||
|
||||
|
@ -113,9 +113,6 @@ class nsDOMNavigationTiming final : public mozilla::RelativeTimeline {
|
||||
return TimeStampToDOM(mLargestContentfulRender);
|
||||
}
|
||||
DOMTimeMilliSec GetTimeToTTFI() const { return TimeStampToDOM(mTTFI); }
|
||||
DOMTimeMilliSec GetTimeToDOMContentFlushed() const {
|
||||
return TimeStampToDOM(mDOMContentFlushed);
|
||||
}
|
||||
|
||||
DOMHighResTimeStamp GetUnloadEventStartHighRes() {
|
||||
mozilla::TimeStamp stamp = GetUnloadEventStartTimeStamp();
|
||||
@ -182,7 +179,6 @@ class nsDOMNavigationTiming final : public mozilla::RelativeTimeline {
|
||||
const mozilla::TimeStamp& aCompositeEndTime);
|
||||
void NotifyLargestContentfulRenderForRootContentDocument(
|
||||
const DOMHighResTimeStamp& aRenderTime);
|
||||
void NotifyDOMContentFlushedForRootContentDocument();
|
||||
void NotifyDocShellStateChanged(DocShellState aDocShellState);
|
||||
|
||||
void MaybeAddLCPProfilerMarker(mozilla::MarkerInnerWindowId aInnerWindowID);
|
||||
@ -243,7 +239,6 @@ class nsDOMNavigationTiming final : public mozilla::RelativeTimeline {
|
||||
mozilla::TimeStamp mNonBlankPaint;
|
||||
mozilla::TimeStamp mContentfulComposite;
|
||||
mozilla::TimeStamp mLargestContentfulRender;
|
||||
mozilla::TimeStamp mDOMContentFlushed;
|
||||
|
||||
mozilla::TimeStamp mBeforeUnloadStart;
|
||||
mozilla::TimeStamp mUnloadStart;
|
||||
|
@ -415,16 +415,6 @@ class PerformanceTiming final : public nsWrapperCache {
|
||||
mPerformance->GetRTPCallerType());
|
||||
}
|
||||
|
||||
DOMTimeMilliSec TimeToDOMContentFlushed() const {
|
||||
if (!StaticPrefs::dom_enable_performance()) {
|
||||
return 0;
|
||||
}
|
||||
return nsRFPService::ReduceTimePrecisionAsMSecs(
|
||||
GetDOMTiming()->GetTimeToDOMContentFlushed(),
|
||||
mPerformance->GetRandomTimelineSeed(),
|
||||
mPerformance->GetRTPCallerType());
|
||||
}
|
||||
|
||||
DOMTimeMilliSec TimeToFirstInteractive() const {
|
||||
if (!StaticPrefs::dom_enable_performance()) {
|
||||
return 0;
|
||||
|
@ -44,12 +44,6 @@ interface PerformanceTiming {
|
||||
[Pref="dom.performance.time_to_contentful_paint.enabled"]
|
||||
readonly attribute unsigned long long timeToContentfulPaint;
|
||||
|
||||
// This is a Mozilla proprietary extension and not part of the
|
||||
// performance/navigation timing specification. It marks the
|
||||
// completion of the first presentation flush after DOMContentLoaded.
|
||||
[Pref="dom.performance.time_to_dom_content_flushed.enabled"]
|
||||
readonly attribute unsigned long long timeToDOMContentFlushed;
|
||||
|
||||
// This is a Chrome proprietary extension and not part of the
|
||||
// performance/navigation timing specification.
|
||||
// Returns 0 if a time-to-interactive measurement has not happened.
|
||||
|
@ -2869,16 +2869,6 @@ void nsPresContext::NotifyPaintStatusReset() {
|
||||
mHadNonTickContentfulPaint = false;
|
||||
}
|
||||
|
||||
void nsPresContext::NotifyDOMContentFlushed() {
|
||||
NS_ENSURE_TRUE_VOID(mPresShell);
|
||||
if (IsRootContentDocumentCrossProcess()) {
|
||||
RefPtr<nsDOMNavigationTiming> timing = mDocument->GetNavigationTiming();
|
||||
if (timing) {
|
||||
timing->NotifyDOMContentFlushedForRootContentDocument();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
nscoord nsPresContext::GfxUnitsToAppUnits(gfxFloat aGfxUnits) const {
|
||||
return mDeviceContext->GfxUnitsToAppUnits(aGfxUnits);
|
||||
}
|
||||
|
@ -1040,7 +1040,6 @@ class nsPresContext : public nsISupports, public mozilla::SupportsWeakPtr {
|
||||
void NotifyNonBlankPaint();
|
||||
void NotifyContentfulPaint();
|
||||
void NotifyPaintStatusReset();
|
||||
void NotifyDOMContentFlushed();
|
||||
|
||||
bool HasEverBuiltInvisibleText() const { return mHasEverBuiltInvisibleText; }
|
||||
void SetBuiltInvisibleText() { mHasEverBuiltInvisibleText = true; }
|
||||
|
@ -1363,7 +1363,6 @@ nsRefreshDriver::nsRefreshDriver(nsPresContext* aPresContext)
|
||||
mWaitingForTransaction(false),
|
||||
mSkippedPaints(false),
|
||||
mResizeSuppressed(false),
|
||||
mNotifyDOMContentFlushed(false),
|
||||
mNeedToUpdateIntersectionObservations(false),
|
||||
mNeedToUpdateResizeObservers(false),
|
||||
mNeedToRunFrameRequestCallbacks(false),
|
||||
@ -1638,21 +1637,6 @@ void nsRefreshDriver::RemoveImageRequest(imgIRequest* aRequest) {
|
||||
}
|
||||
}
|
||||
|
||||
void nsRefreshDriver::NotifyDOMContentLoaded() {
|
||||
// If the refresh driver is going to tick, we mark the timestamp after
|
||||
// everything is flushed in the next tick. If it isn't, mark ourselves as
|
||||
// flushed now.
|
||||
if (!HasReasonsToTick()) {
|
||||
if (nsPresContext* pc = GetPresContext()) {
|
||||
pc->NotifyDOMContentFlushed();
|
||||
}
|
||||
// else, we don't have a nsPresContext, so our doc is probably being
|
||||
// destroyed and this notification doesn't need sending anyway.
|
||||
} else {
|
||||
mNotifyDOMContentFlushed = true;
|
||||
}
|
||||
}
|
||||
|
||||
void nsRefreshDriver::RegisterCompositionPayload(
|
||||
const mozilla::layers::CompositionPayload& aPayload) {
|
||||
mCompositionPayloads.AppendElement(aPayload);
|
||||
@ -2889,11 +2873,6 @@ void nsRefreshDriver::Tick(VsyncId aId, TimeStamp aNowTime,
|
||||
static_cast<uint32_t>(totalMs));
|
||||
#endif
|
||||
|
||||
if (mNotifyDOMContentFlushed) {
|
||||
mNotifyDOMContentFlushed = false;
|
||||
mPresContext->NotifyDOMContentFlushed();
|
||||
}
|
||||
|
||||
for (nsAPostRefreshObserver* observer :
|
||||
mPostRefreshObservers.ForwardRange()) {
|
||||
observer->DidRefresh();
|
||||
|
@ -371,8 +371,6 @@ class nsRefreshDriver final : public mozilla::layers::TransactionIdAllocator,
|
||||
static void DispatchIdleTaskAfterTickUnlessExists(mozilla::Task* aTask);
|
||||
static void CancelIdleTask(mozilla::Task* aTask);
|
||||
|
||||
void NotifyDOMContentLoaded();
|
||||
|
||||
// Schedule a refresh so that any delayed events will run soon.
|
||||
void RunDelayedEventsSoon();
|
||||
|
||||
@ -636,9 +634,6 @@ class nsRefreshDriver final : public mozilla::layers::TransactionIdAllocator,
|
||||
// start of every tick.
|
||||
bool mResizeSuppressed : 1;
|
||||
|
||||
// True if the next tick should notify DOMContentFlushed.
|
||||
bool mNotifyDOMContentFlushed : 1;
|
||||
|
||||
// True if we need to flush in order to update intersection observations in
|
||||
// all our documents.
|
||||
bool mNeedToUpdateIntersectionObservations : 1;
|
||||
|
@ -3349,12 +3349,6 @@
|
||||
value: false
|
||||
mirror: always
|
||||
|
||||
# Is support for PerformanceTiming.timeToDOMContentFlushed enabled?
|
||||
- name: dom.performance.time_to_dom_content_flushed.enabled
|
||||
type: bool
|
||||
value: false
|
||||
mirror: always
|
||||
|
||||
# Is support for PerformanceTiming.timeToFirstInteractive enabled?
|
||||
- name: dom.performance.time_to_first_interactive.enabled
|
||||
type: bool
|
||||
|
@ -13,7 +13,6 @@ user_pref("browser.tabs.hideStatusPanel", true);
|
||||
|
||||
user_pref("dom.performance.time_to_non_blank_paint.enabled", true);
|
||||
user_pref("dom.performance.time_to_contentful_paint.enabled", true);
|
||||
user_pref("dom.performance.time_to_dom_content_flushed.enabled", false);
|
||||
user_pref("dom.performance.time_to_first_interactive.enabled", true);
|
||||
|
||||
// required for geckoview logging
|
||||
|
Loading…
Reference in New Issue
Block a user