Skip to content

Commit a5264bd

Browse files
committed
Add an icon for capturing a trace for early feedback
1 parent 3125b39 commit a5264bd

File tree

7 files changed

+53
-3
lines changed

7 files changed

+53
-3
lines changed

icons/stopping/icon128.png

4.47 KB
Loading

icons/stopping/icon16.png

579 Bytes
Loading

icons/stopping/icon32.png

1.11 KB
Loading

icons/stopping/icon48.png

1.67 KB
Loading

res/icons/profiler-stopping.svg

Lines changed: 44 additions & 0 deletions
Loading

src/state.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ export const state = {
3131
chrome.action.setTitle({ title: "Click to capture the trace" });
3232
},
3333

34+
stopping() {
35+
this.recordingState = "stopping";
36+
setIcons("stopping");
37+
chrome.action.setTitle({ title: "Capturing a trace" });
38+
},
39+
3440
reset() {
3541
// Reset the state
3642
this.recordingState = "idle";
@@ -79,7 +85,7 @@ export const state = {
7985

8086
/**
8187
* Sets the icon of the extension
82-
* @param {"on" | "off"} variant
88+
* @param {"on" | "off" | "stopping"} variant
8389
*/
8490
function setIcons(variant) {
8591
chrome.action.setIcon({

src/tracing.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export async function stopTracingAndCollect() {
101101
console.warn("Failed to get the Tab ID");
102102
return;
103103
}
104-
state.recordingState = "stopping";
104+
state.stopping();
105105

106106
// Add the event listener first and then stop the tracing.
107107
chrome.debugger.onEvent.addListener(
@@ -153,7 +153,7 @@ export async function stopTracing() {
153153
console.warn("Failed to get the Tab ID");
154154
return;
155155
}
156-
state.recordingState = "stopping";
156+
state.stopping();
157157

158158
// Stop tracing without collecting the trace.
159159
await chrome.debugger.sendCommand({ tabId }, "Tracing.end");

0 commit comments

Comments
 (0)