bug 736252 - remove uses of do_QueryInterface in CAccessibleAction r=surkov
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Sun, 01 Apr 2012 15:49:37 -0400
changeset 94138 b569eb963ce13adebbfd21cb0853bd5b5feadf4c
parent 94137 d3f20d0371d0a1431e3df3965727b2c939670314
child 94139 ec9582b2ad155d7b4277171e1c6a06ff8ccb6d72
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssurkov
bugs736252
milestone14.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 736252 - remove uses of do_QueryInterface in CAccessibleAction r=surkov
accessible/src/msaa/CAccessibleAction.cpp
--- a/accessible/src/msaa/CAccessibleAction.cpp
+++ b/accessible/src/msaa/CAccessibleAction.cpp
@@ -37,17 +37,17 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "CAccessibleAction.h"
 
 #include "AccessibleAction_i.c"
 
-#include "nsAccessible.h"
+#include "nsAccessibleWrap.h"
 
 // IUnknown
 
 STDMETHODIMP
 CAccessibleAction::QueryInterface(REFIID iid, void** ppv)
 {
   *ppv = NULL;
 
@@ -66,51 +66,51 @@ STDMETHODIMP
 CAccessibleAction::nActions(long* aActionCount)
 {
 __try {
   if (!aActionCount)
     return E_INVALIDARG;
 
   *aActionCount = 0;
 
-  nsRefPtr<nsAccessible> acc(do_QueryObject(this));
-  if (!acc || acc->IsDefunct())
+  nsAccessibleWrap* acc = static_cast<nsAccessibleWrap*>(this);
+  if (acc->IsDefunct())
     return E_FAIL;
 
   *aActionCount = acc->ActionCount();
   return S_OK;
 
 } __except(nsAccessNodeWrap::FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
   return E_FAIL;
 }
 
 STDMETHODIMP
 CAccessibleAction::doAction(long aActionIndex)
 {
 __try {
-  nsCOMPtr<nsIAccessible> acc(do_QueryObject(this));
-  if (!acc)
+  nsAccessibleWrap* acc = static_cast<nsAccessibleWrap*>(this);
+  if (acc->IsDefunct())
     return E_FAIL;
 
   PRUint8 index = static_cast<PRUint8>(aActionIndex);
   nsresult rv = acc->DoAction(index);
   return GetHRESULT(rv);
 
 } __except(nsAccessNodeWrap::FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
   return E_FAIL;
 }
 
 STDMETHODIMP
 CAccessibleAction::get_description(long aActionIndex, BSTR *aDescription)
 {
 __try {
   *aDescription = NULL;
 
-  nsCOMPtr<nsIAccessible> acc(do_QueryObject(this));
-  if (!acc)
+  nsAccessibleWrap* acc = static_cast<nsAccessibleWrap*>(this);
+  if (acc->IsDefunct())
     return E_FAIL;
 
   nsAutoString description;
   PRUint8 index = static_cast<PRUint8>(aActionIndex);
   nsresult rv = acc->GetActionDescription(index, description);
   if (NS_FAILED(rv))
     return GetHRESULT(rv);
 
@@ -137,18 +137,18 @@ CAccessibleAction::get_keyBinding(long a
 
   if (!aNumBinding)
     return E_INVALIDARG;
   *aNumBinding = 0;
 
   if (aActionIndex != 0 || aNumMaxBinding < 1)
     return E_INVALIDARG;
 
-  nsRefPtr<nsAccessible> acc(do_QueryObject(this));
-  if (!acc || acc->IsDefunct())
+  nsAccessibleWrap* acc = static_cast<nsAccessibleWrap*>(this);
+  if (acc->IsDefunct())
     return E_FAIL;
 
   // Expose keyboard shortcut if it's not exposed via MSAA keyboard shortcut.
   KeyBinding keyBinding = acc->AccessKey();
   if (keyBinding.IsEmpty())
     return S_FALSE;
 
   keyBinding = acc->KeyboardShortcut();
@@ -176,18 +176,18 @@ CAccessibleAction::get_keyBinding(long a
 }
 
 STDMETHODIMP
 CAccessibleAction::get_name(long aActionIndex, BSTR *aName)
 {
 __try {
   *aName = NULL;
 
-  nsCOMPtr<nsIAccessible> acc(do_QueryObject(this));
-  if (!acc)
+  nsAccessibleWrap* acc = static_cast<nsAccessibleWrap*>(this);
+  if (acc->IsDefunct())
     return E_FAIL;
 
   nsAutoString name;
   PRUint8 index = static_cast<PRUint8>(aActionIndex);
   nsresult rv = acc->GetActionName(index, name);
   if (NS_FAILED(rv))
     return GetHRESULT(rv);