2017-11-08 19:36:43 +03:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
"use strict";
|
|
|
|
|
2018-03-14 09:05:48 +03:00
|
|
|
const {
|
|
|
|
Arg,
|
|
|
|
Option,
|
|
|
|
RetVal,
|
|
|
|
generateActorSpec,
|
|
|
|
} = require("devtools/shared/protocol");
|
2017-11-08 19:36:43 +03:00
|
|
|
|
|
|
|
const perfDescription = {
|
|
|
|
typeName: "perf",
|
|
|
|
|
|
|
|
events: {
|
|
|
|
"profiler-started": {
|
2018-03-14 09:05:48 +03:00
|
|
|
type: "profiler-started",
|
|
|
|
entries: Arg(0, "number"),
|
|
|
|
interval: Arg(1, "number"),
|
|
|
|
features: Arg(2, "number"),
|
2018-11-23 19:10:08 +03:00
|
|
|
duration: Arg(3, "nullable:number"),
|
2017-11-08 19:36:43 +03:00
|
|
|
},
|
|
|
|
"profiler-stopped": {
|
2018-10-19 15:55:39 +03:00
|
|
|
type: "profiler-stopped",
|
2017-11-08 19:36:43 +03:00
|
|
|
},
|
|
|
|
"profile-locked-by-private-browsing": {
|
2018-10-19 15:55:39 +03:00
|
|
|
type: "profile-locked-by-private-browsing",
|
2017-11-08 19:36:43 +03:00
|
|
|
},
|
|
|
|
"profile-unlocked-from-private-browsing": {
|
2018-10-19 15:55:39 +03:00
|
|
|
type: "profile-unlocked-from-private-browsing",
|
|
|
|
},
|
2017-11-08 19:36:43 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
startProfiler: {
|
2018-03-14 09:05:48 +03:00
|
|
|
request: {
|
|
|
|
entries: Option(0, "number"),
|
2018-11-23 19:10:08 +03:00
|
|
|
duration: Option(0, "nullable:number"),
|
2018-03-14 09:05:48 +03:00
|
|
|
interval: Option(0, "number"),
|
|
|
|
features: Option(0, "array:string"),
|
|
|
|
threads: Option(0, "array:string"),
|
|
|
|
},
|
2018-10-19 15:55:39 +03:00
|
|
|
response: { value: RetVal("boolean") },
|
2017-11-08 19:36:43 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns null when unable to return the profile.
|
|
|
|
*/
|
|
|
|
getProfileAndStopProfiler: {
|
|
|
|
request: {},
|
2018-10-19 15:55:39 +03:00
|
|
|
response: RetVal("nullable:json"),
|
2017-11-08 19:36:43 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
stopProfilerAndDiscardProfile: {
|
|
|
|
request: {},
|
2018-10-19 15:55:39 +03:00
|
|
|
response: {},
|
2017-11-08 19:36:43 +03:00
|
|
|
},
|
|
|
|
|
2018-10-02 04:52:32 +03:00
|
|
|
getSymbolTable: {
|
|
|
|
request: {
|
|
|
|
debugPath: Arg(0, "string"),
|
|
|
|
breakpadId: Arg(1, "string"),
|
|
|
|
},
|
2018-10-19 15:55:39 +03:00
|
|
|
response: { value: RetVal("array:array:number") },
|
2018-10-02 04:52:32 +03:00
|
|
|
},
|
|
|
|
|
2017-11-08 19:36:43 +03:00
|
|
|
isActive: {
|
|
|
|
request: {},
|
2018-10-19 15:55:39 +03:00
|
|
|
response: { value: RetVal("boolean") },
|
2017-11-08 19:36:43 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
isSupportedPlatform: {
|
|
|
|
request: {},
|
2018-10-19 15:55:39 +03:00
|
|
|
response: { value: RetVal("boolean") },
|
2017-11-08 19:36:43 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
isLockedForPrivateBrowsing: {
|
|
|
|
request: {},
|
2018-10-19 15:55:39 +03:00
|
|
|
response: { value: RetVal("boolean") },
|
|
|
|
},
|
2019-11-12 22:07:28 +03:00
|
|
|
|
|
|
|
// Added in Firefox 72.
|
|
|
|
getSupportedFeatures: {
|
|
|
|
request: {},
|
|
|
|
response: { value: RetVal("array:string") },
|
|
|
|
},
|
2018-10-19 15:55:39 +03:00
|
|
|
},
|
2017-11-08 19:36:43 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
exports.perfDescription = perfDescription;
|
|
|
|
|
|
|
|
const perfSpec = generateActorSpec(perfDescription);
|
|
|
|
|
|
|
|
exports.perfSpec = perfSpec;
|