<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[191919] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/191919">191919</a></dd>
<dt>Author</dt> <dd>andersca@apple.com</dd>
<dt>Date</dt> <dd>2015-11-02 16:07:52 -0800 (Mon, 02 Nov 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>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:]):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedAPICocoaRemoteObjectInvocationh">trunk/Source/WebKit2/Shared/API/Cocoa/RemoteObjectInvocation.h</a></li>
<li><a href="#trunkSourceWebKit2SharedAPICocoaRemoteObjectInvocationmm">trunk/Source/WebKit2/Shared/API/Cocoa/RemoteObjectInvocation.mm</a></li>
<li><a href="#trunkSourceWebKit2SharedAPICocoa_WKRemoteObjectRegistrymm">trunk/Source/WebKit2/Shared/API/Cocoa/_WKRemoteObjectRegistry.mm</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2CocoaRemoteObjectRegistryh">trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/RemoteObjectRegistry.h</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2CocoaRemoteObjectRegistrymm">trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/RemoteObjectRegistry.mm</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2CocoaRemoteObjectRegistryPlugInmm">trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/RemoteObjectRegistryPlugIn.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2PlatformspiCocoaBlockSPIh">trunk/Source/WebKit2/Platform/spi/Cocoa/BlockSPI.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (191918 => 191919)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-11-02 23:53:31 UTC (rev 191918)
+++ trunk/Source/WebKit2/ChangeLog        2015-11-03 00:07:52 UTC (rev 191919)
</span><span class="lines">@@ -1,3 +1,31 @@
</span><ins>+2015-11-02  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+        Begin work on supporting reply blocks in _WKRemoteObjectRegistry
+        https://bugs.webkit.org/show_bug.cgi?id=150739
+
+        Reviewed by Tim Horton.
+
+        * 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:
+
</ins><span class="cx"> 2015-11-02  Brent Fulgham  &lt;bfulgham@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [iOS] Another unreviewed sandbox update.
</span></span></pre></div>
<a id="trunkSourceWebKit2PlatformspiCocoaBlockSPIhfromrev191918trunkToolsTestWebKitAPITestsWebKit2CocoaRemoteObjectRegistryh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/Platform/spi/Cocoa/BlockSPI.h (from rev 191918, trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/RemoteObjectRegistry.h) (0 => 191919)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Platform/spi/Cocoa/BlockSPI.h                                (rev 0)
+++ trunk/Source/WebKit2/Platform/spi/Cocoa/BlockSPI.h        2015-11-03 00:07:52 UTC (rev 191919)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#if USE(APPLE_INTERNAL_SDK)
+
+#import &lt;Block_private.h&gt;
+
+#else
+
+#import &lt;Block.h&gt;
+
+BLOCK_EXPORT const char* _Block_signature(void*);
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKit2SharedAPICocoaRemoteObjectInvocationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/API/Cocoa/RemoteObjectInvocation.h (191918 => 191919)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/API/Cocoa/RemoteObjectInvocation.h        2015-11-02 23:53:31 UTC (rev 191918)
+++ trunk/Source/WebKit2/Shared/API/Cocoa/RemoteObjectInvocation.h        2015-11-03 00:07:52 UTC (rev 191919)
</span><span class="lines">@@ -38,11 +38,22 @@
</span><span class="cx"> 
</span><span class="cx"> class RemoteObjectInvocation {
</span><span class="cx"> public:
</span><ins>+    struct ReplyInfo {
+        ReplyInfo(uint64_t replyID, String&amp;&amp; blockSignature)
+            : replyID(replyID)
+            , blockSignature(WTF::move(blockSignature))
+        {
+        }
+
+        const uint64_t replyID;
+        const String blockSignature;
+    };
</ins><span class="cx">     RemoteObjectInvocation();
</span><del>-    RemoteObjectInvocation(const String&amp; interfaceIdentifier, RefPtr&lt;API::Dictionary&gt;&amp;&amp; encodedInvocation);
</del><ins>+    RemoteObjectInvocation(const String&amp; interfaceIdentifier, RefPtr&lt;API::Dictionary&gt;&amp;&amp; encodedInvocation, std::unique_ptr&lt;ReplyInfo&gt;&amp;&amp;);
</ins><span class="cx"> 
</span><span class="cx">     const String&amp; interfaceIdentifier() const { return m_interfaceIdentifier; }
</span><span class="cx">     const API::Dictionary* encodedInvocation() const { return m_encodedInvocation.get(); }
</span><ins>+    const ReplyInfo* replyInfo() const { return m_replyInfo.get(); }
</ins><span class="cx"> 
</span><span class="cx">     void encode(IPC::ArgumentEncoder&amp;) const;
</span><span class="cx">     static bool decode(IPC::ArgumentDecoder&amp;, RemoteObjectInvocation&amp;);
</span><span class="lines">@@ -50,6 +61,7 @@
</span><span class="cx"> private:
</span><span class="cx">     String m_interfaceIdentifier;
</span><span class="cx">     RefPtr&lt;API::Dictionary&gt; m_encodedInvocation;
</span><ins>+    std::unique_ptr&lt;ReplyInfo&gt; m_replyInfo;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedAPICocoaRemoteObjectInvocationmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/API/Cocoa/RemoteObjectInvocation.mm (191918 => 191919)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/API/Cocoa/RemoteObjectInvocation.mm        2015-11-02 23:53:31 UTC (rev 191918)
+++ trunk/Source/WebKit2/Shared/API/Cocoa/RemoteObjectInvocation.mm        2015-11-03 00:07:52 UTC (rev 191919)
</span><span class="lines">@@ -35,9 +35,10 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RemoteObjectInvocation::RemoteObjectInvocation(const String&amp; interfaceIdentifier, RefPtr&lt;API::Dictionary&gt;&amp;&amp; encodedInvocation)
</del><ins>+RemoteObjectInvocation::RemoteObjectInvocation(const String&amp; interfaceIdentifier, RefPtr&lt;API::Dictionary&gt;&amp;&amp; encodedInvocation, std::unique_ptr&lt;ReplyInfo&gt;&amp;&amp; replyInfo)
</ins><span class="cx">     : m_interfaceIdentifier(interfaceIdentifier)
</span><span class="cx">     , m_encodedInvocation(WTF::move(encodedInvocation))
</span><ins>+    , m_replyInfo(WTF::move(replyInfo))
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -45,6 +46,13 @@
</span><span class="cx"> {
</span><span class="cx">     encoder &lt;&lt; m_interfaceIdentifier;
</span><span class="cx">     UserData::encode(encoder, m_encodedInvocation.get());
</span><ins>+    if (!m_replyInfo) {
+        encoder &lt;&lt; false;
+        return;
+    }
+
+    encoder &lt;&lt; m_replyInfo-&gt;replyID;
+    encoder &lt;&lt; m_replyInfo-&gt;blockSignature;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool RemoteObjectInvocation::decode(IPC::ArgumentDecoder&amp; decoder, RemoteObjectInvocation&amp; result)
</span><span class="lines">@@ -61,6 +69,22 @@
</span><span class="cx"> 
</span><span class="cx">     result.m_encodedInvocation = static_cast&lt;API::Dictionary*&gt;(encodedInvocation.get());
</span><span class="cx"> 
</span><ins>+    bool hasReplyInfo;
+    if (!decoder.decode(hasReplyInfo))
+        return false;
+
+    if (hasReplyInfo) {
+        uint64_t replyID;
+        if (!decoder.decode(replyID))
+            return false;
+
+        String blockSignature;
+        if (!decoder.decode(blockSignature))
+            return false;
+
+        result.m_replyInfo = std::make_unique&lt;ReplyInfo&gt;(replyID, WTF::move(blockSignature));
+    }
+
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedAPICocoa_WKRemoteObjectRegistrymm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/API/Cocoa/_WKRemoteObjectRegistry.mm (191918 => 191919)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/API/Cocoa/_WKRemoteObjectRegistry.mm        2015-11-02 23:53:31 UTC (rev 191918)
+++ trunk/Source/WebKit2/Shared/API/Cocoa/_WKRemoteObjectRegistry.mm        2015-11-03 00:07:52 UTC (rev 191919)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #if WK_API_ENABLED
</span><span class="cx"> 
</span><span class="cx"> #import &quot;APIDictionary.h&quot;
</span><ins>+#import &quot;BlockSPI.h&quot;
</ins><span class="cx"> #import &quot;Connection.h&quot;
</span><span class="cx"> #import &quot;RemoteObjectInvocation.h&quot;
</span><span class="cx"> #import &quot;RemoteObjectRegistry.h&quot;
</span><span class="lines">@@ -94,15 +95,52 @@
</span><span class="cx">     _remoteObjectRegistry = nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static uint64_t generateReplyIdentifier()
+{
+    static uint64_t identifier;
+
+    return ++identifier;
+}
+
</ins><span class="cx"> - (void)_sendInvocation:(NSInvocation *)invocation interface:(_WKRemoteObjectInterface *)interface
</span><span class="cx"> {
</span><del>-    auto encoder = adoptNS([[WKRemoteObjectEncoder alloc] init]);
</del><ins>+    std::unique_ptr&lt;RemoteObjectInvocation::ReplyInfo&gt; replyInfo;
+
+    NSMethodSignature *methodSignature = invocation.methodSignature;
+    for (NSUInteger i = 0, count = methodSignature.numberOfArguments; i &lt; count; ++i) {
+        const char *type = [methodSignature getArgumentTypeAtIndex:i];
+
+        if (strcmp(type, &quot;@?&quot;))
+            continue;
+
+        if (replyInfo)
+            [NSException raise:NSInvalidArgumentException format:@&quot;Only one reply block is allowed per message send. (%s)&quot;, sel_getName(invocation.selector)];
+
+        id block = nullptr;
+        [invocation getArgument:&amp;block atIndex:i];
+        if (!block)
+            [NSException raise:NSInvalidArgumentException format:@&quot;A NULL reply block was passed into a message. (%s)&quot;, sel_getName(invocation.selector)];
+
+        const char* replyBlockSignature = _Block_signature(block);
+
+        if (strcmp([NSMethodSignature signatureWithObjCTypes:replyBlockSignature].methodReturnType, &quot;v&quot;))
+            [NSException raise:NSInvalidArgumentException format:@&quot;Return value of block argument must be 'void'. (%s)&quot;, sel_getName(invocation.selector)];
+
+        replyInfo = std::make_unique&lt;RemoteObjectInvocation::ReplyInfo&gt;(generateReplyIdentifier(), replyBlockSignature);
+
+        // Replace the block object so we won't try to encode it.
+        id null = nullptr;
+        [invocation setArgument:&amp;null atIndex:i];
+    }
+
+    RetainPtr&lt;WKRemoteObjectEncoder&gt; encoder = adoptNS([[WKRemoteObjectEncoder alloc] init]);
+
</ins><span class="cx">     [encoder encodeObject:invocation forKey:invocationKey];
</span><span class="cx"> 
</span><span class="cx">     if (!_remoteObjectRegistry)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    _remoteObjectRegistry-&gt;sendInvocation(RemoteObjectInvocation(interface.identifier, [encoder rootObjectDictionary]));
</del><ins>+    _remoteObjectRegistry-&gt;sendInvocation(RemoteObjectInvocation(interface.identifier, [encoder rootObjectDictionary], WTF::move(replyInfo)));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (WebKit::RemoteObjectRegistry&amp;)remoteObjectRegistry
</span></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (191918 => 191919)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2015-11-02 23:53:31 UTC (rev 191918)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2015-11-03 00:07:52 UTC (rev 191919)
</span><span class="lines">@@ -269,6 +269,7 @@
</span><span class="cx">                 1A5704F81BE01FF400874AF1 /* _WKContextMenuElementInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5704F61BE01FF400874AF1 /* _WKContextMenuElementInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 1A5704FB1BE1751100874AF1 /* RemoteObjectInvocation.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A5704F91BE1751100874AF1 /* RemoteObjectInvocation.mm */; };
</span><span class="cx">                 1A5704FC1BE1751100874AF1 /* RemoteObjectInvocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5704FA1BE1751100874AF1 /* RemoteObjectInvocation.h */; };
</span><ins>+                1A5705111BE410E600874AF1 /* BlockSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5705101BE410E500874AF1 /* BlockSPI.h */; };
</ins><span class="cx">                 1A57109E1ABA0027002FABBE /* WKWebsiteDataStoreRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57109C1ABA0027002FABBE /* WKWebsiteDataStoreRef.cpp */; };
</span><span class="cx">                 1A57109F1ABA0027002FABBE /* WKWebsiteDataStoreRef.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57109D1ABA0027002FABBE /* WKWebsiteDataStoreRef.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 1A5B1C501898606F004FCF9B /* WKNavigation.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A5B1C4E1898606F004FCF9B /* WKNavigation.mm */; };
</span><span class="lines">@@ -2396,6 +2397,7 @@
</span><span class="cx">                 1A5704F61BE01FF400874AF1 /* _WKContextMenuElementInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKContextMenuElementInfo.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1A5704F91BE1751100874AF1 /* RemoteObjectInvocation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RemoteObjectInvocation.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1A5704FA1BE1751100874AF1 /* RemoteObjectInvocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteObjectInvocation.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                1A5705101BE410E500874AF1 /* BlockSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlockSPI.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 1A57109C1ABA0027002FABBE /* WKWebsiteDataStoreRef.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKWebsiteDataStoreRef.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1A57109D1ABA0027002FABBE /* WKWebsiteDataStoreRef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebsiteDataStoreRef.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1A5B1C4E1898606F004FCF9B /* WKNavigation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKNavigation.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -5333,6 +5335,7 @@
</span><span class="cx">                 3754D5411B3A2998003A4C7F /* Cocoa */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                1A5705101BE410E500874AF1 /* BlockSPI.h */,
</ins><span class="cx">                                 3754D5441B3A29FD003A4C7F /* NSInvocationSPI.h */,
</span><span class="cx">                         );
</span><span class="cx">                         path = Cocoa;
</span><span class="lines">@@ -7788,6 +7791,7 @@
</span><span class="cx">                                 BC204EE311C83E98008F3375 /* InjectedBundle.h in Headers */,
</span><span class="cx">                                 935EEBA2127761D0003322B8 /* InjectedBundleBackForwardList.h in Headers */,
</span><span class="cx">                                 935EEBA4127761D6003322B8 /* InjectedBundleBackForwardListItem.h in Headers */,
</span><ins>+                                1A5705111BE410E600874AF1 /* BlockSPI.h in Headers */,
</ins><span class="cx">                                 BCEE7DC5128B645D009827DA /* InjectedBundleClient.h in Headers */,
</span><span class="cx">                                 7CBB811D1AA0F8B1006B1942 /* InjectedBundleFileHandle.h in Headers */,
</span><span class="cx">                                 BC498618124D10E200D834E1 /* InjectedBundleHitTestResult.h in Headers */,
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (191918 => 191919)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2015-11-02 23:53:31 UTC (rev 191918)
+++ trunk/Tools/ChangeLog        2015-11-03 00:07:52 UTC (rev 191919)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2015-11-02  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+        Begin work on supporting reply blocks in _WKRemoteObjectRegistry
+        https://bugs.webkit.org/show_bug.cgi?id=150739
+
+        Reviewed by Tim Horton.
+
+        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:]):
+
</ins><span class="cx"> 2015-11-02  Tim Horton  &lt;timothy_horton@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Get rid of WKWebView's inner WKView (WKView being inside WKWebView leads to weird API issues)
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2CocoaRemoteObjectRegistryh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/RemoteObjectRegistry.h (191918 => 191919)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/RemoteObjectRegistry.h        2015-11-02 23:53:31 UTC (rev 191918)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/RemoteObjectRegistry.h        2015-11-03 00:07:52 UTC (rev 191919)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> @protocol RemoteObjectProtocol &lt;NSObject&gt;
</span><span class="cx"> 
</span><span class="cx"> - (void)sayHello:(NSString *)hello;
</span><ins>+- (void)sayHello:(NSString *)hello completionHandler:(void (^)(NSString *))completionHandler;
</ins><span class="cx"> 
</span><span class="cx"> @end
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2CocoaRemoteObjectRegistrymm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/RemoteObjectRegistry.mm (191918 => 191919)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/RemoteObjectRegistry.mm        2015-11-02 23:53:31 UTC (rev 191918)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/RemoteObjectRegistry.mm        2015-11-03 00:07:52 UTC (rev 191919)
</span><span class="lines">@@ -58,8 +58,11 @@
</span><span class="cx">             EXPECT_WK_STREQ(result, @&quot;Hello, World!&quot;);
</span><span class="cx">             isDone = true;
</span><span class="cx">         }];
</span><ins>+        TestWebKitAPI::Util::run(&amp;isDone);
</ins><span class="cx"> 
</span><del>-        TestWebKitAPI::Util::run(&amp;isDone);
</del><ins>+        [object sayHello:@&quot;Hello Again!&quot; completionHandler:^(NSString *) {
+            // FIXME: Check the string here.
+        }];
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2CocoaRemoteObjectRegistryPlugInmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/RemoteObjectRegistryPlugIn.mm (191918 => 191919)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/RemoteObjectRegistryPlugIn.mm        2015-11-02 23:53:31 UTC (rev 191918)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/RemoteObjectRegistryPlugIn.mm        2015-11-03 00:07:52 UTC (rev 191919)
</span><span class="lines">@@ -62,6 +62,12 @@
</span><span class="cx">     [jsContext setObject:helloString forKeyedSubscript:@&quot;helloString&quot;];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (void)sayHello:(NSString *)hello completionHandler:(void (^)(NSString *))completionHandler
+{
+    // FIXME: Actually call this.
+    // completionHandler([NSString stringWithFormat:@&quot;Your string was '%@'&quot;, hello]);
+}
+
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> #endif // WK_API_ENABLED
</span></span></pre>
</div>
</div>

</body>
</html>