Bug 1382335 - 2. Revert workaround from bug 1372777; r=esawin
authorJim Chen <nchen@mozilla.com>
Mon, 31 Jul 2017 12:30:13 -0400
changeset 420792 81735bcac861e602c6b335060bdb33d1255afdb0
parent 420791 3a434c64cc3b9548ae5a4ba8a526c16594061940
child 420793 094fa02f34a36e8aaea9f5e0ef61f6a35238a758
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersesawin
bugs1382335, 1372777
milestone56.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 1382335 - 2. Revert workaround from bug 1372777; r=esawin Introduce the crash again to get more crash reports for analysis. MozReview-Commit-ID: DYq95o5RpzB
widget/android/jni/Natives.h
widget/android/nsWindow.cpp
--- a/widget/android/jni/Natives.h
+++ b/widget/android/jni/Natives.h
@@ -418,31 +418,29 @@ class ProxyNativeCall
         (*mNativeCall)(mozilla::Get<Indices>(mArgs)...);
     }
 
     template<bool Static, bool ThisArg, size_t... Indices>
     typename mozilla::EnableIf<!Static && ThisArg, void>::Type
     Call(const typename Owner::LocalRef& inst,
          mozilla::IndexSequence<Indices...>) const
     {
-        if (Impl* const impl = NativePtr<Impl>::Get(inst)) {
-            MOZ_CATCH_JNI_EXCEPTION(inst.Env());
-            (impl->*mNativeCall)(inst, mozilla::Get<Indices>(mArgs)...);
-        }
+        Impl* const impl = NativePtr<Impl>::Get(inst);
+        MOZ_CATCH_JNI_EXCEPTION(inst.Env());
+        (impl->*mNativeCall)(inst, mozilla::Get<Indices>(mArgs)...);
     }
 
     template<bool Static, bool ThisArg, size_t... Indices>
     typename mozilla::EnableIf<!Static && !ThisArg, void>::Type
     Call(const typename Owner::LocalRef& inst,
          mozilla::IndexSequence<Indices...>) const
     {
-        if (Impl* const impl = NativePtr<Impl>::Get(inst)) {
-            MOZ_CATCH_JNI_EXCEPTION(inst.Env());
-            (impl->*mNativeCall)(mozilla::Get<Indices>(mArgs)...);
-        }
+        Impl* const impl = NativePtr<Impl>::Get(inst);
+        MOZ_CATCH_JNI_EXCEPTION(inst.Env());
+        (impl->*mNativeCall)(mozilla::Get<Indices>(mArgs)...);
     }
 
     template<size_t... Indices>
     void Clear(JNIEnv* env, mozilla::IndexSequence<Indices...>)
     {
         int dummy[] = {
             (ProxyArg<Args>::Clear(env, Get<Indices>(mArgs)), 0)...
         };
--- a/widget/android/nsWindow.cpp
+++ b/widget/android/nsWindow.cpp
@@ -972,24 +972,21 @@ public:
                 : mCompositor(mozilla::Move(aCompositor))
             {}
 
             void Run() override
             {
                 MOZ_ASSERT(NS_IsMainThread());
 
                 JNIEnv* const env = jni::GetGeckoThreadEnv();
-                // Make sure LayerViewSupport hasn't been detached from the
-                // Java object since this event was dispatched.
-                if (LayerViewSupport* const lvs = GetNative(
-                        LayerView::Compositor::LocalRef(env, mCompositor))) {
-                    MOZ_CATCH_JNI_EXCEPTION(env);
+                LayerViewSupport* const lvs = GetNative(
+                        LayerView::Compositor::LocalRef(env, mCompositor));
+                MOZ_CATCH_JNI_EXCEPTION(env);
 
-                    lvs->OnResumedCompositor();
-                }
+                lvs->OnResumedCompositor();
             }
         };
 
         // Use priority queue for timing-sensitive event.
         nsAppShell::PostEvent(MakeUnique<LayerViewEvent>(
                 MakeUnique<OnResumedEvent>(aObj)));
     }