Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r184846 - Crash when using a removed ScriptMessageHandler
<rdar://problem/20888499> https://bugs.webkit.org/show_bug.cgi?id=145359 Reviewed by Dan Bernstein. Source/WebCore: Added tests: WKUserContentController.ScriptMessageHandlerBasicRemove WKUserContentController.ScriptMessageHandlerCallRemovedHandler * page/UserMessageHandler.cpp: (WebCore::UserMessageHandler::~UserMessageHandler): (WebCore::UserMessageHandler::postMessage): (WebCore::UserMessageHandler::name): * page/UserMessageHandler.h: (WebCore::UserMessageHandler::create): * page/UserMessageHandler.idl: * page/UserMessageHandlerDescriptor.cpp: (WebCore::UserMessageHandlerDescriptor::UserMessageHandlerDescriptor): * page/UserMessageHandlerDescriptor.h: (WebCore::UserMessageHandlerDescriptor::client): (WebCore::UserMessageHandlerDescriptor::invalidateClient): Add support for invalidating the descriptor and throw an exception if someone tries to post a message using an invalidated descriptor. * page/UserMessageHandlersNamespace.cpp: (WebCore::UserMessageHandlersNamespace::handler): Add logic to remove message handlers if their descriptor has been invalidated. Source/WebKit2: * WebProcess/UserContent/WebUserContentController.cpp: (WebKit::WebUserMessageHandlerDescriptorProxy::~WebUserMessageHandlerDescriptorProxy): Invalidate the descriptor when the message handler client (as implemented by WebUserMessageHandlerDescriptorProxy) goes away. This will happen if a script message handler is removed at the API level or the WebUserContentController is destroyed (which will happen if all the pages get destroyed). Tools: * TestWebKitAPI/Tests/WebKit2Cocoa/UserContentController.mm: Add tests for removing script message handlers.
- Loading branch information
1 parent
f87412b
commit 6339dc7
Showing
13 changed files
with
179 additions
and
20 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
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
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