Skip to content

Commit

Permalink
Close extension message channel if the frame with ports enters BFCache
Browse files Browse the repository at this point in the history
When a page enters BFCache, the extension message channel with ports
registered on the cached frames should be closed. No message will be
delivered to the frame in BFCache. It will fire a `onDisconnect`
event on the other end (extension background). Because of this, we won't
evict BFCache entry if a message is unexpectedly delivered to the
BFCached frame.

The logic is behind a feature flag
`kDisconnectExtensionMessagePortWhenPageEntersBFCache`. The browser
test is updated accordingly.

Please refer to this doc for more information: https://docs.google.com/document/d/1aWokmpgY6HVNhKdh4Q3DOn4c5dUdi5gBXBUpcpZEHNw/edit?usp=sharing

Bug: 1488379
Change-Id: Ibb2a272bb940b0d11a039a778fb0dc3d3d503829
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4914116
Reviewed-by: Fergal Daly <fergal@chromium.org>
Reviewed-by: David Bertoni <dbertoni@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Mingyu Lei <leimy@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1210605}
  • Loading branch information
lozy219 authored and Chromium LUCI CQ committed Oct 17, 2023
1 parent 63261be commit 74ad600
Show file tree
Hide file tree
Showing 4 changed files with 284 additions and 146 deletions.

0 comments on commit 74ad600

Please sign in to comment.