Web pages: browsers are made at once, so none outlives its view (M-12)

make_browsers creates each browser synchronously and adopts it in the
same call, so no view waits on a browser: it leaves before creation
(skipped) or has a browser to close. The late-close branch in
on_after_created is gone. webprobe drops 5 views before the pump and
10 within 27 ms; webview.sh wants all 35 freed before the hold.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-10-10 13:47:45 -04:00
1 parent c5cb153f72
commit 0d4dd64640
10 files changed
+50 -24

No files matched your search

+1 -1
View File
@@ -72,7 +72,7 @@
- [x] M-09 导出的保存面板出错被当作取消 — 面板出错走 panel_failed,取消只记日志(审查 1 轮)
- [x] M-10 关闭查找框只清当前标签的高亮 — 关闭查找框对每个标签的页面清除高亮(审查 1 轮)
- [x] M-11 页面把搜索词写进应用日志 — 控制台的文字与来源都可由文档伪造,只记行号;页面自己的诊断经 elyQuery;R1 前缀可伪造、R2 data 来源、R3 sourceURL、R4 编码路径与目录、R5 缺回归测试:已补并经变异核对(五轮上限,未再审)
- [ ] M-12 浏览器创建完成前 `WebView` 已释放,浏览器泄漏
- [x] M-12 浏览器创建完成前 `WebView` 已释放,浏览器泄漏 — 浏览器在泵里同步建好即登记,视图要么在建前已走、要么有浏览器可关;webprobe 加建前丢弃与 0–27 毫秒丢弃,35 页都在保持前释放(审查 4 轮)
- [ ] M-13 编辑器构建失败时页面空白且不上报
- [ ] M-14 `render_pdf` 在界面线程内嵌图片并写文件
- [ ] M-15 打印与导出 PDF 的暂存页执行文档里的脚本
+3
View File
@@ -0,0 +1,3 @@
FAIL
crates/ely-web-content/src/handlers.rs:347 — Missing regression coverage for M-12. No retained test closes a view after browser creation is submitted but before `on_after_created`; the existing `webprobe` churn closes only after `Event::Loaded`. Removing the entire `surface.closed` branch in a review copy leaves all nine WSL library tests passing, while real CEF probes on Windows and WSL reproduce the retained browser/surface on the first such close (the current implementation passes 20 cycles). The original PERF-08 leak can therefore return undetected. Add a regression exercising the production Drop, late creation callback and deferred close, asserting forced browser closure and release of the surface; verify it fails when this branch is removed. Evidence: `.work/m12-r1/linux-mutant-repository.log`, `.work/m12-r1/windows-native-mutant.log`, `.work/m12-r1/linux-native-mutant.log`.
+3
View File
@@ -0,0 +1,3 @@
FAIL
crates/ely-web-content/examples/webprobe.rs:193 — R1's regression-coverage defect remains: the 0–27 ms timers do not ensure a view is dropped after browser creation is submitted but before `on_after_created`. In review copies on both Windows and WSL, restoring asynchronous creation and unconditional callback adoption (the original M-12 bug) still satisfies the new release assertion: 30/30 surfaces freed before hold. When the actual `WebView::Drop` and deferred close run deterministically between submission and the creation callback, that same mutant frees only 20/30; the current synchronous implementation frees 30/30. Thus the original PERF-08 leak can return without this regression probe detecting it. Retain a deterministic lifecycle regression covering that ordering and verify that it rejects the original leaking implementation. Evidence: `.work/m12-r2/windows-async-result.log`, `.work/m12-r2/linux-async-result.log`, `.work/m12-r2/windows-async-forced-result.log`, `.work/m12-r2/linux-async-forced-result.log`; probe method and cleanup are recorded in `.work/m12-r2/evidence.log`.
+3
View File
@@ -0,0 +1,3 @@
FAIL
crates/ely-web-content/examples/webprobe.rs:193 — The early-close regression does not ensure a drop before `make_browsers`. On Windows and WSL, the retained churn frees 30/30 surfaces, but every drop already has a browser; no closed surface is skipped. Removing only the pre-creation `surface.closed` guard, while retaining synchronous creation and adoption, still passes this probe with 30/30 released. Yet opening and dropping ten views in one GPUI update before the pump runs frees only 20/30 with that mutant, versus 30/30 with current code: the deferred close runs before creation, and the ten subsequently created browsers leak. This is a reachable ordering in the current design, unlike R2's removed asynchronous ordering. Add a deterministic pre-pump open/drop case and verify its release assertion rejects removal of the closed guard. Evidence: `.work/m12-r3/{windows,linux}-no-skip-{retained,pre}-result.log`; method, current-code results and cleanup: `.work/m12-r3/evidence.log`.
+1
View File
@@ -0,0 +1 @@
PASS