Bug 1151829 - Unbreak build on non-SPS platforms after bug 1093934. r=rbarker r=dholbert r=mstange

This commit is contained in:
Jan Beich 2015-04-14 19:38:47 +02:00
parent 701acba976
commit 54d60bb515
4 changed files with 31 additions and 35 deletions

View File

@ -83,7 +83,7 @@ CollectLaterSiblings(nsISupports* aElement,
struct RestyleEnumerateData : RestyleTracker::Hints {
nsRefPtr<dom::Element> mElement;
#ifdef MOZ_ENABLE_PROFILER_SPS
#if defined(MOZ_ENABLE_PROFILER_SPS) && !defined(MOZILLA_XPCOMRT_API)
UniquePtr<ProfilerBacktrace> mBacktrace;
#endif
};
@ -143,7 +143,7 @@ CollectRestyles(nsISupports* aElement,
currentRestyle->mElement = element;
currentRestyle->mRestyleHint = aData->mRestyleHint;
currentRestyle->mChangeHint = aData->mChangeHint;
#ifdef MOZ_ENABLE_PROFILER_SPS
#if defined(MOZ_ENABLE_PROFILER_SPS) && !defined(MOZILLA_XPCOMRT_API)
currentRestyle->mBacktrace = Move(aData->mBacktrace);
#endif
@ -311,8 +311,8 @@ RestyleTracker::DoProcessRestyles()
continue;
}
#if defined(MOZ_ENABLE_PROFILER_SPS) && !defined(MOZILLA_XPCOMRT_API)
Maybe<GeckoProfilerTracingRAII> profilerRAII;
#ifdef MOZ_ENABLE_PROFILER_SPS
if (profiler_feature_active("restyle")) {
profilerRAII.emplace("Paint", "Styles", Move(data->mBacktrace));
}
@ -353,8 +353,8 @@ RestyleTracker::DoProcessRestyles()
index++, collector.count);
LOG_RESTYLE_INDENT();
#if defined(MOZ_ENABLE_PROFILER_SPS) && !defined(MOZILLA_XPCOMRT_API)
Maybe<GeckoProfilerTracingRAII> profilerRAII;
#ifdef MOZ_ENABLE_PROFILER_SPS
if (profiler_feature_active("restyle")) {
profilerRAII.emplace("Paint", "Styles", Move(currentRestyle->mBacktrace));
}

View File

@ -18,7 +18,7 @@
#include "mozilla/RestyleLogging.h"
#include "GeckoProfiler.h"
#ifdef MOZ_ENABLE_PROFILER_SPS
#if defined(MOZ_ENABLE_PROFILER_SPS) && !defined(MOZILLA_XPCOMRT_API)
#include "ProfilerBacktrace.h"
#endif
@ -296,7 +296,7 @@ public:
// that we called AddPendingRestyle for and found the element this is
// the RestyleData for as its nearest restyle root.
nsTArray<nsRefPtr<Element>> mDescendants;
#ifdef MOZ_ENABLE_PROFILER_SPS
#if defined(MOZ_ENABLE_PROFILER_SPS) && !defined(MOZILLA_XPCOMRT_API)
UniquePtr<ProfilerBacktrace> mBacktrace;
#endif
};
@ -397,7 +397,7 @@ RestyleTracker::AddPendingRestyleToTable(Element* aElement,
if (!existingData) {
RestyleData* rd = new RestyleData(aRestyleHint, aMinChangeHint);
#ifdef MOZ_ENABLE_PROFILER_SPS
#if defined(MOZ_ENABLE_PROFILER_SPS) && !defined(MOZILLA_XPCOMRT_API)
if (profiler_feature_active("restyle")) {
rd->mBacktrace.reset(profiler_get_backtrace());
}

View File

@ -50,10 +50,6 @@
#define SAMPLER_H
#include "js/TypeDecls.h"
#include "mozilla/GuardObjects.h"
#include "mozilla/UniquePtr.h"
#include "mozilla/GuardObjects.h"
#include "ProfilerBacktrace.h"
namespace mozilla {
class TimeStamp;
@ -229,28 +225,4 @@ public:
}
};
class ProfilerBacktrace;
class MOZ_STACK_CLASS GeckoProfilerTracingRAII {
public:
GeckoProfilerTracingRAII(const char* aCategory, const char* aInfo,
mozilla::UniquePtr<ProfilerBacktrace> aBacktrace
MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
: mCategory(aCategory)
, mInfo(aInfo)
{
MOZ_GUARD_OBJECT_NOTIFIER_INIT;
profiler_tracing(mCategory, mInfo, aBacktrace.release(), TRACING_INTERVAL_START);
}
~GeckoProfilerTracingRAII() {
profiler_tracing(mCategory, mInfo, TRACING_INTERVAL_END);
}
protected:
MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
const char* mCategory;
const char* mInfo;
};
#endif // ifndef SAMPLER_H

View File

@ -12,6 +12,8 @@
#include <stdarg.h>
#include "mozilla/ThreadLocal.h"
#include "mozilla/Assertions.h"
#include "mozilla/GuardObjects.h"
#include "mozilla/UniquePtr.h"
#include "nscore.h"
#include "GeckoProfilerFunc.h"
#include "PseudoStack.h"
@ -356,6 +358,28 @@ static inline void profiler_tracing(const char* aCategory, const char* aInfo,
namespace mozilla {
class MOZ_STACK_CLASS GeckoProfilerTracingRAII {
public:
GeckoProfilerTracingRAII(const char* aCategory, const char* aInfo,
mozilla::UniquePtr<ProfilerBacktrace> aBacktrace
MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
: mCategory(aCategory)
, mInfo(aInfo)
{
MOZ_GUARD_OBJECT_NOTIFIER_INIT;
profiler_tracing(mCategory, mInfo, aBacktrace.release(), TRACING_INTERVAL_START);
}
~GeckoProfilerTracingRAII() {
profiler_tracing(mCategory, mInfo, TRACING_INTERVAL_END);
}
protected:
MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
const char* mCategory;
const char* mInfo;
};
class MOZ_STACK_CLASS SamplerStackFrameRAII {
public:
// we only copy the strings at save time, so to take multiple parameters we'd need to copy them then.