Bug 1145988 - Unbreak build on non-SPS platforms after bug 1129249. r=dholbert f=chiajung

This commit is contained in:
Jan Beich 2015-04-02 21:43:48 +02:00
parent 6bcb348e38
commit a723bd9d20
3 changed files with 17 additions and 1 deletions

View File

@ -83,7 +83,9 @@ CollectLaterSiblings(nsISupports* aElement,
struct RestyleEnumerateData : RestyleTracker::Hints {
nsRefPtr<dom::Element> mElement;
#ifdef MOZ_ENABLE_PROFILER_SPS
UniquePtr<ProfilerBacktrace> mBacktrace;
#endif
};
struct RestyleCollector {
@ -141,7 +143,9 @@ CollectRestyles(nsISupports* aElement,
currentRestyle->mElement = element;
currentRestyle->mRestyleHint = aData->mRestyleHint;
currentRestyle->mChangeHint = aData->mChangeHint;
#ifdef MOZ_ENABLE_PROFILER_SPS
currentRestyle->mBacktrace = Move(aData->mBacktrace);
#endif
#ifdef RESTYLE_LOGGING
collector->count++;
@ -308,9 +312,11 @@ RestyleTracker::DoProcessRestyles()
}
Maybe<GeckoProfilerTracingRAII> profilerRAII;
#ifdef MOZ_ENABLE_PROFILER_SPS
if (profiler_feature_active("restyle")) {
profilerRAII.emplace("Paint", "Styles", Move(data->mBacktrace));
}
#endif
ProcessOneRestyle(element, data->mRestyleHint, data->mChangeHint);
AddRestyleRootsIfAwaitingRestyle(data->mDescendants);
}
@ -348,9 +354,11 @@ RestyleTracker::DoProcessRestyles()
LOG_RESTYLE_INDENT();
Maybe<GeckoProfilerTracingRAII> profilerRAII;
#ifdef MOZ_ENABLE_PROFILER_SPS
if (profiler_feature_active("restyle")) {
profilerRAII.emplace("Paint", "Styles", Move(currentRestyle->mBacktrace));
}
#endif
ProcessOneRestyle(currentRestyle->mElement,
currentRestyle->mRestyleHint,
currentRestyle->mChangeHint);

View File

@ -16,9 +16,12 @@
#include "nsContainerFrame.h"
#include "mozilla/SplayTree.h"
#include "mozilla/RestyleLogging.h"
#include "ProfilerBacktrace.h"
#include "GeckoProfiler.h"
#ifdef MOZ_ENABLE_PROFILER_SPS
#include "ProfilerBacktrace.h"
#endif
namespace mozilla {
class RestyleManager;
@ -293,7 +296,9 @@ 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
UniquePtr<ProfilerBacktrace> mBacktrace;
#endif
};
/**
@ -392,9 +397,11 @@ RestyleTracker::AddPendingRestyleToTable(Element* aElement,
if (!existingData) {
RestyleData* rd = new RestyleData(aRestyleHint, aMinChangeHint);
#ifdef MOZ_ENABLE_PROFILER_SPS
if (profiler_feature_active("restyle")) {
rd->mBacktrace.reset(profiler_get_backtrace());
}
#endif
mPendingRestyles.Put(aElement, rd);
return false;
}

View File

@ -50,6 +50,7 @@
#define SAMPLER_H
#include "js/TypeDecls.h"
#include "mozilla/GuardObjects.h"
#include "mozilla/UniquePtr.h"
namespace mozilla {