Bug 1692846 - Remove redundant nullptr checks of return value of infallible new in accessible/. r=Jamie

Differential Revision: https://phabricator.services.mozilla.com/D105174
This commit is contained in:
Simon Giesecke 2021-02-16 08:43:57 +00:00
parent ae517d5b6d
commit 338908171d
4 changed files with 1 additions and 6 deletions

View File

@ -507,7 +507,7 @@ void RootAccessible::HandlePopupShownEvent(Accessible* aAccessible) {
if (combobox->IsCombobox() || combobox->IsAutoComplete()) {
RefPtr<AccEvent> event =
new AccStateChangeEvent(combobox, states::EXPANDED, true);
if (event) nsEventShell::FireEvent(event);
nsEventShell::FireEvent(event);
}
// If aria-activedescendant is present, redirect focus.

View File

@ -63,9 +63,6 @@ AccessibleHandler::Create(IUnknown* aOuter, REFIID aIid, void** aOutInterface) {
HRESULT hr;
RefPtr<AccessibleHandler> handler(new AccessibleHandler(aOuter, &hr));
if (!handler) {
return E_OUTOFMEMORY;
}
if (FAILED(hr)) {
return hr;
}

View File

@ -684,7 +684,6 @@ AccessibleEnumerator::Next(unsigned long celt, VARIANT FAR* rgvar,
STDMETHODIMP
AccessibleEnumerator::Clone(IEnumVARIANT FAR* FAR* ppenum) {
*ppenum = new AccessibleEnumerator(*this);
if (!*ppenum) return E_OUTOFMEMORY;
NS_ADDREF(*ppenum);
return S_OK;
}

View File

@ -262,7 +262,6 @@ nsresult NS_GetAccessibilityService(nsIAccessibilityService** aResult) {
}
xpcAccessibilityService* service = new xpcAccessibilityService();
NS_ENSURE_TRUE(service, NS_ERROR_OUT_OF_MEMORY);
xpcAccessibilityService::gXPCAccessibilityService = service;
NS_ADDREF(*aResult = service);