events.js 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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 file,
  3. * You can obtain one at http://mozilla.org/MPL/2.0/. */
  4. "use strict";
  5. const ControllerEvents = {
  6. // Fired when a performance pref changes (either because the user changed it
  7. // via the tool's UI, by changing something about:config or programatically).
  8. PREF_CHANGED: "Performance:PrefChanged",
  9. // Fired when the devtools theme changes.
  10. THEME_CHANGED: "Performance:ThemeChanged",
  11. // When a new recording model is received by the controller.
  12. RECORDING_ADDED: "Performance:RecordingAdded",
  13. // When a recording model gets removed from the controller.
  14. RECORDING_DELETED: "Performance:RecordingDeleted",
  15. // When a recording model becomes "started", "stopping" or "stopped".
  16. RECORDING_STATE_CHANGE: "Performance:RecordingStateChange",
  17. // When a recording is offering information on the profiler's circular buffer.
  18. RECORDING_PROFILER_STATUS_UPDATE: "Performance:RecordingProfilerStatusUpdate",
  19. // When a recording model becomes marked as selected.
  20. RECORDING_SELECTED: "Performance:RecordingSelected",
  21. // When starting a recording is attempted and fails because the backend
  22. // does not permit it at this time.
  23. BACKEND_FAILED_AFTER_RECORDING_START: "Performance:BackendFailedRecordingStart",
  24. // When a recording is started and the backend has started working.
  25. BACKEND_READY_AFTER_RECORDING_START: "Performance:BackendReadyRecordingStart",
  26. // When a recording is stopped and the backend has finished cleaning up.
  27. BACKEND_READY_AFTER_RECORDING_STOP: "Performance:BackendReadyRecordingStop",
  28. // When a recording is exported.
  29. RECORDING_EXPORTED: "Performance:RecordingExported",
  30. // When a recording is imported.
  31. RECORDING_IMPORTED: "Performance:RecordingImported",
  32. // When a source is shown in the JavaScript Debugger at a specific location.
  33. SOURCE_SHOWN_IN_JS_DEBUGGER: "Performance:UI:SourceShownInJsDebugger",
  34. SOURCE_NOT_FOUND_IN_JS_DEBUGGER: "Performance:UI:SourceNotFoundInJsDebugger",
  35. // Fired by the PerformanceController when `populateWithRecordings` is finished.
  36. RECORDINGS_SEEDED: "Performance:RecordingsSeeded",
  37. };
  38. const ViewEvents = {
  39. // Emitted by the `ToolbarView` when a preference changes.
  40. UI_PREF_CHANGED: "Performance:UI:PrefChanged",
  41. // When the state (display mode) changes, for example when switching between
  42. // "empty", "recording" or "recorded". This causes certain parts of the UI
  43. // to be hidden or visible.
  44. UI_STATE_CHANGED: "Performance:UI:StateChanged",
  45. // Emitted by the `PerformanceView` on clear button click.
  46. UI_CLEAR_RECORDINGS: "Performance:UI:ClearRecordings",
  47. // Emitted by the `PerformanceView` on record button click.
  48. UI_START_RECORDING: "Performance:UI:StartRecording",
  49. UI_STOP_RECORDING: "Performance:UI:StopRecording",
  50. // Emitted by the `PerformanceView` on import/export button click.
  51. UI_IMPORT_RECORDING: "Performance:UI:ImportRecording",
  52. UI_EXPORT_RECORDING: "Performance:UI:ExportRecording",
  53. // Emitted by the `PerformanceView` when the profiler's circular buffer
  54. // status has been rendered.
  55. UI_RECORDING_PROFILER_STATUS_RENDERED: "Performance:UI:RecordingProfilerStatusRendered",
  56. // When a recording is selected in the UI.
  57. UI_RECORDING_SELECTED: "Performance:UI:RecordingSelected",
  58. // Emitted by the `DetailsView` when a subview is selected
  59. UI_DETAILS_VIEW_SELECTED: "Performance:UI:DetailsViewSelected",
  60. // Emitted by the `OverviewView` after something has been rendered.
  61. UI_OVERVIEW_RENDERED: "Performance:UI:OverviewRendered",
  62. UI_MARKERS_GRAPH_RENDERED: "Performance:UI:OverviewMarkersRendered",
  63. UI_MEMORY_GRAPH_RENDERED: "Performance:UI:OverviewMemoryRendered",
  64. UI_FRAMERATE_GRAPH_RENDERED: "Performance:UI:OverviewFramerateRendered",
  65. // Emitted by the `OverviewView` when a range has been selected in the graphs.
  66. UI_OVERVIEW_RANGE_SELECTED: "Performance:UI:OverviewRangeSelected",
  67. // Emitted by the `WaterfallView` when it has been rendered.
  68. UI_WATERFALL_RENDERED: "Performance:UI:WaterfallRendered",
  69. // Emitted by the `JsCallTreeView` when it has been rendered.
  70. UI_JS_CALL_TREE_RENDERED: "Performance:UI:JsCallTreeRendered",
  71. // Emitted by the `JsFlameGraphView` when it has been rendered.
  72. UI_JS_FLAMEGRAPH_RENDERED: "Performance:UI:JsFlameGraphRendered",
  73. // Emitted by the `MemoryCallTreeView` when it has been rendered.
  74. UI_MEMORY_CALL_TREE_RENDERED: "Performance:UI:MemoryCallTreeRendered",
  75. // Emitted by the `MemoryFlameGraphView` when it has been rendered.
  76. UI_MEMORY_FLAMEGRAPH_RENDERED: "Performance:UI:MemoryFlameGraphRendered",
  77. };
  78. module.exports = Object.assign({}, ControllerEvents, ViewEvents);