Bug 1065251 - Unbreak build on non-SPS platforms after bug 1050376. r=bgirard

This commit is contained in:
Jan Beich 2014-09-09 23:56:00 +02:00
parent e7cd8ba247
commit 8b4aaabb65

View File

@ -91,7 +91,9 @@
#include "nsSHistory.h"
#include "nsDocShellEditorData.h"
#include "GeckoProfiler.h"
#ifdef MOZ_ENABLE_PROFILER_SPS
#include "ProfilerMarkers.h"
#endif
// Helper Classes
#include "nsError.h"
@ -2800,6 +2802,7 @@ unsigned long nsDocShell::gProfileTimelineRecordingsCount = 0;
NS_IMETHODIMP
nsDocShell::SetRecordProfileTimelineMarkers(bool aValue)
{
#ifdef MOZ_ENABLE_PROFILER_SPS
bool currentValue;
GetRecordProfileTimelineMarkers(&currentValue);
if (currentValue != aValue) {
@ -2814,6 +2817,9 @@ nsDocShell::SetRecordProfileTimelineMarkers(bool aValue)
}
return NS_OK;
#else
return NS_ERROR_FAILURE;
#endif
}
NS_IMETHODIMP
@ -2827,6 +2833,7 @@ nsresult
nsDocShell::PopProfileTimelineMarkers(JSContext* aCx,
JS::MutableHandle<JS::Value> aProfileTimelineMarkers)
{
#ifdef MOZ_ENABLE_PROFILER_SPS
// Looping over all markers gathered so far at the docShell level, whenever a
// START marker is found, look for the corresponding END marker and build a
// {name,start,end} JS object.
@ -2881,6 +2888,9 @@ nsDocShell::PopProfileTimelineMarkers(JSContext* aCx,
ClearProfileTimelineMarkers();
return NS_OK;
#else
return NS_ERROR_FAILURE;
#endif
}
float
@ -2893,6 +2903,7 @@ void
nsDocShell::AddProfileTimelineMarker(const char* aName,
TracingMetadata aMetaData)
{
#ifdef MOZ_ENABLE_PROFILER_SPS
if (!mProfileTimelineStartTime.IsNull()) {
float delta = GetProfileTimelineDelta();
ProfilerMarkerTracing* payload = new ProfilerMarkerTracing("Timeline",
@ -2900,6 +2911,7 @@ nsDocShell::AddProfileTimelineMarker(const char* aName,
mProfileTimelineMarkers.AppendElement(
new InternalProfileTimelineMarker(aName, payload, delta));
}
#endif
}
void
@ -2907,6 +2919,7 @@ nsDocShell::AddProfileTimelineMarker(const char* aName,
ProfilerBacktrace* aCause,
TracingMetadata aMetaData)
{
#ifdef MOZ_ENABLE_PROFILER_SPS
if (!mProfileTimelineStartTime.IsNull()) {
float delta = GetProfileTimelineDelta();
ProfilerMarkerTracing* payload = new ProfilerMarkerTracing("Timeline",
@ -2915,16 +2928,19 @@ nsDocShell::AddProfileTimelineMarker(const char* aName,
mProfileTimelineMarkers.AppendElement(
new InternalProfileTimelineMarker(aName, payload, delta));
}
#endif
}
void
nsDocShell::ClearProfileTimelineMarkers()
{
#ifdef MOZ_ENABLE_PROFILER_SPS
for (uint32_t i = 0; i < mProfileTimelineMarkers.Length(); ++i) {
delete mProfileTimelineMarkers[i]->mPayload;
mProfileTimelineMarkers[i]->mPayload = nullptr;
}
mProfileTimelineMarkers.Clear();
#endif
}
nsIDOMStorageManager*