зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1080742. Make DumpJSStack() work on workers. r=bholley
This commit is contained in:
Родитель
cbea31cb3e
Коммит
d0757cbfc2
|
@ -6,6 +6,8 @@
|
|||
|
||||
#include "xpcprivate.h"
|
||||
#include "jsprf.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "nsContentUtils.h"
|
||||
|
||||
#ifdef XP_WIN
|
||||
#include <windows.h>
|
||||
|
@ -32,9 +34,12 @@ static void DebugDump(const char* fmt, ...)
|
|||
}
|
||||
|
||||
bool
|
||||
xpc_DumpJSStack(JSContext* cx, bool showArgs, bool showLocals, bool showThisProps)
|
||||
xpc_DumpJSStack(bool showArgs, bool showLocals, bool showThisProps)
|
||||
{
|
||||
if (char* buf = xpc_PrintJSStack(cx, showArgs, showLocals, showThisProps)) {
|
||||
JSContext* cx = nsContentUtils::GetCurrentJSContextForThread();
|
||||
if (!cx) {
|
||||
printf("there is no JSContext on the stack!\n");
|
||||
} else if (char* buf = xpc_PrintJSStack(cx, showArgs, showLocals, showThisProps)) {
|
||||
DebugDump("%s\n", buf);
|
||||
JS_smprintf_free(buf);
|
||||
}
|
||||
|
|
|
@ -968,11 +968,7 @@ nsXPConnect::DebugDumpJSStack(bool showArgs,
|
|||
bool showLocals,
|
||||
bool showThisProps)
|
||||
{
|
||||
JSContext* cx = GetCurrentJSContext();
|
||||
if (!cx)
|
||||
printf("there is no JSContext on the nsIThreadJSContextStack!\n");
|
||||
else
|
||||
xpc_DumpJSStack(cx, showArgs, showLocals, showThisProps);
|
||||
xpc_DumpJSStack(showArgs, showLocals, showThisProps);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -1389,12 +1385,7 @@ nsXPConnect::ReadFunction(nsIObjectInputStream *stream, JSContext *cx, JSObject
|
|||
extern "C" {
|
||||
JS_EXPORT_API(void) DumpJSStack()
|
||||
{
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIXPConnect> xpc(do_GetService(nsIXPConnect::GetCID(), &rv));
|
||||
if (NS_SUCCEEDED(rv) && xpc)
|
||||
xpc->DebugDumpJSStack(true, true, false);
|
||||
else
|
||||
printf("failed to get XPConnect service!\n");
|
||||
xpc_DumpJSStack(true, true, false);
|
||||
}
|
||||
|
||||
JS_EXPORT_API(char*) PrintJSStack()
|
||||
|
|
|
@ -2968,8 +2968,7 @@ xpc_JSObjectIsID(JSContext *cx, JSObject* obj);
|
|||
// in XPCDebug.cpp
|
||||
|
||||
extern bool
|
||||
xpc_DumpJSStack(JSContext* cx, bool showArgs, bool showLocals,
|
||||
bool showThisProps);
|
||||
xpc_DumpJSStack(bool showArgs, bool showLocals, bool showThisProps);
|
||||
|
||||
// Return a newly-allocated string containing a representation of the
|
||||
// current JS stack. It is the *caller's* responsibility to free this
|
||||
|
|
Загрузка…
Ссылка в новой задаче