Bug 1381921, part 2 - Remove nsAXPCNativeCallContext. r=mrbkap draft
authorAndrew McCreight <continuation@gmail.com>
Tue, 18 Jul 2017 10:42:47 -0700
changeset 610794 20e76e8d3520b9e77a343dcf6a69741feb62836d
parent 610793 97051115deaa1426462438a65cf1655a755788e7
child 637955 6562320f82198559fb88619108d7081535057a67
push id69000
push userbmo:continuation@gmail.com
push dateTue, 18 Jul 2017 19:00:19 +0000
reviewersmrbkap
bugs1381921
milestone56.0a1
Bug 1381921, part 2 - Remove nsAXPCNativeCallContext. r=mrbkap This class is no longer used. MozReview-Commit-ID: Lv9AAd3OjIl
dom/base/nsJSEnvironment.cpp
dom/base/nsJSTimeoutHandler.cpp
js/xpconnect/public/moz.build
js/xpconnect/public/nsAXPCNativeCallContext.h
js/xpconnect/src/XPCCallContext.cpp
js/xpconnect/src/xpcprivate.h
--- a/dom/base/nsJSEnvironment.cpp
+++ b/dom/base/nsJSEnvironment.cpp
@@ -57,17 +57,16 @@
 #include "mozilla/AutoRestore.h"
 #include "mozilla/MainThreadIdlePeriod.h"
 #include "mozilla/StaticPtr.h"
 #include "mozilla/dom/DOMException.h"
 #include "mozilla/dom/DOMExceptionBinding.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/ErrorEvent.h"
 #include "mozilla/dom/ScriptSettings.h"
-#include "nsAXPCNativeCallContext.h"
 #include "mozilla/CycleCollectedJSRuntime.h"
 #include "mozilla/SystemGroup.h"
 #include "nsRefreshDriver.h"
 #include "nsJSPrincipals.h"
 
 #ifdef XP_MACOSX
 // AssertMacros.h defines 'check' and conflicts with AccessCheck.h
 #undef check
--- a/dom/base/nsJSTimeoutHandler.cpp
+++ b/dom/base/nsJSTimeoutHandler.cpp
@@ -5,17 +5,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include <algorithm>
 
 #include "mozilla/Attributes.h"
 #include "mozilla/Likely.h"
 #include "mozilla/Maybe.h"
 #include "mozilla/dom/FunctionBinding.h"
-#include "nsAXPCNativeCallContext.h"
 #include "nsCOMPtr.h"
 #include "nsContentUtils.h"
 #include "nsError.h"
 #include "nsGlobalWindow.h"
 #include "nsIContentSecurityPolicy.h"
 #include "nsIDocument.h"
 #include "nsIScriptTimeoutHandler.h"
 #include "nsIXPConnect.h"
--- a/js/xpconnect/public/moz.build
+++ b/js/xpconnect/public/moz.build
@@ -1,13 +1,12 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 EXPORTS += [
-    'nsAXPCNativeCallContext.h',
     'nsTArrayHelpers.h',
     'xpc_make_class.h',
     'xpc_map_end.h',
 ]
 
deleted file mode 100644
--- a/js/xpconnect/public/nsAXPCNativeCallContext.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* vim: set ts=8 sts=4 et sw=4 tw=99: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nsAXPCNativeCallContext_h__
-#define nsAXPCNativeCallContext_h__
-
-/**
-* A native call context is allocated on the stack when XPConnect calls a
-* native method. Holding a pointer to this object beyond the currently
-* executing stack frame is not permitted.
-*/
-class nsAXPCNativeCallContext
-{
-public:
-    NS_IMETHOD GetCallee(nsISupports** aResult) = 0;
-    NS_IMETHOD GetCalleeMethodIndex(uint16_t* aResult) = 0;
-    NS_IMETHOD GetJSContext(JSContext** aResult) = 0;
-    NS_IMETHOD GetArgc(uint32_t* aResult) = 0;
-    NS_IMETHOD GetArgvPtr(JS::Value** aResult) = 0;
-
-    // Methods added since mozilla 0.6....
-
-    NS_IMETHOD GetCalleeInterface(nsIInterfaceInfo** aResult) = 0;
-    NS_IMETHOD GetCalleeClassInfo(nsIClassInfo** aResult) = 0;
-
-    NS_IMETHOD GetPreviousCallContext(nsAXPCNativeCallContext** aResult) = 0;
-};
-
-#endif
--- a/js/xpconnect/src/XPCCallContext.cpp
+++ b/js/xpconnect/src/XPCCallContext.cpp
@@ -208,69 +208,8 @@ XPCCallContext::SystemIsBeingShutDown()
 
 XPCCallContext::~XPCCallContext()
 {
     if (mXPCJSContext) {
         DebugOnly<XPCCallContext*> old = mXPCJSContext->SetCallContext(mPrevCallContext);
         MOZ_ASSERT(old == this, "bad pop from per thread data");
     }
 }
-
-NS_IMETHODIMP
-XPCCallContext::GetCallee(nsISupports * *aCallee)
-{
-    nsCOMPtr<nsISupports> rval = mWrapper ? mWrapper->GetIdentityObject() : nullptr;
-    rval.forget(aCallee);
-    return NS_OK;
-}
-
-NS_IMETHODIMP
-XPCCallContext::GetCalleeMethodIndex(uint16_t* aCalleeMethodIndex)
-{
-    *aCalleeMethodIndex = mMethodIndex;
-    return NS_OK;
-}
-
-NS_IMETHODIMP
-XPCCallContext::GetCalleeInterface(nsIInterfaceInfo * *aCalleeInterface)
-{
-    nsCOMPtr<nsIInterfaceInfo> rval = mInterface->GetInterfaceInfo();
-    rval.forget(aCalleeInterface);
-    return NS_OK;
-}
-
-NS_IMETHODIMP
-XPCCallContext::GetCalleeClassInfo(nsIClassInfo * *aCalleeClassInfo)
-{
-    nsCOMPtr<nsIClassInfo> rval = mWrapper ? mWrapper->GetClassInfo() : nullptr;
-    rval.forget(aCalleeClassInfo);
-    return NS_OK;
-}
-
-NS_IMETHODIMP
-XPCCallContext::GetJSContext(JSContext * *aJSContext)
-{
-    JS_AbortIfWrongThread(mJSContext);
-    *aJSContext = mJSContext;
-    return NS_OK;
-}
-
-NS_IMETHODIMP
-XPCCallContext::GetArgc(uint32_t* aArgc)
-{
-    *aArgc = (uint32_t) mArgc;
-    return NS_OK;
-}
-
-NS_IMETHODIMP
-XPCCallContext::GetArgvPtr(Value** aArgvPtr)
-{
-    *aArgvPtr = mArgv;
-    return NS_OK;
-}
-
-NS_IMETHODIMP
-XPCCallContext::GetPreviousCallContext(nsAXPCNativeCallContext** aResult)
-{
-  NS_ENSURE_ARG_POINTER(aResult);
-  *aResult = GetPrevCallContext();
-  return NS_OK;
-}
--- a/js/xpconnect/src/xpcprivate.h
+++ b/js/xpconnect/src/xpcprivate.h
@@ -146,17 +146,16 @@
 
 #include "nsIPrincipal.h"
 #include "nsJSPrincipals.h"
 #include "nsIScriptObjectPrincipal.h"
 #include "xpcObjectHelper.h"
 
 #include "SandboxPrivate.h"
 #include "BackstagePass.h"
-#include "nsAXPCNativeCallContext.h"
 
 #ifdef XP_WIN
 // Nasty MS defines
 #ifdef GetClassInfo
 #undef GetClassInfo
 #endif
 #ifdef GetClassName
 #undef GetClassName
@@ -699,28 +698,19 @@ XPCJSContext::GetStringName(unsigned ind
 // init'd and leave other members undefined. In debug builds the accessors
 // use a CHECK_STATE macro to track whether or not the object is in a valid
 // state to answer the question a caller might be asking. As long as this
 // class is maintained correctly it can do its job without a bunch of added
 // overhead from useless initializations and non-DEBUG error checking.
 //
 // Note that most accessors are inlined.
 
-class MOZ_STACK_CLASS XPCCallContext final : public nsAXPCNativeCallContext
+class MOZ_STACK_CLASS XPCCallContext final
 {
 public:
-    NS_IMETHOD GetCallee(nsISupports** aResult);
-    NS_IMETHOD GetCalleeMethodIndex(uint16_t* aResult);
-    NS_IMETHOD GetJSContext(JSContext** aResult);
-    NS_IMETHOD GetArgc(uint32_t* aResult);
-    NS_IMETHOD GetArgvPtr(JS::Value** aResult);
-    NS_IMETHOD GetCalleeInterface(nsIInterfaceInfo** aResult);
-    NS_IMETHOD GetCalleeClassInfo(nsIClassInfo** aResult);
-    NS_IMETHOD GetPreviousCallContext(nsAXPCNativeCallContext** aResult);
-
     enum {NO_ARGS = (unsigned) -1};
 
     explicit XPCCallContext(JSContext* cx,
                             JS::HandleObject obj    = nullptr,
                             JS::HandleObject funobj = nullptr,
                             JS::HandleId id         = JSID_VOIDHANDLE,
                             unsigned argc           = NO_ARGS,
                             JS::Value* argv         = nullptr,