performance.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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";
  5. const { Arg, RetVal, generateActorSpec } = require("devtools/shared/protocol");
  6. require("devtools/shared/specs/performance-recording");
  7. const performanceSpec = generateActorSpec({
  8. typeName: "performance",
  9. /**
  10. * The set of events the PerformanceActor emits over RDP.
  11. */
  12. events: {
  13. "recording-started": {
  14. recording: Arg(0, "performance-recording"),
  15. },
  16. "recording-stopping": {
  17. recording: Arg(0, "performance-recording"),
  18. },
  19. "recording-stopped": {
  20. recording: Arg(0, "performance-recording"),
  21. data: Arg(1, "json"),
  22. },
  23. "profiler-status": {
  24. data: Arg(0, "json"),
  25. },
  26. "console-profile-start": {},
  27. "timeline-data": {
  28. name: Arg(0, "string"),
  29. data: Arg(1, "json"),
  30. recordings: Arg(2, "array:performance-recording"),
  31. },
  32. },
  33. methods: {
  34. connect: {
  35. request: { options: Arg(0, "nullable:json") },
  36. response: RetVal("json")
  37. },
  38. canCurrentlyRecord: {
  39. request: {},
  40. response: { value: RetVal("json") }
  41. },
  42. startRecording: {
  43. request: {
  44. options: Arg(0, "nullable:json"),
  45. },
  46. response: {
  47. recording: RetVal("nullable:performance-recording")
  48. }
  49. },
  50. stopRecording: {
  51. request: {
  52. options: Arg(0, "performance-recording"),
  53. },
  54. response: {
  55. recording: RetVal("performance-recording")
  56. }
  57. },
  58. isRecording: {
  59. request: {},
  60. response: { isRecording: RetVal("boolean") }
  61. },
  62. getRecordings: {
  63. request: {},
  64. response: { recordings: RetVal("array:performance-recording") }
  65. },
  66. getConfiguration: {
  67. request: {},
  68. response: { config: RetVal("json") }
  69. },
  70. setProfilerStatusInterval: {
  71. request: { interval: Arg(0, "number") },
  72. response: { oneway: true }
  73. },
  74. }
  75. });
  76. exports.performanceSpec = performanceSpec;