Bug 1381921, part 1 - Remove nsIXPConnect::CurrentNativeCallContext. r=mrbkap

It is only called in a single place, and can't be called from JS, so
inline it and eliminate it.

MozReview-Commit-ID: DWfyfoO5Zht

--HG--
extra : rebase_source : 8a44719af22a4d8724449d6225f4bdd119d648c8
This commit is contained in:
Andrew McCreight 2017-07-18 10:36:05 -07:00
parent f4e4b2bc68
commit c00d64f6c6
3 changed files with 2 additions and 16 deletions

View File

@ -17,7 +17,6 @@
struct JSFreeOp;
class nsWrapperCache;
class nsAXPCNativeCallContext;
%}
/***************************************************************************/
@ -32,7 +31,6 @@ class nsAXPCNativeCallContext;
native JSEqualityOp(JSEqualityOp);
[ptr] native JSScriptPtr(JSScript);
[ptr] native voidPtrPtr(void*);
[ptr] native nsAXPCNativeCallContextPtr(nsAXPCNativeCallContext);
[ptr] native nsWrapperCachePtr(nsWrapperCache);
[ref] native JSCompartmentOptions(JS::CompartmentOptions);
[ref] native JSCallArgsRef(const JS::CallArgs);
@ -415,7 +413,6 @@ interface nsIXPConnect : nsISupports
// Will return null if there is no JS stack right now.
readonly attribute nsIStackFrame CurrentJSStack;
readonly attribute nsAXPCNativeCallContextPtr CurrentNativeCallContext;
void debugDump(in short depth);
void debugDumpObject(in nsISupports aCOMObj, in short depth);

View File

@ -1703,15 +1703,13 @@ AssembleSandboxMemoryReporterName(JSContext* cx, nsCString& sandboxName)
if (sandboxName.IsEmpty())
sandboxName = NS_LITERAL_CSTRING("[anonymous sandbox]");
nsXPConnect* xpc = nsXPConnect::XPConnect();
// Get the xpconnect native call context.
nsAXPCNativeCallContext* cc = nullptr;
xpc->GetCurrentNativeCallContext(&cc);
XPCCallContext* cc = XPCJSContext::Get()->GetCallContext();
NS_ENSURE_TRUE(cc, NS_ERROR_INVALID_ARG);
// Get the current source info from xpc.
nsCOMPtr<nsIStackFrame> frame;
xpc->GetCurrentJSStack(getter_AddRefs(frame));
nsXPConnect::XPConnect()->GetCurrentJSStack(getter_AddRefs(frame));
// Append the caller's location information.
if (frame) {

View File

@ -836,15 +836,6 @@ nsXPConnect::GetCurrentJSStack(nsIStackFrame * *aCurrentJSStack)
return NS_OK;
}
NS_IMETHODIMP
nsXPConnect::GetCurrentNativeCallContext(nsAXPCNativeCallContext * *aCurrentNativeCallContext)
{
MOZ_ASSERT(aCurrentNativeCallContext, "bad param");
*aCurrentNativeCallContext = XPCJSContext::Get()->GetCallContext();
return NS_OK;
}
NS_IMETHODIMP
nsXPConnect::SetFunctionThisTranslator(const nsIID & aIID,
nsIXPCFunctionThisTranslator* aTranslator)