Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
RemoteObjectRegistry message receiver should be removed when WebPage:…
…:close is called instead of waiting until dealloc https://bugs.webkit.org/show_bug.cgi?id=196744 <rdar://49415309> Patch by Alex Christensen <achristensen@webkit.org> on 2019-04-10 Reviewed by Chris Dumez. Source/WebKit: This is a similar problem to the one I fixed in r241306 so I piggy-backed on the same test. When you do a cross site navigation but the previous page is in a suspended process then you navigate back, you can get two WebPage objects in the same process with the same IDs. WebPage::close has been called on the old one which is supposed to make it so all the message receivers associated with it have been removed so we don't have any loss of communication, but we missed the RemoteObjectRegistry messages, which are owned by the ObjC bundle object wrapping the WebPage (which can keep it alive if a strong reference to it is held). To fix the assertion that happens in this case and the resulting communication breakage, teach the WebPage about these messages so it can tear down the message receiver with the others it removes at close time. * Shared/API/Cocoa/RemoteObjectRegistry.h: * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (-[WKWebProcessPlugInBrowserContextController dealloc]): (-[WKWebProcessPlugInBrowserContextController _remoteObjectRegistry]): * WebProcess/WebPage/Cocoa/WebPageCocoa.mm: (WebKit::WebPage::addRemoteObjectRegistry): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::close): * WebProcess/WebPage/WebPage.h: Tools: * TestWebKitAPI/Tests/WebKitCocoa/BundleRetainPagePlugIn.mm: (-[BundleRetainPagePlugIn webProcessPlugIn:didCreateBrowserContextController:]): Canonical link: https://commits.webkit.org/211057@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244139 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
0e6d307
commit 32f88d3b49f75c2165743454bc9b02b202504f09
Showing
10 changed files
with
86 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -36,6 +36,7 @@ | ||
#import "WKRemoteObject.h" | ||
#import "WKRemoteObjectCoder.h" | ||
#import "WKSharedAPICast.h" | ||
#import "WebPage.h" | ||
#import "_WKRemoteObjectInterface.h" | ||
#import <objc/runtime.h> | ||
|
||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters