mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 06:43:32 +00:00
Temporary restore old shark start/stop functions (bug 625993, r=bz).
This commit is contained in:
parent
949f18ab0c
commit
c71d128474
@ -3362,10 +3362,8 @@ nsJSContext::InitClasses(void *aGlobalObj)
|
||||
rv = NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
#ifdef MOZ_PROFILING
|
||||
// Attempt to initialize profiling functions
|
||||
::JS_DefineProfilingFunctions(mContext, globalObj);
|
||||
#endif
|
||||
|
||||
#ifdef NS_TRACE_MALLOC
|
||||
// Attempt to initialize TraceMalloc functions
|
||||
|
@ -2105,10 +2105,8 @@ nsDOMWorker::CompileGlobalObject(JSContext* aCx, nsLazyAutoRequest *aRequest,
|
||||
success = JS_DefineFunctions(aCx, global, gDOMWorkerFunctions);
|
||||
NS_ENSURE_TRUE(success, PR_FALSE);
|
||||
|
||||
#ifdef MOZ_PROFILING
|
||||
success = JS_DefineProfilingFunctions(aCx, global);
|
||||
NS_ENSURE_TRUE(success, PR_FALSE);
|
||||
#endif
|
||||
|
||||
if (IsPrivileged()) {
|
||||
// Add chrome functions.
|
||||
|
@ -1924,20 +1924,38 @@ JS_StopProfiling()
|
||||
static JSBool
|
||||
StartProfiling(JSContext *cx, uintN argc, jsval *vp)
|
||||
{
|
||||
*vp = BOOLEAN_TO_JSVAL(Probes::startProfiling());
|
||||
JS_SET_RVAL(cx, vp, BOOLEAN_TO_JSVAL(Probes::startProfiling()));
|
||||
return true;
|
||||
}
|
||||
|
||||
static JSBool
|
||||
StopProfiling(JSContext *cx, uintN argc, jsval *vp)
|
||||
{
|
||||
*vp = JSVAL_VOID;
|
||||
JS_SET_RVAL(cx, vp, JSVAL_VOID);
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef MOZ_SHARK
|
||||
|
||||
static JSBool
|
||||
IgnoreAndReturnTrue(JSContext *cx, uintN argc, jsval *vp)
|
||||
{
|
||||
JS_SET_RVAL(cx, vp, JSVAL_TRUE);
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static JSFunctionSpec profiling_functions[] = {
|
||||
JS_FN("startProfiling", StartProfiling, 0,0),
|
||||
JS_FN("stopProfiling", StopProfiling, 0,0),
|
||||
JS_FN("startProfiling", StartProfiling, 0,0),
|
||||
JS_FN("stopProfiling", StopProfiling, 0,0),
|
||||
#ifdef MOZ_SHARK
|
||||
/* Keep users of the old shark API happy. */
|
||||
JS_FN("connectShark", IgnoreAndReturnTrue, 0,0),
|
||||
JS_FN("disconnectShark", IgnoreAndReturnTrue, 0,0),
|
||||
JS_FN("startShark", StartProfiling, 0,0),
|
||||
JS_FN("stopShark", StopProfiling, 0,0),
|
||||
#endif
|
||||
JS_FS_END
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user