Bug 1679273 - Fix bustage when building without MOZ_GECKO_PROFILER. r=gerald

Differential Revision: https://phabricator.services.mozilla.com/D97966
This commit is contained in:
Simon Giesecke 2020-12-07 14:21:28 +00:00
Родитель 1c53236b70
Коммит 8c2c2388e6
9 изменённых файлов: 31 добавлений и 8 удалений

Просмотреть файл

@ -10,12 +10,15 @@
#include "mozilla/dom/PopupBlocker.h"
#include "mozilla/dom/TimeoutHandler.h"
#include "mozilla/LinkedList.h"
#include "mozilla/ProfileChunkedBuffer.h"
#include "mozilla/TimeStamp.h"
#include "nsGlobalWindowInner.h"
#include "nsCycleCollectionParticipant.h"
#include "nsDataHashtable.h"
#ifdef MOZ_GECKO_PROFILER
# include "mozilla/ProfileChunkedBuffer.h"
#endif
namespace mozilla {
namespace dom {

Просмотреть файл

@ -8,6 +8,7 @@
#include "nsGlobalWindow.h"
#include "mozilla/Logging.h"
#include "mozilla/PerformanceCounter.h"
#include "mozilla/ScopeExit.h"
#include "mozilla/StaticPrefs_dom.h"
#include "mozilla/StaticPrefs_privacy.h"
#include "mozilla/Telemetry.h"

Просмотреть файл

@ -20,6 +20,7 @@
#include "nsFocusManager.h"
#include "nsFrameSelection.h"
#include "nsServiceManagerUtils.h"
#include "mozilla/ScopeExit.h"
#include "mozilla/dom/DataTransfer.h"
#include "nsIDocShell.h"

Просмотреть файл

@ -7,8 +7,8 @@
#include "ServiceWorkerRegistrationProxy.h"
#include "mozilla/SchedulerGroup.h"
#include "mozilla/ipc/BackgroundParent.h"
#include "mozilla/ScopeExit.h"
#include "mozilla/ipc/BackgroundParent.h"
#include "ServiceWorkerManager.h"
#include "ServiceWorkerRegistrationParent.h"
#include "ServiceWorkerUnregisterCallback.h"

Просмотреть файл

@ -17,7 +17,7 @@
#include "nsCOMPtr.h"
#include "nsCycleCollectionParticipant.h"
#include "nsISupports.h"
#include "nsStringFwd.h"
#include "nsString.h"
#include "nsTArray.h"
#include "nsWrapperCache.h"

Просмотреть файл

@ -8,6 +8,7 @@
#include <utility>
#include "XPathResult.h"
#include "mozilla/UniquePtrExtensions.h"
#include "mozilla/dom/BindingUtils.h"
#include "mozilla/dom/Document.h"
#include "mozilla/dom/XPathEvaluatorBinding.h"

Просмотреть файл

@ -1216,7 +1216,10 @@ void nsRefreshDriver::AddRefreshObserver(nsARefreshObserver* aObserver,
#endif
array.AppendElement(ObserverData{aObserver, aObserverDescription,
TimeStamp::Now(), innerWindowID,
profiler_capture_backtrace(), aFlushType});
#ifdef MOZ_GECKO_PROFILER
profiler_capture_backtrace(),
#endif
aFlushType});
EnsureTimerStarted();
}
@ -1466,7 +1469,9 @@ void nsRefreshDriver::StopTimer() {
mActiveTimer->RemoveRefreshDriver(this);
mActiveTimer = nullptr;
#ifdef MOZ_GECKO_PROFILER
mRefreshTimerStartedCause = nullptr;
#endif
}
uint32_t nsRefreshDriver::ObserverCount() const {
@ -2033,18 +2038,18 @@ void nsRefreshDriver::Tick(VsyncId aId, TimeStamp aNowTime) {
AUTO_PROFILER_LABEL("nsRefreshDriver::Tick", LAYOUT);
nsAutoCString profilerStr;
#if MOZ_GECKO_PROFILER
#ifdef MOZ_GECKO_PROFILER
if (profiler_can_accept_markers()) {
profilerStr.AppendLiteral("Tick reasons:");
AppendTickReasonsToString(tickReasons, profilerStr);
}
#endif
AUTO_PROFILER_MARKER_TEXT(
"RefreshDriverTick", GRAPHICS,
MarkerOptions(
MarkerStack::TakeBacktrace(std::move(mRefreshTimerStartedCause)),
MarkerInnerWindowIdFromDocShell(GetDocShell(mPresContext))),
profilerStr);
#endif
mResizeSuppressed = false;
@ -2297,7 +2302,7 @@ void nsRefreshDriver::Tick(VsyncId aId, TimeStamp aNowTime) {
if (mViewManagerFlushIsPending) {
AutoRecordPhase paintRecord(&phasePaint);
nsCString transactionId;
#if MOZ_GECKO_PROFILER
#ifdef MOZ_GECKO_PROFILER
if (profiler_can_accept_markers()) {
transactionId.AppendLiteral("Transaction ID: ");
transactionId.AppendInt((uint64_t)mNextTransactionId);
@ -2643,9 +2648,11 @@ void nsRefreshDriver::ScheduleViewManagerFlush() {
NS_ASSERTION(mPresContext->IsRoot(),
"Should only schedule view manager flush on root prescontexts");
mViewManagerFlushIsPending = true;
#ifdef MOZ_GECKO_PROFILER
if (!mViewManagerFlushCause) {
mViewManagerFlushCause = profiler_capture_backtrace();
}
#endif
mHasScheduleFlush = true;
EnsureTimerStarted(eNeverAdjustTimer);
}

Просмотреть файл

@ -13,7 +13,6 @@
#define nsRefreshDriver_h_
#include "mozilla/FlushType.h"
#include "mozilla/ProfileChunkedBuffer.h"
#include "mozilla/TimeStamp.h"
#include "mozilla/UniquePtr.h"
#include "mozilla/Vector.h"
@ -31,6 +30,10 @@
#include "mozilla/layers/TransactionIdAllocator.h"
#include "LayersTypes.h"
#ifdef MOZ_GECKO_PROFILER
# include "mozilla/ProfileChunkedBuffer.h"
#endif
class nsPresContext;
class imgIRequest;
@ -435,7 +438,9 @@ class nsRefreshDriver final : public mozilla::layers::TransactionIdAllocator,
const char* mDescription;
mozilla::TimeStamp mRegisterTime;
mozilla::Maybe<uint64_t> mInnerWindowId;
#ifdef MOZ_GECKO_PROFILER
mozilla::UniquePtr<mozilla::ProfileChunkedBuffer> mCause;
#endif
mozilla::FlushType mFlushType;
bool operator==(nsARefreshObserver* aObserver) const {
@ -488,7 +493,9 @@ class nsRefreshDriver final : public mozilla::layers::TransactionIdAllocator,
mozilla::RefreshDriverTimer* ChooseTimer();
mozilla::RefreshDriverTimer* mActiveTimer;
RefPtr<mozilla::RefreshDriverTimer> mOwnTimer;
#ifdef MOZ_GECKO_PROFILER
mozilla::UniquePtr<mozilla::ProfileChunkedBuffer> mRefreshTimerStartedCause;
#endif
// nsPresContext passed in constructor and unset in Disconnect.
mozilla::WeakPtr<nsPresContext> mPresContext;
@ -517,7 +524,9 @@ class nsRefreshDriver final : public mozilla::layers::TransactionIdAllocator,
// flush since the last time we did it.
const mozilla::TimeDuration mMinRecomputeVisibilityInterval;
#ifdef MOZ_GECKO_PROFILER
mozilla::UniquePtr<mozilla::ProfileChunkedBuffer> mViewManagerFlushCause;
#endif
bool mThrottled : 1;
bool mNeedToRecomputeVisibility : 1;

Просмотреть файл

@ -45,6 +45,7 @@
#include "nsNetCID.h"
#include "mozilla/RandomNum.h"
#include "mozilla/StaticMutex.h"
#include "mozilla/UniquePtrExtensions.h"
#include "mozilla/Unused.h"
#include "mozilla/dom/RTCDataChannelBinding.h"
#include "mozilla/dom/RTCStatsReportBinding.h"