commit | 247bafd09cd08fbd53f9e678a23c829cd5b7e2df | [log] [tgz] |
---|---|---|
author | Ming-Ying Chung <mych@chromium.org> | Tue Sep 20 05:07:29 2022 |
committer | Chromium LUCI CQ <chromium-scoped@luci-project-accounts.iam.gserviceaccount.com> | Tue Sep 20 05:07:29 2022 |
tree | 12dc90b65882a32b5825d6beb089529abed0e231 | |
parent | 2d0eced06255127e471d100b4bc34f5242d2524b [diff] |
[beacon-api] Fix renderer crashes caused by accessing unbound remote - Stacktrace: https://crbug.com/1364348#c5 - Details Explained: https://crbug.com/1364348#c7 When a document is unloaded, it's possible that a `PendingBeacon`'s `timeout_timer_` stays alive even after the ExecutionContext is gone (detached). In such case, `PendingBeacon::TimeoutTimerFired()` will lead to a crash due to accessing `remote_` which is unbound. The crash can be reliably reproduced by setting a short timeout in PendingGetBeacon ctor and unloads the document quickly. (But still not sure why a PendingGetBeacon() with default (negative) timeout can trigger `TimeoutTimerFired()`.) This CL makes `PendingBeacon` implements `ExecutionContextLifecycleObserver` and handles such case in `ContextDestroyed()` method. Also updates the sendondiscard web tests: - Before: PendingPostBeacon was not covered. Beacons with different timeout/backgroundTimeout were not covered. - After: better cover the behaviors of sending beacons on page discard with different timeout/backgroundTimeout values (which should not be used at all though) Bug: 1364348,1293679 Change-Id: I44edc6ddde20c75f8bbcca0d2b452504517530b1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3901567 Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org> Commit-Queue: Ming-Ying Chung <mych@chromium.org> Cr-Commit-Position: refs/heads/main@{#1048952}
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.