Bug 1319850 - part 2, Update MessageLoop so that it supports MessagePumpForAndroidUI r=nfroyd
authorRandall Barker <rbarker@mozilla.com>
Wed, 30 Nov 2016 14:58:38 -0800
changeset 453563 7f1ec68f6e5b1f778bbf63ac9a0ed19c958d4471
parent 453562 ab1843cc574e33893ac6284e81be8ebf1096926b
child 453564 7b28041341d67fbb0d4123daa326389953e9c04b
push id39711
push userdmitchell@mozilla.com
push dateFri, 23 Dec 2016 21:59:47 +0000
reviewersnfroyd
bugs1319850
milestone53.0a1
Bug 1319850 - part 2, Update MessageLoop so that it supports MessagePumpForAndroidUI r=nfroyd
ipc/chromium/src/base/message_loop.cc
ipc/chromium/src/base/message_loop.h
--- a/ipc/chromium/src/base/message_loop.cc
+++ b/ipc/chromium/src/base/message_loop.cc
@@ -125,16 +125,22 @@ MessageLoop::MessageLoop(Type type, nsIT
   case TYPE_MOZILLA_NONMAINTHREAD:
     pump_ = new mozilla::ipc::MessagePumpForNonMainThreads(aThread);
     return;
 #if defined(OS_WIN)
   case TYPE_MOZILLA_NONMAINUITHREAD:
     pump_ = new mozilla::ipc::MessagePumpForNonMainUIThreads(aThread);
     return;
 #endif
+#if defined(MOZ_WIDGET_ANDROID)
+  case TYPE_MOZILLA_ANDROID_UI:
+    MOZ_RELEASE_ASSERT(aThread);
+    pump_ = new mozilla::ipc::MessagePumpForAndroidUI(aThread);
+    return;
+#endif // defined(MOZ_WIDGET_ANDROID)
   default:
     // Create one of Chromium's standard MessageLoop types below.
     break;
   }
 
 #if defined(OS_WIN)
   // TODO(rvargas): Get rid of the OS guards.
   if (type_ == TYPE_DEFAULT) {
--- a/ipc/chromium/src/base/message_loop.h
+++ b/ipc/chromium/src/base/message_loop.h
@@ -175,17 +175,18 @@ public:
   //
   enum Type {
     TYPE_DEFAULT,
     TYPE_UI,
     TYPE_IO,
     TYPE_MOZILLA_CHILD,
     TYPE_MOZILLA_PARENT,
     TYPE_MOZILLA_NONMAINTHREAD,
-    TYPE_MOZILLA_NONMAINUITHREAD
+    TYPE_MOZILLA_NONMAINUITHREAD,
+    TYPE_MOZILLA_ANDROID_UI
   };
 
   // Normally, it is not necessary to instantiate a MessageLoop.  Instead, it
   // is typical to make use of the current thread's MessageLoop instance.
   explicit MessageLoop(Type type = TYPE_DEFAULT, nsIThread* aThread = nullptr);
   ~MessageLoop();
 
   // Returns the type passed to the constructor.