Bug 1430938 part 2: AccessibleHandler: When QueryService is called for IAccessibleAction or IAccessibleText, just use QI. r?MarcoZ draft
authorJames Teh <jteh@mozilla.com>
Wed, 17 Jan 2018 10:23:07 +1000
changeset 721298 23d1666c728ff35ea1be9a282b551dfef2cc0c1f
parent 721297 67d16cf4eb1797a941a0556c4706a5fad9560083
child 746284 67045597ae2d7eb12a6b6badf97d5e513966f543
push id95785
push userbmo:jteh@mozilla.com
push dateWed, 17 Jan 2018 00:26:12 +0000
reviewersMarcoZ
bugs1430938
milestone59.0a1
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());