Bug 1417356 - xpcshell doesn't have Java thread. r?jchen draft
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Thu, 16 Nov 2017 12:25:26 +0900
changeset 698796 5f4b573d12dcf1c7a6adae71b571502cfe2ee18f
parent 698679 f41930a869a84af81df1a88d8e82323ff3a6509a
child 740436 c66668464239344de3a2d4e86daab9c4a5a5f499
push id89354
push userbmo:m_kato@ga2.so-net.ne.jp
push dateThu, 16 Nov 2017 03:29:25 +0000
reviewersjchen
bugs1417356, 1403690
milestone59.0a1
Bug 1417356 - xpcshell doesn't have Java thread. r?jchen This is a regression by bug 1403690. After landing this, some xpcshell tests cause crash with stylo. mozilla::java::GeckoAppShell::GetShowPasswordSetting doesn't work on xpcshell test. If JNI isn't available such as xpcshell, we shouldn't use this method. MozReview-Commit-ID: AUrT93SkQ2H
widget/android/nsLookAndFeel.cpp
--- a/widget/android/nsLookAndFeel.cpp
+++ b/widget/android/nsLookAndFeel.cpp
@@ -510,15 +510,17 @@ nsLookAndFeel::EnsureInitSystemColors()
     }
 }
 
 void
 nsLookAndFeel::EnsureInitShowPassword()
 {
     if (!mInitializedShowPassword) {
         if (XRE_IsParentProcess()) {
-            mShowPassword = java::GeckoAppShell::GetShowPasswordSetting();
+            mShowPassword = jni::IsAvailable() ?
+                                java::GeckoAppShell::GetShowPasswordSetting() :
+                                false; // xpcshell case
         } else {
             ContentChild::GetSingleton()->SendGetShowPasswordSetting(&mShowPassword);
         }
         mInitializedShowPassword = true;
     }
 }