Bug 682921 - Use DEBUG_ANDROID_FOO instead of ANDROID_DEBUG_FOO; r=dougt
authorJames Willcox <jwillcox@mozilla.com>
Mon, 29 Aug 2011 14:29:39 -0400
changeset 76358 e817b1753380d9d7f067d30929a438fb8417d1f6
parent 76357 6c63fffe3b216260a9fae5b4b0ea6d8f985b0b67
child 76359 05e7c10be3a2db79b1546754e4a2434815da30fa
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersdougt
bugs682921
milestone9.0a1
Bug 682921 - Use DEBUG_ANDROID_FOO instead of ANDROID_DEBUG_FOO; r=dougt This allows people to use the --with-debug-label configure options instead of editing source files.
widget/src/android/AndroidBridge.h
widget/src/android/AndroidJavaWrappers.cpp
widget/src/android/nsAppShell.cpp
widget/src/android/nsWindow.cpp
--- a/widget/src/android/AndroidBridge.h
+++ b/widget/src/android/AndroidBridge.h
@@ -47,18 +47,18 @@
 
 #include "AndroidJavaWrappers.h"
 
 #include "nsIMutableArray.h"
 #include "nsIMIMEInfo.h"
 #include "nsColor.h"
 
 // Some debug #defines
-// #define ANDROID_DEBUG_EVENTS
-// #define ANDROID_DEBUG_WIDGET
+// #define DEBUG_ANDROID_EVENTS
+// #define DEBUG_ANDROID_WIDGET
 
 class nsWindow;
 
 namespace mozilla {
 
 // The order and number of the members in this structure must correspond
 // to the attrsAppearance array in GeckoAppShell.getSystemColors()
 typedef struct AndroidSystemColors {
--- a/widget/src/android/AndroidJavaWrappers.cpp
+++ b/widget/src/android/AndroidJavaWrappers.cpp
@@ -434,17 +434,17 @@ AndroidGeckoEvent::Init(JNIEnv *jenv, jo
             ReadCharactersField(jenv);
             break;
         }
 
         default:
             break;
     }
 
-#ifndef ANDROID_DEBUG_EVENTS
+#ifndef DEBUG_ANDROID_EVENTS
     ALOG("AndroidGeckoEvent: %p : %d", (void*)jobj, mType);
 #endif
 }
 
 void
 AndroidGeckoEvent::Init(int aType)
 {
     mType = aType;
--- a/widget/src/android/nsAppShell.cpp
+++ b/widget/src/android/nsAppShell.cpp
@@ -55,17 +55,17 @@
 #include <pthread.h>
 #include <wchar.h>
 
 #ifdef MOZ_LOGGING
 #define FORCE_PR_LOG
 #include "prlog.h"
 #endif
 
-#ifdef ANDROID_DEBUG_EVENTS
+#ifdef DEBUG_ANDROID_EVENTS
 #define EVLOG(args...)  ALOG(args)
 #else
 #define EVLOG(args...) do { } while (0)
 #endif
 
 using namespace mozilla;
 
 #ifdef PR_LOGGING
@@ -212,17 +212,17 @@ nsAppShell::ProcessNextNativeEvent(PRBoo
     nsAutoPtr<AndroidGeckoEvent> curEvent;
     AndroidGeckoEvent *nextEvent;
     {
         MutexAutoLock lock(mCondLock);
 
         curEvent = GetNextEvent();
         if (!curEvent && mayWait) {
             // hmm, should we really hardcode this 10s?
-#if defined(ANDROID_DEBUG_EVENTS)
+#if defined(DEBUG_ANDROID_EVENTS)
             PRTime t0, t1;
             EVLOG("nsAppShell: waiting on mQueueCond");
             t0 = PR_Now();
 
             mQueueCond.Wait(PR_MillisecondsToInterval(10000));
             t1 = PR_Now();
             EVLOG("nsAppShell: wait done, waited %d ms", (int)(t1-t0)/1000);
 #else
@@ -251,17 +251,17 @@ nsAppShell::ProcessNextNativeEvent(PRBoo
             // deal with sequences that look like:
             //   MOVE DRAW MOVE DRAW MOVE DRAW
             // and end up with just
             //   MOVE DRAW
             // when we process all the events.
             RemoveNextEvent();
             delete nextEvent;
 
-#if defined(ANDROID_DEBUG_EVENTS)
+#if defined(DEBUG_ANDROID_EVENTS)
             ALOG("# Removing DRAW event (%d outstanding)", mNumDraws);
 #endif
 
             nextEvent = PeekNextEvent();
             nextType = nextEvent->Type();
         }
 
         // If the next type of event isn't the same as the current type,
@@ -272,17 +272,17 @@ nsAppShell::ProcessNextNativeEvent(PRBoo
         // Can only coalesce motion move events, for motion events
         if (curType != AndroidGeckoEvent::MOTION_EVENT)
             break;
 
         if (!(curEvent->Action() == AndroidMotionEvent::ACTION_MOVE &&
               nextEvent->Action() == AndroidMotionEvent::ACTION_MOVE))
             break;
 
-#if defined(ANDROID_DEBUG_EVENTS)
+#if defined(DEBUG_ANDROID_EVENTS)
         ALOG("# Removing % 2d event", curType);
 #endif
 
         RemoveNextEvent();
         curEvent = nextEvent;
         nextEvent = PeekNextEvent();
     }
 
--- a/widget/src/android/nsWindow.cpp
+++ b/widget/src/android/nsWindow.cpp
@@ -369,17 +369,17 @@ nsWindow::Show(PRBool aState)
                 win->BringToFront();
                 break;
             }
         }
     } else if (FindTopLevel() == TopWindow()) {
         nsAppShell::gAppShell->PostEvent(new AndroidGeckoEvent(-1, -1, -1, -1));
     }
 
-#ifdef ANDROID_DEBUG_WIDGET
+#ifdef DEBUG_ANDROID_WIDGET
     DumpWindows();
 #endif
 
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsWindow::SetModal(PRBool aState)
@@ -1582,23 +1582,23 @@ nsWindow::OnKeyEvent(AndroidGeckoEvent *
     if (!firePress)
         return;
 
     nsKeyEvent pressEvent(PR_TRUE, NS_KEY_PRESS, this);
     InitKeyEvent(pressEvent, *ae);
     if (status == nsEventStatus_eConsumeNoDefault) {
         pressEvent.flags |= NS_EVENT_FLAG_NO_DEFAULT;
     }
-#ifdef ANDROID_DEBUG_WIDGET
+#ifdef DEBUG_ANDROID_WIDGET
     __android_log_print(ANDROID_LOG_INFO, "Gecko", "Dispatching key pressEvent with keyCode %d charCode %d shift %d alt %d sym/ctrl %d metamask %d", pressEvent.keyCode, pressEvent.charCode, pressEvent.isShift, pressEvent.isAlt, pressEvent.isControl, ae->MetaState());
 #endif
     DispatchEvent(&pressEvent);
 }
 
-#ifdef ANDROID_DEBUG_IME
+#ifdef DEBUG_ANDROID_IME
 #define ALOGIME(args...) ALOG(args)
 #else
 #define ALOGIME(args...)
 #endif
 
 void
 nsWindow::OnIMEAddRange(AndroidGeckoEvent *ae)
 {