Begin work on supporting reply blocks in _WKRemoteObjectRegistry
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Nov 2015 00:07:52 +0000 (00:07 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Nov 2015 00:07:52 +0000 (00:07 +0000)
commit2b6519cc6737b820995d8baac0c16e5cbe851871
tree998b1c7227875b7d494d151f8413da03cfd0cb07
parentb0898dac5739c31b859ff288bc0609f95ab51fdb
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@191919 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