commit | 36eecdae0d6f1449a48ded12e6c3ed2530b50d14 | [log] [tgz] |
---|---|---|
author | Devlin Cronin <rdevlin.cronin@chromium.org> | Thu Jul 07 18:15:08 2022 |
committer | Chromium LUCI CQ <chromium-scoped@luci-project-accounts.iam.gserviceaccount.com> | Thu Jul 07 18:15:08 2022 |
tree | 54a66f5ad536ed703b181beedc3cbf1e52ef92c6 | |
parent | 5b526c551d3666bb833d93373a426e40ce5de876 [diff] |
[Extensions] Change how ExtensionHosts handle delegate calls to close WebContentsDelegate::CloseContents() is called when the WebContents indicates it should close (such as when `window.close()` is called in Javascript). Currently, ExtensionHost handles this by notifying its registered observers with the OnShouldCloseExtensionHost() method. A single observer is then expected to handle closing the ExtensionHost. This is bad. It's a misuse of the Observer pattern, and could potentially cause many issues if multiple observers tried to handle the same close event. Instead of this, register a close handler callback on the ExtensionHost. This allows the single object responsible for closing the ExtensionHost to register itself. As a byproduct, remove ExtensionHost::OnShouldCloseExtensionHost(). Bug: None Change-Id: I293b903674cdce956842d2572e5171e695b8be52 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3735816 Commit-Queue: Devlin Cronin <rdevlin.cronin@chromium.org> Reviewed-by: Tim <tjudkins@chromium.org> Cr-Commit-Position: refs/heads/main@{#1021769}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
To check out the source code locally, don't use git clone
! Instead, follow the instructions on how to get the code.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .
For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.
If you found a bug, please file it at https://crbug.com/new.