From 782365b41547cf7d3ccc2ef7fb5b1acd05add35a Mon Sep 17 00:00:00 2001 From: Jonathan Watt Date: Mon, 9 Apr 2018 09:33:56 +0100 Subject: [PATCH] Bug 1452170 - Remove RestyleLogging.h, RestyleTrackerInlines.h and related RESTYLE_LOGGING cruft. r=heycam --- layout/base/RestyleLogging.h | 48 ----------------------------- layout/base/RestyleManager.h | 1 + layout/base/RestyleTrackerInlines.h | 24 --------------- layout/base/moz.build | 1 - layout/base/nsPresContext.cpp | 7 ----- layout/base/nsPresContext.h | 14 --------- layout/style/ComputedStyle.h | 1 - 7 files changed, 1 insertion(+), 95 deletions(-) delete mode 100644 layout/base/RestyleLogging.h delete mode 100644 layout/base/RestyleTrackerInlines.h diff --git a/layout/base/RestyleLogging.h b/layout/base/RestyleLogging.h deleted file mode 100644 index fffa963a683b..000000000000 --- a/layout/base/RestyleLogging.h +++ /dev/null @@ -1,48 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/** - * Macros used to log restyle events. - */ - -#ifndef mozilla_RestyleLogging_h -#define mozilla_RestyleLogging_h - -#include "mozilla/AutoRestore.h" - -#ifdef DEBUG -#endif - -#ifdef RESTYLE_LOGGING -#define LOG_RESTYLE_VAR2(prefix_, suffix_) prefix_##suffix_ -#define LOG_RESTYLE_VAR(prefix_, suffix_) LOG_RESTYLE_VAR2(prefix_, suffix_) -#define LOG_RESTYLE_DEPTH LOG_RESTYLE_VAR(restyle_depth_, __LINE__) -#define LOG_RESTYLE_IF(object_, cond_, message_, ...) \ - PR_BEGIN_MACRO \ - if (object_->ShouldLogRestyle() && (cond_)) { \ - nsCString line; \ - for (int32_t LOG_RESTYLE_VAR(rs_depth_, __LINE__) = 0; \ - LOG_RESTYLE_VAR(rs_depth_, __LINE__) < object_->LoggingDepth(); \ - LOG_RESTYLE_VAR(rs_depth_, __LINE__)++) { \ - line.AppendLiteral(" "); \ - } \ - line.AppendPrintf(message_, ##__VA_ARGS__); \ - printf_stderr("%s\n", line.get()); \ - } \ - PR_END_MACRO -#define LOG_RESTYLE(message_, ...) \ - LOG_RESTYLE_IF(this, true, message_, ##__VA_ARGS__) -// Beware that LOG_RESTYLE_INDENT is two statements not wrapped in a block. -#define LOG_RESTYLE_INDENT() \ - AutoRestore LOG_RESTYLE_VAR(ar_depth_, __LINE__)(LoggingDepth()); \ - ++LoggingDepth(); -#else -#define LOG_RESTYLE_IF(cond_, message_, ...) /* nothing */ -#define LOG_RESTYLE(message_, ...) /* nothing */ -#define LOG_RESTYLE_INDENT() /* nothing */ -#endif - -#endif /* mozilla_RestyleLogging_h */ diff --git a/layout/base/RestyleManager.h b/layout/base/RestyleManager.h index 9ab8af29273c..b6f7faae61dd 100644 --- a/layout/base/RestyleManager.h +++ b/layout/base/RestyleManager.h @@ -7,6 +7,7 @@ #ifndef mozilla_RestyleManager_h #define mozilla_RestyleManager_h +#include "mozilla/AutoRestore.h" #include "mozilla/EventStates.h" #include "mozilla/Maybe.h" #include "mozilla/OverflowChangedTracker.h" diff --git a/layout/base/RestyleTrackerInlines.h b/layout/base/RestyleTrackerInlines.h deleted file mode 100644 index 67375b335794..000000000000 --- a/layout/base/RestyleTrackerInlines.h +++ /dev/null @@ -1,24 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef mozilla_RestyleTrackerInlines_h -#define mozilla_RestyleTrackerInlines_h - -#ifdef RESTYLE_LOGGING -bool -mozilla::RestyleTracker::ShouldLogRestyle() -{ - return mRestyleManager->ShouldLogRestyle(); -} - -int32_t& -mozilla::RestyleTracker::LoggingDepth() -{ - return mRestyleManager->LoggingDepth(); -} -#endif - -#endif // !defined(mozilla_RestyleTrackerInlines_h) diff --git a/layout/base/moz.build b/layout/base/moz.build index 606066fa6b4d..a677b49866b1 100644 --- a/layout/base/moz.build +++ b/layout/base/moz.build @@ -79,7 +79,6 @@ EXPORTS.mozilla += [ 'GeometryUtils.h', 'OverflowChangedTracker.h', 'PresShell.h', - 'RestyleLogging.h', 'RestyleManager.h', 'ShapeUtils.h', 'StaticPresData.h', diff --git a/layout/base/nsPresContext.cpp b/layout/base/nsPresContext.cpp index 6be2651da94f..121634e68c9a 100644 --- a/layout/base/nsPresContext.cpp +++ b/layout/base/nsPresContext.cpp @@ -265,9 +265,6 @@ nsPresContext::nsPresContext(nsIDocument* aDocument, nsPresContextType aType) mQuirkSheetAdded(false), mNeedsPrefUpdate(false), mHadNonBlankPaint(false) -#ifdef RESTYLE_LOGGING - , mRestyleLoggingEnabled(false) -#endif #ifdef DEBUG , mInitialized(false) #endif @@ -944,10 +941,6 @@ nsPresContext::Init(nsDeviceContext* aDeviceContext) mEventManager->SetPresContext(this); -#ifdef RESTYLE_LOGGING - mRestyleLoggingEnabled = GeckoRestyleManager::RestyleLoggingInitiallyEnabled(); -#endif - #ifdef DEBUG mInitialized = true; #endif diff --git a/layout/base/nsPresContext.h b/layout/base/nsPresContext.h index 2a51de0cba02..c3b0574b0682 100644 --- a/layout/base/nsPresContext.h +++ b/layout/base/nsPresContext.h @@ -43,7 +43,6 @@ #include "nsThreadUtils.h" #include "ScrollbarStyles.h" #include "nsIMessageManager.h" -#include "mozilla/RestyleLogging.h" #include "Units.h" #include "prenv.h" #include "mozilla/StaticPresData.h" @@ -1259,14 +1258,6 @@ public: */ bool MayHavePaintEventListenerInSubDocument(); -#ifdef RESTYLE_LOGGING - // Controls for whether debug information about restyling in this - // document should be output. - bool RestyleLoggingEnabled() const { return mRestyleLoggingEnabled; } - void StartRestyleLogging() { mRestyleLoggingEnabled = true; } - void StopRestyleLogging() { mRestyleLoggingEnabled = false; } -#endif - void InvalidatePaintedLayers(); protected: @@ -1504,11 +1495,6 @@ protected: // Has NotifyNonBlankPaint been called on this PresContext? unsigned mHadNonBlankPaint : 1; -#ifdef RESTYLE_LOGGING - // Should we output debug information about restyling for this document? - unsigned mRestyleLoggingEnabled : 1; -#endif - #ifdef DEBUG unsigned mInitialized : 1; #endif diff --git a/layout/style/ComputedStyle.h b/layout/style/ComputedStyle.h index ab253e32a641..1ddf923ab1a7 100644 --- a/layout/style/ComputedStyle.h +++ b/layout/style/ComputedStyle.h @@ -13,7 +13,6 @@ #include #include "mozilla/ArenaObjectID.h" #include "mozilla/Assertions.h" -#include "mozilla/RestyleLogging.h" #include "mozilla/ServoTypes.h" #include "mozilla/ServoUtils.h" #include "mozilla/StyleComplexColor.h"