Bug 1409916: Eliminate pointless cross-process call for IAccessible2_2::get_attribute. r?aklotz draft
authorJames Teh <jteh@mozilla.com>
Thu, 19 Oct 2017 09:22:44 +1000
changeset 682913 5f48d73709e19a5aadbb9f25bd6ea5ff8752033c
parent 682912 b3c3fa1cf361526a607317786e68f899d343dcf0
child 736483 f33e96755964e9edd04717279107bfdb7584e529
push id85201
push userbmo:jteh@mozilla.com
push dateWed, 18 Oct 2017 23:32:15 +0000
reviewersaklotz
bugs1409916
milestone58.0a1
Bug 1409916: Eliminate pointless cross-process call for IAccessible2_2::get_attribute. r?aklotz IAccessible2_2::get_attribute is not implemented yet in Gecko. However, the handler still passes this through, thus resulting in a pointless cross-process call. Instead, just return E_NOTIMPL in the handler for this method. MozReview-Commit-ID: 5XHieUC4cuz
accessible/ipc/win/handler/AccessibleHandler.cpp
--- a/accessible/ipc/win/handler/AccessibleHandler.cpp
+++ b/accessible/ipc/win/handler/AccessibleHandler.cpp
@@ -977,23 +977,21 @@ AccessibleHandler::get_attributes(BSTR* 
   BEGIN_CACHE_ACCESS;
   GET_BSTR(mAttributes, *attributes);
   return S_OK;
 }
 
 HRESULT
 AccessibleHandler::get_attribute(BSTR name, VARIANT* attribute)
 {
-  // We could extract these individually from cached mAttributes.
-  // Consider it if traffic warrants it
-  HRESULT hr = ResolveIA2();
-  if (FAILED(hr)) {
-    return hr;
-  }
-  return mIA2PassThru->get_attribute(name, attribute);
+  // Not yet implemented by ia2Accessible.
+  // Once ia2Accessible implements this, we could either pass it through
+  // or we could extract these individually from cached mAttributes.
+  // The latter should be considered if traffic warrants it.
+  return E_NOTIMPL;
 }
 
 HRESULT
 AccessibleHandler::get_accessibleWithCaret(IUnknown** accessible,
                                            long* caretOffset)
 {
   HRESULT hr = ResolveIA2();
   if (FAILED(hr)) {