Commit 29620c4
committed
src: use env->RequestInterrupt() for inspector MainThreadInterface
This simplifies the code significantly, and removes the dependency of
the inspector code on the availability of a `MultiIsolatePlatform`
(by removing the dependency on a platform altogether).
It also fixes a memory leak that occurs when `RequestInterrupt()`
is used, but the interrupt handler is never called before the Isolate
is destroyed.
One downside is that this leads to a slight change in timing, because
inspector messages are not dispatched in a re-entrant way. This means
having to harden one test to account for that possibility by making
sure that the stack is always clear through a `setImmediate()`.
This does not affect the assertion made by the test, which is that
messages will not be delivered synchronously while other code is
executing.
#32415
Backport-PR-URL: #35241
PR-URL: #32523
Reviewed-By: Matheus Marchini <mat@mmarchini.me>
Reviewed-By: James M Snell <jasnell@gmail.com>1 parent 2e4536e commit 29620c4Copy full SHA for 29620c4
File tree
Expand file treeCollapse file tree
7 files changed
+23
-44
lines changedOpen diff view settings
Filter options
- src
- inspector
- test/parallel
Expand file treeCollapse file tree
7 files changed
+23
-44
lines changedOpen diff view settings
Collapse file
+3-2Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1273 | 1273 | |
1274 | 1274 | |
1275 | 1275 | |
| 1276 | + |
| 1277 | + |
| 1278 | + |
1276 | 1279 | |
1277 | 1280 | |
1278 | 1281 | |
| ||
1410 | 1413 | |
1411 | 1414 | |
1412 | 1415 | |
1413 | | - |
1414 | | - |
1415 | 1416 | |
1416 | 1417 | |
1417 | 1418 | |
|
Collapse file
src/inspector/main_thread_interface.cc
Copy file name to clipboardExpand all lines: src/inspector/main_thread_interface.cc+8-33Lines changed: 8 additions & 33 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1 | 1 | |
2 | 2 | |
| 3 | + |
3 | 4 | |
4 | 5 | |
5 | 6 | |
| ||
85 | 86 | |
86 | 87 | |
87 | 88 | |
88 | | - |
89 | | - |
90 | | - |
91 | | - |
92 | | - |
93 | | - |
94 | | - |
95 | | - |
96 | | - |
97 | | - |
98 | | - |
99 | | - |
100 | | - |
101 | 89 | |
102 | 90 | |
103 | 91 | |
| ||
212 | 200 | |
213 | 201 | |
214 | 202 | |
215 | | - |
216 | | - |
217 | | - |
218 | | - |
219 | | - |
220 | | - |
| 203 | + |
221 | 204 | |
222 | 205 | |
223 | 206 | |
224 | 207 | |
225 | 208 | |
226 | 209 | |
227 | 210 | |
| 211 | + |
228 | 212 | |
229 | 213 | |
230 | 214 | |
231 | 215 | |
232 | | - |
233 | | - |
234 | | - |
235 | | - |
236 | | - |
237 | | - |
238 | | - |
239 | | - |
240 | | - |
241 | | - |
242 | | - |
243 | | - |
244 | | - |
| 216 | + |
| 217 | + |
| 218 | + |
| 219 | + |
245 | 220 | |
246 | 221 | |
247 | 222 | |
| ||
274 | 249 | |
275 | 250 | |
276 | 251 | |
277 | | - |
| 252 | + |
278 | 253 | |
279 | 254 | |
280 | 255 | |
|
Collapse file
src/inspector/main_thread_interface.h
Copy file name to clipboardExpand all lines: src/inspector/main_thread_interface.h+1-4Lines changed: 1 addition & 4 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
72 | 72 | |
73 | 73 | |
74 | 74 | |
75 | | - |
76 | | - |
| 75 | + |
77 | 76 | |
78 | 77 | |
79 | 78 | |
| ||
98 | 97 | |
99 | 98 | |
100 | 99 | |
101 | | - |
102 | | - |
103 | 100 | |
104 | 101 | |
105 | 102 | |
|
Collapse file
+2-4Lines changed: 2 additions & 4 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
660 | 660 | |
661 | 661 | |
662 | 662 | |
663 | | - |
664 | | - |
| 663 | + |
665 | 664 | |
666 | 665 | |
667 | 666 | |
| ||
697 | 696 | |
698 | 697 | |
699 | 698 | |
700 | | - |
701 | 699 | |
702 | 700 | |
703 | | - |
| 701 | + |
704 | 702 | |
705 | 703 | |
706 | 704 | |
|
Collapse file
+2Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
116 | 116 | |
117 | 117 | |
118 | 118 | |
| 119 | + |
| 120 | + |
119 | 121 | |
120 | 122 | |
121 | 123 | |
|
Collapse file
+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
83 | 83 | |
84 | 84 | |
85 | 85 | |
86 | | - |
| 86 | + |
87 | 87 | |
88 | 88 | |
89 | 89 | |
|
Collapse file
test/parallel/test-inspector-connect-main-thread.js
Copy file name to clipboardExpand all lines: test/parallel/test-inspector-connect-main-thread.js+6Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
76 | 76 | |
77 | 77 | |
78 | 78 | |
| 79 | + |
| 80 | + |
| 81 | + |
| 82 | + |
| 83 | + |
| 84 | + |
79 | 85 | |
80 | 86 | |
81 | 87 | |
|
0 commit comments