From d023fa08395a8eb94fb127e28ae629a536276395 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Mon, 5 Feb 2018 16:34:06 -0500 Subject: [PATCH] Bug 1435483 part 20. Remove nsIException::GetData. r=qdot MozReview-Commit-ID: 9cDzCeddOmh --- dom/base/DOMException.cpp | 15 ++------------- dom/base/DOMException.h | 2 +- js/xpconnect/src/XPCWrappedJSClass.cpp | 7 ++----- xpcom/base/nsIException.idl | 3 --- 4 files changed, 5 insertions(+), 22 deletions(-) diff --git a/dom/base/DOMException.cpp b/dom/base/DOMException.cpp index 85050c475ec4..057f82642410 100644 --- a/dom/base/DOMException.cpp +++ b/dom/base/DOMException.cpp @@ -256,16 +256,6 @@ Exception::GetFilename(JSContext* aCx, nsAString& aFilename) aFilename.Truncate(); } -NS_IMETHODIMP -Exception::GetData(nsISupports** aData) -{ - NS_ENSURE_ARG_POINTER(aData); - - nsCOMPtr data = mData; - data.forget(aData); - return NS_OK; -} - NS_IMETHODIMP Exception::ToString(JSContext* aCx, nsACString& _retval) { @@ -345,11 +335,10 @@ Exception::GetLocation() const return location.forget(); } -already_AddRefed +nsISupports* Exception::GetData() const { - nsCOMPtr data = mData; - return data.forget(); + return mData; } void diff --git a/dom/base/DOMException.h b/dom/base/DOMException.h index a46f2f5b34ac..b2c48c042d43 100644 --- a/dom/base/DOMException.h +++ b/dom/base/DOMException.h @@ -97,7 +97,7 @@ public: already_AddRefed GetLocation() const; - already_AddRefed GetData() const; + nsISupports* GetData() const; void GetStack(JSContext* aCx, nsAString& aStack) const; diff --git a/js/xpconnect/src/XPCWrappedJSClass.cpp b/js/xpconnect/src/XPCWrappedJSClass.cpp index ec540d67967b..9b15b6911820 100644 --- a/js/xpconnect/src/XPCWrappedJSClass.cpp +++ b/js/xpconnect/src/XPCWrappedJSClass.cpp @@ -971,11 +971,8 @@ nsXPCWrappedJSClass::CheckForException(XPCCallContext & ccx, (do_GetService(XPC_CONSOLE_CONTRACTID)); if (nullptr != consoleService) { nsresult rv; - nsCOMPtr scriptError; - nsCOMPtr errorData; - rv = xpc_exception->GetData(getter_AddRefs(errorData)); - if (NS_SUCCEEDED(rv)) - scriptError = do_QueryInterface(errorData); + nsCOMPtr scriptError = + do_QueryInterface(xpc_exception->GetData()); if (nullptr == scriptError) { // No luck getting one from the exception, so diff --git a/xpcom/base/nsIException.idl b/xpcom/base/nsIException.idl index cce95fc9dd61..238e1a1ae29f 100644 --- a/xpcom/base/nsIException.idl +++ b/xpcom/base/nsIException.idl @@ -68,9 +68,6 @@ interface nsIStackFrame : nsISupports [scriptable, builtinclass, uuid(4371b5bf-6845-487f-8d9d-3f1e4a9badd2)] interface nsIException : nsISupports { - // Arbitary data for the implementation. - readonly attribute nsISupports data; - // A generic formatter - make it suitable to print, etc. [implicit_jscontext] AUTF8String toString();