mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1137844 - Part 2: Add a Debugger.Memory.prototype.onGarbageCollection getter/setter pair. r=sfink
This commit is contained in:
parent
05bb991f96
commit
41b6a5b520
@ -199,6 +199,7 @@ class Debugger : private mozilla::LinkedListElement<Debugger>
|
||||
OnNewGlobalObject,
|
||||
OnNewPromise,
|
||||
OnPromiseSettled,
|
||||
OnGarbageCollection,
|
||||
HookCount
|
||||
};
|
||||
enum {
|
||||
|
@ -301,6 +301,20 @@ DebuggerMemory::getAllocationsLogOverflowed(JSContext *cx, unsigned argc, Value
|
||||
return true;
|
||||
}
|
||||
|
||||
/* static */ bool
|
||||
DebuggerMemory::getOnGarbageCollection(JSContext *cx, unsigned argc, Value *vp)
|
||||
{
|
||||
THIS_DEBUGGER_MEMORY(cx, argc, vp, "(get onGarbageCollection)", args, memory);
|
||||
return Debugger::getHookImpl(cx, args, *memory->getDebugger(), Debugger::OnGarbageCollection);
|
||||
}
|
||||
|
||||
/* static */ bool
|
||||
DebuggerMemory::setOnGarbageCollection(JSContext *cx, unsigned argc, Value *vp)
|
||||
{
|
||||
THIS_DEBUGGER_MEMORY(cx, argc, vp, "(set onGarbageCollection)", args, memory);
|
||||
return Debugger::setHookImpl(cx, args, *memory->getDebugger(), Debugger::OnGarbageCollection);
|
||||
}
|
||||
|
||||
|
||||
/* Debugger.Memory.prototype.takeCensus */
|
||||
|
||||
@ -814,6 +828,7 @@ DebuggerMemory::takeCensus(JSContext *cx, unsigned argc, Value *vp)
|
||||
JS_PSGS("maxAllocationsLogLength", getMaxAllocationsLogLength, setMaxAllocationsLogLength, 0),
|
||||
JS_PSGS("allocationSamplingProbability", getAllocationSamplingProbability, setAllocationSamplingProbability, 0),
|
||||
JS_PSG("allocationsLogOverflowed", getAllocationsLogOverflowed, 0),
|
||||
JS_PSGS("onGarbageCollection", getOnGarbageCollection, setOnGarbageCollection, 0),
|
||||
JS_PS_END
|
||||
};
|
||||
|
||||
|
@ -43,6 +43,8 @@ class DebuggerMemory : public NativeObject {
|
||||
static bool setAllocationSamplingProbability(JSContext *cx, unsigned argc, Value *vp);
|
||||
static bool getAllocationSamplingProbability(JSContext *cx, unsigned argc, Value *vp);
|
||||
static bool getAllocationsLogOverflowed(JSContext *cx, unsigned argc, Value *vp);
|
||||
static bool getOnGarbageCollection(JSContext *cx, unsigned argc, Value *vp);
|
||||
static bool setOnGarbageCollection(JSContext *cx, unsigned argc, Value *vp);
|
||||
|
||||
// Function properties of Debugger.Memory.prototype.
|
||||
static bool takeCensus(JSContext *cx, unsigned argc, Value *vp);
|
||||
|
Loading…
Reference in New Issue
Block a user