Bug 1859954 - Use XP_DARWIN rather than XP_MACOS in PHC r=glandium
[gecko.git] / devtools / shared / specs / perf.js
blobde8f9ffb217658953bb2c773f86e9a497e43b134
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/. */
4 "use strict";
6 const {
7   Arg,
8   Option,
9   RetVal,
10   generateActorSpec,
11 } = require("resource://devtools/shared/protocol.js");
13 const perfDescription = {
14   typeName: "perf",
16   events: {
17     "profiler-started": {
18       type: "profiler-started",
19       entries: Arg(0, "number"),
20       interval: Arg(1, "number"),
21       features: Arg(2, "number"),
22       duration: Arg(3, "nullable:number"),
23       // The `activeTabID` option passed to `profiler_start` is used to
24       // determine the active tab when user starts the profiler.
25       // This is a parameter that is generated on the
26       // server, that's why we don't need to pass anything on `startProfiler`
27       // actor method. But we return this in "profiler-started" event because
28       // client may want to use that value.
29       activeTabID: Arg(4, "number"),
30     },
31     "profiler-stopped": {
32       type: "profiler-stopped",
33     },
34   },
36   methods: {
37     startProfiler: {
38       request: {
39         entries: Option(0, "number"),
40         duration: Option(0, "nullable:number"),
41         interval: Option(0, "number"),
42         features: Option(0, "array:string"),
43         threads: Option(0, "array:string"),
44       },
45       response: { value: RetVal("boolean") },
46     },
48     /**
49      * Returns null when unable to return the profile.
50      */
51     getProfileAndStopProfiler: {
52       request: {},
53       response: RetVal("nullable:json"),
54     },
56     stopProfilerAndDiscardProfile: {
57       request: {},
58       response: {},
59     },
61     getSymbolTable: {
62       request: {
63         debugPath: Arg(0, "string"),
64         breakpadId: Arg(1, "string"),
65       },
66       response: { value: RetVal("array:array:number") },
67     },
69     isActive: {
70       request: {},
71       response: { value: RetVal("boolean") },
72     },
74     isSupportedPlatform: {
75       request: {},
76       response: { value: RetVal("boolean") },
77     },
79     getSupportedFeatures: {
80       request: {},
81       response: { value: RetVal("array:string") },
82     },
83   },
86 exports.perfDescription = perfDescription;
88 const perfSpec = generateActorSpec(perfDescription);
90 exports.perfSpec = perfSpec;