Begin work on supporting reply blocks in _WKRemoteObjectRegistry
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 31 Oct 2015 00:12:28 +0000 (00:12 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 31 Oct 2015 00:12:28 +0000 (00:12 +0000)
commitdc5e976f6f4929bc1c859488402805dc41d20bae
tree01040653701c53918d865b32201b454e2b60e245
parentb068edd15a12fa34823daceaad55510906308755
Begin work on supporting reply blocks in _WKRemoteObjectRegistry
https://bugs.webkit.org/show_bug.cgi?id=150739

Reviewed by Tim Horton.

Source/WebKit2:

* Platform/spi/Cocoa/BlockSPI.h:
Add SPI header.

* Shared/API/Cocoa/RemoteObjectInvocation.h:
(WebKit::RemoteObjectInvocation::ReplyInfo::ReplyInfo):
(WebKit::RemoteObjectInvocation::replyInfo):
* Shared/API/Cocoa/RemoteObjectInvocation.mm:
(WebKit::RemoteObjectInvocation::RemoteObjectInvocation):
(WebKit::RemoteObjectInvocation::encode):
(WebKit::RemoteObjectInvocation::decode):
Add an optional ReplyInfo struct to RemoteObjectInvocation.

* Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
(generateReplyIdentifier):
Helper function to generate a reply identifier.

(-[_WKRemoteObjectRegistry _sendInvocation:interface:]):
Do some block parameter validation.

* WebKit2.xcodeproj/project.pbxproj:

Tools:

Add a test. We only test the encoding right now.

* TestWebKitAPI/Tests/WebKit2Cocoa/RemoteObjectRegistry.h:
* TestWebKitAPI/Tests/WebKit2Cocoa/RemoteObjectRegistry.mm:
(TEST):
* TestWebKitAPI/Tests/WebKit2Cocoa/RemoteObjectRegistryPlugIn.mm:
(-[RemoteObjectRegistryPlugIn sayHello:completionHandler:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191831 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/Platform/spi/Cocoa/BlockSPI.h [new file with mode: 0644]
Source/WebKit2/Shared/API/Cocoa/RemoteObjectInvocation.h
Source/WebKit2/Shared/API/Cocoa/RemoteObjectInvocation.mm
Source/WebKit2/Shared/API/Cocoa/_WKRemoteObjectRegistry.mm
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKit2Cocoa/RemoteObjectRegistry.h
Tools/TestWebKitAPI/Tests/WebKit2Cocoa/RemoteObjectRegistry.mm
Tools/TestWebKitAPI/Tests/WebKit2Cocoa/RemoteObjectRegistryPlugIn.mm