From 69a49d21a29aa616327e1fd45d4aa3aea1b1ec13 Mon Sep 17 00:00:00 2001 From: Andrew McCreight Date: Fri, 30 Jan 2015 10:55:11 -0800 Subject: [PATCH] Bug 1124261, part 3 - Inline NS_NewXBLKeyEventHandler. r=smaug --- dom/xbl/nsXBLEventHandler.cpp | 14 -------------- dom/xbl/nsXBLEventHandler.h | 4 ---- dom/xbl/nsXBLPrototypeBinding.cpp | 8 +++----- 3 files changed, 3 insertions(+), 23 deletions(-) diff --git a/dom/xbl/nsXBLEventHandler.cpp b/dom/xbl/nsXBLEventHandler.cpp index 8d10a772bfd2..3eb96eced078 100644 --- a/dom/xbl/nsXBLEventHandler.cpp +++ b/dom/xbl/nsXBLEventHandler.cpp @@ -181,17 +181,3 @@ NS_NewXBLEventHandler(nsXBLPrototypeHandler* aHandler, return handler.forget(); } - -nsresult -NS_NewXBLKeyEventHandler(nsIAtom* aEventType, uint8_t aPhase, uint8_t aType, - nsXBLKeyEventHandler** aResult) -{ - *aResult = new nsXBLKeyEventHandler(aEventType, aPhase, aType); - - if (!*aResult) - return NS_ERROR_OUT_OF_MEMORY; - - NS_ADDREF(*aResult); - - return NS_OK; -} diff --git a/dom/xbl/nsXBLEventHandler.h b/dom/xbl/nsXBLEventHandler.h index 7e64e44af583..ab418b179f4e 100644 --- a/dom/xbl/nsXBLEventHandler.h +++ b/dom/xbl/nsXBLEventHandler.h @@ -117,8 +117,4 @@ already_AddRefed NS_NewXBLEventHandler(nsXBLPrototypeHandler* aHandler, nsIAtom* aEventType); -nsresult -NS_NewXBLKeyEventHandler(nsIAtom* aEventType, uint8_t aPhase, - uint8_t aType, nsXBLKeyEventHandler** aResult); - #endif diff --git a/dom/xbl/nsXBLPrototypeBinding.cpp b/dom/xbl/nsXBLPrototypeBinding.cpp index 90f34aa37383..a66a1b19d349 100644 --- a/dom/xbl/nsXBLPrototypeBinding.cpp +++ b/dom/xbl/nsXBLPrototypeBinding.cpp @@ -807,11 +807,9 @@ nsXBLPrototypeBinding::CreateKeyHandlers() } if (i == count) { - nsRefPtr newHandler; - NS_NewXBLKeyEventHandler(eventAtom, phase, type, - getter_AddRefs(newHandler)); - if (newHandler) - mKeyHandlers.AppendObject(newHandler); + nsRefPtr newHandler = + new nsXBLKeyEventHandler(eventAtom, phase, type); + mKeyHandlers.AppendObject(newHandler); handler = newHandler; }