fix: crash when navigating from a page with webview that has inherited zoom level (#24757)

* fix: cleanup webview zoom level observers on navigation

* add spec

* webview should be on same partition

* wait for webview to finish loading
This commit is contained in:
Robo 2020-07-28 13:00:44 -07:00 committed by GitHub
parent 38fafe4986
commit b6321cc22d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 41 additions and 0 deletions

View file

@ -1413,6 +1413,11 @@ bool WebContents::OnMessageReceived(const IPC::Message& message) {
// we need to make sure the api::WebContents is also deleted.
// For #4, the WebContents will be destroyed by embedder.
void WebContents::WebContentsDestroyed() {
// Give chance for guest delegate to cleanup its observers
// since the native class is only destroyed in the next tick.
if (guest_delegate_)
guest_delegate_->WillDestroy();
// Cleanup relationships with other parts.
RemoveFromWeakMap();