mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 718737 - Add a startup timeline event on the first nsDocShell::LoadURI for non about:blank content. r=bz,r=tglek
This commit is contained in:
parent
58a32c337f
commit
c4e4acd545
@ -224,6 +224,7 @@
|
||||
|
||||
#include "nsDOMNavigationTiming.h"
|
||||
#include "nsITimedChannel.h"
|
||||
#include "mozilla/StartupTimeline.h"
|
||||
|
||||
static NS_DEFINE_CID(kDOMScriptObjectFactoryCID,
|
||||
NS_DOM_SCRIPT_OBJECT_FACTORY_CID);
|
||||
@ -1224,6 +1225,11 @@ nsDocShell::LoadURI(nsIURI * aURI,
|
||||
|
||||
NS_ENSURE_ARG(aURI);
|
||||
|
||||
if (!StartupTimeline::HasRecord(StartupTimeline::FIRST_LOAD_URI) &&
|
||||
mItemType == typeContent && !NS_IsAboutBlank(aURI)) {
|
||||
StartupTimeline::RecordOnce(StartupTimeline::FIRST_LOAD_URI);
|
||||
}
|
||||
|
||||
// Extract the info from the DocShellLoadInfo struct...
|
||||
if (aLoadInfo) {
|
||||
aLoadInfo->GetReferrer(getter_AddRefs(referrer));
|
||||
|
@ -43,6 +43,7 @@ mozilla_StartupTimeline_Event(SESSION_RESTORED, "sessionRestored")
|
||||
mozilla_StartupTimeline_Event(CREATE_TOP_LEVEL_WINDOW, "createTopLevelWindow")
|
||||
mozilla_StartupTimeline_Event(LINKER_INITIALIZED, "linkerInitialized")
|
||||
mozilla_StartupTimeline_Event(LIBRARIES_LOADED, "librariesLoaded")
|
||||
mozilla_StartupTimeline_Event(FIRST_LOAD_URI, "firstLoadURI")
|
||||
#else
|
||||
|
||||
#ifndef mozilla_StartupTimeline
|
||||
@ -74,9 +75,13 @@ public:
|
||||
sStartupTimeline[ev] = when;
|
||||
}
|
||||
|
||||
static void RecordOnce(Event ev, PRTime when = PR_Now()) {
|
||||
if (!sStartupTimeline[ev])
|
||||
sStartupTimeline[ev] = when;
|
||||
static void RecordOnce(Event ev) {
|
||||
if (!HasRecord(ev))
|
||||
sStartupTimeline[ev] = PR_Now();
|
||||
}
|
||||
|
||||
static bool HasRecord(Event ev) {
|
||||
return sStartupTimeline[ev];
|
||||
}
|
||||
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user