Bug 1050774 - Record script execution in timeline view. r=bholley
This commit is contained in:
@@ -854,7 +854,8 @@ nsDocShell::nsDocShell():
|
||||
mDefaultLoadFlags(nsIRequest::LOAD_NORMAL),
|
||||
mFrameType(eFrameTypeRegular),
|
||||
mOwnOrContainingAppId(nsIScriptSecurityManager::UNKNOWN_APP_ID),
|
||||
mParentCharsetSource(0)
|
||||
mParentCharsetSource(0),
|
||||
mJSRunToCompletionDepth(0)
|
||||
{
|
||||
mHistoryID = ++gDocshellIDCounter;
|
||||
if (gDocShellCount++ == 0) {
|
||||
@@ -890,6 +891,8 @@ nsDocShell::nsDocShell():
|
||||
|
||||
nsDocShell::~nsDocShell()
|
||||
{
|
||||
MOZ_ASSERT(!mProfileTimelineRecording);
|
||||
|
||||
Destroy();
|
||||
|
||||
nsCOMPtr<nsISHistoryInternal>
|
||||
@@ -2829,14 +2832,15 @@ NS_IMETHODIMP
|
||||
nsDocShell::SetRecordProfileTimelineMarkers(bool aValue)
|
||||
{
|
||||
#ifdef MOZ_ENABLE_PROFILER_SPS
|
||||
bool currentValue;
|
||||
GetRecordProfileTimelineMarkers(¤tValue);
|
||||
bool currentValue = nsIDocShell::GetRecordProfileTimelineMarkers();
|
||||
if (currentValue != aValue) {
|
||||
if (aValue) {
|
||||
++gProfileTimelineRecordingsCount;
|
||||
UseEntryScriptProfiling();
|
||||
mProfileTimelineRecording = true;
|
||||
} else {
|
||||
--gProfileTimelineRecordingsCount;
|
||||
UnuseEntryScriptProfiling();
|
||||
mProfileTimelineRecording = false;
|
||||
ClearProfileTimelineMarkers();
|
||||
}
|
||||
@@ -13608,6 +13612,30 @@ nsDocShell::GetURLSearchParams()
|
||||
return mURLSearchParams;
|
||||
}
|
||||
|
||||
void
|
||||
nsDocShell::NotifyJSRunToCompletionStart()
|
||||
{
|
||||
bool timelineOn = nsIDocShell::GetRecordProfileTimelineMarkers();
|
||||
|
||||
// If first start, mark interval start.
|
||||
if (timelineOn && mJSRunToCompletionDepth == 0) {
|
||||
AddProfileTimelineMarker("Javascript", TRACING_INTERVAL_START);
|
||||
}
|
||||
mJSRunToCompletionDepth++;
|
||||
}
|
||||
|
||||
void
|
||||
nsDocShell::NotifyJSRunToCompletionStop()
|
||||
{
|
||||
bool timelineOn = nsIDocShell::GetRecordProfileTimelineMarkers();
|
||||
|
||||
// If last stop, mark interval end.
|
||||
mJSRunToCompletionDepth--;
|
||||
if (timelineOn && mJSRunToCompletionDepth == 0) {
|
||||
AddProfileTimelineMarker("Javascript", TRACING_INTERVAL_END);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsDocShell::MaybeNotifyKeywordSearchLoading(const nsString &aProvider,
|
||||
const nsString &aKeyword) {
|
||||
|
||||
Reference in New Issue
Block a user