<!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>[177792] trunk/Source/WebKit2</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/177792">177792</a></dd>
<dt>Author</dt> <dd>andersca@apple.com</dd>
<dt>Date</dt> <dd>2014-12-29 09:46:02 -0800 (Mon, 29 Dec 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Use UserData when sending messages to the process pool
https://bugs.webkit.org/show_bug.cgi?id=139978

Reviewed by Sam Weinig.

* Scripts/webkit/messages.py:
(generate_message_handler):
Include the connection parameter for legacy receivers as well.

* Shared/CoreIPCSupport/WebContextMessageKinds.h:
Remove this, it's no longer needed.

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::didReceiveMessage):
No need to special case the postMessage message.

(WebKit::WebProcessPool::didReceiveSyncMessage):
No need to special case the postSynchronousMessageMessage message.

(WebKit::WebProcessPool::handleMessage):
Convert handles to objects and call didReceiveMessageFromInjectedBundle.

(WebKit::WebProcessPool::handleSynchronousMessage):
Convert handles to objects, call didReceiveSynchronousMessageFromInjectedBundle, and then
convert objects back to handles in the reply.

(WebKit::WebProcessPool::didReceiveMessageFromInjectedBundle): Deleted.
(WebKit::WebProcessPool::didReceiveSynchronousMessageFromInjectedBundle): Deleted.
(WebKit::WebProcessPool::dummy): Deleted.
* UIProcess/WebProcessPool.h:
Add handleMessage and handleSynchronousMessage message handlers.

* UIProcess/WebProcessPool.messages.in:
Add new messages.

* WebKit2.xcodeproj/project.pbxproj:
Remove a now unused file.

* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::postMessage):
Convert objects to handles in the message body and then send the HandleMessage to the UI process.

(WebKit::InjectedBundle::postSynchronousMessage):
Convert objects to handles in the message body, send the HandleSynchronousMessage message to the UI process,
and then convert handles back to objects in the reply.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2Scriptswebkitmessagespy">trunk/Source/WebKit2/Scripts/webkit/messages.py</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebProcessPoolcpp">trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebProcessPoolh">trunk/Source/WebKit2/UIProcess/WebProcessPool.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebProcessPoolmessagesin">trunk/Source/WebKit2/UIProcess/WebProcessPool.messages.in</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleInjectedBundlecpp">trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li>trunk/Source/WebKit2/Shared/CoreIPCSupport/</li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (177791 => 177792)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-12-29 15:31:16 UTC (rev 177791)
+++ trunk/Source/WebKit2/ChangeLog        2014-12-29 17:46:02 UTC (rev 177792)
</span><span class="lines">@@ -1,5 +1,53 @@
</span><span class="cx"> 2014-12-28  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Use UserData when sending messages to the process pool
+        https://bugs.webkit.org/show_bug.cgi?id=139978
+
+        Reviewed by Sam Weinig.
+
+        * Scripts/webkit/messages.py:
+        (generate_message_handler):
+        Include the connection parameter for legacy receivers as well.
+
+        * Shared/CoreIPCSupport/WebContextMessageKinds.h:
+        Remove this, it's no longer needed.
+
+        * UIProcess/WebProcessPool.cpp:
+        (WebKit::WebProcessPool::didReceiveMessage):
+        No need to special case the postMessage message.
+
+        (WebKit::WebProcessPool::didReceiveSyncMessage):
+        No need to special case the postSynchronousMessageMessage message.
+
+        (WebKit::WebProcessPool::handleMessage):
+        Convert handles to objects and call didReceiveMessageFromInjectedBundle.
+
+        (WebKit::WebProcessPool::handleSynchronousMessage):
+        Convert handles to objects, call didReceiveSynchronousMessageFromInjectedBundle, and then
+        convert objects back to handles in the reply.
+
+        (WebKit::WebProcessPool::didReceiveMessageFromInjectedBundle): Deleted.
+        (WebKit::WebProcessPool::didReceiveSynchronousMessageFromInjectedBundle): Deleted.
+        (WebKit::WebProcessPool::dummy): Deleted.
+        * UIProcess/WebProcessPool.h:
+        Add handleMessage and handleSynchronousMessage message handlers.
+
+        * UIProcess/WebProcessPool.messages.in:
+        Add new messages.
+
+        * WebKit2.xcodeproj/project.pbxproj:
+        Remove a now unused file.
+
+        * WebProcess/InjectedBundle/InjectedBundle.cpp:
+        (WebKit::InjectedBundle::postMessage):
+        Convert objects to handles in the message body and then send the HandleMessage to the UI process.
+
+        (WebKit::InjectedBundle::postSynchronousMessage):
+        Convert objects to handles in the message body, send the HandleSynchronousMessage message to the UI process,
+        and then convert handles back to objects in the reply.
+
+2014-12-28  Anders Carlsson  &lt;andersca@apple.com&gt;
+
</ins><span class="cx">         Transform nested objects inside arrays
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=139976
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2Scriptswebkitmessagespy"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Scripts/webkit/messages.py (177791 => 177792)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Scripts/webkit/messages.py        2014-12-29 15:31:16 UTC (rev 177791)
+++ trunk/Source/WebKit2/Scripts/webkit/messages.py        2014-12-29 17:46:02 UTC (rev 177792)
</span><span class="lines">@@ -533,7 +533,7 @@
</span><span class="cx"> 
</span><span class="cx">     if async_messages:
</span><span class="cx">         if receiver.has_attribute(LEGACY_RECEIVER_ATTRIBUTE):
</span><del>-            result.append('void %s::didReceive%sMessage(IPC::Connection*, IPC::MessageDecoder&amp; decoder)\n' % (receiver.name, receiver.name))
</del><ins>+            result.append('void %s::didReceive%sMessage(IPC::Connection* connection, IPC::MessageDecoder&amp; decoder)\n' % (receiver.name, receiver.name))
</ins><span class="cx">         else:
</span><span class="cx">             result.append('void %s::didReceiveMessage(IPC::Connection* connection, IPC::MessageDecoder&amp; decoder)\n' % (receiver.name))
</span><span class="cx"> 
</span><span class="lines">@@ -552,9 +552,7 @@
</span><span class="cx">         result.append('\n')
</span><span class="cx">         use_connection = True
</span><span class="cx">         if receiver.has_attribute(LEGACY_RECEIVER_ATTRIBUTE):
</span><del>-            if not sync_delayed_messages:
-                use_connection = False
-            result.append('void %s::didReceiveSync%sMessage(IPC::Connection*%s, IPC::MessageDecoder&amp; decoder, std::unique_ptr&lt;IPC::MessageEncoder&gt;&amp; replyEncoder)\n' % (receiver.name, receiver.name, ' connection' if use_connection else ''))
</del><ins>+            result.append('void %s::didReceiveSync%sMessage(IPC::Connection* connection, IPC::MessageDecoder&amp; decoder, std::unique_ptr&lt;IPC::MessageEncoder&gt;&amp; replyEncoder)\n' % (receiver.name, receiver.name))
</ins><span class="cx">         else:
</span><span class="cx">             result.append('void %s::didReceiveSyncMessage(IPC::Connection* connection, IPC::MessageDecoder&amp; decoder, std::unique_ptr&lt;IPC::MessageEncoder&gt;&amp; replyEncoder)\n' % (receiver.name))
</span><span class="cx">         result.append('{\n')
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebProcessPoolcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp (177791 => 177792)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp        2014-12-29 15:31:16 UTC (rev 177791)
+++ trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp        2014-12-29 17:46:02 UTC (rev 177792)
</span><span class="lines">@@ -38,7 +38,6 @@
</span><span class="cx"> #include &quot;TextChecker.h&quot;
</span><span class="cx"> #include &quot;WKContextPrivate.h&quot;
</span><span class="cx"> #include &quot;WebApplicationCacheManagerProxy.h&quot;
</span><del>-#include &quot;WebContextMessageKinds.h&quot;
</del><span class="cx"> #include &quot;WebContextSupplement.h&quot;
</span><span class="cx"> #include &quot;WebContextUserMessageCoders.h&quot;
</span><span class="cx"> #include &quot;WebCookieManagerProxy.h&quot;
</span><span class="lines">@@ -200,7 +199,6 @@
</span><span class="cx">     platformInitialize();
</span><span class="cx"> 
</span><span class="cx">     addMessageReceiver(Messages::WebProcessPool::messageReceiverName(), *this);
</span><del>-    addMessageReceiver(WebContextLegacyMessages::messageReceiverName(), *this);
</del><span class="cx"> 
</span><span class="cx">     // NOTE: These sub-objects must be initialized after m_messageReceiverMap..
</span><span class="cx">     m_iconDatabase = WebIconDatabase::create(this);
</span><span class="lines">@@ -949,18 +947,6 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-// InjectedBundle client
-
-void WebProcessPool::didReceiveMessageFromInjectedBundle(const String&amp; messageName, API::Object* messageBody)
-{
-    m_injectedBundleClient.didReceiveMessageFromInjectedBundle(this, messageName, messageBody);
-}
-
-void WebProcessPool::didReceiveSynchronousMessageFromInjectedBundle(const String&amp; messageName, API::Object* messageBody, RefPtr&lt;API::Object&gt;&amp; returnData)
-{
-    m_injectedBundleClient.didReceiveSynchronousMessageFromInjectedBundle(this, messageName, messageBody, returnData);
-}
-
</del><span class="cx"> void WebProcessPool::populateVisitedLinks()
</span><span class="cx"> {
</span><span class="cx">     m_historyClient-&gt;populateVisitedLinks(*this);
</span><span class="lines">@@ -1144,20 +1130,6 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (decoder.messageReceiverName() == WebContextLegacyMessages::messageReceiverName()
-        &amp;&amp; decoder.messageName() == WebContextLegacyMessages::postMessageMessageName()) {
-        String messageName;
-        RefPtr&lt;API::Object&gt; messageBody;
-        WebContextUserMessageDecoder messageBodyDecoder(messageBody, *WebProcessProxy::fromConnection(connection));
-        if (!decoder.decode(messageName))
-            return;
-        if (!decoder.decode(messageBodyDecoder))
-            return;
-
-        didReceiveMessageFromInjectedBundle(messageName, messageBody.get());
-        return;
-    }
-
</del><span class="cx">     ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1168,26 +1140,6 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (decoder.messageReceiverName() == WebContextLegacyMessages::messageReceiverName()
-        &amp;&amp; decoder.messageName() == WebContextLegacyMessages::postSynchronousMessageMessageName()) {
-        // FIXME: We should probably encode something in the case that the arguments do not decode correctly.
-
-        WebProcessProxy* process = WebProcessProxy::fromConnection(connection);
-
-        String messageName;
-        RefPtr&lt;API::Object&gt; messageBody;
-        WebContextUserMessageDecoder messageBodyDecoder(messageBody, *process);
-        if (!decoder.decode(messageName))
-            return;
-        if (!decoder.decode(messageBodyDecoder))
-            return;
-
-        RefPtr&lt;API::Object&gt; returnData;
-        didReceiveSynchronousMessageFromInjectedBundle(messageName, messageBody.get(), returnData);
-        replyEncoder-&gt;encode(WebContextUserMessageEncoder(returnData.get(), *process));
-        return;
-    }
-
</del><span class="cx">     ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1380,12 +1332,23 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if !PLATFORM(COCOA)
-void WebProcessPool::dummy(bool&amp;)
</del><ins>+void WebProcessPool::handleMessage(IPC::Connection* connection, const String&amp; messageName, const WebKit::UserData&amp; messageBody)
</ins><span class="cx"> {
</span><ins>+    if (auto* webProcessProxy = WebProcessProxy::fromConnection(connection))
+        m_injectedBundleClient.didReceiveMessageFromInjectedBundle(this, messageName, webProcessProxy-&gt;transformHandlesToObjects(messageBody.object()).get());
</ins><span class="cx"> }
</span><del>-#endif
</del><span class="cx"> 
</span><ins>+void WebProcessPool::handleSynchronousMessage(IPC::Connection* connection, const String&amp; messageName, const UserData&amp; messageBody, UserData&amp; returnUserData)
+{
+    auto* webProcessProxy = WebProcessProxy::fromConnection(connection);
+    if (!webProcessProxy)
+        return;
+
+    RefPtr&lt;API::Object&gt; returnData;
+    m_injectedBundleClient.didReceiveSynchronousMessageFromInjectedBundle(this, messageName, webProcessProxy-&gt;transformHandlesToObjects(messageBody.object()).get(), returnData);
+    returnUserData = UserData(webProcessProxy-&gt;transformObjectsToHandles(returnData.get()));
+}
+
</ins><span class="cx"> void WebProcessPool::didGetStatistics(const StatisticsData&amp; statisticsData, uint64_t requestID)
</span><span class="cx"> {
</span><span class="cx">     RefPtr&lt;StatisticsRequest&gt; request = m_statisticsRequests.take(requestID);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebProcessPoolh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebProcessPool.h (177791 => 177792)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebProcessPool.h        2014-12-29 15:31:16 UTC (rev 177791)
+++ trunk/Source/WebKit2/UIProcess/WebProcessPool.h        2014-12-29 17:46:02 UTC (rev 177792)
</span><span class="lines">@@ -188,10 +188,6 @@
</span><span class="cx"> 
</span><span class="cx">     void postMessageToInjectedBundle(const String&amp;, API::Object*);
</span><span class="cx"> 
</span><del>-    // InjectedBundle client
-    void didReceiveMessageFromInjectedBundle(const String&amp;, API::Object*);
-    void didReceiveSynchronousMessageFromInjectedBundle(const String&amp;, API::Object*, RefPtr&lt;API::Object&gt;&amp; returnData);
-
</del><span class="cx">     void populateVisitedLinks();
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(NETSCAPE_PLUGIN_API)
</span><span class="lines">@@ -406,11 +402,8 @@
</span><span class="cx">     void setPasteboardBufferForType(const String&amp; pasteboardName, const String&amp; pasteboardType, const SharedMemory::Handle&amp;, uint64_t size, uint64_t&amp; newChangeCount);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if !PLATFORM(COCOA)
-    // FIXME: This a dummy message, to avoid breaking the build for platforms that don't require
-    // any synchronous messages, and should be removed when &lt;rdar://problem/8775115&gt; is fixed.
-    void dummy(bool&amp;);
-#endif
</del><ins>+    void handleMessage(IPC::Connection*, const String&amp; messageName, const UserData&amp; messageBody);
+    void handleSynchronousMessage(IPC::Connection*, const String&amp; messageName, const UserData&amp; messageBody, UserData&amp; returnUserData);
</ins><span class="cx"> 
</span><span class="cx">     void didGetStatistics(const StatisticsData&amp;, uint64_t callbackID);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebProcessPoolmessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebProcessPool.messages.in (177791 => 177792)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebProcessPool.messages.in        2014-12-29 15:31:16 UTC (rev 177791)
+++ trunk/Source/WebKit2/UIProcess/WebProcessPool.messages.in        2014-12-29 17:46:02 UTC (rev 177792)
</span><span class="lines">@@ -21,6 +21,8 @@
</span><span class="cx"> # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> 
</span><span class="cx"> messages -&gt; WebProcessPool LegacyReceiver {
</span><ins>+    HandleMessage(String messageName, WebKit::UserData messageBody) WantsConnection
+    HandleSynchronousMessage(String messageName, WebKit::UserData messageBody) -&gt; (WebKit::UserData returnData) WantsConnection
</ins><span class="cx"> 
</span><span class="cx">     DidGetStatistics(struct WebKit::StatisticsData statisticsData, uint64_t callbackID)
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (177791 => 177792)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-12-29 15:31:16 UTC (rev 177791)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-12-29 17:46:02 UTC (rev 177792)
</span><span class="lines">@@ -1476,7 +1476,6 @@
</span><span class="cx">                 BCC5715C115ADAEF001CCAF9 /* WebSystemInterface.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCC5715A115ADAEF001CCAF9 /* WebSystemInterface.mm */; };
</span><span class="cx">                 BCC8B374125FB69000DE46A4 /* WKGeometry.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC8B373125FB69000DE46A4 /* WKGeometry.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 BCC938E11180DE440085E5FE /* WKContextPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC938E01180DE440085E5FE /* WKContextPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-                BCCB75C61203A1CE00222D1B /* WebContextMessageKinds.h in Headers */ = {isa = PBXBuildFile; fileRef = BCCB75C51203A1CE00222D1B /* WebContextMessageKinds.h */; };
</del><span class="cx">                 BCCF672D12C7EDF7008F9C35 /* OriginAndDatabases.h in Headers */ = {isa = PBXBuildFile; fileRef = BCCF672C12C7EDF7008F9C35 /* OriginAndDatabases.h */; };
</span><span class="cx">                 BCCF673312C7F15C008F9C35 /* OriginAndDatabases.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCCF673212C7F15C008F9C35 /* OriginAndDatabases.cpp */; };
</span><span class="cx">                 BCCF6ABC12C91EF9008F9C35 /* WebImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCCF6ABA12C91EF9008F9C35 /* WebImage.cpp */; };
</span><span class="lines">@@ -3596,7 +3595,6 @@
</span><span class="cx">                 BCC5715A115ADAEF001CCAF9 /* WebSystemInterface.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebSystemInterface.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 BCC8B373125FB69000DE46A4 /* WKGeometry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKGeometry.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 BCC938E01180DE440085E5FE /* WKContextPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKContextPrivate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                BCCB75C51203A1CE00222D1B /* WebContextMessageKinds.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebContextMessageKinds.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 BCCF672C12C7EDF7008F9C35 /* OriginAndDatabases.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OriginAndDatabases.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 BCCF673212C7F15C008F9C35 /* OriginAndDatabases.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OriginAndDatabases.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 BCCF6ABA12C91EF9008F9C35 /* WebImage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebImage.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -6255,7 +6253,6 @@
</span><span class="cx">                 BC111B5F112F635E00337BAB /* CoreIPCSupport */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><del>-                                BCCB75C51203A1CE00222D1B /* WebContextMessageKinds.h */,
</del><span class="cx">                         );
</span><span class="cx">                         path = CoreIPCSupport;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -7586,7 +7583,6 @@
</span><span class="cx">                                 510FBB9B1288C95E00AFFDF4 /* WebContextMenuItemData.h in Headers */,
</span><span class="cx">                                 51ACBB82127A8BAD00D203B9 /* WebContextMenuProxy.h in Headers */,
</span><span class="cx">                                 51ACBBA0127A8F2C00D203B9 /* WebContextMenuProxyMac.h in Headers */,
</span><del>-                                BCCB75C61203A1CE00222D1B /* WebContextMessageKinds.h in Headers */,
</del><span class="cx">                                 BCF4DE25168FA44800C94AFC /* WebContextSupplement.h in Headers */,
</span><span class="cx">                                 BCB0B0DC12305A2500B1341E /* WebContextUserMessageCoders.h in Headers */,
</span><span class="cx">                                 330934501315B94D0097A7BC /* WebCookieManager.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleInjectedBundlecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp (177791 => 177792)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp        2014-12-29 15:31:16 UTC (rev 177791)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp        2014-12-29 17:46:02 UTC (rev 177792)
</span><span class="lines">@@ -32,11 +32,11 @@
</span><span class="cx"> #include &quot;InjectedBundleUserMessageCoders.h&quot;
</span><span class="cx"> #include &quot;NotificationPermissionRequestManager.h&quot;
</span><span class="cx"> #include &quot;SessionTracker.h&quot;
</span><ins>+#include &quot;UserData.h&quot;
</ins><span class="cx"> #include &quot;WKAPICast.h&quot;
</span><span class="cx"> #include &quot;WKBundleAPICast.h&quot;
</span><span class="cx"> #include &quot;WebApplicationCacheManager.h&quot;
</span><span class="cx"> #include &quot;WebConnectionToUIProcess.h&quot;
</span><del>-#include &quot;WebContextMessageKinds.h&quot;
</del><span class="cx"> #include &quot;WebCookieManager.h&quot;
</span><span class="cx"> #include &quot;WebCoreArgumentCoders.h&quot;
</span><span class="cx"> #include &quot;WebDatabaseManager.h&quot;
</span><span class="lines">@@ -47,6 +47,7 @@
</span><span class="cx"> #include &quot;WebPreferencesStore.h&quot;
</span><span class="cx"> #include &quot;WebProcess.h&quot;
</span><span class="cx"> #include &quot;WebProcessCreationParameters.h&quot;
</span><ins>+#include &quot;WebProcessPoolMessages.h&quot;
</ins><span class="cx"> #include &lt;JavaScriptCore/APICast.h&gt;
</span><span class="cx"> #include &lt;JavaScriptCore/JSLock.h&gt;
</span><span class="cx"> #include &lt;WebCore/ApplicationCache.h&gt;
</span><span class="lines">@@ -114,27 +115,17 @@
</span><span class="cx"> 
</span><span class="cx"> void InjectedBundle::postMessage(const String&amp; messageName, API::Object* messageBody)
</span><span class="cx"> {
</span><del>-    auto encoder = std::make_unique&lt;IPC::MessageEncoder&gt;(WebContextLegacyMessages::messageReceiverName(), WebContextLegacyMessages::postMessageMessageName(), 0);
-    encoder-&gt;encode(messageName);
-    encoder-&gt;encode(InjectedBundleUserMessageEncoder(messageBody));
-
-    WebProcess::shared().parentProcessConnection()-&gt;sendMessage(WTF::move(encoder));
</del><ins>+    WebProcess::shared().parentProcessConnection()-&gt;send(Messages::WebProcessPool::HandleMessage(messageName, UserData(WebProcess::shared().transformObjectsToHandles(messageBody))), 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InjectedBundle::postSynchronousMessage(const String&amp; messageName, API::Object* messageBody, RefPtr&lt;API::Object&gt;&amp; returnData)
</span><span class="cx"> {
</span><del>-    InjectedBundleUserMessageDecoder messageDecoder(returnData);
</del><ins>+    UserData returnUserData;
</ins><span class="cx"> 
</span><del>-    uint64_t syncRequestID;
-    std::unique_ptr&lt;IPC::MessageEncoder&gt; encoder = WebProcess::shared().parentProcessConnection()-&gt;createSyncMessageEncoder(WebContextLegacyMessages::messageReceiverName(), WebContextLegacyMessages::postSynchronousMessageMessageName(), 0, syncRequestID);
-    encoder-&gt;encode(messageName);
-    encoder-&gt;encode(InjectedBundleUserMessageEncoder(messageBody));
-
-    std::unique_ptr&lt;IPC::MessageDecoder&gt; replyDecoder = WebProcess::shared().parentProcessConnection()-&gt;sendSyncMessage(syncRequestID, WTF::move(encoder), std::chrono::milliseconds::max());
-    if (!replyDecoder || !replyDecoder-&gt;decode(messageDecoder)) {
</del><ins>+    if (!WebProcess::shared().parentProcessConnection()-&gt;sendSync(Messages::WebProcessPool::HandleSynchronousMessage(messageName, UserData(WebProcess::shared().transformObjectsToHandles(messageBody))), Messages::WebProcessPool::HandleSynchronousMessage::Reply(returnUserData), 0))
</ins><span class="cx">         returnData = nullptr;
</span><del>-        return;
-    }
</del><ins>+    else
+        returnData = WebProcess::shared().transformHandlesToObjects(returnUserData.object());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> WebConnection* InjectedBundle::webConnectionToUIProcess() const
</span></span></pre>
</div>
</div>

</body>
</html>