Making a way to create thread with a Java Looper for Android

We need to create a new message loop type for this as for
testing the Android UI message pump type is not the standard Java, but gets overridden to a different one that can handle nested message loops.

Using the new Java thread for the java bridge thread, so the thread used for AJI callbacks will have a prepared Looper.

BUG=b/8680913
TBR=jochen@chromium.org

Review URL: https://chromiumcodereview.appspot.com/18584006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@216349 0039d316-1c4b-4281-b951-d872f2087c98


CrOS-Libchrome-Original-Commit: 349ad5872a8ff25729e1b67ad24a09b64571c04c
diff --git a/base/message_loop/message_loop.h b/base/message_loop/message_loop.h
index 6f71a85..f22c904 100644
--- a/base/message_loop/message_loop.h
+++ b/base/message_loop/message_loop.h
@@ -109,10 +109,19 @@
   //   This type of ML also supports asynchronous IO.  See also
   //   MessageLoopForIO.
   //
+  // TYPE_JAVA
+  //   This type of ML is backed by a Java message handler which is responsible
+  //   for running the tasks added to the ML. This is only for use on Android.
+  //   TYPE_JAVA behaves in essence like TYPE_UI, except during construction
+  //   where it does not use the main thread specific pump factory.
+  //
   enum Type {
     TYPE_DEFAULT,
     TYPE_UI,
-    TYPE_IO
+    TYPE_IO,
+#if defined(OS_ANDROID)
+    TYPE_JAVA,
+#endif // defined(OS_ANDROID)
   };
 
   // Normally, it is not necessary to instantiate a MessageLoop.  Instead, it