From afaa32ab40d8e577b40a431ed951fb1352f46590 Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Sun, 2 Dec 2018 11:56:00 +0200 Subject: [PATCH] Bug 1511714 - Unbreak on platform without GeckoProfiler after bug 1509571. r=mconley --- browser/components/sessionstore/StartupPerformance.jsm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/browser/components/sessionstore/StartupPerformance.jsm b/browser/components/sessionstore/StartupPerformance.jsm index 54230065459b..7834ce188e92 100644 --- a/browser/components/sessionstore/StartupPerformance.jsm +++ b/browser/components/sessionstore/StartupPerformance.jsm @@ -76,7 +76,9 @@ var StartupPerformance = { // Record the start timestamp, setup the timer and `this._promiseFinished`. // Behavior is unspecified if there was already an ongoing measure. _onRestorationStarts(isAutoRestore) { - Services.profiler.AddMarker("_onRestorationStarts"); + if (Services.profiler) { + Services.profiler.AddMarker("_onRestorationStarts"); + } this._latestRestoredTimeStamp = this._startTimeStamp = Date.now(); this._totalNumberOfEagerTabs = 0; this._totalNumberOfTabs = 0; @@ -199,7 +201,9 @@ var StartupPerformance = { // to the user switching to a lazily restored tab, or for tabs // that are restoring eagerly. if (!event.detail.isRemotenessUpdate) { - Services.profiler.AddMarker("SSTabRestored"); + if (Services.profiler) { + Services.profiler.AddMarker("SSTabRestored"); + } this._latestRestoredTimeStamp = Date.now(); this._totalNumberOfEagerTabs += 1; }