<!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>[179326] 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/179326">179326</a></dd>
<dt>Author</dt> <dd>timothy_horton@apple.com</dd>
<dt>Date</dt> <dd>2015-01-28 18:32:24 -0800 (Wed, 28 Jan 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add a WebKitMessageRecorder DTrace provider, exposing IPC details to DTrace
https://bugs.webkit.org/show_bug.cgi?id=140673

Reviewed by Sam Weinig.

* Platform/IPC/ArgumentCoders.cpp:
(IPC::ArgumentCoder&lt;uuid_t&gt;::encode):
(IPC::ArgumentCoder&lt;uuid_t&gt;::decode):
* Platform/IPC/ArgumentCoders.h:
Add a uuid_t (simple) argument coder.
Fix a mis-named header-guard #ifdef.

* Platform/IPC/Connection.cpp:
(IPC::Connection::dispatchWorkQueueMessageReceiverMessage):
(IPC::Connection::dispatchSyncMessage):
Sync message replies inherit the message UUID from the incoming sync message.

(IPC::Connection::sendMessage):
(IPC::Connection::waitForMessage):
(IPC::Connection::sendSyncMessage):
(IPC::Connection::sendSyncMessageFromSecondaryThread):
Record outgoing messages. Because sendSyncMessage calls sendMessage,
we have to explicitly avoid recording the message twice.

(IPC::Connection::dispatchMessage):
Record the incoming message.

(IPC::Connection::remoteProcessID):
Add remoteProcessID(), which tries to determine the pid of the remote process.

* Platform/IPC/Connection.h:
(IPC::Connection::xpcConnection):
This can be const.

(IPC::Connection::isValid):
Make this public.

* Platform/IPC/MessageDecoder.cpp:
(IPC::MessageDecoder::MessageDecoder):
* Platform/IPC/MessageDecoder.h:
(IPC::MessageDecoder::setMessageProcessingToken):
(IPC::MessageDecoder::UUID):
Decode and store the message UUID.
Store a MessageProcessingToken for the lifetime of the MessageDecoder;
this ensures that all time spent processing the incoming message will be
counted against that message.

* Platform/IPC/MessageEncoder.cpp:
(IPC::MessageEncoder::MessageEncoder):
By default, create a new UUID for the message. Alternatively, allow clients
to pass the message UUID in (used for sync message replies).
Store the messageReceiverName and messageName.

(IPC::MessageEncoder::encodeHeader):
Factor encodeHeader() out of the constructors so most of their code can be shared.

(IPC::MessageEncoder::isSyncMessage):
(IPC::MessageEncoder::shouldDispatchMessageWhenWaitingForSyncReply):
Add getters for these flags.

* Platform/IPC/MessageEncoder.h:
(IPC::MessageEncoder::messageReceiverName):
(IPC::MessageEncoder::messageName):
(IPC::MessageEncoder::destinationID):
(IPC::MessageEncoder::UUID):

* Platform/IPC/MessageRecorder.h: Added.
* Platform/IPC/MessageRecorder.cpp: Added.
(MessageRecorder::MessageRecorder):
Add a class that interfaces with a custom DTrace provider to log incoming and outgoing messages.

(MessageRecorder::shared):
(MessageRecorder::isEnabled):
Determine if either of the message probes are enabled. If not, we'll avoid most of the
work associated with MessageRecorder.

(MessageRecorder::recordOutgoingMessage):
(MessageRecorder::recordIncomingMessage):
Build a WebKitMessageRecord and MessageProcessingToken from the Message(De|En)coder.
Once the MessageProcessingToken is deallocated, the probe will be invoked with the WebKitMessageRecord.

(MessageRecorder::MessageProcessingToken::MessageProcessingToken):
(MessageRecorder::MessageProcessingToken::~MessageProcessingToken):
Keep track of when the token is created and destroyed; these are considered the beginning
and ending &quot;processing&quot; times of the message (and as such the token should be kept alive for
exactly as long as the message is being processed).

* Platform/IPC/MessageRecorderProbes.d: Added.
Add a DTrace provider source file with two probes, message_sent and message_received.
The struct must match the struct in MessageRecorder.h.

* Platform/IPC/ProcessType.h: Added.
Add an enum of process types.

* WebKit2.xcodeproj/project.pbxproj:

* DatabaseProcess/DatabaseProcess.h:
* DatabaseProcess/DatabaseToWebProcessConnection.h:
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkProcess.h:
* WebProcess/Databases/WebToDatabaseProcessConnection.h:
* WebProcess/Network/NetworkProcessConnection.h:
* WebProcess/Plugins/PluginProcessConnection.h:
* WebProcess/WebPage/WebInspector.h:
* WebProcess/WebPage/WebInspectorUI.h:
* WebProcess/WebProcess.h:
* UIProcess/Databases/DatabaseProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Plugins/PluginProcessProxy.h:
* UIProcess/WebProcessProxy.h:
* PluginProcess/PluginProcess.h:
* PluginProcess/WebProcessConnection.h:
Annotate Connection::Clients with process types.

* Scripts/dtrace/trace-webkit2-messages.d: Added.
Add a DTrace script that outputs a small blob of JSON per message.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2DatabaseProcessDatabaseProcessh">trunk/Source/WebKit2/DatabaseProcess/DatabaseProcess.h</a></li>
<li><a href="#trunkSourceWebKit2DatabaseProcessDatabaseToWebProcessConnectionh">trunk/Source/WebKit2/DatabaseProcess/DatabaseToWebProcessConnection.h</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkConnectionToWebProcessh">trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.h</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkProcessh">trunk/Source/WebKit2/NetworkProcess/NetworkProcess.h</a></li>
<li><a href="#trunkSourceWebKit2PlatformIPCArgumentCoderscpp">trunk/Source/WebKit2/Platform/IPC/ArgumentCoders.cpp</a></li>
<li><a href="#trunkSourceWebKit2PlatformIPCArgumentCodersh">trunk/Source/WebKit2/Platform/IPC/ArgumentCoders.h</a></li>
<li><a href="#trunkSourceWebKit2PlatformIPCConnectioncpp">trunk/Source/WebKit2/Platform/IPC/Connection.cpp</a></li>
<li><a href="#trunkSourceWebKit2PlatformIPCConnectionh">trunk/Source/WebKit2/Platform/IPC/Connection.h</a></li>
<li><a href="#trunkSourceWebKit2PlatformIPCMessageDecodercpp">trunk/Source/WebKit2/Platform/IPC/MessageDecoder.cpp</a></li>
<li><a href="#trunkSourceWebKit2PlatformIPCMessageDecoderh">trunk/Source/WebKit2/Platform/IPC/MessageDecoder.h</a></li>
<li><a href="#trunkSourceWebKit2PlatformIPCMessageEncodercpp">trunk/Source/WebKit2/Platform/IPC/MessageEncoder.cpp</a></li>
<li><a href="#trunkSourceWebKit2PlatformIPCMessageEncoderh">trunk/Source/WebKit2/Platform/IPC/MessageEncoder.h</a></li>
<li><a href="#trunkSourceWebKit2PlatformIPCmacConnectionMacmm">trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm</a></li>
<li><a href="#trunkSourceWebKit2PluginProcessPluginProcessh">trunk/Source/WebKit2/PluginProcess/PluginProcess.h</a></li>
<li><a href="#trunkSourceWebKit2PluginProcessWebProcessConnectionh">trunk/Source/WebKit2/PluginProcess/WebProcessConnection.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessDatabasesDatabaseProcessProxyh">trunk/Source/WebKit2/UIProcess/Databases/DatabaseProcessProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessNetworkNetworkProcessProxyh">trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessPluginsPluginProcessProxyh">trunk/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebProcessProxyh">trunk/Source/WebKit2/UIProcess/WebProcessProxy.h</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebKit2WebProcessDatabasesWebToDatabaseProcessConnectionh">trunk/Source/WebKit2/WebProcess/Databases/WebToDatabaseProcessConnection.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessNetworkNetworkProcessConnectionh">trunk/Source/WebKit2/WebProcess/Network/NetworkProcessConnection.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessPluginsPluginProcessConnectionh">trunk/Source/WebKit2/WebProcess/Plugins/PluginProcessConnection.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebInspectorh">trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebInspectorUIh">trunk/Source/WebKit2/WebProcess/WebPage/WebInspectorUI.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebProcessh">trunk/Source/WebKit2/WebProcess/WebProcess.h</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2PlatformIPCMessageRecordercpp">trunk/Source/WebKit2/Platform/IPC/MessageRecorder.cpp</a></li>
<li><a href="#trunkSourceWebKit2PlatformIPCMessageRecorderh">trunk/Source/WebKit2/Platform/IPC/MessageRecorder.h</a></li>
<li><a href="#trunkSourceWebKit2PlatformIPCMessageRecorderProbesd">trunk/Source/WebKit2/Platform/IPC/MessageRecorderProbes.d</a></li>
<li><a href="#trunkSourceWebKit2PlatformIPCProcessTypeh">trunk/Source/WebKit2/Platform/IPC/ProcessType.h</a></li>
<li><a href="#trunkToolsScriptsdtracetracewebkit2messagesd">trunk/Tools/Scripts/dtrace/trace-webkit2-messages.d</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (179325 => 179326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-01-29 02:32:19 UTC (rev 179325)
+++ trunk/Source/WebKit2/ChangeLog        2015-01-29 02:32:24 UTC (rev 179326)
</span><span class="lines">@@ -1,3 +1,119 @@
</span><ins>+2015-01-28  Timothy Horton  &lt;timothy_horton@apple.com&gt;
+
+        Add a WebKitMessageRecorder DTrace provider, exposing IPC details to DTrace
+        https://bugs.webkit.org/show_bug.cgi?id=140673
+
+        Reviewed by Sam Weinig.
+
+        * Platform/IPC/ArgumentCoders.cpp:
+        (IPC::ArgumentCoder&lt;uuid_t&gt;::encode):
+        (IPC::ArgumentCoder&lt;uuid_t&gt;::decode):
+        * Platform/IPC/ArgumentCoders.h:
+        Add a uuid_t (simple) argument coder.
+        Fix a mis-named header-guard #ifdef.
+
+        * Platform/IPC/Connection.cpp:
+        (IPC::Connection::dispatchWorkQueueMessageReceiverMessage):
+        (IPC::Connection::dispatchSyncMessage):
+        Sync message replies inherit the message UUID from the incoming sync message.
+
+        (IPC::Connection::sendMessage):
+        (IPC::Connection::waitForMessage):
+        (IPC::Connection::sendSyncMessage):
+        (IPC::Connection::sendSyncMessageFromSecondaryThread):
+        Record outgoing messages. Because sendSyncMessage calls sendMessage,
+        we have to explicitly avoid recording the message twice.
+
+        (IPC::Connection::dispatchMessage):
+        Record the incoming message.
+
+        (IPC::Connection::remoteProcessID):
+        Add remoteProcessID(), which tries to determine the pid of the remote process.
+
+        * Platform/IPC/Connection.h:
+        (IPC::Connection::xpcConnection):
+        This can be const.
+
+        (IPC::Connection::isValid):
+        Make this public.
+
+        * Platform/IPC/MessageDecoder.cpp:
+        (IPC::MessageDecoder::MessageDecoder):
+        * Platform/IPC/MessageDecoder.h:
+        (IPC::MessageDecoder::setMessageProcessingToken):
+        (IPC::MessageDecoder::UUID):
+        Decode and store the message UUID.
+        Store a MessageProcessingToken for the lifetime of the MessageDecoder;
+        this ensures that all time spent processing the incoming message will be
+        counted against that message.
+
+        * Platform/IPC/MessageEncoder.cpp:
+        (IPC::MessageEncoder::MessageEncoder):
+        By default, create a new UUID for the message. Alternatively, allow clients
+        to pass the message UUID in (used for sync message replies).
+        Store the messageReceiverName and messageName.
+
+        (IPC::MessageEncoder::encodeHeader):
+        Factor encodeHeader() out of the constructors so most of their code can be shared.
+
+        (IPC::MessageEncoder::isSyncMessage):
+        (IPC::MessageEncoder::shouldDispatchMessageWhenWaitingForSyncReply):
+        Add getters for these flags.
+
+        * Platform/IPC/MessageEncoder.h:
+        (IPC::MessageEncoder::messageReceiverName):
+        (IPC::MessageEncoder::messageName):
+        (IPC::MessageEncoder::destinationID):
+        (IPC::MessageEncoder::UUID):
+
+        * Platform/IPC/MessageRecorder.h: Added.
+        * Platform/IPC/MessageRecorder.cpp: Added.
+        (MessageRecorder::MessageRecorder):
+        Add a class that interfaces with a custom DTrace provider to log incoming and outgoing messages.
+
+        (MessageRecorder::shared):
+        (MessageRecorder::isEnabled):
+        Determine if either of the message probes are enabled. If not, we'll avoid most of the
+        work associated with MessageRecorder.
+
+        (MessageRecorder::recordOutgoingMessage):
+        (MessageRecorder::recordIncomingMessage):
+        Build a WebKitMessageRecord and MessageProcessingToken from the Message(De|En)coder.
+        Once the MessageProcessingToken is deallocated, the probe will be invoked with the WebKitMessageRecord.
+
+        (MessageRecorder::MessageProcessingToken::MessageProcessingToken):
+        (MessageRecorder::MessageProcessingToken::~MessageProcessingToken):
+        Keep track of when the token is created and destroyed; these are considered the beginning
+        and ending &quot;processing&quot; times of the message (and as such the token should be kept alive for
+        exactly as long as the message is being processed).
+
+        * Platform/IPC/MessageRecorderProbes.d: Added.
+        Add a DTrace provider source file with two probes, message_sent and message_received.
+        The struct must match the struct in MessageRecorder.h.
+        
+        * Platform/IPC/ProcessType.h: Added.
+        Add an enum of process types.
+
+        * WebKit2.xcodeproj/project.pbxproj:
+
+        * DatabaseProcess/DatabaseProcess.h:
+        * DatabaseProcess/DatabaseToWebProcessConnection.h:
+        * NetworkProcess/NetworkConnectionToWebProcess.h:
+        * NetworkProcess/NetworkProcess.h:
+        * WebProcess/Databases/WebToDatabaseProcessConnection.h:
+        * WebProcess/Network/NetworkProcessConnection.h:
+        * WebProcess/Plugins/PluginProcessConnection.h:
+        * WebProcess/WebPage/WebInspector.h:
+        * WebProcess/WebPage/WebInspectorUI.h:
+        * WebProcess/WebProcess.h:
+        * UIProcess/Databases/DatabaseProcessProxy.h:
+        * UIProcess/Network/NetworkProcessProxy.h:
+        * UIProcess/Plugins/PluginProcessProxy.h:
+        * UIProcess/WebProcessProxy.h:
+        * PluginProcess/PluginProcess.h:
+        * PluginProcess/WebProcessConnection.h:
+        Annotate Connection::Clients with process types.
+        
</ins><span class="cx"> 2015-01-28  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: Crash closing inspected page with frequent activity
</span></span></pre></div>
<a id="trunkSourceWebKit2DatabaseProcessDatabaseProcessh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DatabaseProcess/DatabaseProcess.h (179325 => 179326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DatabaseProcess/DatabaseProcess.h        2015-01-29 02:32:19 UTC (rev 179325)
+++ trunk/Source/WebKit2/DatabaseProcess/DatabaseProcess.h        2015-01-29 02:32:24 UTC (rev 179326)
</span><span class="lines">@@ -82,6 +82,8 @@
</span><span class="cx">     virtual void didReceiveMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;) override;
</span><span class="cx">     virtual void didClose(IPC::Connection&amp;) override;
</span><span class="cx">     virtual void didReceiveInvalidMessage(IPC::Connection&amp;, IPC::StringReference messageReceiverName, IPC::StringReference messageName) override;
</span><ins>+    virtual IPC::ProcessType localProcessType() override { return IPC::ProcessType::Database; }
+    virtual IPC::ProcessType remoteProcessType() override { return IPC::ProcessType::UI; }
</ins><span class="cx">     void didReceiveDatabaseProcessMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;);
</span><span class="cx"> 
</span><span class="cx">     // Message Handlers
</span></span></pre></div>
<a id="trunkSourceWebKit2DatabaseProcessDatabaseToWebProcessConnectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DatabaseProcess/DatabaseToWebProcessConnection.h (179325 => 179326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DatabaseProcess/DatabaseToWebProcessConnection.h        2015-01-29 02:32:19 UTC (rev 179325)
+++ trunk/Source/WebKit2/DatabaseProcess/DatabaseToWebProcessConnection.h        2015-01-29 02:32:24 UTC (rev 179326)
</span><span class="lines">@@ -51,6 +51,8 @@
</span><span class="cx">     virtual void didReceiveSyncMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;, std::unique_ptr&lt;IPC::MessageEncoder&gt;&amp;) override;
</span><span class="cx">     virtual void didClose(IPC::Connection&amp;) override;
</span><span class="cx">     virtual void didReceiveInvalidMessage(IPC::Connection&amp;, IPC::StringReference messageReceiverName, IPC::StringReference messageName) override;
</span><ins>+    virtual IPC::ProcessType localProcessType() override { return IPC::ProcessType::Database; }
+    virtual IPC::ProcessType remoteProcessType() override { return IPC::ProcessType::Web; }
</ins><span class="cx">     void didReceiveDatabaseToWebProcessConnectionMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;);
</span><span class="cx"> 
</span><span class="cx">     // IPC::MessageSender
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkConnectionToWebProcessh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.h (179325 => 179326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.h        2015-01-29 02:32:19 UTC (rev 179325)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.h        2015-01-29 02:32:24 UTC (rev 179326)
</span><span class="lines">@@ -65,6 +65,8 @@
</span><span class="cx">     virtual void didReceiveSyncMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;, std::unique_ptr&lt;IPC::MessageEncoder&gt;&amp;);
</span><span class="cx">     virtual void didClose(IPC::Connection&amp;);
</span><span class="cx">     virtual void didReceiveInvalidMessage(IPC::Connection&amp;, IPC::StringReference messageReceiverName, IPC::StringReference messageName);
</span><ins>+    virtual IPC::ProcessType localProcessType() override { return IPC::ProcessType::Network; }
+    virtual IPC::ProcessType remoteProcessType() override { return IPC::ProcessType::Web; }
</ins><span class="cx"> 
</span><span class="cx">     // Message handlers.
</span><span class="cx">     void didReceiveNetworkConnectionToWebProcessMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;);
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkProcessh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkProcess.h (179325 => 179326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkProcess.h        2015-01-29 02:32:19 UTC (rev 179325)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkProcess.h        2015-01-29 02:32:24 UTC (rev 179326)
</span><span class="lines">@@ -99,6 +99,8 @@
</span><span class="cx">     virtual void didReceiveSyncMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;, std::unique_ptr&lt;IPC::MessageEncoder&gt;&amp;) override;
</span><span class="cx">     virtual void didClose(IPC::Connection&amp;) override;
</span><span class="cx">     virtual void didReceiveInvalidMessage(IPC::Connection&amp;, IPC::StringReference messageReceiverName, IPC::StringReference messageName) override;
</span><ins>+    virtual IPC::ProcessType localProcessType() override { return IPC::ProcessType::Network; }
+    virtual IPC::ProcessType remoteProcessType() override { return IPC::ProcessType::UI; }
</ins><span class="cx"> 
</span><span class="cx">     // DownloadManager::Client
</span><span class="cx">     virtual void didCreateDownload() override;
</span></span></pre></div>
<a id="trunkSourceWebKit2PlatformIPCArgumentCoderscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Platform/IPC/ArgumentCoders.cpp (179325 => 179326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Platform/IPC/ArgumentCoders.cpp        2015-01-29 02:32:19 UTC (rev 179325)
+++ trunk/Source/WebKit2/Platform/IPC/ArgumentCoders.cpp        2015-01-29 02:32:24 UTC (rev 179326)
</span><span class="lines">@@ -162,4 +162,14 @@
</span><span class="cx">     return decodeStringText&lt;UChar&gt;(decoder, length, result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void ArgumentCoder&lt;uuid_t&gt;::encode(ArgumentEncoder&amp; encoder, const uuid_t&amp; uuid)
+{
+    SimpleArgumentCoder&lt;uuid_t&gt;::encode(encoder, uuid);
+}
+
+bool ArgumentCoder&lt;uuid_t&gt;::decode(ArgumentDecoder&amp; decoder, uuid_t&amp; uuid)
+{
+    return SimpleArgumentCoder&lt;uuid_t&gt;::decode(decoder, uuid);
+}
+
</ins><span class="cx"> } // namespace IPC
</span></span></pre></div>
<a id="trunkSourceWebKit2PlatformIPCArgumentCodersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Platform/IPC/ArgumentCoders.h (179325 => 179326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Platform/IPC/ArgumentCoders.h        2015-01-29 02:32:19 UTC (rev 179325)
+++ trunk/Source/WebKit2/Platform/IPC/ArgumentCoders.h        2015-01-29 02:32:24 UTC (rev 179326)
</span><span class="lines">@@ -23,12 +23,13 @@
</span><span class="cx">  * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef SimpleArgumentCoder_h
-#define SimpleArgumentCoder_h
</del><ins>+#ifndef ArgumentCoders_h
+#define ArgumentCoders_h
</ins><span class="cx"> 
</span><span class="cx"> #include &quot;ArgumentDecoder.h&quot;
</span><span class="cx"> #include &quot;ArgumentEncoder.h&quot;
</span><span class="cx"> #include &lt;utility&gt;
</span><ins>+#include &lt;uuid/uuid.h&gt;
</ins><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><span class="cx"> #include &lt;wtf/HashMap.h&gt;
</span><span class="cx"> #include &lt;wtf/HashSet.h&gt;
</span><span class="lines">@@ -298,6 +299,11 @@
</span><span class="cx">     static bool decode(ArgumentDecoder&amp;, String&amp;);
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+template&lt;&gt; struct ArgumentCoder&lt;uuid_t&gt; {
+    static void encode(ArgumentEncoder&amp;, const uuid_t&amp;);
+    static bool decode(ArgumentDecoder&amp;, uuid_t&amp;);
+};
+
</ins><span class="cx"> } // namespace IPC
</span><span class="cx"> 
</span><span class="cx"> #endif // ArgumentCoders_h
</span></span></pre></div>
<a id="trunkSourceWebKit2PlatformIPCConnectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Platform/IPC/Connection.cpp (179325 => 179326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Platform/IPC/Connection.cpp        2015-01-29 02:32:19 UTC (rev 179325)
+++ trunk/Source/WebKit2/Platform/IPC/Connection.cpp        2015-01-29 02:32:24 UTC (rev 179326)
</span><span class="lines">@@ -317,7 +317,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    auto replyEncoder = std::make_unique&lt;MessageEncoder&gt;(&quot;IPC&quot;, &quot;SyncMessageReply&quot;, syncRequestID);
</del><ins>+    auto replyEncoder = std::make_unique&lt;MessageEncoder&gt;(&quot;IPC&quot;, &quot;SyncMessageReply&quot;, syncRequestID, incomingMessageDecoder-&gt;UUID());
</ins><span class="cx"> 
</span><span class="cx">     // Hand off both the decoder and encoder to the work queue message receiver.
</span><span class="cx">     workQueueMessageReceiver-&gt;didReceiveSyncMessage(*this, *decoder, replyEncoder);
</span><span class="lines">@@ -369,7 +369,7 @@
</span><span class="cx">     return encoder;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool Connection::sendMessage(std::unique_ptr&lt;MessageEncoder&gt; encoder, unsigned messageSendFlags)
</del><ins>+bool Connection::sendMessage(std::unique_ptr&lt;MessageEncoder&gt; encoder, unsigned messageSendFlags, bool alreadyRecordedMessage)
</ins><span class="cx"> {
</span><span class="cx">     if (!isValid())
</span><span class="cx">         return false;
</span><span class="lines">@@ -379,6 +379,10 @@
</span><span class="cx">             || m_inDispatchMessageMarkedDispatchWhenWaitingForSyncReplyCount))
</span><span class="cx">         encoder-&gt;setShouldDispatchMessageWhenWaitingForSyncReply(true);
</span><span class="cx"> 
</span><ins>+    std::unique_ptr&lt;MessageRecorder::MessageProcessingToken&gt; token;
+    if (!alreadyRecordedMessage)
+        token = MessageRecorder::recordOutgoingMessage(*this, *encoder);
+
</ins><span class="cx">     {
</span><span class="cx">         std::lock_guard&lt;std::mutex&gt; lock(m_outgoingMessagesMutex);
</span><span class="cx">         m_outgoingMessages.append(WTF::move(encoder));
</span><span class="lines">@@ -473,8 +477,10 @@
</span><span class="cx"> 
</span><span class="cx">     ++m_inSendSyncCount;
</span><span class="cx"> 
</span><ins>+    auto token = MessageRecorder::recordOutgoingMessage(*this, *encoder);
+
</ins><span class="cx">     // First send the message.
</span><del>-    sendMessage(WTF::move(encoder), DispatchMessageEvenWhenWaitingForSyncReply);
</del><ins>+    sendMessage(WTF::move(encoder), DispatchMessageEvenWhenWaitingForSyncReply, true);
</ins><span class="cx"> 
</span><span class="cx">     // Then wait for a reply. Waiting for a reply could involve dispatching incoming sync messages, so
</span><span class="cx">     // keep an extra reference to the connection here in case it's invalidated.
</span><span class="lines">@@ -515,8 +521,10 @@
</span><span class="cx">         m_secondaryThreadPendingSyncReplyMap.add(syncRequestID, &amp;pendingReply);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    sendMessage(WTF::move(encoder), 0);
</del><ins>+    auto token = MessageRecorder::recordOutgoingMessage(*this, *encoder);
</ins><span class="cx"> 
</span><ins>+    sendMessage(WTF::move(encoder), 0, true);
+
</ins><span class="cx">     pendingReply.semaphore.wait(currentTime() + (timeout.count() / 1000.0));
</span><span class="cx"> 
</span><span class="cx">     // Finally, pop the pending sync reply information.
</span><span class="lines">@@ -768,7 +776,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    auto replyEncoder = std::make_unique&lt;MessageEncoder&gt;(&quot;IPC&quot;, &quot;SyncMessageReply&quot;, syncRequestID);
</del><ins>+    auto replyEncoder = std::make_unique&lt;MessageEncoder&gt;(&quot;IPC&quot;, &quot;SyncMessageReply&quot;, syncRequestID, decoder.UUID());
</ins><span class="cx"> 
</span><span class="cx">     // Hand off both the decoder and encoder to the client.
</span><span class="cx">     m_client-&gt;didReceiveSyncMessage(*this, decoder, replyEncoder);
</span><span class="lines">@@ -815,6 +823,8 @@
</span><span class="cx"> 
</span><span class="cx"> void Connection::dispatchMessage(std::unique_ptr&lt;MessageDecoder&gt; message)
</span><span class="cx"> {
</span><ins>+    MessageRecorder::recordIncomingMessage(*this, *message);
+
</ins><span class="cx">     if (!m_client)
</span><span class="cx">         return;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2PlatformIPCConnectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Platform/IPC/Connection.h (179325 => 179326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Platform/IPC/Connection.h        2015-01-29 02:32:19 UTC (rev 179325)
+++ trunk/Source/WebKit2/Platform/IPC/Connection.h        2015-01-29 02:32:24 UTC (rev 179326)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> #include &quot;MessageDecoder.h&quot;
</span><span class="cx"> #include &quot;MessageEncoder.h&quot;
</span><span class="cx"> #include &quot;MessageReceiver.h&quot;
</span><ins>+#include &quot;ProcessType.h&quot;
</ins><span class="cx"> #include &quot;WorkQueue.h&quot;
</span><span class="cx"> #include &lt;atomic&gt;
</span><span class="cx"> #include &lt;condition_variable&gt;
</span><span class="lines">@@ -90,6 +91,8 @@
</span><span class="cx">     public:
</span><span class="cx">         virtual void didClose(Connection&amp;) = 0;
</span><span class="cx">         virtual void didReceiveInvalidMessage(Connection&amp;, StringReference messageReceiverName, StringReference messageName) = 0;
</span><ins>+        virtual IPC::ProcessType localProcessType() = 0;
+        virtual IPC::ProcessType remoteProcessType() = 0;
</ins><span class="cx"> 
</span><span class="cx">     protected:
</span><span class="cx">         virtual ~Client() { }
</span><span class="lines">@@ -120,8 +123,9 @@
</span><span class="cx">         OSObjectPtr&lt;xpc_connection_t&gt; xpcConnection;
</span><span class="cx">     };
</span><span class="cx">     static bool identifierIsNull(Identifier identifier) { return identifier.port == MACH_PORT_NULL; }
</span><del>-    xpc_connection_t xpcConnection() { return m_xpcConnection.get(); }
</del><ins>+    xpc_connection_t xpcConnection() const { return m_xpcConnection.get(); }
</ins><span class="cx">     bool getAuditToken(audit_token_t&amp;);
</span><ins>+    pid_t remoteProcessID() const;
</ins><span class="cx"> #elif USE(UNIX_DOMAIN_SOCKETS)
</span><span class="cx">     typedef int Identifier;
</span><span class="cx">     static bool identifierIsNull(Identifier identifier) { return !identifier; }
</span><span class="lines">@@ -174,7 +178,7 @@
</span><span class="cx">     template&lt;typename T&gt; bool waitForAndDispatchImmediately(uint64_t destinationID, std::chrono::milliseconds timeout, unsigned waitForMessageFlags = 0);
</span><span class="cx"> 
</span><span class="cx">     std::unique_ptr&lt;MessageEncoder&gt; createSyncMessageEncoder(StringReference messageReceiverName, StringReference messageName, uint64_t destinationID, uint64_t&amp; syncRequestID);
</span><del>-    bool sendMessage(std::unique_ptr&lt;MessageEncoder&gt;, unsigned messageSendFlags = 0);
</del><ins>+    bool sendMessage(std::unique_ptr&lt;MessageEncoder&gt;, unsigned messageSendFlags = 0, bool alreadyRecordedMessage = false);
</ins><span class="cx">     std::unique_ptr&lt;MessageDecoder&gt; sendSyncMessage(uint64_t syncRequestID, std::unique_ptr&lt;MessageEncoder&gt;, std::chrono::milliseconds timeout, unsigned syncSendFlags = 0);
</span><span class="cx">     std::unique_ptr&lt;MessageDecoder&gt; sendSyncMessageFromSecondaryThread(uint64_t syncRequestID, std::unique_ptr&lt;MessageEncoder&gt;, std::chrono::milliseconds timeout);
</span><span class="cx">     bool sendSyncReply(std::unique_ptr&lt;MessageEncoder&gt;);
</span><span class="lines">@@ -193,13 +197,13 @@
</span><span class="cx">     void terminateSoon(double intervalInSeconds);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    bool isValid() const { return m_client; }
+
</ins><span class="cx"> private:
</span><span class="cx">     Connection(Identifier, bool isServer, Client&amp;, WTF::RunLoop&amp; clientRunLoop);
</span><span class="cx">     void platformInitialize(Identifier);
</span><span class="cx">     void platformInvalidate();
</span><span class="cx">     
</span><del>-    bool isValid() const { return m_client; }
-    
</del><span class="cx">     std::unique_ptr&lt;MessageDecoder&gt; waitForMessage(StringReference messageReceiverName, StringReference messageName, uint64_t destinationID, std::chrono::milliseconds timeout, unsigned waitForMessageFlags);
</span><span class="cx">     
</span><span class="cx">     std::unique_ptr&lt;MessageDecoder&gt; waitForSyncReply(uint64_t syncRequestID, std::chrono::milliseconds timeout, unsigned syncSendFlags);
</span></span></pre></div>
<a id="trunkSourceWebKit2PlatformIPCMessageDecodercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Platform/IPC/MessageDecoder.cpp (179325 => 179326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Platform/IPC/MessageDecoder.cpp        2015-01-29 02:32:19 UTC (rev 179325)
+++ trunk/Source/WebKit2/Platform/IPC/MessageDecoder.cpp        2015-01-29 02:32:24 UTC (rev 179326)
</span><span class="lines">@@ -53,7 +53,10 @@
</span><span class="cx">     if (!decode(m_messageName))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    decode(m_destinationID);
</del><ins>+    if (!decode(m_destinationID))
+        return;
+
+    decode(m_UUID);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool MessageDecoder::isSyncMessage() const
</span></span></pre></div>
<a id="trunkSourceWebKit2PlatformIPCMessageDecoderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Platform/IPC/MessageDecoder.h (179325 => 179326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Platform/IPC/MessageDecoder.h        2015-01-29 02:32:19 UTC (rev 179325)
+++ trunk/Source/WebKit2/Platform/IPC/MessageDecoder.h        2015-01-29 02:32:24 UTC (rev 179326)
</span><span class="lines">@@ -27,7 +27,9 @@
</span><span class="cx"> #define MessageDecoder_h
</span><span class="cx"> 
</span><span class="cx"> #include &quot;ArgumentDecoder.h&quot;
</span><ins>+#include &quot;MessageRecorder.h&quot;
</ins><span class="cx"> #include &quot;StringReference.h&quot;
</span><ins>+#include &lt;uuid/uuid.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace IPC {
</span><span class="cx"> 
</span><span class="lines">@@ -50,6 +52,10 @@
</span><span class="cx">     void setImportanceAssertion(std::unique_ptr&lt;ImportanceAssertion&gt;);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    void setMessageProcessingToken(std::unique_ptr&lt;MessageRecorder::MessageProcessingToken&gt; token) { m_processingToken = WTF::move(token); }
+
+    const uuid_t&amp; UUID() const { return m_UUID; }
+
</ins><span class="cx"> private:
</span><span class="cx">     uint8_t m_messageFlags;
</span><span class="cx">     StringReference m_messageReceiverName;
</span><span class="lines">@@ -57,9 +63,13 @@
</span><span class="cx"> 
</span><span class="cx">     uint64_t m_destinationID;
</span><span class="cx"> 
</span><ins>+    uuid_t m_UUID;
+
</ins><span class="cx"> #if PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1090
</span><span class="cx">     std::unique_ptr&lt;ImportanceAssertion&gt; m_importanceAssertion;
</span><span class="cx"> #endif
</span><ins>+
+    std::unique_ptr&lt;MessageRecorder::MessageProcessingToken&gt; m_processingToken;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace IPC
</span></span></pre></div>
<a id="trunkSourceWebKit2PlatformIPCMessageEncodercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Platform/IPC/MessageEncoder.cpp (179325 => 179326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Platform/IPC/MessageEncoder.cpp        2015-01-29 02:32:19 UTC (rev 179325)
+++ trunk/Source/WebKit2/Platform/IPC/MessageEncoder.cpp        2015-01-29 02:32:24 UTC (rev 179326)
</span><span class="lines">@@ -28,26 +28,56 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;ArgumentCoders.h&quot;
</span><span class="cx"> #include &quot;MessageFlags.h&quot;
</span><ins>+#include &quot;MessageRecorder.h&quot;
</ins><span class="cx"> #include &quot;StringReference.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace IPC {
</span><span class="cx"> 
</span><span class="cx"> static uint8_t defaultMessageFlags = 0;
</span><span class="cx"> 
</span><ins>+MessageEncoder::MessageEncoder(StringReference messageReceiverName, StringReference messageName, uint64_t destinationID, const uuid_t&amp; UUID)
+    : m_messageReceiverName(messageReceiverName)
+    , m_messageName(messageName)
+    , m_destinationID(destinationID)
+{
+    uuid_copy(m_UUID, UUID);
+    encodeHeader();
+}
+
</ins><span class="cx"> MessageEncoder::MessageEncoder(StringReference messageReceiverName, StringReference messageName, uint64_t destinationID)
</span><ins>+    : m_messageReceiverName(messageReceiverName)
+    , m_messageName(messageName)
+    , m_destinationID(destinationID)
</ins><span class="cx"> {
</span><del>-    ASSERT(!messageReceiverName.isEmpty());
</del><ins>+    uuid_generate(m_UUID);
+    encodeHeader();
+}
</ins><span class="cx"> 
</span><ins>+MessageEncoder::~MessageEncoder()
+{
+}
+
+void MessageEncoder::encodeHeader()
+{
+    ASSERT(!m_messageReceiverName.isEmpty());
+
</ins><span class="cx">     *this &lt;&lt; defaultMessageFlags;
</span><del>-    *this &lt;&lt; messageReceiverName;
-    *this &lt;&lt; messageName;
-    *this &lt;&lt; destinationID;
</del><ins>+    *this &lt;&lt; m_messageReceiverName;
+    *this &lt;&lt; m_messageName;
+    *this &lt;&lt; m_destinationID;
+    *this &lt;&lt; m_UUID;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-MessageEncoder::~MessageEncoder()
</del><ins>+bool MessageEncoder::isSyncMessage() const
</ins><span class="cx"> {
</span><ins>+    return *buffer() &amp; SyncMessage;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool MessageEncoder::shouldDispatchMessageWhenWaitingForSyncReply() const
+{
+    return *buffer() &amp; DispatchMessageWhenWaitingForSyncReply;
+}
+
</ins><span class="cx"> void MessageEncoder::setIsSyncMessage(bool isSyncMessage)
</span><span class="cx"> {
</span><span class="cx">     if (isSyncMessage)
</span></span></pre></div>
<a id="trunkSourceWebKit2PlatformIPCMessageEncoderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Platform/IPC/MessageEncoder.h (179325 => 179326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Platform/IPC/MessageEncoder.h        2015-01-29 02:32:19 UTC (rev 179325)
+++ trunk/Source/WebKit2/Platform/IPC/MessageEncoder.h        2015-01-29 02:32:24 UTC (rev 179326)
</span><span class="lines">@@ -27,6 +27,8 @@
</span><span class="cx"> #define MessageEncoder_h
</span><span class="cx"> 
</span><span class="cx"> #include &quot;ArgumentEncoder.h&quot;
</span><ins>+#include &quot;StringReference.h&quot;
+#include &lt;uuid/uuid.h&gt;
</ins><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace IPC {
</span><span class="lines">@@ -36,10 +38,28 @@
</span><span class="cx"> class MessageEncoder : public ArgumentEncoder {
</span><span class="cx"> public:
</span><span class="cx">     MessageEncoder(StringReference messageReceiverName, StringReference messageName, uint64_t destinationID);
</span><ins>+    MessageEncoder(StringReference messageReceiverName, StringReference messageName, uint64_t destinationID, const uuid_t&amp;);
</ins><span class="cx">     virtual ~MessageEncoder();
</span><span class="cx"> 
</span><ins>+    StringReference messageReceiverName() const { return m_messageReceiverName; }
+    StringReference messageName() const { return m_messageName; }
+    uint64_t destinationID() const { return m_destinationID; }
+
</ins><span class="cx">     void setIsSyncMessage(bool);
</span><ins>+    bool isSyncMessage() const;
+
</ins><span class="cx">     void setShouldDispatchMessageWhenWaitingForSyncReply(bool);
</span><ins>+    bool shouldDispatchMessageWhenWaitingForSyncReply() const;
+
+    const uuid_t&amp; UUID() const { return m_UUID; }
+
+private:
+    void encodeHeader();
+
+    StringReference m_messageReceiverName;
+    StringReference m_messageName;
+    uint64_t m_destinationID;
+    uuid_t m_UUID;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace IPC
</span></span></pre></div>
<a id="trunkSourceWebKit2PlatformIPCMessageRecordercpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/Platform/IPC/MessageRecorder.cpp (0 => 179326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Platform/IPC/MessageRecorder.cpp                                (rev 0)
+++ trunk/Source/WebKit2/Platform/IPC/MessageRecorder.cpp        2015-01-29 02:32:24 UTC (rev 179326)
</span><span class="lines">@@ -0,0 +1,116 @@
</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.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;MessageRecorder.h&quot;
+
+#include &quot;Connection.h&quot;
+#include &quot;MessageDecoder.h&quot;
+#include &quot;MessageEncoder.h&quot;
+#include &quot;MessageRecorderProbes.h&quot;
+#include &lt;wtf/CurrentTime.h&gt;
+
+namespace IPC {
+
+bool MessageRecorder::isEnabled()
+{
+    return WEBKITMESSAGERECORDER_MESSAGE_RECEIVED_ENABLED() || WEBKITMESSAGERECORDER_MESSAGE_SENT_ENABLED();
+}
+
+std::unique_ptr&lt;MessageRecorder::MessageProcessingToken&gt; MessageRecorder::recordOutgoingMessage(Connection&amp; connection, MessageEncoder&amp; encoder)
+{
+    if (!isEnabled() || !connection.isValid())
+        return nullptr;
+
+    WebKitMessageRecord record;
+    record.sourceProcessType = static_cast&lt;uint64_t&gt;(connection.client()-&gt;localProcessType());
+    record.destinationProcessType = static_cast&lt;uint64_t&gt;(connection.client()-&gt;remoteProcessType());
+    record.destinationID = encoder.destinationID();
+    record.isSyncMessage = encoder.isSyncMessage();
+    record.shouldDispatchMessageWhenWaitingForSyncReply = encoder.shouldDispatchMessageWhenWaitingForSyncReply();
+    record.sourceProcessID = getpid();
+    record.destinationProcessID = connection.remoteProcessID();
+    record.isIncoming = false;
+
+    record.messageReceiverName = MallocPtr&lt;char&gt;::malloc(sizeof(char) * (encoder.messageReceiverName().size() + 1));
+    strncpy(record.messageReceiverName.get(), encoder.messageReceiverName().data(), encoder.messageReceiverName().size());
+    record.messageReceiverName.get()[encoder.messageReceiverName().size()] = 0;
+
+    record.messageName = MallocPtr&lt;char&gt;::malloc(sizeof(char) * (encoder.messageName().size() + 1));
+    strncpy(record.messageName.get(), encoder.messageName().data(), encoder.messageName().size());
+    record.messageName.get()[encoder.messageName().size()] = 0;
+
+    uuid_copy(record.UUID, encoder.UUID());
+
+    return std::make_unique&lt;MessageProcessingToken&gt;(WTF::move(record));
+}
+
+void MessageRecorder::recordIncomingMessage(Connection&amp; connection, MessageDecoder&amp; decoder)
+{
+    if (!isEnabled() || !connection.isValid())
+        return;
+
+    WebKitMessageRecord record;
+    record.sourceProcessType = static_cast&lt;uint64_t&gt;(connection.client()-&gt;remoteProcessType());
+    record.destinationProcessType = static_cast&lt;uint64_t&gt;(connection.client()-&gt;localProcessType());
+    record.destinationID = decoder.destinationID();
+    record.isSyncMessage = decoder.isSyncMessage();
+    record.shouldDispatchMessageWhenWaitingForSyncReply = decoder.shouldDispatchMessageWhenWaitingForSyncReply();
+    record.sourceProcessID = connection.remoteProcessID();
+    record.destinationProcessID = getpid();
+    record.isIncoming = true;
+
+    record.messageReceiverName = MallocPtr&lt;char&gt;::malloc(sizeof(char) * (decoder.messageReceiverName().size() + 1));
+    strncpy(record.messageReceiverName.get(), decoder.messageReceiverName().data(), decoder.messageReceiverName().size());
+    record.messageReceiverName.get()[decoder.messageReceiverName().size()] = 0;
+
+    record.messageName = MallocPtr&lt;char&gt;::malloc(sizeof(char) * (decoder.messageName().size() + 1));
+    strncpy(record.messageName.get(), decoder.messageName().data(), decoder.messageName().size());
+    record.messageName.get()[decoder.messageName().size()] = 0;
+
+    uuid_copy(record.UUID, decoder.UUID());
+
+    decoder.setMessageProcessingToken(std::make_unique&lt;MessageProcessingToken&gt;(WTF::move(record)));
+}
+
+#pragma mark MessageProcessingToken
+
+MessageRecorder::MessageProcessingToken::MessageProcessingToken(WebKitMessageRecord record)
+    : m_record(WTF::move(record))
+{
+    m_record.startTime = monotonicallyIncreasingTime();
+}
+
+MessageRecorder::MessageProcessingToken::~MessageProcessingToken()
+{
+    m_record.endTime = monotonicallyIncreasingTime();
+
+    if (m_record.isIncoming)
+        WEBKITMESSAGERECORDER_MESSAGE_RECEIVED(&amp;m_record);
+    else
+        WEBKITMESSAGERECORDER_MESSAGE_SENT(&amp;m_record);
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebKit2PlatformIPCMessageRecorderh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/Platform/IPC/MessageRecorder.h (0 => 179326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Platform/IPC/MessageRecorder.h                                (rev 0)
+++ trunk/Source/WebKit2/Platform/IPC/MessageRecorder.h        2015-01-29 02:32:24 UTC (rev 179326)
</span><span class="lines">@@ -0,0 +1,87 @@
</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.
+ */
+
+#ifndef MessageRecorder_h
+#define MessageRecorder_h
+
+#include &quot;ProcessType.h&quot;
+#include &lt;uuid/uuid.h&gt;
+#include &lt;wtf/Forward.h&gt;
+#include &lt;wtf/MallocPtr.h&gt;
+#include &lt;wtf/NeverDestroyed.h&gt;
+#include &lt;wtf/text/CString.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+struct WebKitMessageRecord {
+    uint8_t sourceProcessType; // IPC::ProcessType
+    pid_t sourceProcessID;
+
+    uint8_t destinationProcessType; // IPC::ProcessType
+    pid_t destinationProcessID;
+
+    MallocPtr&lt;char&gt; messageReceiverName;
+    MallocPtr&lt;char&gt; messageName;
+    uint64_t destinationID;
+
+    uuid_t UUID;
+
+    double startTime;
+    double endTime;
+
+    bool isSyncMessage;
+    bool shouldDispatchMessageWhenWaitingForSyncReply;
+    bool isIncoming;
+};
+
+namespace IPC {
+
+class Connection;
+class MessageDecoder;
+class MessageEncoder;
+
+class MessageRecorder {
+public:
+    static bool isEnabled();
+
+    class MessageProcessingToken {
+        WTF_MAKE_NONCOPYABLE(MessageProcessingToken);
+    public:
+        explicit MessageProcessingToken(WebKitMessageRecord);
+        ~MessageProcessingToken();
+
+    private:
+        WebKitMessageRecord m_record;
+    };
+
+    static std::unique_ptr&lt;MessageRecorder::MessageProcessingToken&gt; recordOutgoingMessage(IPC::Connection&amp;, IPC::MessageEncoder&amp;);
+    static void recordIncomingMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;);
+
+private:
+    explicit MessageRecorder() { }
+};
+
+};
+
+#endif // MessageRecorder_h
</ins></span></pre></div>
<a id="trunkSourceWebKit2PlatformIPCMessageRecorderProbesd"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/Platform/IPC/MessageRecorderProbes.d (0 => 179326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Platform/IPC/MessageRecorderProbes.d                                (rev 0)
+++ trunk/Source/WebKit2/Platform/IPC/MessageRecorderProbes.d        2015-01-29 02:32:24 UTC (rev 179326)
</span><span class="lines">@@ -0,0 +1,31 @@
</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.
+ */
+
+struct WebKitMessageRecord;
+
+provider WebKitMessageRecorder {
+    probe message_sent(struct WebKitMessageRecord*);
+    probe message_received(struct WebKitMessageRecord*);
+};
</ins></span></pre></div>
<a id="trunkSourceWebKit2PlatformIPCProcessTypeh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/Platform/IPC/ProcessType.h (0 => 179326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Platform/IPC/ProcessType.h                                (rev 0)
+++ trunk/Source/WebKit2/Platform/IPC/ProcessType.h        2015-01-29 02:32:24 UTC (rev 179326)
</span><span class="lines">@@ -0,0 +1,41 @@
</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.
+ */
+
+#ifndef ProcessType_h
+#define ProcessType_h
+
+namespace IPC {
+
+enum class ProcessType : uint8_t {
+    UI,
+    Web,
+    Network,
+    Database,
+    Plugin
+};
+
+};
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKit2PlatformIPCmacConnectionMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm (179325 => 179326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm        2015-01-29 02:32:19 UTC (rev 179325)
+++ trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm        2015-01-29 02:32:24 UTC (rev 179326)
</span><span class="lines">@@ -609,6 +609,14 @@
</span><span class="cx">     if ((flags &amp; InformPlatformProcessWillSuspend) &amp;&amp; WebCore::AXObjectCache::accessibilityEnabled())
</span><span class="cx">         _AXUIElementNotifyProcessSuspendStatus(AXSuspendStatusRunning);
</span><span class="cx"> #endif
</span><del>-}    
</del><ins>+}
+
+pid_t Connection::remoteProcessID() const
+{
+    if (!m_xpcConnection)
+        return 0;
+
+    return xpc_connection_get_pid(m_xpcConnection.get());
+}
</ins><span class="cx">     
</span><span class="cx"> } // namespace IPC
</span></span></pre></div>
<a id="trunkSourceWebKit2PluginProcessPluginProcessh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/PluginProcess/PluginProcess.h (179325 => 179326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/PluginProcess/PluginProcess.h        2015-01-29 02:32:19 UTC (rev 179325)
+++ trunk/Source/WebKit2/PluginProcess/PluginProcess.h        2015-01-29 02:32:24 UTC (rev 179326)
</span><span class="lines">@@ -91,6 +91,8 @@
</span><span class="cx">     virtual void didReceiveMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;) override;
</span><span class="cx">     virtual void didClose(IPC::Connection&amp;) override;
</span><span class="cx">     virtual void didReceiveInvalidMessage(IPC::Connection&amp;, IPC::StringReference messageReceiverName, IPC::StringReference messageName) override;
</span><ins>+    virtual IPC::ProcessType localProcessType() override { return IPC::ProcessType::Plugin; }
+    virtual IPC::ProcessType remoteProcessType() override { return IPC::ProcessType::UI; }
</ins><span class="cx"> 
</span><span class="cx">     // Message handlers.
</span><span class="cx">     void didReceivePluginProcessMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;);
</span></span></pre></div>
<a id="trunkSourceWebKit2PluginProcessWebProcessConnectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/PluginProcess/WebProcessConnection.h (179325 => 179326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/PluginProcess/WebProcessConnection.h        2015-01-29 02:32:19 UTC (rev 179325)
+++ trunk/Source/WebKit2/PluginProcess/WebProcessConnection.h        2015-01-29 02:32:24 UTC (rev 179326)
</span><span class="lines">@@ -69,6 +69,8 @@
</span><span class="cx">     virtual void didReceiveSyncMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;, std::unique_ptr&lt;IPC::MessageEncoder&gt;&amp;) override;
</span><span class="cx">     virtual void didClose(IPC::Connection&amp;) override;
</span><span class="cx">     virtual void didReceiveInvalidMessage(IPC::Connection&amp;, IPC::StringReference messageReceiverName, IPC::StringReference messageName) override;
</span><ins>+    virtual IPC::ProcessType localProcessType() override { return IPC::ProcessType::Plugin; }
+    virtual IPC::ProcessType remoteProcessType() override { return IPC::ProcessType::Web; }
</ins><span class="cx"> 
</span><span class="cx">     // Message handlers.
</span><span class="cx">     void didReceiveWebProcessConnectionMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessDatabasesDatabaseProcessProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Databases/DatabaseProcessProxy.h (179325 => 179326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Databases/DatabaseProcessProxy.h        2015-01-29 02:32:19 UTC (rev 179325)
+++ trunk/Source/WebKit2/UIProcess/Databases/DatabaseProcessProxy.h        2015-01-29 02:32:24 UTC (rev 179326)
</span><span class="lines">@@ -54,6 +54,8 @@
</span><span class="cx">     virtual void didReceiveMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;) override;
</span><span class="cx">     virtual void didClose(IPC::Connection&amp;) override;
</span><span class="cx">     virtual void didReceiveInvalidMessage(IPC::Connection&amp;, IPC::StringReference messageReceiverName, IPC::StringReference messageName) override;
</span><ins>+    virtual IPC::ProcessType localProcessType() override { return IPC::ProcessType::UI; }
+    virtual IPC::ProcessType remoteProcessType() override { return IPC::ProcessType::Database; }
</ins><span class="cx"> 
</span><span class="cx">     void didReceiveDatabaseProcessProxyMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessNetworkNetworkProcessProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h (179325 => 179326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h        2015-01-29 02:32:19 UTC (rev 179325)
+++ trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h        2015-01-29 02:32:24 UTC (rev 179326)
</span><span class="lines">@@ -83,6 +83,8 @@
</span><span class="cx">     virtual void didReceiveSyncMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;, std::unique_ptr&lt;IPC::MessageEncoder&gt;&amp;) override;
</span><span class="cx">     virtual void didClose(IPC::Connection&amp;) override;
</span><span class="cx">     virtual void didReceiveInvalidMessage(IPC::Connection&amp;, IPC::StringReference messageReceiverName, IPC::StringReference messageName) override;
</span><ins>+    virtual IPC::ProcessType localProcessType() override { return IPC::ProcessType::UI; }
+    virtual IPC::ProcessType remoteProcessType() override { return IPC::ProcessType::Network; }
</ins><span class="cx"> 
</span><span class="cx">     // Message handlers
</span><span class="cx">     void didReceiveNetworkProcessProxyMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessPluginsPluginProcessProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.h (179325 => 179326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.h        2015-01-29 02:32:19 UTC (rev 179325)
+++ trunk/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.h        2015-01-29 02:32:24 UTC (rev 179326)
</span><span class="lines">@@ -120,6 +120,8 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void didClose(IPC::Connection&amp;) override;
</span><span class="cx">     virtual void didReceiveInvalidMessage(IPC::Connection&amp;, IPC::StringReference messageReceiverName, IPC::StringReference messageName) override;
</span><ins>+    virtual IPC::ProcessType localProcessType() override { return IPC::ProcessType::UI; }
+    virtual IPC::ProcessType remoteProcessType() override { return IPC::ProcessType::Plugin; }
</ins><span class="cx"> 
</span><span class="cx">     // ProcessLauncher::Client
</span><span class="cx">     virtual void didFinishLaunching(ProcessLauncher*, IPC::Connection::Identifier) override;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebProcessProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebProcessProxy.h (179325 => 179326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebProcessProxy.h        2015-01-29 02:32:19 UTC (rev 179325)
+++ trunk/Source/WebKit2/UIProcess/WebProcessProxy.h        2015-01-29 02:32:24 UTC (rev 179326)
</span><span class="lines">@@ -184,6 +184,8 @@
</span><span class="cx">     virtual void didReceiveSyncMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;, std::unique_ptr&lt;IPC::MessageEncoder&gt;&amp;) override;
</span><span class="cx">     virtual void didClose(IPC::Connection&amp;) override;
</span><span class="cx">     virtual void didReceiveInvalidMessage(IPC::Connection&amp;, IPC::StringReference messageReceiverName, IPC::StringReference messageName) override;
</span><ins>+    virtual IPC::ProcessType localProcessType() override { return IPC::ProcessType::UI; }
+    virtual IPC::ProcessType remoteProcessType() override { return IPC::ProcessType::Web; }
</ins><span class="cx"> 
</span><span class="cx">     // ResponsivenessTimer::Client
</span><span class="cx">     void didBecomeUnresponsive(ResponsivenessTimer*) override;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (179325 => 179326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2015-01-29 02:32:19 UTC (rev 179325)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2015-01-29 02:32:24 UTC (rev 179326)
</span><span class="lines">@@ -595,6 +595,9 @@
</span><span class="cx">                 2D429BFD1721E2C700EC681F /* PDFPluginPasswordField.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D429BFB1721E2BA00EC681F /* PDFPluginPasswordField.mm */; };
</span><span class="cx">                 2D47B56C1810714E003A3AEE /* RemoteLayerBackingStore.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D47B56A1810714E003A3AEE /* RemoteLayerBackingStore.mm */; };
</span><span class="cx">                 2D47B56D1810714E003A3AEE /* RemoteLayerBackingStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D47B56B1810714E003A3AEE /* RemoteLayerBackingStore.h */; };
</span><ins>+                2D5AB62E1A69D6FB0014A9CB /* MessageRecorder.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D5AB62B1A69D6FB0014A9CB /* MessageRecorder.h */; };
+                2D5AB62F1A69D6FB0014A9CB /* MessageRecorder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D5AB62C1A69D6FB0014A9CB /* MessageRecorder.cpp */; };
+                2D5AB6301A69D6FB0014A9CB /* MessageRecorderProbes.d in Sources */ = {isa = PBXBuildFile; fileRef = 2D5AB62D1A69D6FB0014A9CB /* MessageRecorderProbes.d */; };
</ins><span class="cx">                 2D5C9D0519C81D8F00B3C5C1 /* WebPageOverlay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D5C9D0319C81D8F00B3C5C1 /* WebPageOverlay.cpp */; };
</span><span class="cx">                 2D5C9D0619C81D8F00B3C5C1 /* WebPageOverlay.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D5C9D0419C81D8F00B3C5C1 /* WebPageOverlay.h */; };
</span><span class="cx">                 2D6AB541192B1C4A003A9FD1 /* WKPDFPageNumberIndicator.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D6AB53F192B1C4A003A9FD1 /* WKPDFPageNumberIndicator.h */; };
</span><span class="lines">@@ -605,6 +608,7 @@
</span><span class="cx">                 2D6CD11A189058A500E5A4A0 /* ViewSnapshotStore.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D6CD118189058A500E5A4A0 /* ViewSnapshotStore.mm */; };
</span><span class="cx">                 2D7AAFD318C8640600A7ACD4 /* WKWebViewContentProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D7AAFD218C8640600A7ACD4 /* WKWebViewContentProvider.h */; };
</span><span class="cx">                 2D7AAFD618C956AF00A7ACD4 /* WKWebViewConfigurationInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D7AAFD518C956AF00A7ACD4 /* WKWebViewConfigurationInternal.h */; };
</span><ins>+                2D7F13101A702FBA009A6FBD /* ProcessType.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D7F130F1A702FBA009A6FBD /* ProcessType.h */; };
</ins><span class="cx">                 2D819B9E18627EE9001F03D1 /* ViewGestureGeometryCollector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D819B99186275B3001F03D1 /* ViewGestureGeometryCollector.cpp */; };
</span><span class="cx">                 2D819BA11862800E001F03D1 /* ViewGestureGeometryCollectorMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D819B9F1862800E001F03D1 /* ViewGestureGeometryCollectorMessageReceiver.cpp */; };
</span><span class="cx">                 2D819BA21862800E001F03D1 /* ViewGestureGeometryCollectorMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D819BA01862800E001F03D1 /* ViewGestureGeometryCollectorMessages.h */; };
</span><span class="lines">@@ -2675,6 +2679,9 @@
</span><span class="cx">                 2D429BFB1721E2BA00EC681F /* PDFPluginPasswordField.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = PDFPluginPasswordField.mm; path = PDF/PDFPluginPasswordField.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2D47B56A1810714E003A3AEE /* RemoteLayerBackingStore.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RemoteLayerBackingStore.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2D47B56B1810714E003A3AEE /* RemoteLayerBackingStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteLayerBackingStore.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                2D5AB62B1A69D6FB0014A9CB /* MessageRecorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MessageRecorder.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                2D5AB62C1A69D6FB0014A9CB /* MessageRecorder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MessageRecorder.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                2D5AB62D1A69D6FB0014A9CB /* MessageRecorderProbes.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = MessageRecorderProbes.d; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 2D5C9D0319C81D8F00B3C5C1 /* WebPageOverlay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPageOverlay.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2D5C9D0419C81D8F00B3C5C1 /* WebPageOverlay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPageOverlay.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2D6AB53F192B1C4A003A9FD1 /* WKPDFPageNumberIndicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WKPDFPageNumberIndicator.h; path = ios/WKPDFPageNumberIndicator.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -2687,6 +2694,7 @@
</span><span class="cx">                 2D70AB1418A1D57C00026D6E /* Info-iOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = &quot;Info-iOS.plist&quot;; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2D7AAFD218C8640600A7ACD4 /* WKWebViewContentProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebViewContentProvider.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2D7AAFD518C956AF00A7ACD4 /* WKWebViewConfigurationInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebViewConfigurationInternal.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                2D7F130F1A702FBA009A6FBD /* ProcessType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProcessType.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 2D819B99186275B3001F03D1 /* ViewGestureGeometryCollector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ViewGestureGeometryCollector.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2D819B9A186275B3001F03D1 /* ViewGestureGeometryCollector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewGestureGeometryCollector.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2D819B9B186275B3001F03D1 /* ViewGestureGeometryCollector.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ViewGestureGeometryCollector.messages.in; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -4822,8 +4830,12 @@
</span><span class="cx">                                 1A3EED11161A53D600AEB4F5 /* MessageReceiver.h */,
</span><span class="cx">                                 1A3EED0C161A535300AEB4F5 /* MessageReceiverMap.cpp */,
</span><span class="cx">                                 1A3EED0D161A535300AEB4F5 /* MessageReceiverMap.h */,
</span><ins>+                                2D5AB62B1A69D6FB0014A9CB /* MessageRecorder.h */,
+                                2D5AB62C1A69D6FB0014A9CB /* MessageRecorder.cpp */,
+                                2D5AB62D1A69D6FB0014A9CB /* MessageRecorderProbes.d */,
</ins><span class="cx">                                 1AAB0377185A7C6A00EDF501 /* MessageSender.cpp */,
</span><span class="cx">                                 1AAB0378185A7C6A00EDF501 /* MessageSender.h */,
</span><ins>+                                2D7F130F1A702FBA009A6FBD /* ProcessType.h */,
</ins><span class="cx">                                 1AE00D6918327C1200087DD7 /* StringReference.cpp */,
</span><span class="cx">                                 1AE00D6A18327C1200087DD7 /* StringReference.h */,
</span><span class="cx">                         );
</span><span class="lines">@@ -7343,6 +7355,7 @@
</span><span class="cx">                         isa = PBXHeadersBuildPhase;
</span><span class="cx">                         buildActionMask = 2147483647;
</span><span class="cx">                         files = (
</span><ins>+                                2D7F13101A702FBA009A6FBD /* ProcessType.h in Headers */,
</ins><span class="cx">                                 37A5E01418BBF93F000A081E /* _WKActivatedElementInfo.h in Headers */,
</span><span class="cx">                                 379A873618BBFA4300588AF2 /* _WKActivatedElementInfoInternal.h in Headers */,
</span><span class="cx">                                 A1A4FE5A18DCE9FA00B5EA8A /* _WKDownload.h in Headers */,
</span><span class="lines">@@ -7605,6 +7618,7 @@
</span><span class="cx">                                 1AA56F2911E92BC80061B882 /* PluginController.h in Headers */,
</span><span class="cx">                                 1A8EF4CB1252403700F7067F /* PluginControllerProxy.h in Headers */,
</span><span class="cx">                                 1A8EF96F1252AF6B00F7067F /* PluginControllerProxyMessages.h in Headers */,
</span><ins>+                                2D5AB62E1A69D6FB0014A9CB /* MessageRecorder.h in Headers */,
</ins><span class="cx">                                 1A179780137EE82C00F97D45 /* PluginCreationParameters.h in Headers */,
</span><span class="cx">                                 7C3F8C91173AF52D007B7F39 /* PluginInformation.h in Headers */,
</span><span class="cx">                                 7C89D2B41A6B068C003A5FDE /* APIUserContentFilter.h in Headers */,
</span><span class="lines">@@ -9396,6 +9410,7 @@
</span><span class="cx">                                 1AFDE6591954A42B00C48FFA /* SessionState.cpp in Sources */,
</span><span class="cx">                                 1A002D48196B345D00B9AD44 /* SessionStateCoding.mm in Sources */,
</span><span class="cx">                                 1A7284481959F8040007BCE5 /* SessionStateConversion.cpp in Sources */,
</span><ins>+                                2D5AB6301A69D6FB0014A9CB /* MessageRecorderProbes.d in Sources */,
</ins><span class="cx">                                 753E3E0D1887398500188496 /* SessionTracker.cpp in Sources */,
</span><span class="cx">                                 1A6420E412DCE2FF00CAAE2C /* ShareableBitmap.cpp in Sources */,
</span><span class="cx">                                 C01A260112662F2100C9ED55 /* ShareableBitmapCG.cpp in Sources */,
</span><span class="lines">@@ -9505,6 +9520,7 @@
</span><span class="cx">                                 BC111B5E112F629800337BAB /* WebEventFactory.mm in Sources */,
</span><span class="cx">                                 1A3DD1FD125E59F3004515E6 /* WebFindClient.cpp in Sources */,
</span><span class="cx">                                 BCE469531214E6CB000B98EB /* WebFormClient.cpp in Sources */,
</span><ins>+                                2D5AB62F1A69D6FB0014A9CB /* MessageRecorder.cpp in Sources */,
</ins><span class="cx">                                 BCE469551214E6CB000B98EB /* WebFormSubmissionListenerProxy.cpp in Sources */,
</span><span class="cx">                                 BC111ADD112F5B9300337BAB /* WebFrame.cpp in Sources */,
</span><span class="cx">                                 BCE469791214F2B4000B98EB /* WebFrameListenerProxy.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessDatabasesWebToDatabaseProcessConnectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Databases/WebToDatabaseProcessConnection.h (179325 => 179326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Databases/WebToDatabaseProcessConnection.h        2015-01-29 02:32:19 UTC (rev 179325)
+++ trunk/Source/WebKit2/WebProcess/Databases/WebToDatabaseProcessConnection.h        2015-01-29 02:32:24 UTC (rev 179326)
</span><span class="lines">@@ -58,6 +58,8 @@
</span><span class="cx">     virtual void didReceiveMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;) override;
</span><span class="cx">     virtual void didClose(IPC::Connection&amp;) override;
</span><span class="cx">     virtual void didReceiveInvalidMessage(IPC::Connection&amp;, IPC::StringReference messageReceiverName, IPC::StringReference messageName) override;
</span><ins>+    virtual IPC::ProcessType localProcessType() override { return IPC::ProcessType::Web; }
+    virtual IPC::ProcessType remoteProcessType() override { return IPC::ProcessType::Database; }
</ins><span class="cx"> 
</span><span class="cx">     // IPC::MessageSender
</span><span class="cx">     virtual IPC::Connection* messageSenderConnection() override { return m_connection.get(); }
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessNetworkNetworkProcessConnectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Network/NetworkProcessConnection.h (179325 => 179326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Network/NetworkProcessConnection.h        2015-01-29 02:32:19 UTC (rev 179325)
+++ trunk/Source/WebKit2/WebProcess/Network/NetworkProcessConnection.h        2015-01-29 02:32:24 UTC (rev 179326)
</span><span class="lines">@@ -68,6 +68,8 @@
</span><span class="cx">     virtual void didReceiveSyncMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;, std::unique_ptr&lt;IPC::MessageEncoder&gt;&amp;) override;
</span><span class="cx">     virtual void didClose(IPC::Connection&amp;) override;
</span><span class="cx">     virtual void didReceiveInvalidMessage(IPC::Connection&amp;, IPC::StringReference messageReceiverName, IPC::StringReference messageName) override;
</span><ins>+    virtual IPC::ProcessType localProcessType() override { return IPC::ProcessType::Web; }
+    virtual IPC::ProcessType remoteProcessType() override { return IPC::ProcessType::Network; }
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(SHAREABLE_RESOURCE)
</span><span class="cx">     // Message handlers.
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessPluginsPluginProcessConnectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Plugins/PluginProcessConnection.h (179325 => 179326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Plugins/PluginProcessConnection.h        2015-01-29 02:32:19 UTC (rev 179325)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PluginProcessConnection.h        2015-01-29 02:32:24 UTC (rev 179326)
</span><span class="lines">@@ -68,6 +68,8 @@
</span><span class="cx">     virtual void didReceiveSyncMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;, std::unique_ptr&lt;IPC::MessageEncoder&gt;&amp;) override;
</span><span class="cx">     virtual void didClose(IPC::Connection&amp;) override;
</span><span class="cx">     virtual void didReceiveInvalidMessage(IPC::Connection&amp;, IPC::StringReference messageReceiverName, IPC::StringReference messageName) override;
</span><ins>+    virtual IPC::ProcessType localProcessType() override { return IPC::ProcessType::Web; }
+    virtual IPC::ProcessType remoteProcessType() override { return IPC::ProcessType::Plugin; }
</ins><span class="cx"> 
</span><span class="cx">     // Message handlers.
</span><span class="cx">     void didReceivePluginProcessConnectionMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;);
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebInspectorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.h (179325 => 179326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.h        2015-01-29 02:32:19 UTC (rev 179325)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.h        2015-01-29 02:32:24 UTC (rev 179326)
</span><span class="lines">@@ -53,6 +53,8 @@
</span><span class="cx">     // IPC::Connection::Client
</span><span class="cx">     void didClose(IPC::Connection&amp;) override { close(); }
</span><span class="cx">     void didReceiveInvalidMessage(IPC::Connection&amp;, IPC::StringReference, IPC::StringReference) override { close(); }
</span><ins>+    virtual IPC::ProcessType localProcessType() override { return IPC::ProcessType::Web; }
+    virtual IPC::ProcessType remoteProcessType() override { return IPC::ProcessType::UI; }
</ins><span class="cx"> 
</span><span class="cx">     // Called by WebInspector messages
</span><span class="cx">     void connectionEstablished();
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebInspectorUIh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebInspectorUI.h (179325 => 179326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebInspectorUI.h        2015-01-29 02:32:19 UTC (rev 179325)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebInspectorUI.h        2015-01-29 02:32:24 UTC (rev 179326)
</span><span class="lines">@@ -48,6 +48,8 @@
</span><span class="cx">     // IPC::Connection::Client
</span><span class="cx">     void didClose(IPC::Connection&amp;) override { closeWindow(); }
</span><span class="cx">     void didReceiveInvalidMessage(IPC::Connection&amp;, IPC::StringReference, IPC::StringReference) override { closeWindow(); }
</span><ins>+    virtual IPC::ProcessType localProcessType() override { return IPC::ProcessType::Web; }
+    virtual IPC::ProcessType remoteProcessType() override { return IPC::ProcessType::Web; }
</ins><span class="cx"> 
</span><span class="cx">     // Called by WebInspectorUI messages
</span><span class="cx">     void establishConnection(IPC::Attachment connectionIdentifier, uint64_t inspectedPageIdentifier, bool underTest);
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebProcessh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebProcess.h (179325 => 179326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebProcess.h        2015-01-29 02:32:19 UTC (rev 179325)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.h        2015-01-29 02:32:24 UTC (rev 179326)
</span><span class="lines">@@ -290,6 +290,8 @@
</span><span class="cx">     virtual void didReceiveSyncMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;, std::unique_ptr&lt;IPC::MessageEncoder&gt;&amp;) override;
</span><span class="cx">     virtual void didClose(IPC::Connection&amp;) override;
</span><span class="cx">     virtual void didReceiveInvalidMessage(IPC::Connection&amp;, IPC::StringReference messageReceiverName, IPC::StringReference messageName) override;
</span><ins>+    virtual IPC::ProcessType localProcessType() override { return IPC::ProcessType::Web; }
+    virtual IPC::ProcessType remoteProcessType() override { return IPC::ProcessType::UI; }
</ins><span class="cx"> 
</span><span class="cx">     // Implemented in generated WebProcessMessageReceiver.cpp
</span><span class="cx">     void didReceiveWebProcessMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;);
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (179325 => 179326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2015-01-29 02:32:19 UTC (rev 179325)
+++ trunk/Tools/ChangeLog        2015-01-29 02:32:24 UTC (rev 179326)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2015-01-28  Timothy Horton  &lt;timothy_horton@apple.com&gt;
+
+        Add a WebKitMessageRecorder DTrace provider, exposing IPC details to DTrace
+        https://bugs.webkit.org/show_bug.cgi?id=140673
+
+        Reviewed by Sam Weinig.
+
+        * Scripts/dtrace/trace-webkit2-messages.d: Added.
+        Add a DTrace script that outputs a small blob of JSON per message.
+
</ins><span class="cx"> 2015-01-28  Geoffrey Garen  &lt;ggaren@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Removed fastMallocForbid / fastMallocAllow
</span></span></pre></div>
<a id="trunkToolsScriptsdtracetracewebkit2messagesd"></a>
<div class="addfile"><h4>Added: trunk/Tools/Scripts/dtrace/trace-webkit2-messages.d (0 => 179326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/dtrace/trace-webkit2-messages.d                                (rev 0)
+++ trunk/Tools/Scripts/dtrace/trace-webkit2-messages.d        2015-01-29 02:32:24 UTC (rev 179326)
</span><span class="lines">@@ -0,0 +1,96 @@
</span><ins>+#!/usr/sbin/dtrace -qZs
+
+/*
+ * 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.
+ */
+
+struct WebKitMessageRecord {
+    uint8_t sourceProcessType;
+    pid_t sourceProcessID;
+
+    uint8_t destinationProcessType;
+    pid_t destinationProcessID;
+
+    char* messageReceiverName;
+    char* messageName;
+    uint64_t destinationID;
+
+    char UUID[16];
+
+    double startTime;
+    double endTime;
+
+    bool isSyncMessage;
+    bool shouldDispatchMessageWhenWaitingForSyncReply;
+    bool isIncoming;
+};
+
+WebKitMessageRecorder*:::message_*
+{
+    this-&gt;record = (struct WebKitMessageRecord*)copyin(arg0, sizeof(struct WebKitMessageRecord));
+    printf(&quot;{&quot;);
+
+    printf(&quot;\&quot;sourceProcessType\&quot;: %d, &quot;, this-&gt;record-&gt;sourceProcessType);
+    printf(&quot;\&quot;sourceProcessID\&quot;: %d, &quot;, this-&gt;record-&gt;sourceProcessID);
+
+    printf(&quot;\&quot;destinationProcessType\&quot;: %d, &quot;, this-&gt;record-&gt;destinationProcessType);
+    printf(&quot;\&quot;destinationProcessID\&quot;: %d, &quot;, this-&gt;record-&gt;destinationProcessID);
+
+    printf(&quot;\&quot;messageReceiverName\&quot;: \&quot;%s\&quot;, &quot;, copyinstr((user_addr_t)this-&gt;record-&gt;messageReceiverName));
+    printf(&quot;\&quot;messageName\&quot;: \&quot;%s\&quot;, &quot;, copyinstr((user_addr_t)this-&gt;record-&gt;messageName));
+
+    printf(&quot;\&quot;destinationID\&quot;: %d, &quot;, this-&gt;record-&gt;destinationID);
+
+    printf(&quot;\&quot;UUID\&quot;: \&quot;&quot;);
+    printf(&quot;%02x&quot;, this-&gt;record-&gt;UUID[0]);
+    printf(&quot;%02x&quot;, this-&gt;record-&gt;UUID[1]);
+    printf(&quot;%02x&quot;, this-&gt;record-&gt;UUID[2]);
+    printf(&quot;%02x&quot;, this-&gt;record-&gt;UUID[3]);
+    printf(&quot;-&quot;);
+    printf(&quot;%02x&quot;, this-&gt;record-&gt;UUID[4]);
+    printf(&quot;%02x&quot;, this-&gt;record-&gt;UUID[5]);
+    printf(&quot;-&quot;);
+    printf(&quot;%02x&quot;, this-&gt;record-&gt;UUID[6]);
+    printf(&quot;%02x&quot;, this-&gt;record-&gt;UUID[7]);
+    printf(&quot;-&quot;);
+    printf(&quot;%02x&quot;, this-&gt;record-&gt;UUID[8]);
+    printf(&quot;%02x&quot;, this-&gt;record-&gt;UUID[9]);
+    printf(&quot;-&quot;);
+    printf(&quot;%02x&quot;, this-&gt;record-&gt;UUID[10]);
+    printf(&quot;%02x&quot;, this-&gt;record-&gt;UUID[11]);
+    printf(&quot;%02x&quot;, this-&gt;record-&gt;UUID[12]);
+    printf(&quot;%02x&quot;, this-&gt;record-&gt;UUID[13]);
+    printf(&quot;%02x&quot;, this-&gt;record-&gt;UUID[14]);
+    printf(&quot;%02x&quot;, this-&gt;record-&gt;UUID[15]);
+    printf(&quot;\&quot;, &quot;);
+
+    printf(&quot;\&quot;startTime\&quot;: %f, &quot;, this-&gt;record-&gt;startTime);
+    printf(&quot;\&quot;endTime\&quot;: %f, &quot;, this-&gt;record-&gt;endTime);
+
+    printf(&quot;\&quot;isSyncMessage\&quot;: %d, &quot;, this-&gt;record-&gt;isSyncMessage);
+    printf(&quot;\&quot;shouldDispatchMessageWhenWaitingForSyncReply\&quot;: %d, &quot;, this-&gt;record-&gt;shouldDispatchMessageWhenWaitingForSyncReply);
+    printf(&quot;\&quot;isIncoming\&quot;: %d&quot;, this-&gt;record-&gt;isIncoming);
+
+    printf(&quot;}\n&quot;);
+}
</ins><span class="cx">Property changes on: trunk/Tools/Scripts/dtrace/trace-webkit2-messages.d
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnexecutable"></a>
<div class="addfile"><h4>Added: svn:executable</h4></div>
</div>

</body>
</html>