Bug 1430938 part 2: AccessibleHandler: When QueryService is called for IAccessibleAction or IAccessibleText, just use QI. r=MarcoZ
authorJames Teh <jteh@mozilla.com>
Wed, 17 Jan 2018 10:23:07 +1000
changeset 453867 b38266ed3cd460c0e941f85609b76defb20baba4
parent 453866 a5075d2577012fcf220bd89d6715df274efed291
child 453868 6a91181c84aa559e4106c2020913d1b4671fbdc7
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMarcoZ
bugs1430938
milestone59.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 1430938 part 2: AccessibleHandler: When QueryService is called for IAccessibleAction or IAccessibleText, just use QI. r=MarcoZ JAWS uses QueryService for these. Using QI avoids a cross-process call, since we have these interfaces cached. More importantly, if QS is used, the handler won't get used for that object, so our caching won't be used. MozReview-Commit-ID: Ejc2Bjp7NSv
accessible/ipc/win/handler/AccessibleHandler.cpp
--- a/accessible/ipc/win/handler/AccessibleHandler.cpp
+++ b/accessible/ipc/win/handler/AccessibleHandler.cpp
@@ -1241,16 +1241,23 @@ AccessibleHandler::QueryService(REFGUID 
      of our own object to implement this just like a QI. */
   if (aIid == IID_IAccessible2_3 || aIid == IID_IAccessible2_2 ||
       aIid == IID_IAccessible2) {
     RefPtr<NEWEST_IA2_INTERFACE> ia2(this);
     ia2.forget(aOutInterface);
     return S_OK;
   }
 
+  // JAWS uses QueryService for these, but QI will work just fine and we can
+  // thus avoid a cross-process call. More importantly, if QS is used, the
+  // handler won't get used for that object, so our caching won't be used.
+  if (aIid == IID_IAccessibleAction || aIid == IID_IAccessibleText) {
+    return InternalQueryInterface(aIid, aOutInterface);
+  }
+
   for (uint32_t i = 0; i < ArrayLength(kUnsupportedServices); ++i) {
     if (aServiceId == kUnsupportedServices[i]) {
       return E_NOINTERFACE;
     }
   }
 
   if (!mServProvPassThru) {
     RefPtr<IUnknown> proxy(GetProxy());