File tree Expand file tree Collapse file tree
2021-05/crbug-nested-dedicated-workers-user-timing-issues Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html lang ="en ">
3+ < head >
4+ < meta charset ="UTF-8 " />
5+ < meta http-equiv ="X-UA-Compatible " content ="IE=edge " />
6+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
7+ < title > CRBug Nested Dedicated Workers</ title >
8+ < style >
9+ html {
10+ font-family : systemui;
11+ }
12+ </ style >
13+ </ head >
14+ < body >
15+ < h1 > CRBug Nested Dedicated Workers issue</ h1 >
16+ < a href ="./bug.png "> Screenshot of what I see in DevTools for this page.</ a >
17+ < pre >
18+ // this html file
19+ const worker = new Worker("worker.js", {
20+ type: "module"
21+ })
22+ </ pre >
23+ < pre >
24+ // < a href ="./worker.js "> worker.js</ a >
25+ const startMark = "w";
26+ performance.mark(startMark);
27+ console.info("worker.js executed");
28+ const w = new Worker("./subworker.js", { type: "module" });
29+ console.info("worker.js constructed subworker");
30+ performance.measure("worker.js", startMark);
31+ </ pre >
32+ < pre >
33+ // < a href ="./subworker.js "> subworker.js</ a >
34+ const startMark = "sw";
35+ performance.mark(startMark);
36+ console.info("subworker.js executed");
37+ performance.measure("subworker.js", startMark);
38+ </ pre >
39+ < p >
40+ Observe that we get a user timing for "worker.js", we do not get a user
41+ timing for "subworker.js". We get logs for both "worker.js executed" and
42+ "subworker.js executed".
43+ </ p >
44+ < script >
45+ const worker = new Worker ( "worker.js" , {
46+ type : "module" ,
47+ } ) ;
48+ </ script >
49+ </ body >
50+ </ html >
Original file line number Diff line number Diff line change 1+ // subworker.js
2+ const startMark = "sw" ;
3+ performance . mark ( startMark ) ;
4+ console . info ( "subworker.js executed" ) ;
5+ performance . measure ( "subworker.js" , startMark ) ;
Original file line number Diff line number Diff line change 1+ // worker.js
2+ const startMark = "w" ;
3+ performance . mark ( startMark ) ;
4+ console . info ( "worker.js executed" ) ;
5+ const w = new Worker ( "./subworker.js" , { type : "module" } ) ;
6+ console . info ( "worker.js constructed subworker" ) ;
7+ performance . measure ( "worker.js" , startMark ) ;
Original file line number Diff line number Diff line change 2424 < li >
2525 < a href ="./2021-04/svelte-minimal-demo/index.html "> Minimal Svelte demo</ a >
2626 </ li >
27+ < li >
28+ < a href ="./2021-05/crbug-nested-dedicated-workers-user-timing-issues/index.html "> Chromium bug with User Timings in nested workers</ a >
29+ </ li >
2730 </ ul >
2831 < br >
2932 < ul >
3336 </ ul >
3437</ body >
3538
36- </ html >
39+ </ html >
You can’t perform that action at this time.
0 commit comments