Skip to content

Commit

Permalink
Bug 1617565 - Convert additional compile-conditional logging bits to …
Browse files Browse the repository at this point in the history
…MOZ_LOG. r=botond

Differential Revision: https://phabricator.services.mozilla.com/D63868

--HG--
extra : moz-landing-system : lando
  • Loading branch information
staktrace committed Feb 24, 2020
1 parent 6d4a857 commit 85c3d9e
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 26 deletions.
4 changes: 2 additions & 2 deletions dom/base/VisualViewport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#include "nsRefreshDriver.h"
#include "DocumentInlines.h"

#define VVP_LOG(...)
// #define VVP_LOG(...) printf_stderr("VVP: " __VA_ARGS__)
static mozilla::LazyLogModule sVvpLog("visualviewport");
#define VVP_LOG(...) MOZ_LOG(sVvpLog, LogLevel::Debug, (__VA_ARGS__))

using namespace mozilla;
using namespace mozilla::dom;
Expand Down
19 changes: 10 additions & 9 deletions dom/ipc/BrowserChild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "EventStateManager.h"
#include "FrameLayerBuilder.h"
#include "Layers.h"
#include "LayersLogging.h"
#include "MMPrinter.h"
#include "PermissionMessageUtils.h"
#include "PuppetWidget.h"
Expand Down Expand Up @@ -146,8 +147,7 @@
#define BROWSER_ELEMENT_CHILD_SCRIPT \
NS_LITERAL_STRING("chrome://global/content/BrowserElementChild.js")

#define TABC_LOG(...)
// #define TABC_LOG(...) printf_stderr("TABC: " __VA_ARGS__)
static mozilla::LazyLogModule sApzChildLog("apz.child");

using namespace mozilla;
using namespace mozilla::dom;
Expand Down Expand Up @@ -1369,11 +1369,12 @@ mozilla::ipc::IPCResult BrowserChild::RecvSuppressDisplayport(
void BrowserChild::HandleDoubleTap(const CSSPoint& aPoint,
const Modifiers& aModifiers,
const ScrollableLayerGuid& aGuid) {
TABC_LOG("Handling double tap at %s with %p %p\n", Stringify(aPoint).c_str(),
mBrowserChildMessageManager
? mBrowserChildMessageManager->GetWrapper()
: nullptr,
mBrowserChildMessageManager.get());
MOZ_LOG(
sApzChildLog, LogLevel::Debug,
("Handling double tap at %s with %p %p\n", Stringify(aPoint).c_str(),
mBrowserChildMessageManager ? mBrowserChildMessageManager->GetWrapper()
: nullptr,
mBrowserChildMessageManager.get()));

if (!mBrowserChildMessageManager) {
return;
Expand Down Expand Up @@ -1873,7 +1874,8 @@ mozilla::ipc::IPCResult BrowserChild::RecvNormalPriorityMouseWheelEvent(
mozilla::ipc::IPCResult BrowserChild::RecvRealTouchEvent(
const WidgetTouchEvent& aEvent, const ScrollableLayerGuid& aGuid,
const uint64_t& aInputBlockId, const nsEventStatus& aApzResponse) {
TABC_LOG("Receiving touch event of type %d\n", aEvent.mMessage);
MOZ_LOG(sApzChildLog, LogLevel::Debug,
("Receiving touch event of type %d\n", aEvent.mMessage));

WidgetTouchEvent localEvent(aEvent);
localEvent.mWidget = mPuppetWidget;
Expand Down Expand Up @@ -3456,7 +3458,6 @@ nsresult BrowserChild::CanCancelContentJS(
if (aEpoch <= mCancelContentJSEpoch) {
// The next page loaded before we got here, so we shouldn't try to cancel
// the content JS.
TABC_LOG("Unable to cancel content JS; the next page is already loaded!\n");
return NS_OK;
}

Expand Down
4 changes: 2 additions & 2 deletions gfx/layers/composite/ContainerLayerComposite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
# include "ProfilerMarkerPayload.h" // for LayerTranslationMarkerPayload
#endif

#define CULLING_LOG(...)
// #define CULLING_LOG(...) printf_stderr("CULLING: " __VA_ARGS__)
static mozilla::LazyLogModule sGfxCullLog("gfx.culling");
#define CULLING_LOG(...) MOZ_LOG(sGfxCullLog, LogLevel::Debug, (__VA_ARGS__))

#define DUMP(...) \
do { \
Expand Down
6 changes: 3 additions & 3 deletions layout/base/MobileViewportManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
#include "nsViewportInfo.h"
#include "UnitTransforms.h"

#define MVM_LOG(...)
// #define MVM_LOG(...) printf_stderr("MVM: " __VA_ARGS__)
static mozilla::LazyLogModule sApzMvmLog("apz.mobileviewport");
#define MVM_LOG(...) MOZ_LOG(sApzMvmLog, LogLevel::Debug, (__VA_ARGS__))

NS_IMPL_ISUPPORTS(MobileViewportManager, nsIDOMEventListener, nsIObserver)

Expand All @@ -36,7 +36,7 @@ MobileViewportManager::MobileViewportManager(MVMContext* aContext)
: mContext(aContext), mIsFirstPaint(false), mPainted(false) {
MOZ_ASSERT(mContext);

MVM_LOG("%p: creating with context %p\n", this, mContext);
MVM_LOG("%p: creating with context %p\n", this, mContext.get());

mContext->AddEventListener(DOM_META_ADDED, this, false);
mContext->AddEventListener(DOM_META_CHANGED, this, false);
Expand Down
18 changes: 12 additions & 6 deletions layout/base/PositionedEventTargeting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "mozilla/Preferences.h"
#include "mozilla/PresShell.h"
#include "mozilla/dom/MouseEventBinding.h"
#include "nsFrameList.h" // for DEBUG_FRAME_DUMP
#include "nsHTMLParts.h"
#include "nsLayoutUtils.h"
#include "nsGkAtoms.h"
Expand All @@ -28,10 +29,11 @@
using namespace mozilla;
using namespace mozilla::dom;

// If debugging this code you may wish to enable this logging, and also
// uncomment the DumpFrameTree call near the bottom of the file.
#define PET_LOG(...)
// #define PET_LOG(...) printf_stderr("PET: " __VA_ARGS__);
// If debugging this code you may wish to enable this logging, via
// the env var MOZ_LOG="event.retarget:4". For extra logging (getting
// frame dumps, use MOZ_LOG="event.retarget:5".
static mozilla::LazyLogModule sEvtTgtLog("event.retarget");
#define PET_LOG(...) MOZ_LOG(sEvtTgtLog, LogLevel::Debug, (__VA_ARGS__))

namespace mozilla {

Expand Down Expand Up @@ -616,10 +618,14 @@ nsIFrame* FindFrameTargetedByInputEvent(
}
PET_LOG("Final target is %p\n", target);

// Uncomment this to dump the frame tree to help with debugging.
#ifdef DEBUG_FRAME_DUMP
// At verbose logging level, dump the frame tree to help with debugging.
// Note that dumping the frame tree at the top of the function may flood
// logcat on Android devices and cause the PET_LOGs to get dropped.
// aRootFrame->DumpFrameTree();
if (MOZ_LOG_TEST(sEvtTgtLog, LogLevel::Verbose)) {
aRootFrame->DumpFrameTree();
}
#endif

if (!target || !prefs->mRepositionEventCoords) {
// No repositioning required for this event
Expand Down
4 changes: 2 additions & 2 deletions layout/base/ZoomConstraintsClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
#include "Units.h"
#include "UnitTransforms.h"

#define ZCC_LOG(...)
// #define ZCC_LOG(...) printf_stderr("ZCC: " __VA_ARGS__)
static mozilla::LazyLogModule sApzZoomLog("apz.zoom");
#define ZCC_LOG(...) MOZ_LOG(sApzZoomLog, LogLevel::Debug, (__VA_ARGS__))

NS_IMPL_ISUPPORTS(ZoomConstraintsClient, nsIDOMEventListener, nsIObserver)

Expand Down
5 changes: 3 additions & 2 deletions layout/generic/nsGfxScrollFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,9 @@
#include <cstdlib> // for std::abs(int/long)
#include <cmath> // for std::abs(float/double)

#define PAINT_SKIP_LOG(...)
// #define PAINT_SKIP_LOG(...) printf_stderr("PSKIP: " __VA_ARGS__)
static mozilla::LazyLogModule sApzPaintSkipLog("apz.paintskip");
#define PAINT_SKIP_LOG(...) \
MOZ_LOG(sApzPaintSkipLog, LogLevel::Debug, (__VA_ARGS__))

using namespace mozilla;
using namespace mozilla::dom;
Expand Down

0 comments on commit 85c3d9e

Please sign in to comment.