Bug 1581719: Change QI assertion in AccessibleWrap::GetRemoteIAccessibleFor to a warning. r=MarcoZ
authorJames Teh <jteh@mozilla.com>
Mon, 02 Dec 2019 06:13:55 +0000
changeset 504795 4b4d691f63dabc03eeeaf2898ce06f0fe97ce114
parent 504794 f4f9195bd6284cf8801a8eeed21bf9b0d827d0be
child 504796 b8f3a97900e5148daed8c0aae87243b8ef4a2c31
push id36867
push userrmaries@mozilla.com
push dateMon, 02 Dec 2019 09:12:09 +0000
treeherdermozilla-central@b8f3a97900e5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMarcoZ
bugs1581719
milestone72.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 1581719: Change QI assertion in AccessibleWrap::GetRemoteIAccessibleFor to a warning. r=MarcoZ Sometimes, when running tests, fetching IDispatch for a remote IAccessible succeeds, but QueryInterface to IAccessible fails. This is probably because the remote Accessible died between these two calls. While we want to know about this in case of real problems in future, it usually doesn't indicate a problem, so make it a warning. Differential Revision: https://phabricator.services.mozilla.com/D55404
accessible/windows/msaa/AccessibleWrap.cpp
--- a/accessible/windows/msaa/AccessibleWrap.cpp
+++ b/accessible/windows/msaa/AccessibleWrap.cpp
@@ -1580,17 +1580,19 @@ already_AddRefed<IAccessible> Accessible
     }
 
     if (!disp) {
       continue;
     }
 
     DebugOnly<HRESULT> hr =
         disp->QueryInterface(IID_IAccessible, getter_AddRefs(result));
-    MOZ_ASSERT(SUCCEEDED(hr));
+    // QI can fail on rare occasions if the Accessible dies after we fetched
+    // disp but before we QI.
+    NS_WARNING_ASSERTION(SUCCEEDED(hr), "QI failed on remote IDispatch");
     return result.forget();
   }
 
   return nullptr;
 }
 
 void AccessibleWrap::UpdateSystemCaretFor(Accessible* aAccessible) {
   // Move the system caret so that Windows Tablet Edition and tradional ATs with