Bug 1448091 part 1: Accessible HandlerProvider: Return an error if refreshing the cache fails. r=MarcoZ
authorJames Teh <jteh@mozilla.com>
Fri, 23 Mar 2018 11:44:05 -0400
changeset 463214 702ffbc7ccd54d86913b43becf7a559da8b3f189
parent 463213 8b9c47146c70949d5c7a09dab6f3dcfd41789929
child 463215 a61e917f9406110b7d84ccc01416fda61c8bf4d0
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMarcoZ
bugs1448091
milestone61.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 1448091 part 1: Accessible HandlerProvider: Return an error if refreshing the cache fails. r=MarcoZ BuildDynamicIA2Data can't return an HRESULT; failure is communicated by the fact that the unique id in the data is set to 0. However, IGeckoBackChannel::Refresh returned S_OK even if BuildDynamicIA2Data failed. We now check the unique id and return an appropriate error code if it's 0. Among other things, this means that the handler will return an error when querying dead objects instead of returning stale cache data. MozReview-Commit-ID: IorDRHCItD8
accessible/ipc/win/HandlerProvider.cpp
--- a/accessible/ipc/win/HandlerProvider.cpp
+++ b/accessible/ipc/win/HandlerProvider.cpp
@@ -551,16 +551,26 @@ HandlerProvider::Refresh(DynamicIA2Data*
   }
 
   if (!mscom::InvokeOnMainThread("HandlerProvider::BuildDynamicIA2Data",
                                  this, &HandlerProvider::BuildDynamicIA2Data,
                                  aOutData)) {
     return E_FAIL;
   }
 
+  if (!aOutData->mUniqueId) {
+    // BuildDynamicIA2Data failed.
+    if (!mTargetUnk) {
+      // Even though we checked this before, the accessible can be shut down
+      // before BuildDynamicIA2Data executes on the main thread.
+      return CO_E_OBJNOTCONNECTED;
+    }
+    return E_FAIL;
+  }
+
   return S_OK;
 }
 
 template<typename Interface>
 HRESULT
 HandlerProvider::ToWrappedObject(Interface** aObj)
 {
   mscom::STAUniquePtr<Interface> inObj(*aObj);