mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-10 02:08:38 +09:00
No issue - add API to tell Profile Timeline Recording state to JS engine
Based-on: m-c 1342070/5
This commit is contained in:
parent
1230808583
commit
531906eb87
3 changed files with 37 additions and 0 deletions
|
|
@ -1276,6 +1276,20 @@ JS::detail::ComputeThis(JSContext* cx, Value* vp)
|
|||
return thisv;
|
||||
}
|
||||
|
||||
static bool gProfileTimelineRecordingEnabled = false;
|
||||
|
||||
JS_PUBLIC_API(void)
|
||||
JS::SetProfileTimelineRecordingEnabled(bool enabled)
|
||||
{
|
||||
gProfileTimelineRecordingEnabled = enabled;
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS::IsProfileTimelineRecordingEnabled()
|
||||
{
|
||||
return gProfileTimelineRecordingEnabled;
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(void*)
|
||||
JS_malloc(JSContext* cx, size_t nbytes)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1545,6 +1545,22 @@ JS_DefineProfilingFunctions(JSContext* cx, JS::HandleObject obj);
|
|||
extern JS_PUBLIC_API(bool)
|
||||
JS_DefineDebuggerObject(JSContext* cx, JS::HandleObject obj);
|
||||
|
||||
namespace JS {
|
||||
|
||||
/**
|
||||
* Tell JS engine whether Profile Timeline Recording is enabled or not.
|
||||
* If Profile Timeline Recording is enabled, data shown there like stack won't
|
||||
* be optimized out.
|
||||
* This is global state and not associated with specific runtime or context.
|
||||
*/
|
||||
extern JS_PUBLIC_API(void)
|
||||
SetProfileTimelineRecordingEnabled(bool enabled);
|
||||
|
||||
extern JS_PUBLIC_API(bool)
|
||||
IsProfileTimelineRecordingEnabled();
|
||||
|
||||
} // namespace JS
|
||||
|
||||
#ifdef JS_HAS_CTYPES
|
||||
/**
|
||||
* Initialize the 'ctypes' object on a global variable 'obj'. The 'ctypes'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue