Skip to content

Commit 1c476f9

Browse files
committed
Add crbug for nested web workers
1 parent 1e765db commit 1c476f9

5 files changed

Lines changed: 66 additions & 1 deletion

File tree

250 KB
Loading
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// subworker.js
2+
const startMark = "sw";
3+
performance.mark(startMark);
4+
console.info("subworker.js executed");
5+
performance.measure("subworker.js", startMark);
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
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);

static/random/index.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
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>
@@ -33,4 +36,4 @@
3336
</ul>
3437
</body>
3538

36-
</html>
39+
</html>

0 commit comments

Comments
 (0)