commit | a6223083496b5fed8d8bb69c38b20d7819ca3be9 | [log] [tgz] |
---|---|---|
author | Scott Chen <scottchen@chromium.org> | Fri Dec 07 04:43:15 2018 |
committer | Commit Bot <commit-bot@chromium.org> | Fri Dec 07 04:43:15 2018 |
tree | 4aac8505996423e1f8408fdd3345f801bb4f7b8b | |
parent | 54c3aef61f7f6568ff4c4f1526107d9894003c94 [diff] |
Nux Onboarding: fix race-condition crashes There are a couple race-conditions happening in the code that in combination causes 'undefined' to be passed to the C++ handler, which crashes on a CHECK in BookmarkHandler: - in some places toggleBookmarkBar() depends on isBookmarkBarShown() result, without taking into account that isBookmarkBarShown is async. - multiple toggleBookmarkBar() async calls fire consecutively, overriding each other's effects. The above two issues are fixed together by locally cached bookmark visibility state that can be updated and retrieved synchronously (inside of the wrapper BookmarkBarManager). There doesn't seem to be a way for toggling bookmark visibility to fail in the backend. Even if that's possible, the best we can do is to keep using the local cache value until the visibility state becomes eventually consistent, so simply updating this local cache should suffice. After the above fix, another timing issue is exposed: - the navigation behavior's onRouteChange is always called in the order that elements are created. This is problematic since sometimes module's clean-up code run after another module's init code and causing conflicting effects. The above issue is fixed in this CL by adding additional enter and exit hooks to each route, and navigation behavior will trigger them in the expected order. Bug: 908544 Change-Id: If462d2ec955ece0d8b17fc342fc7d1ce0225e72c Reviewed-on: https://chromium-review.googlesource.com/c/1357523 Commit-Queue: Scott Chen <scottchen@chromium.org> Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org> Reviewed-by: Hector Carmona <hcarmona@chromium.org> Cr-Commit-Position: refs/heads/master@{#614604}
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.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .