Repository navigation
Revert "Keep actively-playing media browser panes alive in the background (issue 5409)" - #5436
Conversation
…ound (issue 5409)"
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughMedia-playback-based discard blocking is removed entirely. BrowserHiddenWebViewDiscardManager switches from tracking active media playback ( ChangesMedia Playback Discard Blocking Removal
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR reverts #5412, which had introduced a mechanism to keep browser panes with actively-playing
Confidence Score: 5/5Clean mechanical revert with no dangling symbols, orphaned build references, or test inconsistencies. All three deleted Swift files have zero remaining references in the source tree or test target. The BlockerSnapshot struct, its callers in BrowserPanel.swift, the bindWebView setup, the navigation-commit reset, and both regression tests were removed in lockstep. The Xcode project file is consistent. The only consequence of this change is intentional: panes playing background media are once again eligible for hidden-webview discard, re-opening issue #5409 until a replacement fix lands. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant Page as WebPage (JS)
participant Handler as BrowserMediaPlaybackMessageHandler
participant Panel as BrowserPanel
participant Discard as BrowserHiddenWebViewDiscardManager
Note over Page,Discard: BEFORE revert (PR #5412 — now removed)
Page->>Handler: "postMessage({frameID, playing})"
Handler->>Panel: handleMediaPlaybackReport(_:fromWebViewInstanceID:)
Panel->>Panel: "applyMediaPlaybackReport → isPlayingMedia=true"
Panel->>Discard: reevaluateHiddenWebViewDiscardScheduling
Discard-->>Discard: blockers → [media_playback] → no discard scheduled
Note over Page,Discard: AFTER revert (this PR — current state)
Page--xHandler: (handler removed, no message received)
Discard-->>Discard: blockers → [] → discard scheduled after hidden delay
Reviews (1): Last reviewed commit: "Revert "Keep actively-playing media brow..." | Re-trigger Greptile |
Reverts #5412
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Note
Medium Risk
Restores prior memory-discard behavior for background tabs; users may see interrupted media or reloads, but no new security or data paths are introduced.
Overview
This reverts the feature that kept hidden browser panes alive while
<video>/<audio>was playing (issue 5409).It removes the injected document-start script, isolated
WKContentWorld, andcmuxMediaPlaybackmessage handler, plus per-frame playback tracking onBrowserPanel. Hidden-webview discard no longer treats media playback as a blocker—only camera/mic capture (isCapturingMedia) still blocks discard. Related tests and Xcode project entries for the deleted files are removed.Behavior change: background tabs with playing media can again be memory-discarded after the hidden delay, which may interrupt playback or force a reload when the pane is restored.
Reviewed by Cursor Bugbot for commit c0f349c. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by cubic
Reverts the hidden-pane media keep-alive behavior. Hidden browser panes can be discarded again even if they are playing media, restoring prior memory management.
BrowserPanel+MediaPlayback.swift,BrowserMediaPlaybackMessageHandler.swift, andBrowserMediaPlaybackReport.swift.BrowserPaneland themedia_playbackblocker fromBrowserHiddenWebViewDiscardManager.Written for commit c0f349c. Summary will update on new commits.
Summary by CodeRabbit