Bug 1162673 - Part 1: Remove instances of #ifdef PR_LOGGING in layout. r=froydnj

PR_LOGGING is now always defined, we can remove #ifdefs checking for it.
This commit is contained in:
Eric Rahm 2015-05-11 13:53:18 -07:00
parent 68ed7c3539
commit 041335c76e
15 changed files with 0 additions and 99 deletions

View File

@ -39,7 +39,6 @@
using namespace mozilla;
using namespace mozilla::dom;
#ifdef PR_LOGGING
static PRLogModuleInfo* gSelectionCaretsLog;
static const char* kSelectionCaretsLogModuleName = "SelectionCarets";
@ -54,10 +53,6 @@ static const char* kSelectionCaretsLogModuleName = "SelectionCarets";
PR_LOG(gSelectionCaretsLog, PR_LOG_DEBUG, \
("SelectionCarets: %s:%d : " message "\n", __FUNCTION__, __LINE__, \
##__VA_ARGS__));
#else
#define SELECTIONCARETS_LOG(message, ...)
#define SELECTIONCARETS_LOG_STATIC(message, ...)
#endif // #ifdef PR_LOGGING
// We treat mouse/touch move as "REAL" move event once its move distance
// exceed this value, in CSS pixel.
@ -88,11 +83,9 @@ SelectionCarets::SelectionCarets(nsIPresShell* aPresShell)
{
MOZ_ASSERT(NS_IsMainThread());
#ifdef PR_LOGGING
if (!gSelectionCaretsLog) {
gSelectionCaretsLog = PR_NewLogModule(kSelectionCaretsLogModuleName);
}
#endif
SELECTIONCARETS_LOG("Constructor, PresShell=%p", mPresShell);

View File

@ -36,7 +36,6 @@
using namespace mozilla;
#ifdef PR_LOGGING
static PRLogModuleInfo* gTouchCaretLog;
static const char* kTouchCaretLogModuleName = "TouchCaret";
@ -51,10 +50,6 @@ static const char* kTouchCaretLogModuleName = "TouchCaret";
PR_LOG(gTouchCaretLog, PR_LOG_DEBUG, \
("TouchCaret: %s:%d : " message "\n", __FUNCTION__, __LINE__, \
##__VA_ARGS__));
#else
#define TOUCHCARET_LOG(message, ...)
#define TOUCHCARET_LOG_STATIC(message, ...)
#endif // #ifdef PR_LOGGING
// Click on the boundary of input/textarea will place the caret at the
// front/end of the content. To advoid this, we need to deflate the content
@ -75,11 +70,9 @@ TouchCaret::TouchCaret(nsIPresShell* aPresShell)
{
MOZ_ASSERT(NS_IsMainThread());
#ifdef PR_LOGGING
if (!gTouchCaretLog) {
gTouchCaretLog = PR_NewLogModule(kTouchCaretLogModuleName);
}
#endif
TOUCHCARET_LOG("Constructor, PresShell=%p", aPresShell);

View File

@ -133,8 +133,6 @@ using namespace mozilla::dom;
// PR LOGGING
#include "prlog.h"
#ifdef PR_LOGGING
#ifdef NS_PRINTING
static PRLogModuleInfo *
GetPrintingLog()
@ -148,10 +146,6 @@ GetPrintingLog()
#endif // NS_PRINTING
#define PRT_YESNO(_p) ((_p)?"YES":"NO")
#else
#define PRT_YESNO(_p)
#define PR_PL(_p1)
#endif
//-----------------------------------------------------
class nsDocumentViewer;

View File

@ -535,9 +535,7 @@ private:
bool PresShell::sDisableNonTestMouseEvents = false;
#ifdef PR_LOGGING
PRLogModuleInfo* PresShell::gLog;
#endif
#ifdef DEBUG
static void
@ -752,12 +750,10 @@ PresShell::PresShell()
mReflowCountMgr->SetPresContext(mPresContext);
mReflowCountMgr->SetPresShell(this);
#endif
#ifdef PR_LOGGING
mLoadBegin = TimeStamp::Now();
if (!gLog) {
gLog = PR_NewLogModule("PresShell");
}
#endif
mSelectionFlags = nsISelectionDisplay::DISPLAY_TEXT | nsISelectionDisplay::DISPLAY_IMAGES;
mIsThemeSupportDisabled = false;
mIsActive = true;
@ -970,7 +966,6 @@ PresShell::Init(nsIDocument* aDocument,
mTouchManager.Init(this, mDocument);
}
#ifdef PR_LOGGING
enum TextPerfLogType {
eLog_reflow,
eLog_loaddone,
@ -1051,7 +1046,6 @@ LogTextPerfStats(gfxTextPerfMetrics* aTextPerf,
aTextPerf->cumulative.textrunDestr));
}
}
#endif
void
PresShell::Destroy()
@ -1060,7 +1054,6 @@ PresShell::Destroy()
"destroy called on presshell while scripts not blocked");
// dump out cumulative text perf metrics
#ifdef PR_LOGGING
gfxTextPerfMetrics* tp;
if (mPresContext && (tp = mPresContext->GetTextPerfMetrics())) {
tp->Accumulate();
@ -1068,7 +1061,6 @@ PresShell::Destroy()
LogTextPerfStats(tp, this, tp->cumulative, 0.0, eLog_totals, nullptr);
}
}
#endif
#ifdef MOZ_REFLOW_PERF
DumpReflows();
@ -2652,7 +2644,6 @@ PresShell::BeginLoad(nsIDocument *aDocument)
{
mDocumentLoading = true;
#ifdef PR_LOGGING
gfxTextPerfMetrics *tp = nullptr;
if (mPresContext) {
tp = mPresContext->GetTextPerfMetrics();
@ -2673,7 +2664,6 @@ PresShell::BeginLoad(nsIDocument *aDocument)
("(presshell) %p load begin [%s]\n",
this, spec.get()));
}
#endif
}
void
@ -2689,7 +2679,6 @@ PresShell::EndLoad(nsIDocument *aDocument)
void
PresShell::LoadComplete()
{
#ifdef PR_LOGGING
gfxTextPerfMetrics *tp = nullptr;
if (mPresContext) {
tp = mPresContext->GetTextPerfMetrics();
@ -2717,7 +2706,6 @@ PresShell::LoadComplete()
}
}
}
#endif
}
#ifdef DEBUG
@ -9284,7 +9272,6 @@ PresShell::DoReflow(nsIFrame* target, bool aInterruptible)
MaybeScheduleReflow();
}
#ifdef PR_LOGGING
// dump text perf metrics for reflows with significant text processing
if (tp) {
if (tp->current.numChars > 100) {
@ -9294,7 +9281,6 @@ PresShell::DoReflow(nsIFrame* target, bool aInterruptible)
}
tp->Accumulate();
}
#endif
if (docShell) {
docShell->AddProfileTimelineMarker("Reflow", TRACING_INTERVAL_END);

View File

@ -319,9 +319,7 @@ public:
virtual void VerifyStyleTree() override;
#endif
#ifdef PR_LOGGING
static PRLogModuleInfo* gLog;
#endif
virtual void DisableNonTestMouseEvents(bool aDisable) override;

View File

@ -73,12 +73,8 @@ using namespace mozilla::widget;
using namespace mozilla::ipc;
using namespace mozilla::layout;
#ifdef PR_LOGGING
static PRLogModuleInfo *gLog = nullptr;
#define LOG(...) PR_LOG(gLog, PR_LOG_NOTICE, (__VA_ARGS__))
#else
#define LOG(...) do { } while(0)
#endif
#define DEFAULT_FRAME_RATE 60
#define DEFAULT_THROTTLED_FRAME_RATE 1
@ -902,11 +898,9 @@ GetFirstFrameDelay(imgIRequest* req)
/* static */ void
nsRefreshDriver::InitializeStatics()
{
#ifdef PR_LOGGING
if (!gLog) {
gLog = PR_NewLogModule("nsRefreshDriver");
}
#endif
}
/* static */ void

View File

@ -33,7 +33,6 @@ typedef nsFlexContainerFrame::FlexLine FlexLine;
typedef nsFlexContainerFrame::FlexboxAxisTracker FlexboxAxisTracker;
typedef nsFlexContainerFrame::StrutInfo StrutInfo;
#ifdef PR_LOGGING
static PRLogModuleInfo*
GetFlexContainerLog()
{
@ -42,7 +41,6 @@ GetFlexContainerLog()
sLog = PR_NewLogModule("nsFlexContainerFrame");
return sLog;
}
#endif /* PR_LOGGING */
// XXXdholbert Some of this helper-stuff should be separated out into a general
// "main/cross-axis utils" header, shared by grid & flexbox?

View File

@ -22,12 +22,8 @@
#include "nsIPrintSettings.h"
#include "prlog.h"
#ifdef PR_LOGGING
extern PRLogModuleInfo *GetLayoutPrintingLog();
#define PR_PL(_p1) PR_LOG(GetLayoutPrintingLog(), PR_LOG_DEBUG, _p1)
#else
#define PR_PL(_p1)
#endif
using namespace mozilla;
using namespace mozilla::gfx;

View File

@ -93,7 +93,6 @@ using mozilla::DefaultXDisplay;
#undef CreateEvent
#endif
#ifdef PR_LOGGING
static PRLogModuleInfo *
GetObjectFrameLog()
{
@ -102,7 +101,6 @@ GetObjectFrameLog()
sLog = PR_NewLogModule("nsPluginFrame");
return sLog;
}
#endif /* PR_LOGGING */
using namespace mozilla;
using namespace mozilla::gfx;

View File

@ -42,7 +42,6 @@ static const char sPrintOptionsContractID[] = "@mozilla.org/gfx/printsettings-se
//
#include "prlog.h"
#ifdef PR_LOGGING
PRLogModuleInfo *
GetLayoutPrintingLog()
{
@ -52,9 +51,6 @@ GetLayoutPrintingLog()
return sLog;
}
#define PR_PL(_p1) PR_LOG(GetLayoutPrintingLog(), PR_LOG_DEBUG, _p1)
#else
#define PR_PL(_p1)
#endif
nsSimplePageSequenceFrame*
NS_NewSimplePageSequenceFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)

View File

@ -16,7 +16,6 @@
// PR LOGGING
#include "prlog.h"
#ifdef PR_LOGGING
#define DUMP_LAYOUT_LEVEL 9 // this turns on the dumping of each doucment's layout info
static PRLogModuleInfo *
GetPrintingLog()
@ -27,10 +26,6 @@ GetPrintingLog()
return sLog;
}
#define PR_PL(_p1) PR_LOG(GetPrintingLog(), PR_LOG_DEBUG, _p1);
#else
#define PRT_YESNO(_p)
#define PR_PL(_p1)
#endif
//---------------------------------------------------
//-- nsPrintData Class Impl

View File

@ -129,8 +129,6 @@ using namespace mozilla::dom;
// PR LOGGING
#include "prlog.h"
#ifdef PR_LOGGING
#ifdef DEBUG
// PR_LOGGING is force to always be on (even in release builds)
// but we only want some of it on,
@ -161,10 +159,6 @@ static const char * gFrameTypesStr[] = {"eDoc", "eFrame", "eIFrame", "eFra
static const char * gPrintFrameTypeStr[] = {"kNoFrames", "kFramesAsIs", "kSelectedFrame", "kEachFrameSep"};
static const char * gFrameHowToEnableStr[] = {"kFrameEnableNone", "kFrameEnableAll", "kFrameEnableAsIsAndEach"};
static const char * gPrintRangeStr[] = {"kRangeAllPages", "kRangeSpecifiedPageRange", "kRangeSelection", "kRangeFocusFrame"};
#else
#define PRT_YESNO(_p)
#define PR_PL(_p1)
#endif
#ifdef EXTENDED_DEBUG_PRINTING
// Forward Declarations
@ -1713,7 +1707,6 @@ nsPrintEngine::SetupToPrintContent()
NS_ENSURE_SUCCESS(rv, rv);
}
#ifdef PR_LOGGING
float calcRatio = 0.0f;
if (mPrt->mPrintDocList.Length() > 1 && mPrt->mPrintObject->mFrameType == eFrameSet) {
nsPrintObject* smallestPO = FindSmallestSTF();
@ -1729,7 +1722,6 @@ nsPrintEngine::SetupToPrintContent()
PR_PL(("**************************************************************************\n"));
PR_PL(("STF Ratio is: %8.5f Effective Ratio: %8.5f Diff: %8.5f\n", mPrt->mShrinkRatio, calcRatio, mPrt->mShrinkRatio-calcRatio));
PR_PL(("**************************************************************************\n"));
#endif
}
// If the frames got reconstructed and reflowed the number of pages might

View File

@ -451,7 +451,6 @@ FontFaceSet::StartLoad(gfxUserFontEntry* aUserFontEntry,
nsRefPtr<nsFontFaceLoader> fontLoader =
new nsFontFaceLoader(aUserFontEntry, aFontFaceSrc->mURI, this, channel);
#ifdef PR_LOGGING
if (LOG_ENABLED()) {
nsAutoCString fontURI, referrerURI;
aFontFaceSrc->mURI->GetSpec(fontURI);
@ -461,7 +460,6 @@ FontFaceSet::StartLoad(gfxUserFontEntry* aUserFontEntry,
"referrer uri: (%s)\n",
fontLoader.get(), fontURI.get(), referrerURI.get()));
}
#endif
nsCOMPtr<nsIHttpChannel> httpChannel(do_QueryInterface(channel));
if (httpChannel) {
@ -653,14 +651,12 @@ FontFaceSet::UpdateRules(const nsTArray<nsFontFaceRuleContainer>& aRules)
// local rules have been rebuilt, so clear the flag
mUserFontSet->mLocalRulesUsed = false;
#if PR_LOGGING
if (LOG_ENABLED() && !mRuleFaces.IsEmpty()) {
LOG(("userfonts (%p) userfont rules update (%s) rule count: %d",
mUserFontSet.get(),
(modified ? "modified" : "not modified"),
mRuleFaces.Length()));
}
#endif
return modified;
}
@ -1111,11 +1107,9 @@ FontFaceSet::LogMessage(gfxUserFontEntry* aUserFontEntry,
message.AppendLiteral(" source: ");
message.Append(fontURI);
#ifdef PR_LOGGING
if (LOG_ENABLED()) {
LOG(("userfonts (%p) %s", mUserFontSet.get(), message.get()));
}
#endif
// try to give the user an indication of where the rule came from
nsCSSFontFaceRule* rule = FindRuleForUserFontEntry(aUserFontEntry);

View File

@ -255,7 +255,6 @@ private:
#include "prlog.h"
#ifdef PR_LOGGING
static PRLogModuleInfo *
GetLoaderLog()
{
@ -264,7 +263,6 @@ GetLoaderLog()
sLog = PR_NewLogModule("nsCSSLoader");
return sLog;
}
#endif /* PR_LOGGING */
#define LOG_FORCE(args) PR_LOG(GetLoaderLog(), PR_LOG_ALWAYS, args)
#define LOG_ERROR(args) PR_LOG(GetLoaderLog(), PR_LOG_ERROR, args)
@ -278,7 +276,6 @@ GetLoaderLog()
#define LOG_DEBUG_ENABLED() PR_LOG_TEST(GetLoaderLog(), PR_LOG_DEBUG)
#define LOG_ENABLED() LOG_DEBUG_ENABLED()
#ifdef PR_LOGGING
#define LOG_URI(format, uri) \
PR_BEGIN_MACRO \
NS_ASSERTION(uri, "Logging null uri"); \
@ -288,12 +285,8 @@ GetLoaderLog()
LOG((format, _logURISpec.get())); \
} \
PR_END_MACRO
#else // PR_LOGGING
#define LOG_URI(format, uri)
#endif // PR_LOGGING
// And some convenience strings...
#ifdef PR_LOGGING
static const char* const gStateStrings[] = {
"eSheetStateUnknown",
"eSheetNeedsParser",
@ -301,7 +294,6 @@ static const char* const gStateStrings[] = {
"eSheetLoading",
"eSheetComplete"
};
#endif
/********************************
* SheetLoadData implementation *
@ -673,9 +665,7 @@ SheetLoadData::OnDetermineCharset(nsIUnicharStreamLoader* aLoader,
// aCharset is now either "UTF-16BE", "UTF-16BE" or "UTF-8"
// which will swallow the BOM.
mCharset.Assign(aCharset);
#ifdef PR_LOGGING
LOG((" Setting from BOM to: %s", PromiseFlatCString(aCharset).get()));
#endif
return NS_OK;
}
@ -686,9 +676,7 @@ SheetLoadData::OnDetermineCharset(nsIUnicharStreamLoader* aLoader,
channel->GetContentCharset(specified);
if (EncodingUtils::FindEncodingForLabel(specified, aCharset)) {
mCharset.Assign(aCharset);
#ifdef PR_LOGGING
LOG((" Setting from HTTP to: %s", PromiseFlatCString(aCharset).get()));
#endif
return NS_OK;
}
}
@ -709,10 +697,8 @@ SheetLoadData::OnDetermineCharset(nsIUnicharStreamLoader* aLoader,
aCharset.AssignLiteral("UTF-8");
}
mCharset.Assign(aCharset);
#ifdef PR_LOGGING
LOG((" Setting from @charset rule to: %s",
PromiseFlatCString(aCharset).get()));
#endif
return NS_OK;
}
}
@ -724,10 +710,8 @@ SheetLoadData::OnDetermineCharset(nsIUnicharStreamLoader* aLoader,
mOwningElement->GetCharset(specified16);
if (EncodingUtils::FindEncodingForLabel(specified16, aCharset)) {
mCharset.Assign(aCharset);
#ifdef PR_LOGGING
LOG((" Setting from charset attribute to: %s",
PromiseFlatCString(aCharset).get()));
#endif
return NS_OK;
}
}
@ -736,10 +720,8 @@ SheetLoadData::OnDetermineCharset(nsIUnicharStreamLoader* aLoader,
// in via mCharsetHint instead.
if (EncodingUtils::FindEncodingForLabel(mCharsetHint, aCharset)) {
mCharset.Assign(aCharset);
#ifdef PR_LOGGING
LOG((" Setting from charset attribute (preload case) to: %s",
PromiseFlatCString(aCharset).get()));
#endif
return NS_OK;
}
@ -748,10 +730,8 @@ SheetLoadData::OnDetermineCharset(nsIUnicharStreamLoader* aLoader,
aCharset = mParentData->mCharset;
if (!aCharset.IsEmpty()) {
mCharset.Assign(aCharset);
#ifdef PR_LOGGING
LOG((" Setting from parent sheet to: %s",
PromiseFlatCString(aCharset).get()));
#endif
return NS_OK;
}
}
@ -761,17 +741,13 @@ SheetLoadData::OnDetermineCharset(nsIUnicharStreamLoader* aLoader,
aCharset = mLoader->mDocument->GetDocumentCharacterSet();
MOZ_ASSERT(!aCharset.IsEmpty());
mCharset.Assign(aCharset);
#ifdef PR_LOGGING
LOG((" Setting from document to: %s", PromiseFlatCString(aCharset).get()));
#endif
return NS_OK;
}
aCharset.AssignLiteral("UTF-8");
mCharset = aCharset;
#ifdef PR_LOGGING
LOG((" Setting from default to: %s", PromiseFlatCString(aCharset).get()));
#endif
return NS_OK;
}

View File

@ -143,7 +143,6 @@ nsFontFaceLoader::OnStreamComplete(nsIStreamLoader* aLoader,
mFontFaceSet->RemoveLoader(this);
#ifdef PR_LOGGING
if (LOG_ENABLED()) {
nsAutoCString fontURI;
mFontURI->GetSpec(fontURI);
@ -155,7 +154,6 @@ nsFontFaceLoader::OnStreamComplete(nsIStreamLoader* aLoader,
this, fontURI.get(), aStatus));
}
}
#endif
nsPresContext* ctx = mFontFaceSet->GetPresContext();
NS_ASSERTION(ctx && !ctx->PresShell()->IsDestroying(),