<!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<uuid_t>::encode):
(IPC::ArgumentCoder<uuid_t>::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 "processing" 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 <timothy_horton@apple.com>
+
+ 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<uuid_t>::encode):
+ (IPC::ArgumentCoder<uuid_t>::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 "processing" 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 <pecoraro@apple.com>
</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&, IPC::MessageDecoder&) override;
</span><span class="cx"> virtual void didClose(IPC::Connection&) override;
</span><span class="cx"> virtual void didReceiveInvalidMessage(IPC::Connection&, 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&, IPC::MessageDecoder&);
</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&, IPC::MessageDecoder&, std::unique_ptr<IPC::MessageEncoder>&) override;
</span><span class="cx"> virtual void didClose(IPC::Connection&) override;
</span><span class="cx"> virtual void didReceiveInvalidMessage(IPC::Connection&, 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&, IPC::MessageDecoder&);
</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&, IPC::MessageDecoder&, std::unique_ptr<IPC::MessageEncoder>&);
</span><span class="cx"> virtual void didClose(IPC::Connection&);
</span><span class="cx"> virtual void didReceiveInvalidMessage(IPC::Connection&, 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&, IPC::MessageDecoder&);
</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&, IPC::MessageDecoder&, std::unique_ptr<IPC::MessageEncoder>&) override;
</span><span class="cx"> virtual void didClose(IPC::Connection&) override;
</span><span class="cx"> virtual void didReceiveInvalidMessage(IPC::Connection&, 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<UChar>(decoder, length, result);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void ArgumentCoder<uuid_t>::encode(ArgumentEncoder& encoder, const uuid_t& uuid)
+{
+ SimpleArgumentCoder<uuid_t>::encode(encoder, uuid);
+}
+
+bool ArgumentCoder<uuid_t>::decode(ArgumentDecoder& decoder, uuid_t& uuid)
+{
+ return SimpleArgumentCoder<uuid_t>::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 "ArgumentDecoder.h"
</span><span class="cx"> #include "ArgumentEncoder.h"
</span><span class="cx"> #include <utility>
</span><ins>+#include <uuid/uuid.h>
</ins><span class="cx"> #include <wtf/Forward.h>
</span><span class="cx"> #include <wtf/HashMap.h>
</span><span class="cx"> #include <wtf/HashSet.h>
</span><span class="lines">@@ -298,6 +299,11 @@
</span><span class="cx"> static bool decode(ArgumentDecoder&, String&);
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+template<> struct ArgumentCoder<uuid_t> {
+ static void encode(ArgumentEncoder&, const uuid_t&);
+ static bool decode(ArgumentDecoder&, uuid_t&);
+};
+
</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<MessageEncoder>("IPC", "SyncMessageReply", syncRequestID);
</del><ins>+ auto replyEncoder = std::make_unique<MessageEncoder>("IPC", "SyncMessageReply", syncRequestID, incomingMessageDecoder->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->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<MessageEncoder> encoder, unsigned messageSendFlags)
</del><ins>+bool Connection::sendMessage(std::unique_ptr<MessageEncoder> 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->setShouldDispatchMessageWhenWaitingForSyncReply(true);
</span><span class="cx">
</span><ins>+ std::unique_ptr<MessageRecorder::MessageProcessingToken> token;
+ if (!alreadyRecordedMessage)
+ token = MessageRecorder::recordOutgoingMessage(*this, *encoder);
+
</ins><span class="cx"> {
</span><span class="cx"> std::lock_guard<std::mutex> 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, &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<MessageEncoder>("IPC", "SyncMessageReply", syncRequestID);
</del><ins>+ auto replyEncoder = std::make_unique<MessageEncoder>("IPC", "SyncMessageReply", 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->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<MessageDecoder> 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 "MessageDecoder.h"
</span><span class="cx"> #include "MessageEncoder.h"
</span><span class="cx"> #include "MessageReceiver.h"
</span><ins>+#include "ProcessType.h"
</ins><span class="cx"> #include "WorkQueue.h"
</span><span class="cx"> #include <atomic>
</span><span class="cx"> #include <condition_variable>
</span><span class="lines">@@ -90,6 +91,8 @@
</span><span class="cx"> public:
</span><span class="cx"> virtual void didClose(Connection&) = 0;
</span><span class="cx"> virtual void didReceiveInvalidMessage(Connection&, 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<xpc_connection_t> 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&);
</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<typename T> bool waitForAndDispatchImmediately(uint64_t destinationID, std::chrono::milliseconds timeout, unsigned waitForMessageFlags = 0);
</span><span class="cx">
</span><span class="cx"> std::unique_ptr<MessageEncoder> createSyncMessageEncoder(StringReference messageReceiverName, StringReference messageName, uint64_t destinationID, uint64_t& syncRequestID);
</span><del>- bool sendMessage(std::unique_ptr<MessageEncoder>, unsigned messageSendFlags = 0);
</del><ins>+ bool sendMessage(std::unique_ptr<MessageEncoder>, unsigned messageSendFlags = 0, bool alreadyRecordedMessage = false);
</ins><span class="cx"> std::unique_ptr<MessageDecoder> sendSyncMessage(uint64_t syncRequestID, std::unique_ptr<MessageEncoder>, std::chrono::milliseconds timeout, unsigned syncSendFlags = 0);
</span><span class="cx"> std::unique_ptr<MessageDecoder> sendSyncMessageFromSecondaryThread(uint64_t syncRequestID, std::unique_ptr<MessageEncoder>, std::chrono::milliseconds timeout);
</span><span class="cx"> bool sendSyncReply(std::unique_ptr<MessageEncoder>);
</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&, WTF::RunLoop& 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<MessageDecoder> 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<MessageDecoder> 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 "ArgumentDecoder.h"
</span><ins>+#include "MessageRecorder.h"
</ins><span class="cx"> #include "StringReference.h"
</span><ins>+#include <uuid/uuid.h>
</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<ImportanceAssertion>);
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+ void setMessageProcessingToken(std::unique_ptr<MessageRecorder::MessageProcessingToken> token) { m_processingToken = WTF::move(token); }
+
+ const uuid_t& 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) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
</span><span class="cx"> std::unique_ptr<ImportanceAssertion> m_importanceAssertion;
</span><span class="cx"> #endif
</span><ins>+
+ std::unique_ptr<MessageRecorder::MessageProcessingToken> 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 "ArgumentCoders.h"
</span><span class="cx"> #include "MessageFlags.h"
</span><ins>+#include "MessageRecorder.h"
</ins><span class="cx"> #include "StringReference.h"
</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& 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 << defaultMessageFlags;
</span><del>- *this << messageReceiverName;
- *this << messageName;
- *this << destinationID;
</del><ins>+ *this << m_messageReceiverName;
+ *this << m_messageName;
+ *this << m_destinationID;
+ *this << 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() & SyncMessage;
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+bool MessageEncoder::shouldDispatchMessageWhenWaitingForSyncReply() const
+{
+ return *buffer() & 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 "ArgumentEncoder.h"
</span><ins>+#include "StringReference.h"
+#include <uuid/uuid.h>
</ins><span class="cx"> #include <wtf/Forward.h>
</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&);
</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& 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 "config.h"
+#include "MessageRecorder.h"
+
+#include "Connection.h"
+#include "MessageDecoder.h"
+#include "MessageEncoder.h"
+#include "MessageRecorderProbes.h"
+#include <wtf/CurrentTime.h>
+
+namespace IPC {
+
+bool MessageRecorder::isEnabled()
+{
+ return WEBKITMESSAGERECORDER_MESSAGE_RECEIVED_ENABLED() || WEBKITMESSAGERECORDER_MESSAGE_SENT_ENABLED();
+}
+
+std::unique_ptr<MessageRecorder::MessageProcessingToken> MessageRecorder::recordOutgoingMessage(Connection& connection, MessageEncoder& encoder)
+{
+ if (!isEnabled() || !connection.isValid())
+ return nullptr;
+
+ WebKitMessageRecord record;
+ record.sourceProcessType = static_cast<uint64_t>(connection.client()->localProcessType());
+ record.destinationProcessType = static_cast<uint64_t>(connection.client()->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<char>::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<char>::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<MessageProcessingToken>(WTF::move(record));
+}
+
+void MessageRecorder::recordIncomingMessage(Connection& connection, MessageDecoder& decoder)
+{
+ if (!isEnabled() || !connection.isValid())
+ return;
+
+ WebKitMessageRecord record;
+ record.sourceProcessType = static_cast<uint64_t>(connection.client()->remoteProcessType());
+ record.destinationProcessType = static_cast<uint64_t>(connection.client()->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<char>::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<char>::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<MessageProcessingToken>(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(&m_record);
+ else
+ WEBKITMESSAGERECORDER_MESSAGE_SENT(&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 "ProcessType.h"
+#include <uuid/uuid.h>
+#include <wtf/Forward.h>
+#include <wtf/MallocPtr.h>
+#include <wtf/NeverDestroyed.h>
+#include <wtf/text/CString.h>
+#include <wtf/text/WTFString.h>
+
+struct WebKitMessageRecord {
+ uint8_t sourceProcessType; // IPC::ProcessType
+ pid_t sourceProcessID;
+
+ uint8_t destinationProcessType; // IPC::ProcessType
+ pid_t destinationProcessID;
+
+ MallocPtr<char> messageReceiverName;
+ MallocPtr<char> 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<MessageRecorder::MessageProcessingToken> recordOutgoingMessage(IPC::Connection&, IPC::MessageEncoder&);
+ static void recordIncomingMessage(IPC::Connection&, IPC::MessageDecoder&);
+
+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 & InformPlatformProcessWillSuspend) && 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&, IPC::MessageDecoder&) override;
</span><span class="cx"> virtual void didClose(IPC::Connection&) override;
</span><span class="cx"> virtual void didReceiveInvalidMessage(IPC::Connection&, 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&, IPC::MessageDecoder&);
</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&, IPC::MessageDecoder&, std::unique_ptr<IPC::MessageEncoder>&) override;
</span><span class="cx"> virtual void didClose(IPC::Connection&) override;
</span><span class="cx"> virtual void didReceiveInvalidMessage(IPC::Connection&, 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&, IPC::MessageDecoder&);
</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&, IPC::MessageDecoder&) override;
</span><span class="cx"> virtual void didClose(IPC::Connection&) override;
</span><span class="cx"> virtual void didReceiveInvalidMessage(IPC::Connection&, 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&, IPC::MessageDecoder&);
</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&, IPC::MessageDecoder&, std::unique_ptr<IPC::MessageEncoder>&) override;
</span><span class="cx"> virtual void didClose(IPC::Connection&) override;
</span><span class="cx"> virtual void didReceiveInvalidMessage(IPC::Connection&, 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&, IPC::MessageDecoder&);
</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&) override;
</span><span class="cx"> virtual void didReceiveInvalidMessage(IPC::Connection&, 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&, IPC::MessageDecoder&, std::unique_ptr<IPC::MessageEncoder>&) override;
</span><span class="cx"> virtual void didClose(IPC::Connection&) override;
</span><span class="cx"> virtual void didReceiveInvalidMessage(IPC::Connection&, 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 = "<group>"; };
</span><span class="cx">                 2D47B56A1810714E003A3AEE /* RemoteLayerBackingStore.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RemoteLayerBackingStore.mm; sourceTree = "<group>"; };
</span><span class="cx">                 2D47B56B1810714E003A3AEE /* RemoteLayerBackingStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteLayerBackingStore.h; sourceTree = "<group>"; };
</span><ins>+                2D5AB62B1A69D6FB0014A9CB /* MessageRecorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MessageRecorder.h; sourceTree = "<group>"; };
+                2D5AB62C1A69D6FB0014A9CB /* MessageRecorder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MessageRecorder.cpp; sourceTree = "<group>"; };
+                2D5AB62D1A69D6FB0014A9CB /* MessageRecorderProbes.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; path = MessageRecorderProbes.d; sourceTree = "<group>"; };
</ins><span class="cx">                 2D5C9D0319C81D8F00B3C5C1 /* WebPageOverlay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPageOverlay.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 2D5C9D0419C81D8F00B3C5C1 /* WebPageOverlay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPageOverlay.h; sourceTree = "<group>"; };
</span><span class="cx">                 2D6AB53F192B1C4A003A9FD1 /* WKPDFPageNumberIndicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WKPDFPageNumberIndicator.h; path = ios/WKPDFPageNumberIndicator.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -2687,6 +2694,7 @@
</span><span class="cx">                 2D70AB1418A1D57C00026D6E /* Info-iOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-iOS.plist"; sourceTree = "<group>"; };
</span><span class="cx">                 2D7AAFD218C8640600A7ACD4 /* WKWebViewContentProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebViewContentProvider.h; sourceTree = "<group>"; };
</span><span class="cx">                 2D7AAFD518C956AF00A7ACD4 /* WKWebViewConfigurationInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebViewConfigurationInternal.h; sourceTree = "<group>"; };
</span><ins>+                2D7F130F1A702FBA009A6FBD /* ProcessType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProcessType.h; sourceTree = "<group>"; };
</ins><span class="cx">                 2D819B99186275B3001F03D1 /* ViewGestureGeometryCollector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ViewGestureGeometryCollector.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 2D819B9A186275B3001F03D1 /* ViewGestureGeometryCollector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewGestureGeometryCollector.h; sourceTree = "<group>"; };
</span><span class="cx">                 2D819B9B186275B3001F03D1 /* ViewGestureGeometryCollector.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ViewGestureGeometryCollector.messages.in; sourceTree = "<group>"; };
</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&, IPC::MessageDecoder&) override;
</span><span class="cx"> virtual void didClose(IPC::Connection&) override;
</span><span class="cx"> virtual void didReceiveInvalidMessage(IPC::Connection&, 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&, IPC::MessageDecoder&, std::unique_ptr<IPC::MessageEncoder>&) override;
</span><span class="cx"> virtual void didClose(IPC::Connection&) override;
</span><span class="cx"> virtual void didReceiveInvalidMessage(IPC::Connection&, 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&, IPC::MessageDecoder&, std::unique_ptr<IPC::MessageEncoder>&) override;
</span><span class="cx"> virtual void didClose(IPC::Connection&) override;
</span><span class="cx"> virtual void didReceiveInvalidMessage(IPC::Connection&, 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&, IPC::MessageDecoder&);
</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&) override { close(); }
</span><span class="cx"> void didReceiveInvalidMessage(IPC::Connection&, 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&) override { closeWindow(); }
</span><span class="cx"> void didReceiveInvalidMessage(IPC::Connection&, 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&, IPC::MessageDecoder&, std::unique_ptr<IPC::MessageEncoder>&) override;
</span><span class="cx"> virtual void didClose(IPC::Connection&) override;
</span><span class="cx"> virtual void didReceiveInvalidMessage(IPC::Connection&, 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&, IPC::MessageDecoder&);
</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 <timothy_horton@apple.com>
+
+ 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 <ggaren@apple.com>
</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->record = (struct WebKitMessageRecord*)copyin(arg0, sizeof(struct WebKitMessageRecord));
+ printf("{");
+
+ printf("\"sourceProcessType\": %d, ", this->record->sourceProcessType);
+ printf("\"sourceProcessID\": %d, ", this->record->sourceProcessID);
+
+ printf("\"destinationProcessType\": %d, ", this->record->destinationProcessType);
+ printf("\"destinationProcessID\": %d, ", this->record->destinationProcessID);
+
+ printf("\"messageReceiverName\": \"%s\", ", copyinstr((user_addr_t)this->record->messageReceiverName));
+ printf("\"messageName\": \"%s\", ", copyinstr((user_addr_t)this->record->messageName));
+
+ printf("\"destinationID\": %d, ", this->record->destinationID);
+
+ printf("\"UUID\": \"");
+ printf("%02x", this->record->UUID[0]);
+ printf("%02x", this->record->UUID[1]);
+ printf("%02x", this->record->UUID[2]);
+ printf("%02x", this->record->UUID[3]);
+ printf("-");
+ printf("%02x", this->record->UUID[4]);
+ printf("%02x", this->record->UUID[5]);
+ printf("-");
+ printf("%02x", this->record->UUID[6]);
+ printf("%02x", this->record->UUID[7]);
+ printf("-");
+ printf("%02x", this->record->UUID[8]);
+ printf("%02x", this->record->UUID[9]);
+ printf("-");
+ printf("%02x", this->record->UUID[10]);
+ printf("%02x", this->record->UUID[11]);
+ printf("%02x", this->record->UUID[12]);
+ printf("%02x", this->record->UUID[13]);
+ printf("%02x", this->record->UUID[14]);
+ printf("%02x", this->record->UUID[15]);
+ printf("\", ");
+
+ printf("\"startTime\": %f, ", this->record->startTime);
+ printf("\"endTime\": %f, ", this->record->endTime);
+
+ printf("\"isSyncMessage\": %d, ", this->record->isSyncMessage);
+ printf("\"shouldDispatchMessageWhenWaitingForSyncReply\": %d, ", this->record->shouldDispatchMessageWhenWaitingForSyncReply);
+ printf("\"isIncoming\": %d", this->record->isIncoming);
+
+ printf("}\n");
+}
</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>