mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 865729 - Remove nsIJSContextStack. r=gabor
\o/
This commit is contained in:
parent
eb840cbdb4
commit
e47507c912
@ -262,10 +262,7 @@ JSContext *
|
||||
nsScriptSecurityManager::GetCurrentJSContext()
|
||||
{
|
||||
// Get JSContext from stack.
|
||||
JSContext *cx;
|
||||
if (NS_FAILED(sXPConnect->Peek(&cx)))
|
||||
return nullptr;
|
||||
return cx;
|
||||
return sXPConnect->GetCurrentJSContext();
|
||||
}
|
||||
|
||||
JSContext *
|
||||
|
@ -5447,11 +5447,7 @@ nsContentUtils::GetContextForEventHandlers(nsINode* aNode,
|
||||
JSContext *
|
||||
nsContentUtils::GetCurrentJSContext()
|
||||
{
|
||||
JSContext *cx = nullptr;
|
||||
|
||||
sXPConnect->Peek(&cx);
|
||||
|
||||
return cx;
|
||||
return sXPConnect->GetCurrentJSContext();
|
||||
}
|
||||
|
||||
/* static */
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
XPIDL_SOURCES += [
|
||||
'mozIJSSubScriptLoader.idl',
|
||||
'nsIJSContextStack.idl',
|
||||
'nsIJSEngineTelemetryStats.idl',
|
||||
'nsIJSRuntimeService.idl',
|
||||
'nsIScriptError.idl',
|
||||
|
@ -1,23 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* 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/. */
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
[ptr] native JSContext(JSContext);
|
||||
|
||||
[uuid(ff1e7ec6-249b-4bda-9068-7b06ebb58a2a)]
|
||||
interface nsIJSContextStack : nsISupports
|
||||
{
|
||||
readonly attribute int32_t count;
|
||||
JSContext peek();
|
||||
};
|
||||
|
||||
[uuid(59ad3ff1-a2d3-4c11-b825-098bff3c3e15)]
|
||||
interface nsIThreadJSContextStack : nsIJSContextStack
|
||||
{
|
||||
/* inherits methods of nsIJSContextStack */
|
||||
[notxpcom,nostdcall] JSContext getSafeJSContext();
|
||||
};
|
@ -17,7 +17,6 @@
|
||||
#include "nsIVariant.idl"
|
||||
#include "nsIObjectOutputStream.idl"
|
||||
#include "nsIObjectInputStream.idl"
|
||||
#include "nsIJSContextStack.idl"
|
||||
|
||||
%{ C++
|
||||
#include "jspubtd.h"
|
||||
@ -291,8 +290,8 @@ interface nsIXPCFunctionThisTranslator : nsISupports
|
||||
{ 0xbd, 0xd6, 0x0, 0x0, 0x64, 0x65, 0x73, 0x74 } }
|
||||
%}
|
||||
|
||||
[uuid(b3012603-aa25-4192-b331-c16272499957)]
|
||||
interface nsIXPConnect : nsIThreadJSContextStack
|
||||
[uuid(4d292c29-9d18-403b-b98e-2056e550a3b4)]
|
||||
interface nsIXPConnect : nsISupports
|
||||
{
|
||||
%{ C++
|
||||
NS_DEFINE_STATIC_CID_ACCESSOR(NS_XPCONNECT_CID)
|
||||
@ -465,10 +464,9 @@ interface nsIXPConnect : nsIThreadJSContextStack
|
||||
in int32_t aLineNumber,
|
||||
in nsIStackFrame aCaller);
|
||||
|
||||
/**
|
||||
* @deprecated do-nothing function.
|
||||
*/
|
||||
[deprecated] void syncJSContexts();
|
||||
|
||||
[noscript,notxpcom,nostdcall] JSContextPtr getCurrentJSContext();
|
||||
[noscript,notxpcom,nostdcall] JSContextPtr getSafeJSContext();
|
||||
|
||||
readonly attribute nsIStackFrame CurrentJSStack;
|
||||
readonly attribute nsAXPCNativeCallContextPtr CurrentNativeCallContext;
|
||||
|
@ -48,13 +48,11 @@ using namespace mozilla::dom;
|
||||
using namespace xpc;
|
||||
using namespace JS;
|
||||
|
||||
NS_IMPL_THREADSAFE_ISUPPORTS7(nsXPConnect,
|
||||
NS_IMPL_THREADSAFE_ISUPPORTS5(nsXPConnect,
|
||||
nsIXPConnect,
|
||||
nsISupportsWeakReference,
|
||||
nsIThreadObserver,
|
||||
nsIJSRuntimeService,
|
||||
nsIJSContextStack,
|
||||
nsIThreadJSContextStack,
|
||||
nsIJSEngineTelemetryStats)
|
||||
|
||||
nsXPConnect* nsXPConnect::gSelf = nullptr;
|
||||
@ -1520,9 +1518,8 @@ nsXPConnect::GetCurrentJSStack(nsIStackFrame * *aCurrentJSStack)
|
||||
NS_ASSERTION(aCurrentJSStack, "bad param");
|
||||
*aCurrentJSStack = nullptr;
|
||||
|
||||
JSContext* cx;
|
||||
// is there a current context available?
|
||||
if (NS_SUCCEEDED(Peek(&cx)) && cx) {
|
||||
if (JSContext *cx = GetCurrentJSContext()) {
|
||||
nsCOMPtr<nsIStackFrame> stack;
|
||||
XPCJSStack::CreateStack(cx, getter_AddRefs(stack));
|
||||
if (stack) {
|
||||
@ -1552,13 +1549,6 @@ nsXPConnect::GetCurrentNativeCallContext(nsAXPCNativeCallContext * *aCurrentNati
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXPConnect::SyncJSContexts(void)
|
||||
{
|
||||
// Do-nothing compatibility function
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* void setFunctionThisTranslator (in nsIIDRef aIID, in nsIXPCFunctionThisTranslator aTranslator); */
|
||||
NS_IMETHODIMP
|
||||
nsXPConnect::SetFunctionThisTranslator(const nsIID & aIID,
|
||||
@ -1774,10 +1764,8 @@ nsXPConnect::DebugDumpJSStack(bool showArgs,
|
||||
bool showLocals,
|
||||
bool showThisProps)
|
||||
{
|
||||
JSContext* cx;
|
||||
if (NS_FAILED(Peek(&cx)))
|
||||
printf("failed to peek into nsIThreadJSContextStack service!\n");
|
||||
else if (!cx)
|
||||
JSContext* cx = GetCurrentJSContext();
|
||||
if (!cx)
|
||||
printf("there is no JSContext on the nsIThreadJSContextStack!\n");
|
||||
else
|
||||
xpc_DumpJSStack(cx, showArgs, showLocals, showThisProps);
|
||||
@ -1790,10 +1778,8 @@ nsXPConnect::DebugPrintJSStack(bool showArgs,
|
||||
bool showLocals,
|
||||
bool showThisProps)
|
||||
{
|
||||
JSContext* cx;
|
||||
if (NS_FAILED(Peek(&cx)))
|
||||
printf("failed to peek into nsIThreadJSContextStack service!\n");
|
||||
else if (!cx)
|
||||
JSContext* cx = GetCurrentJSContext();
|
||||
if (!cx)
|
||||
printf("there is no JSContext on the nsIThreadJSContextStack!\n");
|
||||
else
|
||||
return xpc_PrintJSStack(cx, showArgs, showLocals, showThisProps);
|
||||
@ -1805,10 +1791,8 @@ nsXPConnect::DebugPrintJSStack(bool showArgs,
|
||||
NS_IMETHODIMP
|
||||
nsXPConnect::DebugDumpEvalInJSStackFrame(uint32_t aFrameNumber, const char *aSourceText)
|
||||
{
|
||||
JSContext* cx;
|
||||
if (NS_FAILED(Peek(&cx)))
|
||||
printf("failed to peek into nsIThreadJSContextStack service!\n");
|
||||
else if (!cx)
|
||||
JSContext* cx = GetCurrentJSContext();
|
||||
if (!cx)
|
||||
printf("there is no JSContext on the nsIThreadJSContextStack!\n");
|
||||
else
|
||||
xpc_DumpEvalInJSStackFrame(cx, aFrameNumber, aSourceText);
|
||||
@ -1963,28 +1947,6 @@ nsXPConnect::UnregisterGCCallback(JSGCCallback func)
|
||||
mRuntime->RemoveGCCallback(func);
|
||||
}
|
||||
|
||||
// nsIJSContextStack and nsIThreadJSContextStack implementations
|
||||
|
||||
/* readonly attribute int32_t Count; */
|
||||
NS_IMETHODIMP
|
||||
nsXPConnect::GetCount(int32_t *aCount)
|
||||
{
|
||||
MOZ_ASSERT(aCount);
|
||||
|
||||
*aCount = XPCJSRuntime::Get()->GetJSContextStack()->Count();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* JSContext Peek (); */
|
||||
NS_IMETHODIMP
|
||||
nsXPConnect::Peek(JSContext * *_retval)
|
||||
{
|
||||
MOZ_ASSERT(_retval);
|
||||
|
||||
*_retval = xpc_UnmarkGrayContext(XPCJSRuntime::Get()->GetJSContextStack()->Peek());
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef MOZ_JSDEBUGGER
|
||||
void
|
||||
nsXPConnect::CheckForDebugMode(JSRuntime *rt)
|
||||
@ -2063,6 +2025,14 @@ xpc_ActivateDebugMode()
|
||||
nsXPConnect::CheckForDebugMode(rt->GetJSRuntime());
|
||||
}
|
||||
|
||||
/* virtual */
|
||||
JSContext*
|
||||
nsXPConnect::GetCurrentJSContext()
|
||||
{
|
||||
JSContext *cx = XPCJSRuntime::Get()->GetJSContextStack()->Peek();
|
||||
return xpc_UnmarkGrayContext(cx);
|
||||
}
|
||||
|
||||
/* virtual */
|
||||
JSContext*
|
||||
nsXPConnect::GetSafeJSContext()
|
||||
|
@ -146,7 +146,6 @@
|
||||
#include "mozilla/Mutex.h"
|
||||
|
||||
#include "nsThreadUtils.h"
|
||||
#include "nsIJSContextStack.h"
|
||||
#include "nsIJSEngineTelemetryStats.h"
|
||||
|
||||
#include "nsIConsoleService.h"
|
||||
@ -472,8 +471,6 @@ public:
|
||||
NS_DECL_NSIXPCONNECT
|
||||
NS_DECL_NSITHREADOBSERVER
|
||||
NS_DECL_NSIJSRUNTIMESERVICE
|
||||
NS_DECL_NSIJSCONTEXTSTACK
|
||||
NS_DECL_NSITHREADJSCONTEXTSTACK
|
||||
NS_DECL_NSIJSENGINETELEMETRYSTATS
|
||||
|
||||
// non-interface implementation
|
||||
|
Loading…
Reference in New Issue
Block a user