diff options
23 files changed, 7 insertions, 1099 deletions
diff --git a/accessible/windows/ia2/ia2Accessible.cpp b/accessible/windows/ia2/ia2Accessible.cpp index c72719b51..97cd0d788 100644 --- a/accessible/windows/ia2/ia2Accessible.cpp +++ b/accessible/windows/ia2/ia2Accessible.cpp @@ -63,8 +63,6 @@ ia2Accessible::QueryInterface(REFIID iid, void** ppv) STDMETHODIMP ia2Accessible::get_nRelations(long* aNRelations) { - A11Y_TRYBLOCK_BEGIN - if (!aNRelations) return E_INVALIDARG; *aNRelations = 0; @@ -84,16 +82,12 @@ ia2Accessible::get_nRelations(long* aNRelations) (*aNRelations)++; } return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2Accessible::get_relation(long aRelationIndex, IAccessibleRelation** aRelation) { - A11Y_TRYBLOCK_BEGIN - if (!aRelation || aRelationIndex < 0) return E_INVALIDARG; *aRelation = nullptr; @@ -124,8 +118,6 @@ ia2Accessible::get_relation(long aRelationIndex, } return E_INVALIDARG; - - A11Y_TRYBLOCK_END } STDMETHODIMP @@ -133,8 +125,6 @@ ia2Accessible::get_relations(long aMaxRelations, IAccessibleRelation** aRelation, long *aNRelations) { - A11Y_TRYBLOCK_BEGIN - if (!aRelation || !aNRelations || aMaxRelations <= 0) return E_INVALIDARG; *aNRelations = 0; @@ -160,15 +150,11 @@ ia2Accessible::get_relations(long aMaxRelations, } } return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2Accessible::role(long* aRole) { - A11Y_TRYBLOCK_BEGIN - if (!aRole) return E_INVALIDARG; *aRole = 0; @@ -204,15 +190,11 @@ ia2Accessible::role(long* aRole) } return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2Accessible::scrollTo(enum IA2ScrollType aScrollType) { - A11Y_TRYBLOCK_BEGIN - AccessibleWrap* acc = static_cast<AccessibleWrap*>(this); if (acc->IsDefunct()) return CO_E_OBJNOTCONNECTED; @@ -222,16 +204,12 @@ ia2Accessible::scrollTo(enum IA2ScrollType aScrollType) aScrollType); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2Accessible::scrollToPoint(enum IA2CoordinateType aCoordType, long aX, long aY) { - A11Y_TRYBLOCK_BEGIN - AccessibleWrap* acc = static_cast<AccessibleWrap*>(this); if (acc->IsDefunct()) return CO_E_OBJNOTCONNECTED; @@ -244,8 +222,6 @@ ia2Accessible::scrollToPoint(enum IA2CoordinateType aCoordType, acc->ScrollToPoint(geckoCoordType, aX, aY); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP @@ -253,8 +229,6 @@ ia2Accessible::get_groupPosition(long* aGroupLevel, long* aSimilarItemsInGroup, long* aPositionInGroup) { - A11Y_TRYBLOCK_BEGIN - if (!aGroupLevel || !aSimilarItemsInGroup || !aPositionInGroup) return E_INVALIDARG; @@ -279,15 +253,11 @@ ia2Accessible::get_groupPosition(long* aGroupLevel, *aPositionInGroup = groupPos.posInSet; return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2Accessible::get_states(AccessibleStates* aStates) { - A11Y_TRYBLOCK_BEGIN - if (!aStates) return E_INVALIDARG; *aStates = 0; @@ -347,50 +317,36 @@ ia2Accessible::get_states(AccessibleStates* aStates) *aStates |= IA2_STATE_PINNED; return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2Accessible::get_extendedRole(BSTR* aExtendedRole) { - A11Y_TRYBLOCK_BEGIN - if (!aExtendedRole) return E_INVALIDARG; *aExtendedRole = nullptr; return E_NOTIMPL; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2Accessible::get_localizedExtendedRole(BSTR* aLocalizedExtendedRole) { - A11Y_TRYBLOCK_BEGIN - if (!aLocalizedExtendedRole) return E_INVALIDARG; *aLocalizedExtendedRole = nullptr; return E_NOTIMPL; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2Accessible::get_nExtendedStates(long* aNExtendedStates) { - A11Y_TRYBLOCK_BEGIN - if (!aNExtendedStates) return E_INVALIDARG; *aNExtendedStates = 0; return E_NOTIMPL; - - A11Y_TRYBLOCK_END } STDMETHODIMP @@ -398,16 +354,12 @@ ia2Accessible::get_extendedStates(long aMaxExtendedStates, BSTR** aExtendedStates, long* aNExtendedStates) { - A11Y_TRYBLOCK_BEGIN - if (!aExtendedStates || !aNExtendedStates) return E_INVALIDARG; *aExtendedStates = nullptr; *aNExtendedStates = 0; return E_NOTIMPL; - - A11Y_TRYBLOCK_END } STDMETHODIMP @@ -415,38 +367,28 @@ ia2Accessible::get_localizedExtendedStates(long aMaxLocalizedExtendedStates, BSTR** aLocalizedExtendedStates, long* aNLocalizedExtendedStates) { - A11Y_TRYBLOCK_BEGIN - if (!aLocalizedExtendedStates || !aNLocalizedExtendedStates) return E_INVALIDARG; *aLocalizedExtendedStates = nullptr; *aNLocalizedExtendedStates = 0; return E_NOTIMPL; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2Accessible::get_uniqueID(long* aUniqueID) { - A11Y_TRYBLOCK_BEGIN - if (!aUniqueID) return E_INVALIDARG; AccessibleWrap* acc = static_cast<AccessibleWrap*>(this); *aUniqueID = AccessibleWrap::GetChildIDFor(acc); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2Accessible::get_windowHandle(HWND* aWindowHandle) { - A11Y_TRYBLOCK_BEGIN - if (!aWindowHandle) return E_INVALIDARG; *aWindowHandle = 0; @@ -457,15 +399,11 @@ ia2Accessible::get_windowHandle(HWND* aWindowHandle) *aWindowHandle = AccessibleWrap::GetHWNDFor(acc); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2Accessible::get_indexInParent(long* aIndexInParent) { - A11Y_TRYBLOCK_BEGIN - if (!aIndexInParent) return E_INVALIDARG; *aIndexInParent = -1; @@ -481,15 +419,11 @@ ia2Accessible::get_indexInParent(long* aIndexInParent) return S_FALSE; return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2Accessible::get_locale(IA2Locale* aLocale) { - A11Y_TRYBLOCK_BEGIN - if (!aLocale) return E_INVALIDARG; @@ -532,15 +466,11 @@ ia2Accessible::get_locale(IA2Locale* aLocale) // country abbreviations or if there are more than one subcode. aLocale->variant = ::SysAllocString(lang.get()); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2Accessible::get_attributes(BSTR* aAttributes) { - A11Y_TRYBLOCK_BEGIN - if (!aAttributes) return E_INVALIDARG; *aAttributes = nullptr; @@ -558,8 +488,6 @@ ia2Accessible::get_attributes(BSTR* aAttributes) MOZ_ASSERT(!acc->IsProxy()); return E_UNEXPECTED; - - A11Y_TRYBLOCK_END } //////////////////////////////////////////////////////////////////////////////// @@ -568,22 +496,16 @@ ia2Accessible::get_attributes(BSTR* aAttributes) STDMETHODIMP ia2Accessible::get_attribute(BSTR name, VARIANT* aAttribute) { - A11Y_TRYBLOCK_BEGIN - if (!aAttribute) return E_INVALIDARG; return E_NOTIMPL; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2Accessible::get_accessibleWithCaret(IUnknown** aAccessible, long* aCaretOffset) { - A11Y_TRYBLOCK_BEGIN - if (!aAccessible || !aCaretOffset) return E_INVALIDARG; @@ -611,8 +533,6 @@ ia2Accessible::get_accessibleWithCaret(IUnknown** aAccessible, (*aAccessible)->AddRef(); *aCaretOffset = caretOffset; return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP @@ -621,8 +541,6 @@ ia2Accessible::get_relationTargetsOfType(BSTR aType, IUnknown*** aTargets, long* aNTargets) { - A11Y_TRYBLOCK_BEGIN - if (!aTargets || !aNTargets || aMaxTargets < 0) return E_INVALIDARG; *aNTargets = 0; @@ -663,16 +581,12 @@ ia2Accessible::get_relationTargetsOfType(BSTR aType, } return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2Accessible::get_selectionRanges(IA2Range** aRanges, long *aNRanges) { - A11Y_TRYBLOCK_BEGIN - if (!aRanges || !aNRanges) return E_INVALIDARG; @@ -714,8 +628,6 @@ ia2Accessible::get_selectionRanges(IA2Range** aRanges, } return S_OK; - - A11Y_TRYBLOCK_END } diff --git a/accessible/windows/ia2/ia2AccessibleAction.cpp b/accessible/windows/ia2/ia2AccessibleAction.cpp index 0710b753f..ffd19f049 100644 --- a/accessible/windows/ia2/ia2AccessibleAction.cpp +++ b/accessible/windows/ia2/ia2AccessibleAction.cpp @@ -39,8 +39,6 @@ ia2AccessibleAction::QueryInterface(REFIID iid, void** ppv) STDMETHODIMP ia2AccessibleAction::nActions(long* aActionCount) { - A11Y_TRYBLOCK_BEGIN - if (!aActionCount) return E_INVALIDARG; @@ -52,30 +50,22 @@ ia2AccessibleAction::nActions(long* aActionCount) *aActionCount = acc->ActionCount(); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleAction::doAction(long aActionIndex) { - A11Y_TRYBLOCK_BEGIN - AccessibleWrap* acc = static_cast<AccessibleWrap*>(this); if (acc->IsDefunct()) return CO_E_OBJNOTCONNECTED; uint8_t index = static_cast<uint8_t>(aActionIndex); return acc->DoAction(index) ? S_OK : E_INVALIDARG; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleAction::get_description(long aActionIndex, BSTR *aDescription) { - A11Y_TRYBLOCK_BEGIN - if (!aDescription) return E_INVALIDARG; *aDescription = nullptr; @@ -93,8 +83,6 @@ ia2AccessibleAction::get_description(long aActionIndex, BSTR *aDescription) *aDescription = ::SysAllocStringLen(description.get(), description.Length()); return *aDescription ? S_OK : E_OUTOFMEMORY; - - A11Y_TRYBLOCK_END } STDMETHODIMP @@ -102,8 +90,6 @@ ia2AccessibleAction::get_keyBinding(long aActionIndex, long aNumMaxBinding, BSTR **aKeyBinding, long *aNumBinding) { - A11Y_TRYBLOCK_BEGIN - if (!aKeyBinding) return E_INVALIDARG; *aKeyBinding = nullptr; @@ -143,15 +129,11 @@ ia2AccessibleAction::get_keyBinding(long aActionIndex, long aNumMaxBinding, *aNumBinding = 1; return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleAction::get_name(long aActionIndex, BSTR *aName) { - A11Y_TRYBLOCK_BEGIN - if (!aName) return E_INVALIDARG; @@ -169,20 +151,14 @@ ia2AccessibleAction::get_name(long aActionIndex, BSTR *aName) *aName = ::SysAllocStringLen(name.get(), name.Length()); return *aName ? S_OK : E_OUTOFMEMORY; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleAction::get_localizedName(long aActionIndex, BSTR *aLocalizedName) { - A11Y_TRYBLOCK_BEGIN - if (!aLocalizedName) return E_INVALIDARG; *aLocalizedName = nullptr; return E_NOTIMPL; - - A11Y_TRYBLOCK_END } diff --git a/accessible/windows/ia2/ia2AccessibleComponent.cpp b/accessible/windows/ia2/ia2AccessibleComponent.cpp index f32c09d1e..2c9cd0ab4 100644 --- a/accessible/windows/ia2/ia2AccessibleComponent.cpp +++ b/accessible/windows/ia2/ia2AccessibleComponent.cpp @@ -41,8 +41,6 @@ ia2AccessibleComponent::QueryInterface(REFIID iid, void** ppv) STDMETHODIMP ia2AccessibleComponent::get_locationInParent(long* aX, long* aY) { - A11Y_TRYBLOCK_BEGIN - if (!aX || !aY) return E_INVALIDARG; @@ -75,15 +73,11 @@ ia2AccessibleComponent::get_locationInParent(long* aX, long* aY) *aX = rect.x - parentRect.x; *aY = rect.y - parentRect.y; return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleComponent::get_foreground(IA2Color* aForeground) { - A11Y_TRYBLOCK_BEGIN - if (!aForeground) return E_INVALIDARG; @@ -98,15 +92,11 @@ ia2AccessibleComponent::get_foreground(IA2Color* aForeground) *aForeground = frame->StyleColor()->mColor; return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleComponent::get_background(IA2Color* aBackground) { - A11Y_TRYBLOCK_BEGIN - if (!aBackground) return E_INVALIDARG; @@ -121,7 +111,5 @@ ia2AccessibleComponent::get_background(IA2Color* aBackground) *aBackground = frame->StyleBackground()->mBackgroundColor; return S_OK; - - A11Y_TRYBLOCK_END } diff --git a/accessible/windows/ia2/ia2AccessibleEditableText.cpp b/accessible/windows/ia2/ia2AccessibleEditableText.cpp index 361d6a130..0b433bf6d 100644 --- a/accessible/windows/ia2/ia2AccessibleEditableText.cpp +++ b/accessible/windows/ia2/ia2AccessibleEditableText.cpp @@ -22,8 +22,6 @@ using namespace mozilla::a11y; STDMETHODIMP ia2AccessibleEditableText::copyText(long aStartOffset, long aEndOffset) { - A11Y_TRYBLOCK_BEGIN - MOZ_ASSERT(!HyperTextProxyFor(this)); HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this); @@ -35,15 +33,11 @@ ia2AccessibleEditableText::copyText(long aStartOffset, long aEndOffset) textAcc->CopyText(aStartOffset, aEndOffset); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleEditableText::deleteText(long aStartOffset, long aEndOffset) { - A11Y_TRYBLOCK_BEGIN - MOZ_ASSERT(!HyperTextProxyFor(this)); HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this); @@ -55,15 +49,11 @@ ia2AccessibleEditableText::deleteText(long aStartOffset, long aEndOffset) textAcc->DeleteText(aStartOffset, aEndOffset); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleEditableText::insertText(long aOffset, BSTR *aText) { - A11Y_TRYBLOCK_BEGIN - uint32_t length = ::SysStringLen(*aText); nsAutoString text(*aText, length); MOZ_ASSERT(!HyperTextProxyFor(this)); @@ -77,15 +67,11 @@ ia2AccessibleEditableText::insertText(long aOffset, BSTR *aText) textAcc->InsertText(text, aOffset); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleEditableText::cutText(long aStartOffset, long aEndOffset) { - A11Y_TRYBLOCK_BEGIN - MOZ_ASSERT(!HyperTextProxyFor(this)); HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this); @@ -97,15 +83,11 @@ ia2AccessibleEditableText::cutText(long aStartOffset, long aEndOffset) textAcc->CutText(aStartOffset, aEndOffset); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleEditableText::pasteText(long aOffset) { - A11Y_TRYBLOCK_BEGIN - MOZ_ASSERT(!HyperTextProxyFor(this)); HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this); @@ -117,16 +99,12 @@ ia2AccessibleEditableText::pasteText(long aOffset) textAcc->PasteText(aOffset); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleEditableText::replaceText(long aStartOffset, long aEndOffset, BSTR *aText) { - A11Y_TRYBLOCK_BEGIN - HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this); if (textAcc->IsDefunct()) return CO_E_OBJNOTCONNECTED; @@ -141,8 +119,6 @@ ia2AccessibleEditableText::replaceText(long aStartOffset, long aEndOffset, textAcc->InsertText(text, aStartOffset); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP diff --git a/accessible/windows/ia2/ia2AccessibleHyperlink.cpp b/accessible/windows/ia2/ia2AccessibleHyperlink.cpp index c6d564103..d36c0ef25 100644 --- a/accessible/windows/ia2/ia2AccessibleHyperlink.cpp +++ b/accessible/windows/ia2/ia2AccessibleHyperlink.cpp @@ -45,8 +45,6 @@ ia2AccessibleHyperlink::QueryInterface(REFIID iid, void** ppv) STDMETHODIMP ia2AccessibleHyperlink::get_anchor(long aIndex, VARIANT* aAnchor) { - A11Y_TRYBLOCK_BEGIN - if (!aAnchor) return E_INVALIDARG; @@ -77,15 +75,11 @@ ia2AccessibleHyperlink::get_anchor(long aIndex, VARIANT* aAnchor) aAnchor->punkVal = static_cast<IUnknown*>(instancePtr); aAnchor->vt = VT_UNKNOWN; return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleHyperlink::get_anchorTarget(long aIndex, VARIANT* aAnchorTarget) { - A11Y_TRYBLOCK_BEGIN - if (!aAnchorTarget) { return E_INVALIDARG; } @@ -124,15 +118,11 @@ ia2AccessibleHyperlink::get_anchorTarget(long aIndex, VARIANT* aAnchorTarget) aAnchorTarget->bstrVal = ::SysAllocStringLen(stringURI.get(), stringURI.Length()); return aAnchorTarget->bstrVal ? S_OK : E_OUTOFMEMORY; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleHyperlink::get_startIndex(long* aIndex) { - A11Y_TRYBLOCK_BEGIN - if (!aIndex) return E_INVALIDARG; @@ -149,15 +139,11 @@ ia2AccessibleHyperlink::get_startIndex(long* aIndex) *aIndex = thisObj->StartOffset(); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleHyperlink::get_endIndex(long* aIndex) { - A11Y_TRYBLOCK_BEGIN - if (!aIndex) return E_INVALIDARG; @@ -174,15 +160,11 @@ ia2AccessibleHyperlink::get_endIndex(long* aIndex) *aIndex = thisObj->EndOffset(); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleHyperlink::get_valid(boolean* aValid) { - A11Y_TRYBLOCK_BEGIN - if (!aValid) return E_INVALIDARG; @@ -199,7 +181,5 @@ ia2AccessibleHyperlink::get_valid(boolean* aValid) *aValid = thisObj->IsLinkValid(); return S_OK; - - A11Y_TRYBLOCK_END } diff --git a/accessible/windows/ia2/ia2AccessibleHypertext.cpp b/accessible/windows/ia2/ia2AccessibleHypertext.cpp index f4b3bdaf2..555bde686 100644 --- a/accessible/windows/ia2/ia2AccessibleHypertext.cpp +++ b/accessible/windows/ia2/ia2AccessibleHypertext.cpp @@ -19,8 +19,6 @@ using namespace mozilla::a11y; STDMETHODIMP ia2AccessibleHypertext::get_nHyperlinks(long* aHyperlinkCount) { - A11Y_TRYBLOCK_BEGIN - if (!aHyperlinkCount) return E_INVALIDARG; @@ -34,16 +32,12 @@ ia2AccessibleHypertext::get_nHyperlinks(long* aHyperlinkCount) *aHyperlinkCount = hyperText->LinkCount(); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleHypertext::get_hyperlink(long aLinkIndex, IAccessibleHyperlink** aHyperlink) { - A11Y_TRYBLOCK_BEGIN - if (!aHyperlink) return E_INVALIDARG; @@ -65,15 +59,11 @@ ia2AccessibleHypertext::get_hyperlink(long aLinkIndex, static_cast<IAccessibleHyperlink*>(hyperLink); (*aHyperlink)->AddRef(); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleHypertext::get_hyperlinkIndex(long aCharIndex, long* aHyperlinkIndex) { - A11Y_TRYBLOCK_BEGIN - if (!aHyperlinkIndex) return E_INVALIDARG; @@ -87,7 +77,5 @@ ia2AccessibleHypertext::get_hyperlinkIndex(long aCharIndex, long* aHyperlinkInde *aHyperlinkIndex = hyperAcc->LinkIndexAtOffset(aCharIndex); return S_OK; - - A11Y_TRYBLOCK_END } diff --git a/accessible/windows/ia2/ia2AccessibleImage.cpp b/accessible/windows/ia2/ia2AccessibleImage.cpp index 989fde925..7dc7f765c 100644 --- a/accessible/windows/ia2/ia2AccessibleImage.cpp +++ b/accessible/windows/ia2/ia2AccessibleImage.cpp @@ -43,8 +43,6 @@ ia2AccessibleImage::QueryInterface(REFIID iid, void** ppv) STDMETHODIMP ia2AccessibleImage::get_description(BSTR* aDescription) { - A11Y_TRYBLOCK_BEGIN - if (!aDescription) return E_INVALIDARG; @@ -61,8 +59,6 @@ ia2AccessibleImage::get_description(BSTR* aDescription) *aDescription = ::SysAllocStringLen(description.get(), description.Length()); return *aDescription ? S_OK : E_OUTOFMEMORY; - - A11Y_TRYBLOCK_END } STDMETHODIMP @@ -70,8 +66,6 @@ ia2AccessibleImage::get_imagePosition(enum IA2CoordinateType aCoordType, long* aX, long* aY) { - A11Y_TRYBLOCK_BEGIN - if (!aX || !aY) return E_INVALIDARG; @@ -90,15 +84,11 @@ ia2AccessibleImage::get_imagePosition(enum IA2CoordinateType aCoordType, *aX = pos.x; *aY = pos.y; return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleImage::get_imageSize(long* aHeight, long* aWidth) { - A11Y_TRYBLOCK_BEGIN - if (!aHeight || !aWidth) return E_INVALIDARG; @@ -113,7 +103,5 @@ ia2AccessibleImage::get_imageSize(long* aHeight, long* aWidth) *aHeight = size.width; *aWidth = size.height; return S_OK; - - A11Y_TRYBLOCK_END } diff --git a/accessible/windows/ia2/ia2AccessibleRelation.cpp b/accessible/windows/ia2/ia2AccessibleRelation.cpp index cc6fd83c8..67435ee52 100644 --- a/accessible/windows/ia2/ia2AccessibleRelation.cpp +++ b/accessible/windows/ia2/ia2AccessibleRelation.cpp @@ -34,8 +34,6 @@ IMPL_IUNKNOWN_QUERY_TAIL STDMETHODIMP ia2AccessibleRelation::get_relationType(BSTR* aRelationType) { - A11Y_TRYBLOCK_BEGIN - if (!aRelationType) return E_INVALIDARG; @@ -51,43 +49,31 @@ ia2AccessibleRelation::get_relationType(BSTR* aRelationType) } return *aRelationType ? S_OK : E_OUTOFMEMORY; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleRelation::get_localizedRelationType(BSTR *aLocalizedRelationType) { - A11Y_TRYBLOCK_BEGIN - if (!aLocalizedRelationType) return E_INVALIDARG; *aLocalizedRelationType = nullptr; return E_NOTIMPL; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleRelation::get_nTargets(long *aNTargets) { - A11Y_TRYBLOCK_BEGIN - if (!aNTargets) return E_INVALIDARG; *aNTargets = mTargets.Length(); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleRelation::get_target(long aTargetIndex, IUnknown **aTarget) { - A11Y_TRYBLOCK_BEGIN - if (aTargetIndex < 0 || (uint32_t)aTargetIndex >= mTargets.Length() || !aTarget) return E_INVALIDARG; @@ -97,16 +83,12 @@ ia2AccessibleRelation::get_target(long aTargetIndex, IUnknown **aTarget) (*aTarget)->AddRef(); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleRelation::get_targets(long aMaxTargets, IUnknown **aTargets, long *aNTargets) { - A11Y_TRYBLOCK_BEGIN - if (!aNTargets || !aTargets) return E_INVALIDARG; @@ -120,6 +102,4 @@ ia2AccessibleRelation::get_targets(long aMaxTargets, IUnknown **aTargets, *aNTargets = maxTargets; return S_OK; - - A11Y_TRYBLOCK_END } diff --git a/accessible/windows/ia2/ia2AccessibleTable.cpp b/accessible/windows/ia2/ia2AccessibleTable.cpp index 6ac6bbab4..a99f72def 100644 --- a/accessible/windows/ia2/ia2AccessibleTable.cpp +++ b/accessible/windows/ia2/ia2AccessibleTable.cpp @@ -60,8 +60,6 @@ ia2AccessibleTable::get_accessibleAt(long aRowIdx, long aColIdx, STDMETHODIMP ia2AccessibleTable::get_caption(IUnknown** aAccessible) { - A11Y_TRYBLOCK_BEGIN - if (!aAccessible) return E_INVALIDARG; @@ -75,16 +73,12 @@ ia2AccessibleTable::get_caption(IUnknown** aAccessible) (*aAccessible = static_cast<IAccessible*>(caption))->AddRef(); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleTable::get_childIndex(long aRowIdx, long aColIdx, long* aChildIdx) { - A11Y_TRYBLOCK_BEGIN - if (!aChildIdx) return E_INVALIDARG; @@ -99,15 +93,11 @@ ia2AccessibleTable::get_childIndex(long aRowIdx, long aColIdx, *aChildIdx = mTable->CellIndexAt(aRowIdx, aColIdx); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleTable::get_columnDescription(long aColIdx, BSTR* aDescription) { - A11Y_TRYBLOCK_BEGIN - if (!aDescription) return E_INVALIDARG; @@ -125,16 +115,12 @@ ia2AccessibleTable::get_columnDescription(long aColIdx, BSTR* aDescription) *aDescription = ::SysAllocStringLen(descr.get(), descr.Length()); return *aDescription ? S_OK : E_OUTOFMEMORY; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleTable::get_columnExtentAt(long aRowIdx, long aColIdx, long* aSpan) { - A11Y_TRYBLOCK_BEGIN - if (!aSpan) return E_INVALIDARG; @@ -149,31 +135,23 @@ ia2AccessibleTable::get_columnExtentAt(long aRowIdx, long aColIdx, *aSpan = mTable->ColExtentAt(aRowIdx, aColIdx); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleTable::get_columnHeader(IAccessibleTable** aAccessibleTable, long* aStartingRowIndex) { - A11Y_TRYBLOCK_BEGIN - if (!aAccessibleTable || !aStartingRowIndex) return E_INVALIDARG; *aAccessibleTable = nullptr; *aStartingRowIndex = -1; return E_NOTIMPL; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleTable::get_columnIndex(long aCellIdx, long* aColIdx) { - A11Y_TRYBLOCK_BEGIN - if (!aColIdx) return E_INVALIDARG; @@ -187,15 +165,11 @@ ia2AccessibleTable::get_columnIndex(long aCellIdx, long* aColIdx) *aColIdx = mTable->ColIndexAt(aCellIdx); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleTable::get_nColumns(long* aColCount) { - A11Y_TRYBLOCK_BEGIN - if (!aColCount) return E_INVALIDARG; @@ -205,15 +179,11 @@ ia2AccessibleTable::get_nColumns(long* aColCount) *aColCount = mTable->ColCount(); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleTable::get_nRows(long* aRowCount) { - A11Y_TRYBLOCK_BEGIN - if (!aRowCount) return E_INVALIDARG; @@ -223,8 +193,6 @@ ia2AccessibleTable::get_nRows(long* aRowCount) *aRowCount = mTable->RowCount(); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP @@ -236,8 +204,6 @@ ia2AccessibleTable::get_nSelectedChildren(long* aChildCount) STDMETHODIMP ia2AccessibleTable::get_nSelectedColumns(long* aColCount) { - A11Y_TRYBLOCK_BEGIN - if (!aColCount) return E_INVALIDARG; @@ -247,15 +213,11 @@ ia2AccessibleTable::get_nSelectedColumns(long* aColCount) *aColCount = mTable->SelectedColCount(); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleTable::get_nSelectedRows(long* aRowCount) { - A11Y_TRYBLOCK_BEGIN - if (!aRowCount) return E_INVALIDARG; @@ -266,15 +228,11 @@ ia2AccessibleTable::get_nSelectedRows(long* aRowCount) *aRowCount = mTable->SelectedRowCount(); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleTable::get_rowDescription(long aRowIdx, BSTR* aDescription) { - A11Y_TRYBLOCK_BEGIN - if (!aDescription) return E_INVALIDARG; @@ -292,15 +250,11 @@ ia2AccessibleTable::get_rowDescription(long aRowIdx, BSTR* aDescription) *aDescription = ::SysAllocStringLen(descr.get(), descr.Length()); return *aDescription ? S_OK : E_OUTOFMEMORY; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleTable::get_rowExtentAt(long aRowIdx, long aColIdx, long* aSpan) { - A11Y_TRYBLOCK_BEGIN - if (!aSpan) return E_INVALIDARG; @@ -315,31 +269,23 @@ ia2AccessibleTable::get_rowExtentAt(long aRowIdx, long aColIdx, long* aSpan) *aSpan = mTable->RowExtentAt(aRowIdx, aColIdx); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleTable::get_rowHeader(IAccessibleTable** aAccessibleTable, long* aStartingColumnIndex) { - A11Y_TRYBLOCK_BEGIN - if (!aAccessibleTable || !aStartingColumnIndex) return E_INVALIDARG; *aAccessibleTable = nullptr; *aStartingColumnIndex = -1; return E_NOTIMPL; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleTable::get_rowIndex(long aCellIdx, long* aRowIdx) { - A11Y_TRYBLOCK_BEGIN - if (!aRowIdx) return E_INVALIDARG; @@ -353,16 +299,12 @@ ia2AccessibleTable::get_rowIndex(long aCellIdx, long* aRowIdx) *aRowIdx = mTable->RowIndexAt(aCellIdx); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleTable::get_selectedChildren(long aMaxChildren, long** aChildren, long* aNChildren) { - A11Y_TRYBLOCK_BEGIN - if (!aChildren || !aNChildren) return E_INVALIDARG; @@ -384,36 +326,24 @@ ia2AccessibleTable::get_selectedChildren(long aMaxChildren, long** aChildren, (*aChildren)[i] = cellIndices[i]; return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleTable::get_selectedColumns(long aMaxColumns, long** aColumns, long* aNColumns) { - A11Y_TRYBLOCK_BEGIN - return get_selectedColumns(aColumns, aNColumns); - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleTable::get_selectedRows(long aMaxRows, long** aRows, long* aNRows) { - A11Y_TRYBLOCK_BEGIN - return get_selectedRows(aRows, aNRows); - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleTable::get_summary(IUnknown** aAccessible) { - A11Y_TRYBLOCK_BEGIN - if (!aAccessible) return E_INVALIDARG; @@ -424,15 +354,11 @@ ia2AccessibleTable::get_summary(IUnknown** aAccessible) *aAccessible = nullptr; return S_FALSE; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleTable::get_isColumnSelected(long aColIdx, boolean* aIsSelected) { - A11Y_TRYBLOCK_BEGIN - if (!aIsSelected) return E_INVALIDARG; @@ -445,15 +371,11 @@ ia2AccessibleTable::get_isColumnSelected(long aColIdx, boolean* aIsSelected) *aIsSelected = mTable->IsColSelected(aColIdx); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleTable::get_isRowSelected(long aRowIdx, boolean* aIsSelected) { - A11Y_TRYBLOCK_BEGIN - if (!aIsSelected) return E_INVALIDARG; @@ -466,16 +388,12 @@ ia2AccessibleTable::get_isRowSelected(long aRowIdx, boolean* aIsSelected) *aIsSelected = mTable->IsRowSelected(aRowIdx); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleTable::get_isSelected(long aRowIdx, long aColIdx, boolean* aIsSelected) { - A11Y_TRYBLOCK_BEGIN - if (!aIsSelected) return E_INVALIDARG; @@ -490,15 +408,11 @@ ia2AccessibleTable::get_isSelected(long aRowIdx, long aColIdx, *aIsSelected = mTable->IsCellSelected(aRowIdx, aColIdx); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleTable::selectRow(long aRowIdx) { - A11Y_TRYBLOCK_BEGIN - if (!mTable) return CO_E_OBJNOTCONNECTED; @@ -507,15 +421,11 @@ ia2AccessibleTable::selectRow(long aRowIdx) mTable->SelectRow(aRowIdx); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleTable::selectColumn(long aColIdx) { - A11Y_TRYBLOCK_BEGIN - if (!mTable) return CO_E_OBJNOTCONNECTED; @@ -524,15 +434,11 @@ ia2AccessibleTable::selectColumn(long aColIdx) mTable->SelectCol(aColIdx); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleTable::unselectRow(long aRowIdx) { - A11Y_TRYBLOCK_BEGIN - if (!mTable) return CO_E_OBJNOTCONNECTED; @@ -541,15 +447,11 @@ ia2AccessibleTable::unselectRow(long aRowIdx) mTable->UnselectRow(aRowIdx); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleTable::unselectColumn(long aColIdx) { - A11Y_TRYBLOCK_BEGIN - if (!mTable) return CO_E_OBJNOTCONNECTED; @@ -558,8 +460,6 @@ ia2AccessibleTable::unselectColumn(long aColIdx) mTable->UnselectCol(aColIdx); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP @@ -569,8 +469,6 @@ ia2AccessibleTable::get_rowColumnExtentsAtIndex(long aCellIdx, long* aRowIdx, long* aColExtents, boolean* aIsSelected) { - A11Y_TRYBLOCK_BEGIN - if (!aRowIdx || !aColIdx || !aRowExtents || !aColExtents || !aIsSelected) return E_INVALIDARG; @@ -595,8 +493,6 @@ ia2AccessibleTable::get_rowColumnExtentsAtIndex(long aCellIdx, long* aRowIdx, *aIsSelected = mTable->IsCellSelected(rowIdx, colIdx); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP @@ -611,8 +507,6 @@ ia2AccessibleTable::get_modelChange(IA2TableModelChange* aModelChange) STDMETHODIMP ia2AccessibleTable::get_cellAt(long aRowIdx, long aColIdx, IUnknown** aCell) { - A11Y_TRYBLOCK_BEGIN - if (!aCell) return E_INVALIDARG; @@ -628,15 +522,11 @@ ia2AccessibleTable::get_cellAt(long aRowIdx, long aColIdx, IUnknown** aCell) (*aCell = static_cast<IAccessible*>(cell))->AddRef(); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleTable::get_nSelectedCells(long* aCellCount) { - A11Y_TRYBLOCK_BEGIN - if (!aCellCount) return E_INVALIDARG; @@ -646,15 +536,11 @@ ia2AccessibleTable::get_nSelectedCells(long* aCellCount) *aCellCount = mTable->SelectedCellCount(); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleTable::get_selectedCells(IUnknown*** aCells, long* aNSelectedCells) { - A11Y_TRYBLOCK_BEGIN - if (!aCells || !aNSelectedCells) return E_INVALIDARG; @@ -682,15 +568,11 @@ ia2AccessibleTable::get_selectedCells(IUnknown*** aCells, long* aNSelectedCells) *aNSelectedCells = cells.Length(); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleTable::get_selectedColumns(long** aColumns, long* aNColumns) { - A11Y_TRYBLOCK_BEGIN - if (!aColumns || !aNColumns) return E_INVALIDARG; @@ -712,15 +594,11 @@ ia2AccessibleTable::get_selectedColumns(long** aColumns, long* aNColumns) (*aColumns)[i] = colIndices[i]; return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleTable::get_selectedRows(long** aRows, long* aNRows) { - A11Y_TRYBLOCK_BEGIN - if (!aRows || !aNRows) return E_INVALIDARG; @@ -742,6 +620,4 @@ ia2AccessibleTable::get_selectedRows(long** aRows, long* aNRows) (*aRows)[i] = rowIndices[i]; return S_OK; - - A11Y_TRYBLOCK_END } diff --git a/accessible/windows/ia2/ia2AccessibleTableCell.cpp b/accessible/windows/ia2/ia2AccessibleTableCell.cpp index e625a7049..19cfc55da 100644 --- a/accessible/windows/ia2/ia2AccessibleTableCell.cpp +++ b/accessible/windows/ia2/ia2AccessibleTableCell.cpp @@ -46,8 +46,6 @@ ia2AccessibleTableCell::QueryInterface(REFIID iid, void** ppv) STDMETHODIMP ia2AccessibleTableCell::get_table(IUnknown** aTable) { - A11Y_TRYBLOCK_BEGIN - if (!aTable) return E_INVALIDARG; @@ -63,15 +61,11 @@ ia2AccessibleTableCell::get_table(IUnknown** aTable) *aTable = static_cast<IAccessible*>(wrap); (*aTable)->AddRef(); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleTableCell::get_columnExtent(long* aSpan) { - A11Y_TRYBLOCK_BEGIN - if (!aSpan) return E_INVALIDARG; @@ -82,16 +76,12 @@ ia2AccessibleTableCell::get_columnExtent(long* aSpan) *aSpan = mTableCell->ColExtent(); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleTableCell::get_columnHeaderCells(IUnknown*** aCellAccessibles, long* aNColumnHeaderCells) { - A11Y_TRYBLOCK_BEGIN - if (!aCellAccessibles || !aNColumnHeaderCells) return E_INVALIDARG; @@ -118,15 +108,11 @@ ia2AccessibleTableCell::get_columnHeaderCells(IUnknown*** aCellAccessibles, } return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleTableCell::get_columnIndex(long* aColIdx) { - A11Y_TRYBLOCK_BEGIN - if (!aColIdx) return E_INVALIDARG; @@ -136,15 +122,11 @@ ia2AccessibleTableCell::get_columnIndex(long* aColIdx) *aColIdx = mTableCell->ColIdx(); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleTableCell::get_rowExtent(long* aSpan) { - A11Y_TRYBLOCK_BEGIN - if (!aSpan) return E_INVALIDARG; @@ -154,16 +136,12 @@ ia2AccessibleTableCell::get_rowExtent(long* aSpan) *aSpan = mTableCell->RowExtent(); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleTableCell::get_rowHeaderCells(IUnknown*** aCellAccessibles, long* aNRowHeaderCells) { - A11Y_TRYBLOCK_BEGIN - if (!aCellAccessibles || !aNRowHeaderCells) return E_INVALIDARG; @@ -189,15 +167,11 @@ ia2AccessibleTableCell::get_rowHeaderCells(IUnknown*** aCellAccessibles, } return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleTableCell::get_rowIndex(long* aRowIdx) { - A11Y_TRYBLOCK_BEGIN - if (!aRowIdx) return E_INVALIDARG; @@ -207,8 +181,6 @@ ia2AccessibleTableCell::get_rowIndex(long* aRowIdx) *aRowIdx = mTableCell->RowIdx(); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP @@ -217,8 +189,6 @@ ia2AccessibleTableCell::get_rowColumnExtents(long* aRowIdx, long* aColIdx, long* aColExtents, boolean* aIsSelected) { - A11Y_TRYBLOCK_BEGIN - if (!aRowIdx || !aColIdx || !aRowExtents || !aColExtents || !aIsSelected) return E_INVALIDARG; @@ -234,15 +204,11 @@ ia2AccessibleTableCell::get_rowColumnExtents(long* aRowIdx, long* aColIdx, *aIsSelected = mTableCell->Selected(); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleTableCell::get_isSelected(boolean* aIsSelected) { - A11Y_TRYBLOCK_BEGIN - if (!aIsSelected) return E_INVALIDARG; @@ -252,6 +218,4 @@ ia2AccessibleTableCell::get_isSelected(boolean* aIsSelected) *aIsSelected = mTableCell->Selected(); return S_OK; - - A11Y_TRYBLOCK_END } diff --git a/accessible/windows/ia2/ia2AccessibleText.cpp b/accessible/windows/ia2/ia2AccessibleText.cpp index 7ac766f30..86b3abdf6 100644 --- a/accessible/windows/ia2/ia2AccessibleText.cpp +++ b/accessible/windows/ia2/ia2AccessibleText.cpp @@ -28,8 +28,6 @@ bool ia2AccessibleText::sLastTextChangeWasInsert = false; STDMETHODIMP ia2AccessibleText::addSelection(long aStartOffset, long aEndOffset) { - A11Y_TRYBLOCK_BEGIN - MOZ_ASSERT(!HyperTextProxyFor(this)); HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this); @@ -38,16 +36,12 @@ ia2AccessibleText::addSelection(long aStartOffset, long aEndOffset) return textAcc->AddToSelection(aStartOffset, aEndOffset) ? S_OK : E_INVALIDARG; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleText::get_attributes(long aOffset, long *aStartOffset, long *aEndOffset, BSTR *aTextAttributes) { - A11Y_TRYBLOCK_BEGIN - if (!aStartOffset || !aEndOffset || !aTextAttributes) return E_INVALIDARG; @@ -74,15 +68,11 @@ ia2AccessibleText::get_attributes(long aOffset, long *aStartOffset, *aEndOffset = endOffset; return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleText::get_caretOffset(long *aOffset) { - A11Y_TRYBLOCK_BEGIN - if (!aOffset) return E_INVALIDARG; @@ -97,8 +87,6 @@ ia2AccessibleText::get_caretOffset(long *aOffset) *aOffset = textAcc->CaretOffset(); return *aOffset != -1 ? S_OK : S_FALSE; - - A11Y_TRYBLOCK_END } STDMETHODIMP @@ -107,8 +95,6 @@ ia2AccessibleText::get_characterExtents(long aOffset, long* aX, long* aY, long* aWidth, long* aHeight) { - A11Y_TRYBLOCK_BEGIN - if (!aX || !aY || !aWidth || !aHeight) return E_INVALIDARG; *aX = *aY = *aWidth = *aHeight = 0; @@ -129,15 +115,11 @@ ia2AccessibleText::get_characterExtents(long aOffset, *aWidth = rect.width; *aHeight = rect.height; return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleText::get_nSelections(long* aNSelections) { - A11Y_TRYBLOCK_BEGIN - if (!aNSelections) return E_INVALIDARG; *aNSelections = 0; @@ -151,8 +133,6 @@ ia2AccessibleText::get_nSelections(long* aNSelections) *aNSelections = textAcc->SelectionCount(); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP @@ -160,8 +140,6 @@ ia2AccessibleText::get_offsetAtPoint(long aX, long aY, enum IA2CoordinateType aCoordType, long* aOffset) { - A11Y_TRYBLOCK_BEGIN - if (!aOffset) return E_INVALIDARG; *aOffset = 0; @@ -179,16 +157,12 @@ ia2AccessibleText::get_offsetAtPoint(long aX, long aY, *aOffset = textAcc->OffsetAtPoint(aX, aY, geckoCoordType); return *aOffset == -1 ? S_FALSE : S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleText::get_selection(long aSelectionIndex, long* aStartOffset, long* aEndOffset) { - A11Y_TRYBLOCK_BEGIN - if (!aStartOffset || !aEndOffset) return E_INVALIDARG; *aStartOffset = *aEndOffset = 0; @@ -207,15 +181,11 @@ ia2AccessibleText::get_selection(long aSelectionIndex, long* aStartOffset, *aStartOffset = startOffset; *aEndOffset = endOffset; return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleText::get_text(long aStartOffset, long aEndOffset, BSTR* aText) { - A11Y_TRYBLOCK_BEGIN - if (!aText) return E_INVALIDARG; @@ -239,8 +209,6 @@ ia2AccessibleText::get_text(long aStartOffset, long aEndOffset, BSTR* aText) *aText = ::SysAllocStringLen(text.get(), text.Length()); return *aText ? S_OK : E_OUTOFMEMORY; - - A11Y_TRYBLOCK_END } STDMETHODIMP @@ -249,8 +217,6 @@ ia2AccessibleText::get_textBeforeOffset(long aOffset, long* aStartOffset, long* aEndOffset, BSTR* aText) { - A11Y_TRYBLOCK_BEGIN - if (!aStartOffset || !aEndOffset || !aText) return E_INVALIDARG; @@ -287,8 +253,6 @@ ia2AccessibleText::get_textBeforeOffset(long aOffset, *aText = ::SysAllocStringLen(text.get(), text.Length()); return *aText ? S_OK : E_OUTOFMEMORY; - - A11Y_TRYBLOCK_END } STDMETHODIMP @@ -297,8 +261,6 @@ ia2AccessibleText::get_textAfterOffset(long aOffset, long* aStartOffset, long* aEndOffset, BSTR* aText) { - A11Y_TRYBLOCK_BEGIN - if (!aStartOffset || !aEndOffset || !aText) return E_INVALIDARG; @@ -335,8 +297,6 @@ ia2AccessibleText::get_textAfterOffset(long aOffset, *aText = ::SysAllocStringLen(text.get(), text.Length()); return *aText ? S_OK : E_OUTOFMEMORY; - - A11Y_TRYBLOCK_END } STDMETHODIMP @@ -345,8 +305,6 @@ ia2AccessibleText::get_textAtOffset(long aOffset, long* aStartOffset, long* aEndOffset, BSTR* aText) { - A11Y_TRYBLOCK_BEGIN - if (!aStartOffset || !aEndOffset || !aText) return E_INVALIDARG; @@ -381,15 +339,11 @@ ia2AccessibleText::get_textAtOffset(long aOffset, *aText = ::SysAllocStringLen(text.get(), text.Length()); return *aText ? S_OK : E_OUTOFMEMORY; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleText::removeSelection(long aSelectionIndex) { - A11Y_TRYBLOCK_BEGIN - MOZ_ASSERT(!HyperTextProxyFor(this)); HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this); @@ -398,15 +352,11 @@ ia2AccessibleText::removeSelection(long aSelectionIndex) return textAcc->RemoveFromSelection(aSelectionIndex) ? S_OK : E_INVALIDARG; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleText::setCaretOffset(long aOffset) { - A11Y_TRYBLOCK_BEGIN - MOZ_ASSERT(!HyperTextProxyFor(this)); HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this); @@ -418,16 +368,12 @@ ia2AccessibleText::setCaretOffset(long aOffset) textAcc->SetCaretOffset(aOffset); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleText::setSelection(long aSelectionIndex, long aStartOffset, long aEndOffset) { - A11Y_TRYBLOCK_BEGIN - MOZ_ASSERT(!HyperTextProxyFor(this)); HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this); @@ -436,15 +382,11 @@ ia2AccessibleText::setSelection(long aSelectionIndex, long aStartOffset, return textAcc->SetSelectionBoundsAt(aSelectionIndex, aStartOffset, aEndOffset) ? S_OK : E_INVALIDARG; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleText::get_nCharacters(long* aNCharacters) { - A11Y_TRYBLOCK_BEGIN - if (!aNCharacters) return E_INVALIDARG; *aNCharacters = 0; @@ -457,16 +399,12 @@ ia2AccessibleText::get_nCharacters(long* aNCharacters) *aNCharacters = textAcc->CharacterCount(); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleText::scrollSubstringTo(long aStartIndex, long aEndIndex, enum IA2ScrollType aScrollType) { - A11Y_TRYBLOCK_BEGIN - MOZ_ASSERT(!HyperTextProxyFor(this)); HyperTextAccessible* textAcc = static_cast<HyperTextAccessibleWrap*>(this); @@ -478,8 +416,6 @@ ia2AccessibleText::scrollSubstringTo(long aStartIndex, long aEndIndex, textAcc->ScrollSubstringTo(aStartIndex, aEndIndex, aScrollType); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP @@ -487,8 +423,6 @@ ia2AccessibleText::scrollSubstringToPoint(long aStartIndex, long aEndIndex, enum IA2CoordinateType aCoordType, long aX, long aY) { - A11Y_TRYBLOCK_BEGIN - uint32_t geckoCoordType = (aCoordType == IA2_COORDTYPE_SCREEN_RELATIVE) ? nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE : nsIAccessibleCoordinateType::COORDTYPE_PARENT_RELATIVE; @@ -505,28 +439,18 @@ ia2AccessibleText::scrollSubstringToPoint(long aStartIndex, long aEndIndex, textAcc->ScrollSubstringToPoint(aStartIndex, aEndIndex, geckoCoordType, aX, aY); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleText::get_newText(IA2TextSegment *aNewText) { - A11Y_TRYBLOCK_BEGIN - return GetModifiedText(true, aNewText); - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleText::get_oldText(IA2TextSegment *aOldText) { - A11Y_TRYBLOCK_BEGIN - return GetModifiedText(false, aOldText); - - A11Y_TRYBLOCK_END } // ia2AccessibleText diff --git a/accessible/windows/ia2/ia2AccessibleValue.cpp b/accessible/windows/ia2/ia2AccessibleValue.cpp index e33442295..44d2c31fb 100644 --- a/accessible/windows/ia2/ia2AccessibleValue.cpp +++ b/accessible/windows/ia2/ia2AccessibleValue.cpp @@ -46,8 +46,6 @@ ia2AccessibleValue::QueryInterface(REFIID iid, void** ppv) STDMETHODIMP ia2AccessibleValue::get_currentValue(VARIANT* aCurrentValue) { - A11Y_TRYBLOCK_BEGIN - if (!aCurrentValue) return E_INVALIDARG; @@ -68,15 +66,11 @@ ia2AccessibleValue::get_currentValue(VARIANT* aCurrentValue) aCurrentValue->vt = VT_R8; aCurrentValue->dblVal = currentValue; return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleValue::setCurrentValue(VARIANT aValue) { - A11Y_TRYBLOCK_BEGIN - if (aValue.vt != VT_R8) return E_INVALIDARG; @@ -87,15 +81,11 @@ ia2AccessibleValue::setCurrentValue(VARIANT aValue) return CO_E_OBJNOTCONNECTED; return valueAcc->SetCurValue(aValue.dblVal) ? S_OK : E_FAIL; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleValue::get_maximumValue(VARIANT* aMaximumValue) { - A11Y_TRYBLOCK_BEGIN - if (!aMaximumValue) return E_INVALIDARG; @@ -116,15 +106,11 @@ ia2AccessibleValue::get_maximumValue(VARIANT* aMaximumValue) aMaximumValue->vt = VT_R8; aMaximumValue->dblVal = maximumValue; return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ia2AccessibleValue::get_minimumValue(VARIANT* aMinimumValue) { - A11Y_TRYBLOCK_BEGIN - if (!aMinimumValue) return E_INVALIDARG; @@ -145,7 +131,5 @@ ia2AccessibleValue::get_minimumValue(VARIANT* aMinimumValue) aMinimumValue->vt = VT_R8; aMinimumValue->dblVal = minimumValue; return S_OK; - - A11Y_TRYBLOCK_END } diff --git a/accessible/windows/msaa/AccessibleWrap.cpp b/accessible/windows/msaa/AccessibleWrap.cpp index 6112c370a..426270814 100644 --- a/accessible/windows/msaa/AccessibleWrap.cpp +++ b/accessible/windows/msaa/AccessibleWrap.cpp @@ -110,8 +110,6 @@ AccessibleWrap::Shutdown() STDMETHODIMP AccessibleWrap::QueryInterface(REFIID iid, void** ppv) { - A11Y_TRYBLOCK_BEGIN - if (!ppv) return E_INVALIDARG; @@ -165,8 +163,6 @@ AccessibleWrap::QueryInterface(REFIID iid, void** ppv) (reinterpret_cast<IUnknown*>(*ppv))->AddRef(); return S_OK; - - A11Y_TRYBLOCK_END } //----------------------------------------------------- @@ -176,8 +172,6 @@ AccessibleWrap::QueryInterface(REFIID iid, void** ppv) STDMETHODIMP AccessibleWrap::get_accParent( IDispatch __RPC_FAR *__RPC_FAR *ppdispParent) { - A11Y_TRYBLOCK_BEGIN - if (!ppdispParent) return E_INVALIDARG; @@ -208,15 +202,11 @@ AccessibleWrap::get_accParent( IDispatch __RPC_FAR *__RPC_FAR *ppdispParent) *ppdispParent = NativeAccessible(xpParentAcc); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP AccessibleWrap::get_accChildCount( long __RPC_FAR *pcountChildren) { - A11Y_TRYBLOCK_BEGIN - if (!pcountChildren) return E_INVALIDARG; @@ -230,8 +220,6 @@ AccessibleWrap::get_accChildCount( long __RPC_FAR *pcountChildren) *pcountChildren = ChildCount(); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP @@ -239,8 +227,6 @@ AccessibleWrap::get_accChild( /* [in] */ VARIANT varChild, /* [retval][out] */ IDispatch __RPC_FAR *__RPC_FAR *ppdispChild) { - A11Y_TRYBLOCK_BEGIN - if (!ppdispChild) return E_INVALIDARG; @@ -265,8 +251,6 @@ AccessibleWrap::get_accChild( child.forget(ppdispChild); return S_OK; - - A11Y_TRYBLOCK_END } /** @@ -331,8 +315,6 @@ AccessibleWrap::get_accName( /* [optional][in] */ VARIANT varChild, /* [retval][out] */ BSTR __RPC_FAR *pszName) { - A11Y_TRYBLOCK_BEGIN - if (!pszName || varChild.vt != VT_I4) return E_INVALIDARG; @@ -361,8 +343,6 @@ AccessibleWrap::get_accName( if (!*pszName) return E_OUTOFMEMORY; return S_OK; - - A11Y_TRYBLOCK_END } @@ -371,8 +351,6 @@ AccessibleWrap::get_accValue( /* [optional][in] */ VARIANT varChild, /* [retval][out] */ BSTR __RPC_FAR *pszValue) { - A11Y_TRYBLOCK_BEGIN - if (!pszValue) return E_INVALIDARG; @@ -401,16 +379,12 @@ AccessibleWrap::get_accValue( if (!*pszValue) return E_OUTOFMEMORY; return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP AccessibleWrap::get_accDescription(VARIANT varChild, BSTR __RPC_FAR *pszDescription) { - A11Y_TRYBLOCK_BEGIN - if (!pszDescription) return E_INVALIDARG; @@ -432,8 +406,6 @@ AccessibleWrap::get_accDescription(VARIANT varChild, *pszDescription = ::SysAllocStringLen(description.get(), description.Length()); return *pszDescription ? S_OK : E_OUTOFMEMORY; - - A11Y_TRYBLOCK_END } STDMETHODIMP @@ -441,8 +413,6 @@ AccessibleWrap::get_accRole( /* [optional][in] */ VARIANT varChild, /* [retval][out] */ VARIANT __RPC_FAR *pvarRole) { - A11Y_TRYBLOCK_BEGIN - if (!pvarRole) return E_INVALIDARG; @@ -532,8 +502,6 @@ AccessibleWrap::get_accRole( } return E_FAIL; - - A11Y_TRYBLOCK_END } STDMETHODIMP @@ -541,8 +509,6 @@ AccessibleWrap::get_accState( /* [optional][in] */ VARIANT varChild, /* [retval][out] */ VARIANT __RPC_FAR *pvarState) { - A11Y_TRYBLOCK_BEGIN - if (!pvarState) return E_INVALIDARG; @@ -574,8 +540,6 @@ AccessibleWrap::get_accState( nsAccUtils::To32States(state, &msaaState, nullptr); pvarState->lVal = msaaState; return S_OK; - - A11Y_TRYBLOCK_END } @@ -584,15 +548,11 @@ AccessibleWrap::get_accHelp( /* [optional][in] */ VARIANT varChild, /* [retval][out] */ BSTR __RPC_FAR *pszHelp) { - A11Y_TRYBLOCK_BEGIN - if (!pszHelp) return E_INVALIDARG; *pszHelp = nullptr; return S_FALSE; - - A11Y_TRYBLOCK_END } STDMETHODIMP @@ -601,16 +561,12 @@ AccessibleWrap::get_accHelpTopic( /* [optional][in] */ VARIANT varChild, /* [retval][out] */ long __RPC_FAR *pidTopic) { - A11Y_TRYBLOCK_BEGIN - if (!pszHelpFile || !pidTopic) return E_INVALIDARG; *pszHelpFile = nullptr; *pidTopic = 0; return S_FALSE; - - A11Y_TRYBLOCK_END } STDMETHODIMP @@ -618,8 +574,6 @@ AccessibleWrap::get_accKeyboardShortcut( /* [optional][in] */ VARIANT varChild, /* [retval][out] */ BSTR __RPC_FAR *pszKeyboardShortcut) { - A11Y_TRYBLOCK_BEGIN - if (!pszKeyboardShortcut) return E_INVALIDARG; *pszKeyboardShortcut = nullptr; @@ -645,16 +599,12 @@ AccessibleWrap::get_accKeyboardShortcut( *pszKeyboardShortcut = ::SysAllocStringLen(shortcut.get(), shortcut.Length()); return *pszKeyboardShortcut ? S_OK : E_OUTOFMEMORY; - - A11Y_TRYBLOCK_END } STDMETHODIMP AccessibleWrap::get_accFocus( /* [retval][out] */ VARIANT __RPC_FAR *pvarChild) { - A11Y_TRYBLOCK_BEGIN - if (!pvarChild) return E_INVALIDARG; @@ -685,8 +635,6 @@ AccessibleWrap::get_accFocus( } return S_OK; - - A11Y_TRYBLOCK_END } /** @@ -723,8 +671,6 @@ private: STDMETHODIMP AccessibleEnumerator::QueryInterface(REFIID iid, void ** ppvObject) { - A11Y_TRYBLOCK_BEGIN - if (iid == IID_IEnumVARIANT) { *ppvObject = static_cast<IEnumVARIANT*>(this); AddRef(); @@ -738,15 +684,11 @@ AccessibleEnumerator::QueryInterface(REFIID iid, void ** ppvObject) *ppvObject = nullptr; return E_NOINTERFACE; - - A11Y_TRYBLOCK_END } STDMETHODIMP AccessibleEnumerator::Next(unsigned long celt, VARIANT FAR* rgvar, unsigned long FAR* pceltFetched) { - A11Y_TRYBLOCK_BEGIN - uint32_t length = mArray.Length(); HRESULT hr = S_OK; @@ -766,29 +708,21 @@ AccessibleEnumerator::Next(unsigned long celt, VARIANT FAR* rgvar, unsigned long *pceltFetched = celt; return hr; - - A11Y_TRYBLOCK_END } STDMETHODIMP AccessibleEnumerator::Clone(IEnumVARIANT FAR* FAR* ppenum) { - A11Y_TRYBLOCK_BEGIN - *ppenum = new AccessibleEnumerator(*this); if (!*ppenum) return E_OUTOFMEMORY; NS_ADDREF(*ppenum); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP AccessibleEnumerator::Skip(unsigned long celt) { - A11Y_TRYBLOCK_BEGIN - uint32_t length = mArray.Length(); // Check if we can skip the requested number of elements if (celt > length - mCurIndex) { @@ -797,8 +731,6 @@ AccessibleEnumerator::Skip(unsigned long celt) } mCurIndex += celt; return S_OK; - - A11Y_TRYBLOCK_END } /** @@ -821,8 +753,6 @@ AccessibleEnumerator::Skip(unsigned long celt) STDMETHODIMP AccessibleWrap::get_accSelection(VARIANT __RPC_FAR *pvarChildren) { - A11Y_TRYBLOCK_BEGIN - if (!pvarChildren) return E_INVALIDARG; @@ -842,8 +772,6 @@ AccessibleWrap::get_accSelection(VARIANT __RPC_FAR *pvarChildren) NS_ADDREF(pvarChildren->punkVal = pEnum); } return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP @@ -851,8 +779,6 @@ AccessibleWrap::get_accDefaultAction( /* [optional][in] */ VARIANT varChild, /* [retval][out] */ BSTR __RPC_FAR *pszDefaultAction) { - A11Y_TRYBLOCK_BEGIN - if (!pszDefaultAction) return E_INVALIDARG; @@ -874,8 +800,6 @@ AccessibleWrap::get_accDefaultAction( *pszDefaultAction = ::SysAllocStringLen(defaultAction.get(), defaultAction.Length()); return *pszDefaultAction ? S_OK : E_OUTOFMEMORY; - - A11Y_TRYBLOCK_END } STDMETHODIMP @@ -883,8 +807,6 @@ AccessibleWrap::accSelect( /* [in] */ long flagsSelect, /* [optional][in] */ VARIANT varChild) { - A11Y_TRYBLOCK_BEGIN - RefPtr<IAccessible> accessible; HRESULT hr = ResolveChild(varChild, getter_AddRefs(accessible)); if (FAILED(hr)) { @@ -926,8 +848,6 @@ AccessibleWrap::accSelect( } return E_FAIL; - - A11Y_TRYBLOCK_END } STDMETHODIMP @@ -938,8 +858,6 @@ AccessibleWrap::accLocation( /* [out] */ long __RPC_FAR *pcyHeight, /* [optional][in] */ VARIANT varChild) { - A11Y_TRYBLOCK_BEGIN - if (!pxLeft || !pyTop || !pcxWidth || !pcyHeight) return E_INVALIDARG; @@ -966,8 +884,6 @@ AccessibleWrap::accLocation( *pcxWidth = rect.width; *pcyHeight = rect.height; return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP @@ -976,8 +892,6 @@ AccessibleWrap::accNavigate( /* [optional][in] */ VARIANT varStart, /* [retval][out] */ VARIANT __RPC_FAR *pvarEndUpAt) { - A11Y_TRYBLOCK_BEGIN - if (!pvarEndUpAt) return E_INVALIDARG; @@ -1060,8 +974,6 @@ AccessibleWrap::accNavigate( pvarEndUpAt->pdispVal = NativeAccessible(navAccessible); pvarEndUpAt->vt = VT_DISPATCH; return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP @@ -1070,8 +982,6 @@ AccessibleWrap::accHitTest( /* [in] */ long yTop, /* [retval][out] */ VARIANT __RPC_FAR *pvarChild) { - A11Y_TRYBLOCK_BEGIN - if (!pvarChild) return E_INVALIDARG; @@ -1098,16 +1008,12 @@ AccessibleWrap::accHitTest( return S_FALSE; } return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP AccessibleWrap::accDoDefaultAction( /* [optional][in] */ VARIANT varChild) { - A11Y_TRYBLOCK_BEGIN - RefPtr<IAccessible> accessible; HRESULT hr = ResolveChild(varChild, getter_AddRefs(accessible)); if (FAILED(hr)) { @@ -1119,8 +1025,6 @@ AccessibleWrap::accDoDefaultAction( } return DoAction(0) ? S_OK : E_INVALIDARG; - - A11Y_TRYBLOCK_END } STDMETHODIMP diff --git a/accessible/windows/msaa/ApplicationAccessibleWrap.cpp b/accessible/windows/msaa/ApplicationAccessibleWrap.cpp index b78a8dd55..ec9d511e4 100644 --- a/accessible/windows/msaa/ApplicationAccessibleWrap.cpp +++ b/accessible/windows/msaa/ApplicationAccessibleWrap.cpp @@ -69,8 +69,6 @@ ApplicationAccessibleWrap::QueryInterface(REFIID iid, void** ppv) STDMETHODIMP ApplicationAccessibleWrap::get_appName(BSTR* aName) { - A11Y_TRYBLOCK_BEGIN - if (!aName) return E_INVALIDARG; @@ -86,15 +84,11 @@ ApplicationAccessibleWrap::get_appName(BSTR* aName) *aName = ::SysAllocStringLen(name.get(), name.Length()); return *aName ? S_OK : E_OUTOFMEMORY; - - A11Y_TRYBLOCK_END } STDMETHODIMP ApplicationAccessibleWrap::get_appVersion(BSTR* aVersion) { - A11Y_TRYBLOCK_BEGIN - if (!aVersion) return E_INVALIDARG; @@ -110,15 +104,11 @@ ApplicationAccessibleWrap::get_appVersion(BSTR* aVersion) *aVersion = ::SysAllocStringLen(version.get(), version.Length()); return *aVersion ? S_OK : E_OUTOFMEMORY; - - A11Y_TRYBLOCK_END } STDMETHODIMP ApplicationAccessibleWrap::get_toolkitName(BSTR* aName) { - A11Y_TRYBLOCK_BEGIN - if (!aName) return E_INVALIDARG; @@ -132,15 +122,11 @@ ApplicationAccessibleWrap::get_toolkitName(BSTR* aName) *aName = ::SysAllocStringLen(name.get(), name.Length()); return *aName ? S_OK : E_OUTOFMEMORY; - - A11Y_TRYBLOCK_END } STDMETHODIMP ApplicationAccessibleWrap::get_toolkitVersion(BSTR* aVersion) { - A11Y_TRYBLOCK_BEGIN - if (!aVersion) return E_INVALIDARG; @@ -156,7 +142,5 @@ ApplicationAccessibleWrap::get_toolkitVersion(BSTR* aVersion) *aVersion = ::SysAllocStringLen(version.get(), version.Length()); return *aVersion ? S_OK : E_OUTOFMEMORY; - - A11Y_TRYBLOCK_END } diff --git a/accessible/windows/msaa/DocAccessibleWrap.cpp b/accessible/windows/msaa/DocAccessibleWrap.cpp index 6fb89816d..895fe9192 100644 --- a/accessible/windows/msaa/DocAccessibleWrap.cpp +++ b/accessible/windows/msaa/DocAccessibleWrap.cpp @@ -65,8 +65,6 @@ DocAccessibleWrap::get_accParent( STDMETHODIMP DocAccessibleWrap::get_accValue(VARIANT aVarChild, BSTR __RPC_FAR* aValue) { - A11Y_TRYBLOCK_BEGIN - if (!aValue) return E_INVALIDARG; *aValue = nullptr; @@ -90,8 +88,6 @@ DocAccessibleWrap::get_accValue(VARIANT aVarChild, BSTR __RPC_FAR* aValue) *aValue = ::SysAllocStringLen(url.get(), url.Length()); return *aValue ? S_OK : E_OUTOFMEMORY; - - A11Y_TRYBLOCK_END } //////////////////////////////////////////////////////////////////////////////// diff --git a/accessible/windows/msaa/EnumVariant.cpp b/accessible/windows/msaa/EnumVariant.cpp index 86c81a105..2344208a3 100644 --- a/accessible/windows/msaa/EnumVariant.cpp +++ b/accessible/windows/msaa/EnumVariant.cpp @@ -21,8 +21,6 @@ STDMETHODIMP ChildrenEnumVariant::Next(ULONG aCount, VARIANT FAR* aItems, ULONG FAR* aCountFetched) { - A11Y_TRYBLOCK_BEGIN - if (!aItems || !aCountFetched) return E_INVALIDARG; @@ -55,15 +53,11 @@ ChildrenEnumVariant::Next(ULONG aCount, VARIANT FAR* aItems, (*aCountFetched) = countFetched; return countFetched < aCount ? S_FALSE : S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ChildrenEnumVariant::Skip(ULONG aCount) { - A11Y_TRYBLOCK_BEGIN - if (mAnchorAcc->IsDefunct() || mAnchorAcc->GetChildAt(mCurIndex) != mCurAcc) return CO_E_OBJNOTCONNECTED; @@ -71,15 +65,11 @@ ChildrenEnumVariant::Skip(ULONG aCount) mCurAcc = mAnchorAcc->GetChildAt(mCurIndex); return mCurAcc ? S_OK : S_FALSE; - - A11Y_TRYBLOCK_END } STDMETHODIMP ChildrenEnumVariant::Reset() { - A11Y_TRYBLOCK_BEGIN - if (mAnchorAcc->IsDefunct()) return CO_E_OBJNOTCONNECTED; @@ -87,15 +77,11 @@ ChildrenEnumVariant::Reset() mCurAcc = mAnchorAcc->GetChildAt(0); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP ChildrenEnumVariant::Clone(IEnumVARIANT** aEnumVariant) { - A11Y_TRYBLOCK_BEGIN - if (!aEnumVariant) return E_INVALIDARG; @@ -103,6 +89,4 @@ ChildrenEnumVariant::Clone(IEnumVARIANT** aEnumVariant) (*aEnumVariant)->AddRef(); return S_OK; - - A11Y_TRYBLOCK_END } diff --git a/accessible/windows/msaa/IUnknownImpl.cpp b/accessible/windows/msaa/IUnknownImpl.cpp index 4a9fa5383..c74f86e33 100644 --- a/accessible/windows/msaa/IUnknownImpl.cpp +++ b/accessible/windows/msaa/IUnknownImpl.cpp @@ -37,22 +37,5 @@ GetHRESULT(nsresult aResult) } } -int -FilterExceptions(unsigned int aCode, EXCEPTION_POINTERS* aExceptionInfo) -{ - if (aCode == EXCEPTION_ACCESS_VIOLATION) { -#ifdef MOZ_CRASHREPORTER - // MSAA swallows crashes (because it is COM-based) but we still need to - // learn about those crashes so we can fix them. Make sure to pass them to - // the crash reporter. - CrashReporter::WriteMinidumpForException(aExceptionInfo); -#endif - } else { - NS_NOTREACHED("We should only be catching crash exceptions"); - } - - return EXCEPTION_CONTINUE_SEARCH; -} - } // namespace a11y } // namespace mozilla diff --git a/accessible/windows/msaa/IUnknownImpl.h b/accessible/windows/msaa/IUnknownImpl.h index dbf6c1374..d939a4dfa 100644 --- a/accessible/windows/msaa/IUnknownImpl.h +++ b/accessible/windows/msaa/IUnknownImpl.h @@ -79,7 +79,6 @@ virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID, void**); \ STDMETHODIMP \ Class::QueryInterface(REFIID aIID, void** aInstancePtr) \ { \ - A11Y_TRYBLOCK_BEGIN \ if (!aInstancePtr) \ return E_INVALIDARG; \ *aInstancePtr = nullptr; \ @@ -88,17 +87,14 @@ Class::QueryInterface(REFIID aIID, void** aInstancePtr) \ #define IMPL_IUNKNOWN_QUERY_TAIL \ return hr; \ - A11Y_TRYBLOCK_END \ } #define IMPL_IUNKNOWN_QUERY_TAIL_AGGREGATED(Member) \ return Member->QueryInterface(aIID, aInstancePtr); \ - A11Y_TRYBLOCK_END \ } #define IMPL_IUNKNOWN_QUERY_TAIL_INHERITED(BaseClass) \ return BaseClass::QueryInterface(aIID, aInstancePtr); \ - A11Y_TRYBLOCK_END \ } #define IMPL_IUNKNOWN_QUERY_IFACE(Iface) \ @@ -158,21 +154,6 @@ Class::QueryInterface(REFIID aIID, void** aInstancePtr) \ IMPL_IUNKNOWN_QUERY_CLASS(Super2); \ IMPL_IUNKNOWN_QUERY_TAIL_INHERITED(Super0) - -/** - * Wrap every method body by these macroses to pass exception to the crash - * reporter. - */ -#define A11Y_TRYBLOCK_BEGIN \ - MOZ_SEH_TRY { - -#define A11Y_TRYBLOCK_END \ - } MOZ_SEH_EXCEPT(mozilla::a11y::FilterExceptions(::GetExceptionCode(), \ - GetExceptionInformation())) \ - { } \ - return E_FAIL; - - namespace mozilla { namespace a11y { @@ -181,11 +162,6 @@ namespace a11y { */ HRESULT GetHRESULT(nsresult aResult); -/** - * Used to pass an exception to the crash reporter. - */ -int FilterExceptions(unsigned int aCode, EXCEPTION_POINTERS* aExceptionInfo); - } // namespace a11y; } //namespace mozilla; diff --git a/accessible/windows/sdn/sdnAccessible.cpp b/accessible/windows/sdn/sdnAccessible.cpp index 909b0779c..d90631c8f 100644 --- a/accessible/windows/sdn/sdnAccessible.cpp +++ b/accessible/windows/sdn/sdnAccessible.cpp @@ -28,8 +28,6 @@ using namespace mozilla::a11y; STDMETHODIMP sdnAccessible::QueryInterface(REFIID aREFIID, void** aInstancePtr) { - A11Y_TRYBLOCK_BEGIN - if (!aInstancePtr) return E_FAIL; *aInstancePtr = nullptr; @@ -53,8 +51,6 @@ sdnAccessible::QueryInterface(REFIID aREFIID, void** aInstancePtr) } return E_NOINTERFACE; - - A11Y_TRYBLOCK_END } STDMETHODIMP @@ -65,8 +61,6 @@ sdnAccessible::get_nodeInfo(BSTR __RPC_FAR* aNodeName, unsigned int __RPC_FAR* aUniqueID, unsigned short __RPC_FAR* aNodeType) { - A11Y_TRYBLOCK_BEGIN - if (!aNodeName || !aNameSpaceID || !aNodeValue || !aNumChildren || !aUniqueID || !aNodeType) return E_INVALIDARG; @@ -114,8 +108,6 @@ sdnAccessible::get_nodeInfo(BSTR __RPC_FAR* aNodeName, *aNumChildren = mNode->GetChildCount(); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP @@ -125,8 +117,6 @@ sdnAccessible::get_attributes(unsigned short aMaxAttribs, BSTR __RPC_FAR* aAttribValues, unsigned short __RPC_FAR* aNumAttribs) { - A11Y_TRYBLOCK_BEGIN - if (!aAttribNames || !aNameSpaceIDs || !aAttribValues || !aNumAttribs) return E_INVALIDARG; @@ -159,8 +149,6 @@ sdnAccessible::get_attributes(unsigned short aMaxAttribs, } return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP @@ -169,8 +157,6 @@ sdnAccessible::get_attributesForNames(unsigned short aMaxAttribs, short __RPC_FAR* aNameSpaceID, BSTR __RPC_FAR* aAttribValues) { - A11Y_TRYBLOCK_BEGIN - if (!aAttribNames || !aNameSpaceID || !aAttribValues) return E_INVALIDARG; @@ -207,8 +193,6 @@ sdnAccessible::get_attributesForNames(unsigned short aMaxAttribs, } return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP @@ -218,8 +202,6 @@ sdnAccessible::get_computedStyle(unsigned short aMaxStyleProperties, BSTR __RPC_FAR* aStyleValues, unsigned short __RPC_FAR* aNumStyleProperties) { - A11Y_TRYBLOCK_BEGIN - if (!aStyleProperties || aStyleValues || !aNumStyleProperties) return E_INVALIDARG; @@ -257,8 +239,6 @@ sdnAccessible::get_computedStyle(unsigned short aMaxStyleProperties, *aNumStyleProperties = static_cast<unsigned short>(realIndex); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP @@ -267,8 +247,6 @@ sdnAccessible::get_computedStyleForProperties(unsigned short aNumStyleProperties BSTR __RPC_FAR* aStyleProperties, BSTR __RPC_FAR* aStyleValues) { - A11Y_TRYBLOCK_BEGIN - if (!aStyleProperties || !aStyleValues) return E_INVALIDARG; @@ -291,15 +269,11 @@ sdnAccessible::get_computedStyleForProperties(unsigned short aNumStyleProperties } return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP sdnAccessible::scrollTo(boolean aScrollTopLeft) { - A11Y_TRYBLOCK_BEGIN - DocAccessible* document = GetDocument(); if (!document) // that's IsDefunct check return CO_E_OBJNOTCONNECTED; @@ -313,15 +287,11 @@ sdnAccessible::scrollTo(boolean aScrollTopLeft) nsCoreUtils::ScrollTo(document->PresShell(), mNode->AsContent(), scrollType); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP sdnAccessible::get_parentNode(ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode) { - A11Y_TRYBLOCK_BEGIN - if (!aNode) return E_INVALIDARG; *aNode = nullptr; @@ -336,15 +306,11 @@ sdnAccessible::get_parentNode(ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode) } return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP sdnAccessible::get_firstChild(ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode) { - A11Y_TRYBLOCK_BEGIN - if (!aNode) return E_INVALIDARG; *aNode = nullptr; @@ -359,15 +325,11 @@ sdnAccessible::get_firstChild(ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode) } return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP sdnAccessible::get_lastChild(ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode) { - A11Y_TRYBLOCK_BEGIN - if (!aNode) return E_INVALIDARG; *aNode = nullptr; @@ -382,15 +344,11 @@ sdnAccessible::get_lastChild(ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode) } return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP sdnAccessible::get_previousSibling(ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode) { - A11Y_TRYBLOCK_BEGIN - if (!aNode) return E_INVALIDARG; *aNode = nullptr; @@ -405,15 +363,11 @@ sdnAccessible::get_previousSibling(ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode) } return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP sdnAccessible::get_nextSibling(ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode) { - A11Y_TRYBLOCK_BEGIN - if (!aNode) return E_INVALIDARG; *aNode = nullptr; @@ -428,16 +382,12 @@ sdnAccessible::get_nextSibling(ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode) } return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP sdnAccessible::get_childAt(unsigned aChildIndex, ISimpleDOMNode __RPC_FAR *__RPC_FAR* aNode) { - A11Y_TRYBLOCK_BEGIN - if (!aNode) return E_INVALIDARG; *aNode = nullptr; @@ -453,15 +403,11 @@ sdnAccessible::get_childAt(unsigned aChildIndex, return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP sdnAccessible::get_innerHTML(BSTR __RPC_FAR* aInnerHTML) { - A11Y_TRYBLOCK_BEGIN - if (!aInnerHTML) return E_INVALIDARG; *aInnerHTML = nullptr; @@ -482,15 +428,11 @@ sdnAccessible::get_innerHTML(BSTR __RPC_FAR* aInnerHTML) return E_OUTOFMEMORY; return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP sdnAccessible::get_localInterface(void __RPC_FAR *__RPC_FAR* aLocalInterface) { - A11Y_TRYBLOCK_BEGIN - if (!aLocalInterface) return E_INVALIDARG; *aLocalInterface = nullptr; @@ -502,15 +444,11 @@ sdnAccessible::get_localInterface(void __RPC_FAR *__RPC_FAR* aLocalInterface) AddRef(); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP sdnAccessible::get_language(BSTR __RPC_FAR* aLanguage) { - A11Y_TRYBLOCK_BEGIN - if (!aLanguage) return E_INVALIDARG; *aLanguage = nullptr; @@ -534,6 +472,4 @@ sdnAccessible::get_language(BSTR __RPC_FAR* aLanguage) return E_OUTOFMEMORY; return S_OK; - - A11Y_TRYBLOCK_END } diff --git a/accessible/windows/sdn/sdnDocAccessible.cpp b/accessible/windows/sdn/sdnDocAccessible.cpp index 07b39e66f..a1c5be872 100644 --- a/accessible/windows/sdn/sdnDocAccessible.cpp +++ b/accessible/windows/sdn/sdnDocAccessible.cpp @@ -24,8 +24,6 @@ IMPL_IUNKNOWN_QUERY_TAIL_AGGREGATED(mAccessible) STDMETHODIMP sdnDocAccessible::get_URL(BSTR __RPC_FAR* aURL) { - A11Y_TRYBLOCK_BEGIN - if (!aURL) return E_INVALIDARG; *aURL = nullptr; @@ -40,15 +38,11 @@ sdnDocAccessible::get_URL(BSTR __RPC_FAR* aURL) *aURL = ::SysAllocStringLen(URL.get(), URL.Length()); return *aURL ? S_OK : E_OUTOFMEMORY; - - A11Y_TRYBLOCK_END } STDMETHODIMP sdnDocAccessible::get_title(BSTR __RPC_FAR* aTitle) { - A11Y_TRYBLOCK_BEGIN - if (!aTitle) return E_INVALIDARG; *aTitle = nullptr; @@ -60,15 +54,11 @@ sdnDocAccessible::get_title(BSTR __RPC_FAR* aTitle) mAccessible->Title(title); *aTitle = ::SysAllocStringLen(title.get(), title.Length()); return *aTitle ? S_OK : E_OUTOFMEMORY; - - A11Y_TRYBLOCK_END } STDMETHODIMP sdnDocAccessible::get_mimeType(BSTR __RPC_FAR* aMimeType) { - A11Y_TRYBLOCK_BEGIN - if (!aMimeType) return E_INVALIDARG; *aMimeType = nullptr; @@ -83,15 +73,11 @@ sdnDocAccessible::get_mimeType(BSTR __RPC_FAR* aMimeType) *aMimeType = ::SysAllocStringLen(mimeType.get(), mimeType.Length()); return *aMimeType ? S_OK : E_OUTOFMEMORY; - - A11Y_TRYBLOCK_END } STDMETHODIMP sdnDocAccessible::get_docType(BSTR __RPC_FAR* aDocType) { - A11Y_TRYBLOCK_BEGIN - if (!aDocType) return E_INVALIDARG; *aDocType = nullptr; @@ -106,16 +92,12 @@ sdnDocAccessible::get_docType(BSTR __RPC_FAR* aDocType) *aDocType = ::SysAllocStringLen(docType.get(), docType.Length()); return *aDocType ? S_OK : E_OUTOFMEMORY; - - A11Y_TRYBLOCK_END } STDMETHODIMP sdnDocAccessible::get_nameSpaceURIForID(short aNameSpaceID, BSTR __RPC_FAR* aNameSpaceURI) { - A11Y_TRYBLOCK_BEGIN - if (!aNameSpaceURI) return E_INVALIDARG; *aNameSpaceURI = nullptr; @@ -138,20 +120,14 @@ sdnDocAccessible::get_nameSpaceURIForID(short aNameSpaceID, nameSpaceURI.Length()); return *aNameSpaceURI ? S_OK : E_OUTOFMEMORY; - - A11Y_TRYBLOCK_END } STDMETHODIMP sdnDocAccessible::put_alternateViewMediaTypes(BSTR __RPC_FAR* aCommaSeparatedMediaTypes) { - A11Y_TRYBLOCK_BEGIN - if (!aCommaSeparatedMediaTypes) return E_INVALIDARG; *aCommaSeparatedMediaTypes = nullptr; return mAccessible->IsDefunct() ? CO_E_OBJNOTCONNECTED : E_NOTIMPL; - - A11Y_TRYBLOCK_END } diff --git a/accessible/windows/sdn/sdnTextAccessible.cpp b/accessible/windows/sdn/sdnTextAccessible.cpp index b51caf44e..b6f580ba3 100644 --- a/accessible/windows/sdn/sdnTextAccessible.cpp +++ b/accessible/windows/sdn/sdnTextAccessible.cpp @@ -33,8 +33,6 @@ IMPL_IUNKNOWN_QUERY_TAIL_AGGREGATED(mAccessible) STDMETHODIMP sdnTextAccessible::get_domText(BSTR __RPC_FAR* aText) { - A11Y_TRYBLOCK_BEGIN - if (!aText) return E_INVALIDARG; *aText = nullptr; @@ -51,8 +49,6 @@ sdnTextAccessible::get_domText(BSTR __RPC_FAR* aText) *aText = ::SysAllocStringLen(nodeValue.get(), nodeValue.Length()); return *aText ? S_OK : E_OUTOFMEMORY; - - A11Y_TRYBLOCK_END } STDMETHODIMP @@ -63,8 +59,6 @@ sdnTextAccessible::get_clippedSubstringBounds(unsigned int aStartIndex, int __RPC_FAR* aWidth, int __RPC_FAR* aHeight) { - A11Y_TRYBLOCK_BEGIN - nscoord x = 0, y = 0, width = 0, height = 0; HRESULT rv = get_unclippedSubstringBounds(aStartIndex, aEndIndex, &x, &y, &width, &height); @@ -86,8 +80,6 @@ sdnTextAccessible::get_clippedSubstringBounds(unsigned int aStartIndex, *aWidth = clippedRect.width; *aHeight = clippedRect.height; return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP @@ -98,8 +90,6 @@ sdnTextAccessible::get_unclippedSubstringBounds(unsigned int aStartIndex, int __RPC_FAR* aWidth, int __RPC_FAR* aHeight) { - A11Y_TRYBLOCK_BEGIN - if (!aX || !aY || !aWidth || !aHeight) return E_INVALIDARG; *aX = *aY = *aWidth = *aHeight = 0; @@ -135,16 +125,12 @@ sdnTextAccessible::get_unclippedSubstringBounds(unsigned int aStartIndex, *aHeight = presContext->AppUnitsToDevPixels(sum.height); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP sdnTextAccessible::scrollToSubstring(unsigned int aStartIndex, unsigned int aEndIndex) { - A11Y_TRYBLOCK_BEGIN - if (mAccessible->IsDefunct()) return CO_E_OBJNOTCONNECTED; @@ -159,15 +145,11 @@ sdnTextAccessible::scrollToSubstring(unsigned int aStartIndex, nsCoreUtils::ScrollSubstringTo(mAccessible->GetFrame(), range, nsIAccessibleScrollType::SCROLL_TYPE_ANYWHERE); return GetHRESULT(rv); - - A11Y_TRYBLOCK_END } STDMETHODIMP sdnTextAccessible::get_fontFamily(BSTR __RPC_FAR* aFontFamily) { - A11Y_TRYBLOCK_BEGIN - if (!aFontFamily) return E_INVALIDARG; *aFontFamily = nullptr; @@ -189,8 +171,6 @@ sdnTextAccessible::get_fontFamily(BSTR __RPC_FAR* aFontFamily) *aFontFamily = ::SysAllocStringLen(name.get(), name.Length()); return *aFontFamily ? S_OK : E_OUTOFMEMORY; - - A11Y_TRYBLOCK_END } nsIFrame* diff --git a/accessible/windows/uia/uiaRawElmProvider.cpp b/accessible/windows/uia/uiaRawElmProvider.cpp index 54e54766d..3121661e1 100644 --- a/accessible/windows/uia/uiaRawElmProvider.cpp +++ b/accessible/windows/uia/uiaRawElmProvider.cpp @@ -28,24 +28,18 @@ STDMETHODIMP uiaRawElmProvider::GetObjectForChild(long aIdChild, __RPC__deref_out_opt IAccessibleEx** aAccEx) { - A11Y_TRYBLOCK_BEGIN - if (!aAccEx) return E_INVALIDARG; *aAccEx = nullptr; return mAcc->IsDefunct() ? CO_E_OBJNOTCONNECTED : S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP uiaRawElmProvider::GetIAccessiblePair(__RPC__deref_out_opt IAccessible** aAcc, __RPC__out long* aIdChild) { - A11Y_TRYBLOCK_BEGIN - if (!aAcc || !aIdChild) return E_INVALIDARG; @@ -60,15 +54,11 @@ uiaRawElmProvider::GetIAccessiblePair(__RPC__deref_out_opt IAccessible** aAcc, mAcc->AddRef(); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP uiaRawElmProvider::GetRuntimeId(__RPC__deref_out_opt SAFEARRAY** aRuntimeIds) { - A11Y_TRYBLOCK_BEGIN - if (!aRuntimeIds) return E_INVALIDARG; @@ -81,16 +71,12 @@ uiaRawElmProvider::GetRuntimeId(__RPC__deref_out_opt SAFEARRAY** aRuntimeIds) SafeArrayPutElement(*aRuntimeIds, &i, (void*)&(ids[i])); return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP uiaRawElmProvider::ConvertReturnedElement(__RPC__in_opt IRawElementProviderSimple* aRawElmProvider, __RPC__deref_out_opt IAccessibleEx** aAccEx) { - A11Y_TRYBLOCK_BEGIN - if (!aRawElmProvider || !aAccEx) return E_INVALIDARG; @@ -102,8 +88,6 @@ uiaRawElmProvider::ConvertReturnedElement(__RPC__in_opt IRawElementProviderSimpl *aAccEx = static_cast<IAccessibleEx*>(instancePtr); return hr; - - A11Y_TRYBLOCK_END } //////////////////////////////////////////////////////////////////////////////// @@ -112,39 +96,29 @@ uiaRawElmProvider::ConvertReturnedElement(__RPC__in_opt IRawElementProviderSimpl STDMETHODIMP uiaRawElmProvider::get_ProviderOptions(__RPC__out enum ProviderOptions* aOptions) { - A11Y_TRYBLOCK_BEGIN - if (!aOptions) return E_INVALIDARG; // This method is not used with IAccessibleEx implementations. *aOptions = ProviderOptions_ServerSideProvider; return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP uiaRawElmProvider::GetPatternProvider(PATTERNID aPatternId, __RPC__deref_out_opt IUnknown** aPatternProvider) { - A11Y_TRYBLOCK_BEGIN - if (!aPatternProvider) return E_INVALIDARG; *aPatternProvider = nullptr; return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP uiaRawElmProvider::GetPropertyValue(PROPERTYID aPropertyId, __RPC__out VARIANT* aPropertyValue) { - A11Y_TRYBLOCK_BEGIN - if (!aPropertyValue) return E_INVALIDARG; @@ -226,21 +200,15 @@ uiaRawElmProvider::GetPropertyValue(PROPERTYID aPropertyId, } return S_OK; - - A11Y_TRYBLOCK_END } STDMETHODIMP uiaRawElmProvider::get_HostRawElementProvider(__RPC__deref_out_opt IRawElementProviderSimple** aRawElmProvider) { - A11Y_TRYBLOCK_BEGIN - if (!aRawElmProvider) return E_INVALIDARG; // This method is not used with IAccessibleEx implementations. *aRawElmProvider = nullptr; return S_OK; - - A11Y_TRYBLOCK_END } diff --git a/js/src/threading/windows/ConditionVariable.cpp b/js/src/threading/windows/ConditionVariable.cpp index 868c35141..3c75a0f27 100644 --- a/js/src/threading/windows/ConditionVariable.cpp +++ b/js/src/threading/windows/ConditionVariable.cpp @@ -28,342 +28,34 @@ _InterlockedIncrement((volatile long*)(addend)) #endif -// Windows XP and Server 2003 don't support condition variables natively. The -// NativeImports class is responsible for detecting native support and -// retrieving the appropriate function pointers. It gets instantiated once, -// using a static initializer. -class ConditionVariableNativeImports -{ -public: - ConditionVariableNativeImports() { - HMODULE kernel32_dll = GetModuleHandle("kernel32.dll"); - MOZ_RELEASE_ASSERT(kernel32_dll != NULL); - -#define LOAD_SYMBOL(symbol) loadSymbol(kernel32_dll, #symbol, symbol) - supported_ = LOAD_SYMBOL(InitializeConditionVariable) && - LOAD_SYMBOL(WakeConditionVariable) && - LOAD_SYMBOL(WakeAllConditionVariable) && - LOAD_SYMBOL(SleepConditionVariableCS); -#undef LOAD_SYMBOL - } - - inline bool supported() const { - return supported_; - } - - void(WINAPI* InitializeConditionVariable)(CONDITION_VARIABLE* ConditionVariable); - void(WINAPI* WakeAllConditionVariable)(PCONDITION_VARIABLE ConditionVariable); - void(WINAPI* WakeConditionVariable)(CONDITION_VARIABLE* ConditionVariable); - BOOL(WINAPI* SleepConditionVariableCS)(CONDITION_VARIABLE* ConditionVariable, - CRITICAL_SECTION* CriticalSection, - DWORD dwMilliseconds); - -private: - template <typename T> - inline bool loadSymbol(HMODULE module, const char* name, T& fn) { - FARPROC ptr = GetProcAddress(module, name); - if (!ptr) - return false; - - fn = reinterpret_cast<T>(ptr); - return true; - } - - bool supported_; -}; - -static ConditionVariableNativeImports sNativeImports; - // Wrapper for native condition variable APIs. -struct ConditionVariableNative -{ - inline void initialize() { - sNativeImports.InitializeConditionVariable(&cv_); - } - - inline void destroy() { - // Native condition variables don't require cleanup. - } - - inline void notify_one() { sNativeImports.WakeConditionVariable(&cv_); } - - inline void notify_all() { sNativeImports.WakeAllConditionVariable(&cv_); } - - inline bool wait(CRITICAL_SECTION* cs, DWORD msec) { - return sNativeImports.SleepConditionVariableCS(&cv_, cs, msec); - } - -private: - CONDITION_VARIABLE cv_; -}; - -// Fallback condition variable support for Windows XP and Server 2003. Given the -// difficulty of testing on these antiquated platforms and their rapidly -// diminishing market share, this implementation trades performance for -// predictable behavior. -struct ConditionVariableFallback -{ - static const uint32_t WAKEUP_MODE_NONE = 0; - static const uint32_t WAKEUP_MODE_ONE = 0x40000000; - static const uint32_t WAKEUP_MODE_ALL = 0x80000000; - - static const uint32_t WAKEUP_MODE_MASK = WAKEUP_MODE_ONE | WAKEUP_MODE_ALL; - static const uint32_t SLEEPERS_COUNT_MASK = ~WAKEUP_MODE_MASK; - - void initialize() - { - // Initialize the state variable to 0 sleepers, no wakeup. - sleepersCountAndWakeupMode_ = 0 | WAKEUP_MODE_NONE; - - // Create a semaphore that prevents threads from entering sleep, - // or waking other threads while a wakeup is ongoing. - sleepWakeupSemaphore_ = CreateSemaphoreW(NULL, 1, 1, NULL); - MOZ_RELEASE_ASSERT(sleepWakeupSemaphore_); - - // Use an auto-reset event for waking up a single sleeper. - wakeOneEvent_ = CreateEventW(NULL, FALSE, FALSE, NULL); - MOZ_RELEASE_ASSERT(wakeOneEvent_); - - // Use a manual-reset event for waking up all sleepers. - wakeAllEvent_ = CreateEventW(NULL, TRUE, FALSE, NULL); - MOZ_RELEASE_ASSERT(wakeAllEvent_); - } - - void destroy() - { - BOOL r; - - MOZ_RELEASE_ASSERT(sleepersCountAndWakeupMode_ == (0 | WAKEUP_MODE_NONE)); - - r = CloseHandle(sleepWakeupSemaphore_); - MOZ_RELEASE_ASSERT(r); - - r = CloseHandle(wakeOneEvent_); - MOZ_RELEASE_ASSERT(r); - - r = CloseHandle(wakeAllEvent_); - MOZ_RELEASE_ASSERT(r); - } - -private: - void wakeup(uint32_t wakeupMode, HANDLE wakeEvent) - { - // Ensure that only one thread at a time can wake up others. - BOOL result = WaitForSingleObject(sleepWakeupSemaphore_, INFINITE); - MOZ_RELEASE_ASSERT(result == WAIT_OBJECT_0); - - // Atomically set the wakeup mode and retrieve the number of sleepers. - uint32_t wcwm = InterlockedExchangeAdd(&sleepersCountAndWakeupMode_, - wakeupMode); - uint32_t sleepersCount = wcwm & SLEEPERS_COUNT_MASK; - MOZ_RELEASE_ASSERT((wcwm & WAKEUP_MODE_MASK) == WAKEUP_MODE_NONE); - - if (sleepersCount > 0) { - // If there are any sleepers, set the wake event. The (last) woken - // up thread is responsible for releasing the semaphore. - BOOL success = SetEvent(wakeEvent); - MOZ_RELEASE_ASSERT(success); - - } else { - // If there are no sleepers, set the wakeup mode back to 'none' - // and release the semaphore ourselves. - sleepersCountAndWakeupMode_ = 0 | WAKEUP_MODE_NONE; - - BOOL success = ReleaseSemaphore(sleepWakeupSemaphore_, 1, NULL); - MOZ_RELEASE_ASSERT(success); - } - } - -public: - void notify_one() { wakeup(WAKEUP_MODE_ONE, wakeOneEvent_); } - - void notify_all() { wakeup(WAKEUP_MODE_ALL, wakeAllEvent_); } - - bool wait(CRITICAL_SECTION* userLock, DWORD msec) - { - // Make sure that we can't enter sleep when there are other threads - // that still need to wake up on either of the wake events being set. - DWORD result = WaitForSingleObject(sleepWakeupSemaphore_, INFINITE); - MOZ_RELEASE_ASSERT(result == WAIT_OBJECT_0); - - // Register ourselves as a sleeper. Use an atomic operation, because - // if another thread times out at the same time, it will decrement the - // sleepers count without acquiring the semaphore. - uint32_t wcwm = InterlockedIncrement(&sleepersCountAndWakeupMode_); - MOZ_RELEASE_ASSERT((wcwm & WAKEUP_MODE_MASK) == WAKEUP_MODE_NONE); - - // Now that that this thread has been enlisted as a sleeper, it is safe - // again for other threads to do a wakeup. - BOOL success = ReleaseSemaphore(sleepWakeupSemaphore_, 1, NULL); - MOZ_RELEASE_ASSERT(success); - - // Release the caller's mutex. - LeaveCriticalSection(userLock); - - // Wait for either event to become signaled, which happens when - // notify_one() or notify_all() is called, or for a timeout. - HANDLE handles[2] = { wakeOneEvent_, wakeAllEvent_ }; - DWORD waitResult = WaitForMultipleObjects(2, handles, FALSE, msec); - MOZ_RELEASE_ASSERT(waitResult == WAIT_OBJECT_0 || - waitResult == WAIT_OBJECT_0 + 1 || - (waitResult == WAIT_TIMEOUT && msec != INFINITE)); - - // Atomically decrease the sleepers count and retrieve the wakeup mode - // and new sleepers count. - // If the wait returned because wakeOneEvent_ was set, we are certain - // that the wakeup mode will be WAKEUP_MODE_ONE. In that case, - // atomically reset the wakeup mode to 'none', because if another - // thread's sleep times out at same time and it finds that it was the - // last sleeper, it decides whether or not to reset the wakeOneEvent_ - // based on the current wakeup mode. - uint32_t sub; - if (waitResult == WAIT_OBJECT_0) - sub = 1 | WAKEUP_MODE_ONE; - else - sub = 1; - // Note that InterlockedExchangeAdd returns the old value, but it's - // easier to work with the new value. - wcwm = InterlockedExchangeAdd(&sleepersCountAndWakeupMode_, -sub) - sub; - - uint32_t wakeupMode = wcwm & WAKEUP_MODE_MASK; - uint32_t sleepersCount = wcwm & SLEEPERS_COUNT_MASK; - - bool releaseSleepWakeupSemaphore = false; - - if (waitResult == WAIT_OBJECT_0) { - // The wake-one event is an auto-reset event so if we're woken by - // it, it should already have been reset. We also already removed - // the WAKEUP_MODE_ONE bit so the wakeup mode should now be 'none' - // again. - MOZ_RELEASE_ASSERT(wakeupMode == WAKEUP_MODE_NONE); - - // The signaling thread has acquired the enter-wakeup semaphore and - // expects the woken (this) thread to release it again. - releaseSleepWakeupSemaphore = true; - - } else if (waitResult == WAIT_TIMEOUT && wakeupMode == WAKEUP_MODE_ONE && - sleepersCount == 0) { - // In theory a race condition is possible where the last sleeper - // times out right at the moment that another thread signals it. - // If that just happened we now have a dangling signal event and - // mode, but no threads to be woken up by it, and we need to clean - // that up. - BOOL success = ResetEvent(wakeOneEvent_); - MOZ_RELEASE_ASSERT(success); - - // This is safe - we are certain there are no other sleepers that - // could wake up right now, and the semaphore ensures that no - // non-sleeping threads are messing with - // sleepersCountAndWakeupMode_. - sleepersCountAndWakeupMode_ = 0 | WAKEUP_MODE_NONE; - - // The signaling thread has acquired the sleep-wakeup semaphore and - // expects the woken thread to release it. But since there are no - // sleeping threads left this thread will do it instead. - releaseSleepWakeupSemaphore = true; - - } else if (wakeupMode == WAKEUP_MODE_ALL && sleepersCount == 0) { - // If this was the last thread waking up in response to a - // notify_all, clear the wakeup mode and reset the wake-all event. - // A race condition similar to the case described above could - // occur, so waitResult could be WAIT_TIMEOUT, but that doesn't - // matter for the actions that need to be taken. - MOZ_RELEASE_ASSERT(waitResult = WAIT_OBJECT_0 + 1 || - waitResult == WAIT_TIMEOUT); - - BOOL success = ResetEvent(wakeAllEvent_); - MOZ_RELEASE_ASSERT(success); - - sleepersCountAndWakeupMode_ = 0 | WAKEUP_MODE_NONE; - - // The broadcasting thread has acquired the enter-wakeup semaphore - // and expects the last thread that wakes up to release it. - releaseSleepWakeupSemaphore = true; - - } else if ((waitResult == WAIT_TIMEOUT && msec != INFINITE) || - (waitResult == WAIT_OBJECT_0 + 1 && - wakeupMode == WAKEUP_MODE_ALL)) { - // Either: - // * The wait timed out but found no active notify_one or notify_all - // the moment it decreased the wait count. - // * A notify_all woke up this thread but there are more threads - // that need to be woken up by the wake-all event. - // These are ordinary conditions in which we don't have to do - // anything. - - } else { - MOZ_CRASH("invalid wakeup condition"); - } - - // Release the enter-wakeup semaphore if the wakeup condition requires - // us to do it. - if (releaseSleepWakeupSemaphore) { - BOOL success = ReleaseSemaphore(sleepWakeupSemaphore_, 1, NULL); - MOZ_RELEASE_ASSERT(success); - } - - // Reacquire the user mutex. - EnterCriticalSection(userLock); - - // Return true if woken up, false when timed out. - if (waitResult == WAIT_TIMEOUT) { - SetLastError(ERROR_TIMEOUT); - return false; - } - return true; - } - -private: - uint32_t sleepersCountAndWakeupMode_; - HANDLE sleepWakeupSemaphore_; - HANDLE wakeOneEvent_; - HANDLE wakeAllEvent_; -}; - struct js::ConditionVariable::PlatformData { - union - { - ConditionVariableNative native; - ConditionVariableFallback fallback; - }; + CONDITION_VARIABLE cv_; }; js::ConditionVariable::ConditionVariable() { - if (sNativeImports.supported()) - platformData()->native.initialize(); - else - platformData()->fallback.initialize(); + InitializeConditionVariable(&platformData()->cv_); } void js::ConditionVariable::notify_one() { - if (sNativeImports.supported()) - platformData()->native.notify_one(); - else - platformData()->fallback.notify_one(); + WakeConditionVariable(&platformData()->cv_); } void js::ConditionVariable::notify_all() { - if (sNativeImports.supported()) - platformData()->native.notify_all(); - else - platformData()->fallback.notify_all(); + WakeAllConditionVariable(&platformData()->cv_); } void js::ConditionVariable::wait(UniqueLock<Mutex>& lock) { CRITICAL_SECTION* cs = &lock.lock.platformData()->criticalSection; - bool r; - if (sNativeImports.supported()) - r = platformData()->native.wait(cs, INFINITE); - else - r = platformData()->fallback.wait(cs, INFINITE); + bool r = SleepConditionVariableCS(&platformData()->cv_, cs, INFINITE); MOZ_RELEASE_ASSERT(r); } @@ -390,11 +82,7 @@ js::ConditionVariable::wait_for(UniqueLock<Mutex>& lock, ? INFINITE : static_cast<DWORD>(msecd); - BOOL r; - if (sNativeImports.supported()) - r = platformData()->native.wait(cs, msec); - else - r = platformData()->fallback.wait(cs, msec); + BOOL r = SleepConditionVariableCS(&platformData()->cv_, cs, msec); if (r) return CVStatus::NoTimeout; MOZ_RELEASE_ASSERT(GetLastError() == ERROR_TIMEOUT); @@ -403,10 +91,7 @@ js::ConditionVariable::wait_for(UniqueLock<Mutex>& lock, js::ConditionVariable::~ConditionVariable() { - if (sNativeImports.supported()) - platformData()->native.destroy(); - else - platformData()->fallback.destroy(); + // Native condition variables don't require cleanup. } inline js::ConditionVariable::PlatformData* |