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 const perfDescription = {
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"),
32 type: "profiler-stopped",
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"),
45 response: { value: RetVal("boolean") },
49 * Returns null when unable to return the profile.
51 getProfileAndStopProfiler: {
53 response: RetVal("nullable:json"),
56 stopProfilerAndDiscardProfile: {
63 debugPath: Arg(0, "string"),
64 breakpadId: Arg(1, "string"),
66 response: { value: RetVal("array:array:number") },
71 response: { value: RetVal("boolean") },
74 isSupportedPlatform: {
76 response: { value: RetVal("boolean") },
79 getSupportedFeatures: {
81 response: { value: RetVal("array:string") },
86 exports.perfDescription = perfDescription;
88 const perfSpec = generateActorSpec(perfDescription);
90 exports.perfSpec = perfSpec;