<!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>[168565] trunk/Source</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/168565">168565</a></dd>
<dt>Author</dt> <dd>joepeck@webkit.org</dd>
<dt>Date</dt> <dd>2014-05-09 18:30:13 -0700 (Fri, 09 May 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: Allow Remote Inspector to entitlement check UIProcess through WebProcess
https://bugs.webkit.org/show_bug.cgi?id=132409

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:
Proxy applications are applications which hold WebViews for other
applications. The WebProcess (Web Content Service) is a proxy application.
For legacy reasons we were supporting a scenario where proxy applications
could potentially host WebViews for more then one other application. That
was never the case for WebProcess and it is now a scenario we don't need
to worry about supporting.

With this change, a proxy application more naturally only holds WebViews
for a single parent / host application. The proxy process can set the
parent pid / audit_token data on the RemoteInspector singleton, and
that data will be sent on to webinspectord later on to be validated.
In the WebProcess&lt;-&gt;UIProcess relationship that information is known
and set immediately. In the Legacy iOS case that information is set
soon after, but not immediately known at the point the WebView is created.

This allows us to simplify the RemoteInspectorDebuggable interface.
We no longer need a pid per-Debuggable.

* inspector/remote/RemoteInspector.h:
* inspector/remote/RemoteInspector.mm:
(Inspector::RemoteInspector::RemoteInspector):
(Inspector::RemoteInspector::setParentProcessInformation):
(Inspector::RemoteInspector::xpcConnectionReceivedMessage):
(Inspector::RemoteInspector::listingForDebuggable):
(Inspector::RemoteInspector::receivedProxyApplicationSetupMessage):
Handle new proxy application setup message, and provide an API
for a proxy application to set the parent process information.

* inspector/remote/RemoteInspectorConstants.h:
New setup and response message for proxy applications to pass
their parent / host application information to webinspectord.

* inspector/remote/RemoteInspectorDebuggable.cpp:
(Inspector::RemoteInspectorDebuggable::info):
* inspector/remote/RemoteInspectorDebuggable.h:
(Inspector::RemoteInspectorDebuggableInfo::RemoteInspectorDebuggableInfo):
(Inspector::RemoteInspectorDebuggableInfo::hasParentProcess): Deleted.
pid per debuggable is no longer needed.

Source/WebCore:
* inspector/InspectorClient.h:
(WebCore::InspectorClient::parentProcessIdentifier): Deleted.
* page/PageDebuggable.cpp:
(WebCore::PageDebuggable::parentProcessIdentifier): Deleted.
* page/PageDebuggable.h:
pid per debuggable is no longer needed.

Source/WebKit/mac:
Simplify the legacy iOS UIWebViewController case by passing on
the host process pid and audit_token.

* WebView/WebView.mm:
(-[WebView _setHostApplicationProcessIdentifier:auditToken:]):
(-[WebView setHostApplicationBundleId:name:]): Deleted.
(-[WebView hostApplicationBundleId]): Deleted.
(-[WebView hostApplicationName]): Deleted.
* WebView/WebViewData.h:
* WebView/WebViewData.mm:
(-[WebViewPrivate dealloc]):
* WebView/WebViewPrivate.h:

Source/WebKit2:
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
(WebKit::WebInspectorClient::parentProcessIdentifier): Deleted.
pid per debuggable is no longer needed.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
Immediately pass the parent process pid and audit_token on
to the RemoteInspector singleton when the process is created
so that it can be sent to webinspectord.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorremoteRemoteInspectorh">trunk/Source/JavaScriptCore/inspector/remote/RemoteInspector.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorremoteRemoteInspectormm">trunk/Source/JavaScriptCore/inspector/remote/RemoteInspector.mm</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorremoteRemoteInspectorConstantsh">trunk/Source/JavaScriptCore/inspector/remote/RemoteInspectorConstants.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorremoteRemoteInspectorDebuggablecpp">trunk/Source/JavaScriptCore/inspector/remote/RemoteInspectorDebuggable.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorremoteRemoteInspectorDebuggableh">trunk/Source/JavaScriptCore/inspector/remote/RemoteInspectorDebuggable.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorClienth">trunk/Source/WebCore/inspector/InspectorClient.h</a></li>
<li><a href="#trunkSourceWebCorepagePageDebuggablecpp">trunk/Source/WebCore/page/PageDebuggable.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePageDebuggableh">trunk/Source/WebCore/page/PageDebuggable.h</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebViewmm">trunk/Source/WebKit/mac/WebView/WebView.mm</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebViewDatah">trunk/Source/WebKit/mac/WebView/WebViewData.h</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebViewDatamm">trunk/Source/WebKit/mac/WebView/WebViewData.mm</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebViewPrivateh">trunk/Source/WebKit/mac/WebView/WebViewPrivate.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebInspectorClientcpp">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebInspectorClienth">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebProcesscpp">trunk/Source/WebKit2/WebProcess/WebProcess.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (168564 => 168565)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2014-05-10 01:23:43 UTC (rev 168564)
+++ trunk/Source/JavaScriptCore/ChangeLog        2014-05-10 01:30:13 UTC (rev 168565)
</span><span class="lines">@@ -1,3 +1,49 @@
</span><ins>+2014-05-09  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: Allow Remote Inspector to entitlement check UIProcess through WebProcess
+        https://bugs.webkit.org/show_bug.cgi?id=132409
+
+        Reviewed by Timothy Hatcher.
+
+        Proxy applications are applications which hold WebViews for other
+        applications. The WebProcess (Web Content Service) is a proxy application.
+        For legacy reasons we were supporting a scenario where proxy applications
+        could potentially host WebViews for more then one other application. That
+        was never the case for WebProcess and it is now a scenario we don't need
+        to worry about supporting.
+
+        With this change, a proxy application more naturally only holds WebViews
+        for a single parent / host application. The proxy process can set the
+        parent pid / audit_token data on the RemoteInspector singleton, and
+        that data will be sent on to webinspectord later on to be validated.
+        In the WebProcess&lt;-&gt;UIProcess relationship that information is known
+        and set immediately. In the Legacy iOS case that information is set
+        soon after, but not immediately known at the point the WebView is created.
+
+        This allows us to simplify the RemoteInspectorDebuggable interface.
+        We no longer need a pid per-Debuggable.
+
+        * inspector/remote/RemoteInspector.h:
+        * inspector/remote/RemoteInspector.mm:
+        (Inspector::RemoteInspector::RemoteInspector):
+        (Inspector::RemoteInspector::setParentProcessInformation):
+        (Inspector::RemoteInspector::xpcConnectionReceivedMessage):
+        (Inspector::RemoteInspector::listingForDebuggable):
+        (Inspector::RemoteInspector::receivedProxyApplicationSetupMessage):
+        Handle new proxy application setup message, and provide an API
+        for a proxy application to set the parent process information.
+
+        * inspector/remote/RemoteInspectorConstants.h:
+        New setup and response message for proxy applications to pass
+        their parent / host application information to webinspectord.
+
+        * inspector/remote/RemoteInspectorDebuggable.cpp:
+        (Inspector::RemoteInspectorDebuggable::info):
+        * inspector/remote/RemoteInspectorDebuggable.h:
+        (Inspector::RemoteInspectorDebuggableInfo::RemoteInspectorDebuggableInfo):
+        (Inspector::RemoteInspectorDebuggableInfo::hasParentProcess): Deleted.
+        pid per debuggable is no longer needed.
+
</ins><span class="cx"> 2014-05-09  Mark Hahnenberg  &lt;mhahnenberg@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         JSDOMWindow should disable property caching after a certain point
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorremoteRemoteInspectorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/remote/RemoteInspector.h (168564 => 168565)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/remote/RemoteInspector.h        2014-05-10 01:23:43 UTC (rev 168564)
+++ trunk/Source/JavaScriptCore/inspector/remote/RemoteInspector.h        2014-05-10 01:30:13 UTC (rev 168565)
</span><span class="lines">@@ -31,13 +31,14 @@
</span><span class="cx"> #import &quot;RemoteInspectorXPCConnection.h&quot;
</span><span class="cx"> #import &lt;wtf/Forward.h&gt;
</span><span class="cx"> #import &lt;wtf/HashMap.h&gt;
</span><del>-#import &lt;wtf/Forward.h&gt;
</del><ins>+#import &lt;wtf/RetainPtr.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> OBJC_CLASS NSDictionary;
</span><span class="cx"> OBJC_CLASS NSString;
</span><span class="cx"> 
</span><span class="cx"> namespace Inspector {
</span><span class="cx"> 
</span><ins>+class RemoteInspectorClient;
</ins><span class="cx"> class RemoteInspectorDebuggable;
</span><span class="cx"> class RemoteInspectorDebuggableConnection;
</span><span class="cx"> struct RemoteInspectorDebuggableInfo;
</span><span class="lines">@@ -60,6 +61,12 @@
</span><span class="cx">     void start();
</span><span class="cx">     void stop();
</span><span class="cx"> 
</span><ins>+    bool hasParentProcessInformation() const { return m_parentProcessIdentifier != 0; }
+    pid_t parentProcessIdentifier() const { return m_parentProcessIdentifier; }
+    RetainPtr&lt;CFDataRef&gt; parentProcessAuditData() const { return m_parentProcessAuditData; }
+    void setParentProcessInformation(pid_t, RetainPtr&lt;CFDataRef&gt; auditData);
+    void setParentProcessInfomationIsDelayed();
+
</ins><span class="cx"> private:
</span><span class="cx">     RemoteInspector();
</span><span class="cx"> 
</span><span class="lines">@@ -85,6 +92,7 @@
</span><span class="cx">     void receivedDidCloseMessage(NSDictionary *userInfo);
</span><span class="cx">     void receivedGetListingMessage(NSDictionary *userInfo);
</span><span class="cx">     void receivedIndicateMessage(NSDictionary *userInfo);
</span><ins>+    void receivedProxyApplicationSetupMessage(NSDictionary *userInfo);
</ins><span class="cx">     void receivedConnectionDiedMessage(NSDictionary *userInfo);
</span><span class="cx"> 
</span><span class="cx">     static bool startEnabled;
</span><span class="lines">@@ -98,12 +106,17 @@
</span><span class="cx">     HashMap&lt;unsigned, std::pair&lt;RemoteInspectorDebuggable*, RemoteInspectorDebuggableInfo&gt;&gt; m_debuggableMap;
</span><span class="cx">     HashMap&lt;unsigned, RefPtr&lt;RemoteInspectorDebuggableConnection&gt;&gt; m_connectionMap;
</span><span class="cx">     RefPtr&lt;RemoteInspectorXPCConnection&gt; m_xpcConnection;
</span><ins>+
</ins><span class="cx">     dispatch_queue_t m_xpcQueue;
</span><span class="cx">     unsigned m_nextAvailableIdentifier;
</span><span class="cx">     int m_notifyToken;
</span><span class="cx">     bool m_enabled;
</span><span class="cx">     bool m_hasActiveDebugSession;
</span><span class="cx">     bool m_pushScheduled;
</span><ins>+
+    pid_t m_parentProcessIdentifier;
+    RetainPtr&lt;CFDataRef&gt; m_parentProcessAuditData;
+    bool m_shouldSendParentProcessInformation;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace Inspector
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorremoteRemoteInspectormm"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/remote/RemoteInspector.mm (168564 => 168565)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/remote/RemoteInspector.mm        2014-05-10 01:23:43 UTC (rev 168564)
+++ trunk/Source/JavaScriptCore/inspector/remote/RemoteInspector.mm        2014-05-10 01:30:13 UTC (rev 168565)
</span><span class="lines">@@ -87,6 +87,8 @@
</span><span class="cx">     , m_enabled(false)
</span><span class="cx">     , m_hasActiveDebugSession(false)
</span><span class="cx">     , m_pushScheduled(false)
</span><ins>+    , m_parentProcessIdentifier(0)
+    , m_shouldSendParentProcessInformation(false)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -248,6 +250,22 @@
</span><span class="cx">     pushListingSoon();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#pragma mark - Proxy Application Information
+
+void RemoteInspector::setParentProcessInformation(pid_t pid, RetainPtr&lt;CFDataRef&gt; auditData)
+{
+    std::lock_guard&lt;std::mutex&gt; lock(m_mutex);
+
+    if (m_parentProcessIdentifier || m_parentProcessAuditData)
+        return;
+
+    m_parentProcessIdentifier = pid;
+    m_parentProcessAuditData = auditData;
+
+    if (m_shouldSendParentProcessInformation)
+        receivedProxyApplicationSetupMessage(nil);
+}
+
</ins><span class="cx"> #pragma mark - RemoteInspectorXPCConnection::Client
</span><span class="cx"> 
</span><span class="cx"> void RemoteInspector::xpcConnectionReceivedMessage(RemoteInspectorXPCConnection*, NSString *messageName, NSDictionary *userInfo)
</span><span class="lines">@@ -269,6 +287,8 @@
</span><span class="cx">         receivedGetListingMessage(userInfo);
</span><span class="cx">     else if ([messageName isEqualToString:WIRIndicateMessage])
</span><span class="cx">         receivedIndicateMessage(userInfo);
</span><ins>+    else if ([messageName isEqualToString:WIRProxyApplicationSetupMessage])
+        receivedProxyApplicationSetupMessage(userInfo);
</ins><span class="cx">     else if ([messageName isEqualToString:WIRConnectionDiedMessage])
</span><span class="cx">         receivedConnectionDiedMessage(userInfo);
</span><span class="cx">     else
</span><span class="lines">@@ -334,11 +354,6 @@
</span><span class="cx">     if (debuggableInfo.hasLocalDebugger)
</span><span class="cx">         [debuggableDetails setObject:@YES forKey:WIRHasLocalDebuggerKey];
</span><span class="cx"> 
</span><del>-    if (debuggableInfo.hasParentProcess()) {
-        NSString *parentApplicationIdentifier = [NSString stringWithFormat:@&quot;PID:%lu&quot;, (unsigned long)debuggableInfo.parentProcessIdentifier];
-        [debuggableDetails setObject:parentApplicationIdentifier forKey:WIRHostApplicationIdentifierKey];
-    }
-
</del><span class="cx">     return debuggableDetails;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -506,6 +521,32 @@
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void RemoteInspector::receivedProxyApplicationSetupMessage(NSDictionary *)
+{
+    ASSERT(m_xpcConnection);
+    if (!m_xpcConnection)
+        return;
+
+    if (!m_parentProcessIdentifier || !m_parentProcessAuditData) {
+        // We are a proxy application without parent process information.
+        // Wait a bit for the information, but give up after a second.
+        m_shouldSendParentProcessInformation = true;
+        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC), dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+            std::lock_guard&lt;std::mutex&gt; lock(m_mutex);
+            if (m_shouldSendParentProcessInformation)
+                stopInternal(StopSource::XPCMessage);
+        });
+        return;
+    }
+
+    m_shouldSendParentProcessInformation = false;
+
+    m_xpcConnection-&gt;sendMessage(WIRProxyApplicationSetupResponseMessage, @{
+        WIRProxyApplicationParentPIDKey: @(m_parentProcessIdentifier),
+        WIRProxyApplicationParentAuditDataKey: (NSData *)m_parentProcessAuditData.get(),
+    });
+}
+
</ins><span class="cx"> void RemoteInspector::receivedConnectionDiedMessage(NSDictionary *userInfo)
</span><span class="cx"> {
</span><span class="cx">     NSString *connectionIdentifier = [userInfo objectForKey:WIRConnectionIdentifierKey];
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorremoteRemoteInspectorConstantsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/remote/RemoteInspectorConstants.h (168564 => 168565)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/remote/RemoteInspectorConstants.h        2014-05-10 01:23:43 UTC (rev 168564)
+++ trunk/Source/JavaScriptCore/inspector/remote/RemoteInspectorConstants.h        2014-05-10 01:30:13 UTC (rev 168565)
</span><span class="lines">@@ -81,5 +81,9 @@
</span><span class="cx"> // These definitions are shared between webinspectord and WebKit.
</span><span class="cx"> 
</span><span class="cx"> #define WIRPermissionDenied                     @&quot;WIRPermissionDenied&quot;
</span><ins>+#define WIRProxyApplicationParentPIDKey         @&quot;WIRProxyApplicationParentPID&quot;
+#define WIRProxyApplicationParentAuditDataKey   @&quot;WIRProxyApplicationParentAuditData&quot;
+#define WIRProxyApplicationSetupMessage         @&quot;WIRProxyApplicationSetupMessage&quot;
+#define WIRProxyApplicationSetupResponseMessage @&quot;WIRProxyApplicationSetupResponseMessage&quot;
</ins><span class="cx"> 
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorremoteRemoteInspectorDebuggablecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/remote/RemoteInspectorDebuggable.cpp (168564 => 168565)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/remote/RemoteInspectorDebuggable.cpp        2014-05-10 01:23:43 UTC (rev 168564)
+++ trunk/Source/JavaScriptCore/inspector/remote/RemoteInspectorDebuggable.cpp        2014-05-10 01:30:13 UTC (rev 168565)
</span><span class="lines">@@ -73,7 +73,6 @@
</span><span class="cx">     info.url = url();
</span><span class="cx">     info.hasLocalDebugger = hasLocalDebugger();
</span><span class="cx">     info.remoteDebuggingAllowed = remoteDebuggingAllowed();
</span><del>-    info.parentProcessIdentifier = parentProcessIdentifier();
</del><span class="cx">     return info;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorremoteRemoteInspectorDebuggableh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/remote/RemoteInspectorDebuggable.h (168564 => 168565)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/remote/RemoteInspectorDebuggable.h        2014-05-10 01:23:43 UTC (rev 168564)
+++ trunk/Source/JavaScriptCore/inspector/remote/RemoteInspectorDebuggable.h        2014-05-10 01:30:13 UTC (rev 168565)
</span><span class="lines">@@ -56,7 +56,6 @@
</span><span class="cx">     virtual String name() const { return String(); } // JavaScript and Web
</span><span class="cx">     virtual String url() const { return String(); } // Web
</span><span class="cx">     virtual bool hasLocalDebugger() const = 0;
</span><del>-    virtual pid_t parentProcessIdentifier() const { return 0; }
</del><span class="cx"> 
</span><span class="cx">     virtual void connect(InspectorFrontendChannel*) = 0;
</span><span class="cx">     virtual void disconnect() = 0;
</span><span class="lines">@@ -74,19 +73,15 @@
</span><span class="cx">         , type(RemoteInspectorDebuggable::JavaScript)
</span><span class="cx">         , hasLocalDebugger(false)
</span><span class="cx">         , remoteDebuggingAllowed(false)
</span><del>-        , parentProcessIdentifier(0)
</del><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    bool hasParentProcess() const { return !!parentProcessIdentifier; }
-
</del><span class="cx">     unsigned identifier;
</span><span class="cx">     RemoteInspectorDebuggable::DebuggableType type;
</span><span class="cx">     String name;
</span><span class="cx">     String url;
</span><span class="cx">     bool hasLocalDebugger;
</span><span class="cx">     bool remoteDebuggingAllowed;
</span><del>-    pid_t parentProcessIdentifier;
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace Inspector
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (168564 => 168565)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-05-10 01:23:43 UTC (rev 168564)
+++ trunk/Source/WebCore/ChangeLog        2014-05-10 01:30:13 UTC (rev 168565)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2014-05-09  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: Allow Remote Inspector to entitlement check UIProcess through WebProcess
+        https://bugs.webkit.org/show_bug.cgi?id=132409
+
+        Reviewed by Timothy Hatcher.
+
+        * inspector/InspectorClient.h:
+        (WebCore::InspectorClient::parentProcessIdentifier): Deleted.
+        * page/PageDebuggable.cpp:
+        (WebCore::PageDebuggable::parentProcessIdentifier): Deleted.
+        * page/PageDebuggable.h:
+        pid per debuggable is no longer needed.
+
</ins><span class="cx"> 2014-05-09  Dean Jackson  &lt;dino@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [fullscreen] cursor should auto-hide when over video
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorClient.h (168564 => 168565)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorClient.h        2014-05-10 01:23:43 UTC (rev 168564)
+++ trunk/Source/WebCore/inspector/InspectorClient.h        2014-05-10 01:30:13 UTC (rev 168565)
</span><span class="lines">@@ -49,10 +49,6 @@
</span><span class="cx">     virtual void bringFrontendToFront() = 0;
</span><span class="cx">     virtual void didResizeMainFrame(Frame*) { }
</span><span class="cx"> 
</span><del>-#if ENABLE(REMOTE_INSPECTOR)
-    virtual pid_t parentProcessIdentifier() const { return 0; }
-#endif
-
</del><span class="cx">     virtual void highlight() = 0;
</span><span class="cx">     virtual void hideHighlight() = 0;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepagePageDebuggablecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PageDebuggable.cpp (168564 => 168565)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PageDebuggable.cpp        2014-05-10 01:23:43 UTC (rev 168564)
+++ trunk/Source/WebCore/page/PageDebuggable.cpp        2014-05-10 01:30:13 UTC (rev 168565)
</span><span class="lines">@@ -29,7 +29,6 @@
</span><span class="cx"> #if ENABLE(REMOTE_INSPECTOR)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Document.h&quot;
</span><del>-#include &quot;InspectorClient.h&quot;
</del><span class="cx"> #include &quot;InspectorController.h&quot;
</span><span class="cx"> #include &quot;InspectorForwarding.h&quot;
</span><span class="cx"> #include &quot;MainFrame.h&quot;
</span><span class="lines">@@ -71,14 +70,6 @@
</span><span class="cx">     return m_page.inspectorController().hasLocalFrontend();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-pid_t PageDebuggable::parentProcessIdentifier() const
-{
-    if (InspectorClient* inspectorClient = m_page.inspectorController().inspectorClient())
-        return inspectorClient-&gt;parentProcessIdentifier();
-
-    return 0;
-}
-
</del><span class="cx"> void PageDebuggable::connect(Inspector::InspectorFrontendChannel* channel)
</span><span class="cx"> {
</span><span class="cx"> #if PLATFORM(IOS)
</span></span></pre></div>
<a id="trunkSourceWebCorepagePageDebuggableh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PageDebuggable.h (168564 => 168565)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PageDebuggable.h        2014-05-10 01:23:43 UTC (rev 168564)
+++ trunk/Source/WebCore/page/PageDebuggable.h        2014-05-10 01:30:13 UTC (rev 168565)
</span><span class="lines">@@ -46,7 +46,6 @@
</span><span class="cx">     virtual String name() const override;
</span><span class="cx">     virtual String url() const override;
</span><span class="cx">     virtual bool hasLocalDebugger() const override;
</span><del>-    virtual pid_t parentProcessIdentifier() const override;
</del><span class="cx"> 
</span><span class="cx">     virtual void connect(Inspector::InspectorFrontendChannel*) override;
</span><span class="cx">     virtual void disconnect() override;
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (168564 => 168565)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2014-05-10 01:23:43 UTC (rev 168564)
+++ trunk/Source/WebKit/mac/ChangeLog        2014-05-10 01:30:13 UTC (rev 168565)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2014-05-09  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: Allow Remote Inspector to entitlement check UIProcess through WebProcess
+        https://bugs.webkit.org/show_bug.cgi?id=132409
+
+        Reviewed by Timothy Hatcher.
+
+        Simplify the legacy iOS UIWebViewController case by passing on
+        the host process pid and audit_token.
+
+        * WebView/WebView.mm:
+        (-[WebView _setHostApplicationProcessIdentifier:auditToken:]):
+        (-[WebView setHostApplicationBundleId:name:]): Deleted.
+        (-[WebView hostApplicationBundleId]): Deleted.
+        (-[WebView hostApplicationName]): Deleted.
+        * WebView/WebViewData.h:
+        * WebView/WebViewData.mm:
+        (-[WebViewPrivate dealloc]):
+        * WebView/WebViewPrivate.h:
+
</ins><span class="cx"> 2014-05-09  Benjamin Poulain  &lt;benjamin@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         [iOS] Switch geolocation to an explicit authorization query model
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (168564 => 168565)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebView.mm        2014-05-10 01:23:43 UTC (rev 168564)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm        2014-05-10 01:30:13 UTC (rev 168565)
</span><span class="lines">@@ -1918,30 +1918,11 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><del>-- (void)setHostApplicationBundleId:(NSString *)bundleId name:(NSString *)name
</del><ins>+- (void)_setHostApplicationProcessIdentifier:(pid_t)pid auditToken:(audit_token_t)auditToken
</ins><span class="cx"> {
</span><del>-    if (![_private-&gt;hostApplicationBundleId isEqualToString:bundleId]) {
-        [_private-&gt;hostApplicationBundleId release];
-        _private-&gt;hostApplicationBundleId = [bundleId copy];
-    }
-
-    if (![_private-&gt;hostApplicationName isEqualToString:name]) {
-        [_private-&gt;hostApplicationName release];
-        _private-&gt;hostApplicationName = [name copy];
-    }
-
-    // FIXME: This has not yet been ported to Inspector::RemoteInspectorServer.
</del><ins>+    RetainPtr&lt;CFDataRef&gt; auditData = adoptCF(CFDataCreate(nullptr, (const UInt8*)&amp;auditToken, sizeof(auditToken)));
+    RemoteInspector::shared().setParentProcessInformation(pid, auditData);
</ins><span class="cx"> }
</span><del>-
-- (NSString *)hostApplicationBundleId
-{
-    return _private-&gt;hostApplicationBundleId;
-}
-
-- (NSString *)hostApplicationName
-{
-    return _private-&gt;hostApplicationName;
-}
</del><span class="cx"> #endif // PLATFORM(IOS)
</span><span class="cx"> #endif // ENABLE(REMOTE_INSPECTOR)
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebViewDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebViewData.h (168564 => 168565)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebViewData.h        2014-05-10 01:23:43 UTC (rev 168564)
+++ trunk/Source/WebKit/mac/WebView/WebViewData.h        2014-05-10 01:30:13 UTC (rev 168565)
</span><span class="lines">@@ -256,8 +256,6 @@
</span><span class="cx"> #if ENABLE(REMOTE_INSPECTOR)
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     WebIndicateLayer *indicateLayer;
</span><del>-    NSString *hostApplicationBundleId;
-    NSString *hostApplicationName;
</del><span class="cx"> #endif
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebViewDatamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebViewData.mm (168564 => 168565)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebViewData.mm        2014-05-10 01:23:43 UTC (rev 168564)
+++ trunk/Source/WebKit/mac/WebView/WebViewData.mm        2014-05-10 01:30:13 UTC (rev 168565)
</span><span class="lines">@@ -153,8 +153,6 @@
</span><span class="cx"> #if ENABLE(REMOTE_INSPECTOR)
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     [indicateLayer release];
</span><del>-    [hostApplicationBundleId release];
-    [hostApplicationName release];
</del><span class="cx"> #endif
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebViewPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebViewPrivate.h (168564 => 168565)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebViewPrivate.h        2014-05-10 01:23:43 UTC (rev 168564)
+++ trunk/Source/WebKit/mac/WebView/WebViewPrivate.h        2014-05-10 01:30:13 UTC (rev 168565)
</span><span class="lines">@@ -326,27 +326,7 @@
</span><span class="cx"> - (void)setShowingInspectorIndication:(BOOL)enabled;
</span><span class="cx"> 
</span><span class="cx"> #if TARGET_OS_IPHONE
</span><del>-/*!
-    @method setHostApplicationBundleId:name
-    @param bundleId The application that this WebView was created for.
-    @param name That application's localized display name.
-    @abstract When a WebView is created out of process for an application,
-    you can clarify to a Remote Debugger which application this WebView
-    is intended to belong to; the application which hosts the WebView.
-*/
-- (void)setHostApplicationBundleId:(NSString *)bundleId name:(NSString *)name;
-
-/*!
-    @method hostApplicationBundleId
-    @result Returns the host application bundle id.
-*/
-- (NSString *)hostApplicationBundleId;
-
-/*!
-    @method hostApplicationName
-    @result Returns the host application name.
-*/
-- (NSString *)hostApplicationName;
</del><ins>+- (void)_setHostApplicationProcessIdentifier:(pid_t)pid auditToken:(audit_token_t)auditToken;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE_REMOTE_INSPECTOR
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (168564 => 168565)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-05-10 01:23:43 UTC (rev 168564)
+++ trunk/Source/WebKit2/ChangeLog        2014-05-10 01:30:13 UTC (rev 168565)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2014-05-09  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: Allow Remote Inspector to entitlement check UIProcess through WebProcess
+        https://bugs.webkit.org/show_bug.cgi?id=132409
+
+        Reviewed by Timothy Hatcher.
+
+        * WebProcess/WebCoreSupport/WebInspectorClient.h:
+        * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
+        (WebKit::WebInspectorClient::parentProcessIdentifier): Deleted.
+        pid per debuggable is no longer needed.
+
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::initializeWebProcess):
+        Immediately pass the parent process pid and audit_token on
+        to the RemoteInspector singleton when the process is created
+        so that it can be sent to webinspectord.
+
</ins><span class="cx"> 2014-05-09  Enrica Casucci  &lt;enrica@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION (WebKit2): Tapping in search field at wikipedia.org doesn’t bring up the keyboard.
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebInspectorClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.cpp (168564 => 168565)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.cpp        2014-05-10 01:23:43 UTC (rev 168564)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.cpp        2014-05-10 01:30:13 UTC (rev 168565)
</span><span class="lines">@@ -33,10 +33,6 @@
</span><span class="cx"> #include &lt;WebCore/InspectorController.h&gt;
</span><span class="cx"> #include &lt;WebCore/Page.h&gt;
</span><span class="cx"> 
</span><del>-#if ENABLE(REMOTE_INSPECTOR)
-#include &quot;WebProcess.h&quot;
-#endif
-
</del><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="lines">@@ -71,13 +67,6 @@
</span><span class="cx">         m_page-&gt;inspector()-&gt;updateDockingAvailability();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if ENABLE(REMOTE_INSPECTOR)
-pid_t WebInspectorClient::parentProcessIdentifier() const
-{
-    return WebProcess::shared().presenterApplicationPid();
-}
-#endif
-
</del><span class="cx"> void WebInspectorClient::highlight()
</span><span class="cx"> {
</span><span class="cx">     if (!m_highlightOverlay) {
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebInspectorClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.h (168564 => 168565)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.h        2014-05-10 01:23:43 UTC (rev 168564)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.h        2014-05-10 01:30:13 UTC (rev 168565)
</span><span class="lines">@@ -58,10 +58,6 @@
</span><span class="cx">     virtual void bringFrontendToFront() override;
</span><span class="cx">     virtual void didResizeMainFrame(WebCore::Frame*) override;
</span><span class="cx"> 
</span><del>-#if ENABLE(REMOTE_INSPECTOR)
-    virtual pid_t parentProcessIdentifier() const override;
-#endif
-
</del><span class="cx">     virtual void highlight() override;
</span><span class="cx">     virtual void hideHighlight() override;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebProcess.cpp (168564 => 168565)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2014-05-10 01:23:43 UTC (rev 168564)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2014-05-10 01:30:13 UTC (rev 168565)
</span><span class="lines">@@ -123,6 +123,10 @@
</span><span class="cx"> #include &quot;WebResourceLoadScheduler.h&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(REMOTE_INSPECTOR)
+#include &lt;JavaScriptCore/RemoteInspector.h&gt;
+#endif
+
</ins><span class="cx"> #if USE(SOUP) &amp;&amp; !ENABLE(CUSTOM_PROTOCOLS)
</span><span class="cx"> #include &quot;WebSoupRequestManager.h&quot;
</span><span class="cx"> #endif
</span><span class="lines">@@ -366,6 +370,14 @@
</span><span class="cx"> #if ENABLE(SERVICE_CONTROLS)
</span><span class="cx">     setEnabledServices(parameters.hasImageServices, parameters.hasSelectionServices);
</span><span class="cx"> #endif
</span><ins>+
+#if ENABLE(REMOTE_INSPECTOR)
+    audit_token_t auditToken;
+    if (parentProcessConnection()-&gt;getAuditToken(auditToken)) {
+        RetainPtr&lt;CFDataRef&gt; auditData = adoptCF(CFDataCreate(nullptr, (const UInt8*)&amp;auditToken, sizeof(auditToken)));
+        Inspector::RemoteInspector::shared().setParentProcessInformation(presenterApplicationPid(), auditData);
+    }
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(NETWORK_PROCESS)
</span></span></pre>
</div>
</div>

</body>
</html>