Bug 709595 - Add a name for each java thread and timer to aide with debugging. r=blassey
authorDoug Turner <dougt@dougt.org>
Mon, 12 Dec 2011 16:27:35 +0800
changeset 84073 0ce8da61c6cc43f6626638b5f59cf15a30cb0621
parent 84072 c65be44ac4898d8af28ad11b3ab0a6fb3aeb57c3
child 84074 bcc015450e7a2ef9d23256adf266017461f08fc1
push id519
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 00:38:35 +0000
treeherdermozilla-beta@788ea1ef610b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersblassey
bugs709595
milestone11.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 709595 - Add a name for each java thread and timer to aide with debugging. r=blassey
mobile/android/base/CrashReporter.java.in
mobile/android/base/GeckoApp.java
mobile/android/base/GeckoAppShell.java
mobile/android/base/GeckoInputConnection.java
mobile/android/base/ui/PanZoomController.java
--- a/mobile/android/base/CrashReporter.java.in
+++ b/mobile/android/base/CrashReporter.java.in
@@ -160,17 +160,17 @@ public class CrashReporter extends Activ
             return;
         }
 
         mProgressDialog.show();
         new Thread(new Runnable() {
             public void run() {
                 sendReport(mPendingMinidumpFile, mExtrasStringMap, mPendingExtrasFile);
             }
-        }).start();
+            }, "CrashReporter Thread").start();
     }
 
     public void onCloseClick(View v) {  // bound via crash_reporter.xml
         backgroundSendReport();
     }
 
     public void onRestartClick(View v) {  // bound via crash_reporter.xml
         doRestart();
--- a/mobile/android/base/GeckoApp.java
+++ b/mobile/android/base/GeckoApp.java
@@ -2033,17 +2033,17 @@ abstract public class GeckoApp
                 public void run() {
                     try {
                         Log.i(LOGTAG,"resolving: " + u.getHost());
                         InetAddress.getByName(u.getHost());
                     } catch (Exception e) {
                         // we really don't care.
                     }
                 }
-            }).start();
+            }, "DNSPrefetcher Thread").start();
     }
 }
 
 class PluginLayoutParams extends AbsoluteLayout.LayoutParams
 {
     private static final int MAX_DIMENSION = 2048;
     private static final String LOGTAG = "GeckoApp.PluginLayoutParams";
 
--- a/mobile/android/base/GeckoAppShell.java
+++ b/mobile/android/base/GeckoAppShell.java
@@ -141,16 +141,17 @@ public class GeckoAppShell
     public static native void freeDirectBuffer(ByteBuffer buf);
 
     // A looper thread, accessed by GeckoAppShell.getHandler
     private static class LooperThread extends Thread {
         public SynchronousQueue<Handler> mHandlerQueue =
             new SynchronousQueue<Handler>();
         
         public void run() {
+            setName("GeckoLooper Thread");
             Looper.prepare();
             try {
                 mHandlerQueue.put(new Handler());
             } catch (InterruptedException ie) {}
             Looper.loop();
         }
     }
 
--- a/mobile/android/base/GeckoInputConnection.java
+++ b/mobile/android/base/GeckoInputConnection.java
@@ -1004,17 +1004,17 @@ public class GeckoInputConnection
     public void returnIMEQueryResult(String result, int selectionStart, int selectionLength) {
         mSelectionStart = selectionStart;
         mSelectionLength = selectionLength;
         try {
             mQueryResult.put(result);
         } catch (InterruptedException e) {}
     }
 
-    static private final Timer mIMETimer = new Timer();
+    static private final Timer mIMETimer = new Timer("GeckoInputConnection Timer");
 
     static private final int NOTIFY_IME_RESETINPUTSTATE = 0;
     static private final int NOTIFY_IME_SETOPENSTATE = 1;
     static private final int NOTIFY_IME_CANCELCOMPOSITION = 2;
     static private final int NOTIFY_IME_FOCUSCHANGE = 3;
 
 
     /* Delay updating IME states (see bug 573800) */
--- a/mobile/android/base/ui/PanZoomController.java
+++ b/mobile/android/base/ui/PanZoomController.java
@@ -508,17 +508,17 @@ public class PanZoomController
 
     /* Starts the fling or bounce animation. */
     private void startAnimationTimer(final Runnable runnable) {
         if (mAnimationTimer != null) {
             Log.e(LOGTAG, "Attempted to start a new fling without canceling the old one!");
             stopAnimationTimer();
         }
 
-        mAnimationTimer = new Timer();
+        mAnimationTimer = new Timer("Animation Timer");
         mAnimationTimer.scheduleAtFixedRate(new TimerTask() {
             @Override
             public void run() { mController.post(runnable); }
         }, 0, 1000L/60L);
     }
 
     /* Stops the fling or bounce animation. */
     private void stopAnimationTimer() {