1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
11 } = require("resource://devtools/shared/protocol.js");
13 types.addDictType("AllocationsRecordingOptions", {
14 // The probability we sample any given allocation when recording
15 // allocations. Must be between 0.0 and 1.0. Defaults to 1.0, or sampling
17 probability: "number",
19 // The maximum number of of allocation events to keep in the allocations
20 // log. If new allocations arrive, when we are already at capacity, the oldest
21 // allocation event is lost. This number must fit in a 32 bit signed integer.
22 maxLogLength: "number",
25 const memorySpec = generateActorSpec({
29 * The set of unsolicited events the MemoryActor emits that will be sent over
30 * the RDP (by protocol.js).
33 // Same format as the data passed to the
34 // `Debugger.Memory.prototype.onGarbageCollection` hook. See
35 // `js/src/doc/Debugger/Debugger.Memory.md` for documentation.
36 "garbage-collection": {
37 type: "garbage-collection",
41 // Same data as the data from `getAllocations` -- only fired if
42 // `autoDrain` set during `startRecordingAllocations`.
53 type: RetVal("string"),
59 type: RetVal("string"),
64 state: RetVal(0, "string"),
69 response: RetVal("json"),
71 startRecordingAllocations: {
73 options: Arg(0, "nullable:AllocationsRecordingOptions"),
76 // Accept `nullable` in the case of server Gecko <= 37, handled on the front
77 value: RetVal(0, "nullable:number"),
80 stopRecordingAllocations: {
83 // Accept `nullable` in the case of server Gecko <= 37, handled on the front
84 value: RetVal(0, "nullable:number"),
87 getAllocationsSettings: {
90 options: RetVal(0, "json"),
95 response: RetVal("json"),
97 forceGarbageCollection: {
101 forceCycleCollection: {
107 response: RetVal("json"),
111 response: { value: RetVal("number") },
115 boundaries: Arg(0, "nullable:json"),
118 snapshotId: RetVal("string"),
124 exports.memorySpec = memorySpec;