Bug 1159455 - Fix assorted debugging strings in APZ code. r=botond
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 30 Apr 2015 14:30:37 -0400
changeset 273257 0cca6dda74672cc6203a2b6844ebbc1de34de060
parent 273256 67cb17031e9f79452f37a4161cd8ee5f5d39b0bc
child 273258 262243fb509a6190003a8021013cb8f7370ec335
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbotond
bugs1159455
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1159455 - Fix assorted debugging strings in APZ code. r=botond
gfx/layers/apz/src/AsyncPanZoomController.cpp
gfx/layers/apz/src/GestureEventListener.cpp
gfx/layers/apz/src/InputBlockState.cpp
gfx/layers/apz/util/APZEventState.cpp
gfx/layers/apz/util/APZThreadUtils.cpp
--- a/gfx/layers/apz/src/AsyncPanZoomController.cpp
+++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp
@@ -2956,17 +2956,17 @@ const FrameMetrics& AsyncPanZoomControll
 
 APZCTreeManager* AsyncPanZoomController::GetApzcTreeManager() const {
   mMonitor.AssertNotCurrentThreadIn();
   return mTreeManager;
 }
 
 void AsyncPanZoomController::ZoomToRect(CSSRect aRect) {
   if (!aRect.IsFinite()) {
-    NS_WARNING("ZoomToRect got called with a non-finite rect; ignoring...\n");
+    NS_WARNING("ZoomToRect got called with a non-finite rect; ignoring...");
     return;
   }
 
   // Only the root APZC is zoomable, and the root APZC is not allowed to have
   // different x and y scales. If it did, the calculations in this function
   // would have to be adjusted (as e.g. it would no longer be valid to take
   // the minimum or maximum of the ratios of the widths and heights of the
   // page rect and the composition bounds).
@@ -3125,17 +3125,17 @@ bool AsyncPanZoomController::IsTransform
 bool AsyncPanZoomController::IsInPanningState() const {
   return (mState == PANNING || mState == PANNING_LOCKED_X || mState == PANNING_LOCKED_Y);
 }
 
 void AsyncPanZoomController::UpdateZoomConstraints(const ZoomConstraints& aConstraints) {
   APZC_LOG("%p updating zoom constraints to %d %d %f %f\n", this, aConstraints.mAllowZoom,
     aConstraints.mAllowDoubleTapZoom, aConstraints.mMinZoom.scale, aConstraints.mMaxZoom.scale);
   if (IsNaN(aConstraints.mMinZoom.scale) || IsNaN(aConstraints.mMaxZoom.scale)) {
-    NS_WARNING("APZC received zoom constraints with NaN values; dropping...\n");
+    NS_WARNING("APZC received zoom constraints with NaN values; dropping...");
     return;
   }
   // inf float values and other bad cases should be sanitized by the code below.
   mZoomConstraints.mAllowZoom = aConstraints.mAllowZoom;
   mZoomConstraints.mAllowDoubleTapZoom = aConstraints.mAllowDoubleTapZoom;
   mZoomConstraints.mMinZoom = (MIN_ZOOM > aConstraints.mMinZoom ? MIN_ZOOM : aConstraints.mMinZoom);
   mZoomConstraints.mMaxZoom = (MAX_ZOOM > aConstraints.mMaxZoom ? aConstraints.mMaxZoom : MAX_ZOOM);
   if (mZoomConstraints.mMaxZoom < mZoomConstraints.mMinZoom) {
--- a/gfx/layers/apz/src/GestureEventListener.cpp
+++ b/gfx/layers/apz/src/GestureEventListener.cpp
@@ -5,16 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "GestureEventListener.h"
 #include <math.h>                       // for fabsf
 #include <stddef.h>                     // for size_t
 #include "AsyncPanZoomController.h"     // for AsyncPanZoomController
 #include "base/task.h"                  // for CancelableTask, etc
 #include "gfxPrefs.h"                   // for gfxPrefs
+#include "mozilla/SizePrintfMacros.h"   // for PRIuSIZE
 #include "nsDebug.h"                    // for NS_WARNING
 #include "nsMathUtils.h"                // for NS_hypot
 
 #define GEL_LOG(...)
 // #define GEL_LOG(...) printf_stderr("GEL: " __VA_ARGS__)
 
 namespace mozilla {
 namespace layers {
@@ -73,17 +74,17 @@ GestureEventListener::GestureEventListen
 }
 
 GestureEventListener::~GestureEventListener()
 {
 }
 
 nsEventStatus GestureEventListener::HandleInputEvent(const MultiTouchInput& aEvent)
 {
-  GEL_LOG("Receiving event type %d with %lu touches in state %d\n", aEvent.mType, aEvent.mTouches.Length(), mState);
+  GEL_LOG("Receiving event type %d with %" PRIuSIZE " touches in state %d\n", aEvent.mType, aEvent.mTouches.Length(), mState);
 
   nsEventStatus rv = nsEventStatus_eIgnore;
 
   // Cache the current event since it may become the single or long tap that we
   // send.
   mLastTouchInput = aEvent;
 
   switch (aEvent.mType) {
--- a/gfx/layers/apz/src/InputBlockState.cpp
+++ b/gfx/layers/apz/src/InputBlockState.cpp
@@ -1,18 +1,19 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set sw=2 ts=8 et 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/. */
 
 #include "InputBlockState.h"
-#include "mozilla/layers/APZCTreeManager.h" // for AllowedTouchBehavior
 #include "AsyncPanZoomController.h"         // for AsyncPanZoomController
 #include "gfxPrefs.h"                       // for gfxPrefs
+#include "mozilla/SizePrintfMacros.h"       // for PRIuSIZE
+#include "mozilla/layers/APZCTreeManager.h" // for AllowedTouchBehavior
 #include "OverscrollHandoffState.h"
 
 #define TBS_LOG(...)
 // #define TBS_LOG(...) printf_stderr("TBS: " __VA_ARGS__)
 
 namespace mozilla {
 namespace layers {
 
@@ -242,25 +243,25 @@ bool
 WheelBlockState::HasEvents() const
 {
   return !mEvents.IsEmpty();
 }
 
 void
 WheelBlockState::DropEvents()
 {
-  TBS_LOG("%p dropping %lu events\n", this, mEvents.Length());
+  TBS_LOG("%p dropping %" PRIuSIZE " events\n", this, mEvents.Length());
   mEvents.Clear();
 }
 
 void
 WheelBlockState::HandleEvents()
 {
   while (HasEvents()) {
-    TBS_LOG("%p returning first of %lu events\n", this, mEvents.Length());
+    TBS_LOG("%p returning first of %" PRIuSIZE " events\n", this, mEvents.Length());
     ScrollWheelInput event = mEvents[0];
     mEvents.RemoveElementAt(0);
     GetTargetApzc()->HandleInputEvent(event, mTransformToApzc);
   }
 }
 
 bool
 WheelBlockState::MustStayActive()
@@ -411,17 +412,17 @@ TouchBlockState::TouchBlockState(const n
 }
 
 bool
 TouchBlockState::SetAllowedTouchBehaviors(const nsTArray<TouchBehaviorFlags>& aBehaviors)
 {
   if (mAllowedTouchBehaviorSet) {
     return false;
   }
-  TBS_LOG("%p got allowed touch behaviours for %lu points\n", this, aBehaviors.Length());
+  TBS_LOG("%p got allowed touch behaviours for %" PRIuSIZE " points\n", this, aBehaviors.Length());
   mAllowedTouchBehaviors.AppendElements(aBehaviors);
   mAllowedTouchBehaviorSet = true;
   return true;
 }
 
 bool
 TouchBlockState::GetAllowedTouchBehaviors(nsTArray<TouchBehaviorFlags>& aOutBehaviors) const
 {
@@ -511,25 +512,25 @@ const char*
 TouchBlockState::Type()
 {
   return "touch";
 }
 
 void
 TouchBlockState::DropEvents()
 {
-  TBS_LOG("%p dropping %lu events\n", this, mEvents.Length());
+  TBS_LOG("%p dropping %" PRIuSIZE " events\n", this, mEvents.Length());
   mEvents.Clear();
 }
 
 void
 TouchBlockState::HandleEvents()
 {
   while (HasEvents()) {
-    TBS_LOG("%p returning first of %lu events\n", this, mEvents.Length());
+    TBS_LOG("%p returning first of %" PRIuSIZE " events\n", this, mEvents.Length());
     MultiTouchInput event = mEvents[0];
     mEvents.RemoveElementAt(0);
     GetTargetApzc()->HandleInputEvent(event, mTransformToApzc);
   }
 }
 
 bool
 TouchBlockState::TouchActionAllowsPinchZoom() const
--- a/gfx/layers/apz/util/APZEventState.cpp
+++ b/gfx/layers/apz/util/APZEventState.cpp
@@ -12,17 +12,17 @@
 #include "nsDocShell.h"
 #include "nsIDOMWindowUtils.h"
 #include "nsITimer.h"
 #include "nsIWeakReferenceUtils.h"
 #include "nsIWidget.h"
 #include "TouchManager.h"
 
 #define APZES_LOG(...)
-// #define APZES_LOG(...) printf_stderr("APZCCH: " __VA_ARGS__)
+// #define APZES_LOG(...) printf_stderr("APZES: " __VA_ARGS__)
 
 // Static helper functions
 namespace {
 
 int32_t
 WidgetModifiersToDOMModifiers(mozilla::Modifiers aModifiers)
 {
   int32_t result = 0;
--- a/gfx/layers/apz/util/APZThreadUtils.cpp
+++ b/gfx/layers/apz/util/APZThreadUtils.cpp
@@ -62,17 +62,17 @@ APZThreadUtils::RunOnControllerThread(Ta
     aTask->Run();
     delete aTask;
   } else {
     AndroidBridge::Bridge()->PostTaskToUiThread(aTask, 0);
   }
 #else
   if (!sControllerThread) {
     // Could happen on startup
-    NS_WARNING("Dropping task posted to controller thread\n");
+    NS_WARNING("Dropping task posted to controller thread");
     delete aTask;
     return;
   }
 
   if (sControllerThread == MessageLoop::current()) {
     aTask->Run();
     delete aTask;
   } else {