<!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>[151054] trunk/Source/WebKit2</title>
</head>
<body>

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

<h3>Log Message</h3>
<pre>Need the ability to get the information for a plug-in with a particular process id that may
be running on a page
https://bugs.webkit.org/show_bug.cgi?id=117090

Rubber-stamped by Anders Carlsson.

Follow-up to <a href="http://trac.webkit.org/projects/webkit/changeset/151043">r151043</a> incorprating some feedback I got from Darin after I had already
committed the patch.

* UIProcess/API/C/mac/WKPagePrivateMac.cpp:
(callGetPlugInInformationBlockAndDispose):
Renamed to be less wordy.
(WKPageGetPlugInInformation):
Ditto.
* UIProcess/API/C/mac/WKPagePrivateMac.h:
Ditto.

* UIProcess/Plugins/PluginProcessManager.h:
* UIProcess/Plugins/mac/PluginProcessManagerMac.mm:
(WebKit::PluginProcessManager::findPlugInProcessByID):
Renamed to not use &quot;Cocoa method style&quot; in non-Cocoa functions.
(WebKit::PluginProcessManager::findPlugInProcessByToken):
Ditto.

* UIProcess/WebPageProxy.h:
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::getPlugInInformation):
Reduce ref count churn and fix a variable name.
Updated for the change to findPlugInProcessByID.
(WebKit::WebPageProxy::containsPlugInCallback):
Updated for the change to findPlugInProcessByToken.

* WebProcess/Plugins/PDF/SimplePDFPlugin.h:
Move the override of a virtual function to the private section.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICmacWKPagePrivateMaccpp">trunk/Source/WebKit2/UIProcess/API/C/mac/WKPagePrivateMac.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICmacWKPagePrivateMach">trunk/Source/WebKit2/UIProcess/API/C/mac/WKPagePrivateMac.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessPluginsPluginProcessManagerh">trunk/Source/WebKit2/UIProcess/Plugins/PluginProcessManager.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessPluginsmacPluginProcessManagerMacmm">trunk/Source/WebKit2/UIProcess/Plugins/mac/PluginProcessManagerMac.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxyh">trunk/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacWebPageProxyMacmm">trunk/Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessPluginsPDFSimplePDFPluginh">trunk/Source/WebKit2/WebProcess/Plugins/PDF/SimplePDFPlugin.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (151053 => 151054)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2013-05-31 23:32:29 UTC (rev 151053)
+++ trunk/Source/WebKit2/ChangeLog        2013-05-31 23:32:53 UTC (rev 151054)
</span><span class="lines">@@ -12,6 +12,43 @@
</span><span class="cx">         be running on a page
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=117090
</span><span class="cx"> 
</span><ins>+        Rubber-stamped by Anders Carlsson.
+
+        Follow-up to r151043 incorprating some feedback I got from Darin after I had already
+        committed the patch.
+
+        * UIProcess/API/C/mac/WKPagePrivateMac.cpp:
+        (callGetPlugInInformationBlockAndDispose):
+        Renamed to be less wordy.
+        (WKPageGetPlugInInformation):
+        Ditto.
+        * UIProcess/API/C/mac/WKPagePrivateMac.h:
+        Ditto.
+
+        * UIProcess/Plugins/PluginProcessManager.h:
+        * UIProcess/Plugins/mac/PluginProcessManagerMac.mm:
+        (WebKit::PluginProcessManager::findPlugInProcessByID):
+        Renamed to not use &quot;Cocoa method style&quot; in non-Cocoa functions.
+        (WebKit::PluginProcessManager::findPlugInProcessByToken):
+        Ditto.
+
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/mac/WebPageProxyMac.mm:
+        (WebKit::WebPageProxy::getPlugInInformation):
+        Reduce ref count churn and fix a variable name.
+        Updated for the change to findPlugInProcessByID.
+        (WebKit::WebPageProxy::containsPlugInCallback):
+        Updated for the change to findPlugInProcessByToken.
+
+        * WebProcess/Plugins/PDF/SimplePDFPlugin.h:
+        Move the override of a virtual function to the private section.
+
+2013-05-31  Jessie Berlin  &lt;jberlin@apple.com&gt;
+
+        Need the ability to get the information for a plug-in with a particular process id that may
+        be running on a page
+        https://bugs.webkit.org/show_bug.cgi?id=117090
+
</ins><span class="cx">         Reviewed by Anders Carlsson.
</span><span class="cx"> 
</span><span class="cx">         * UIProcess/API/C/mac/WKPagePrivateMac.cpp:
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICmacWKPagePrivateMaccpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/mac/WKPagePrivateMac.cpp (151053 => 151054)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/mac/WKPagePrivateMac.cpp        2013-05-31 23:32:29 UTC (rev 151053)
+++ trunk/Source/WebKit2/UIProcess/API/C/mac/WKPagePrivateMac.cpp        2013-05-31 23:32:53 UTC (rev 151054)
</span><span class="lines">@@ -47,14 +47,14 @@
</span><span class="cx">     return webPageProxy-&gt;process()-&gt;context()-&gt;isURLKnownHSTSHost(toImpl(url)-&gt;string(), privateBrowsingEnabled);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void callGetInformationForPlugInWithProcessIDBlockAndDispose(WKDictionaryRef resultValue, WKErrorRef error, void* context)
</del><ins>+static void callGetPlugInInformationBlockAndDispose(WKDictionaryRef resultValue, WKErrorRef error, void* context)
</ins><span class="cx"> {
</span><del>-    WKPageGetInformationForPlugInWithProcessIDBlock block = (WKPageGetInformationForPlugInWithProcessIDBlock)context;
</del><ins>+    WKPageGetPlugInInformationBlock block = (WKPageGetPlugInInformationBlock)context;
</ins><span class="cx">     block(resultValue, error);
</span><span class="cx">     Block_release(block);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WKPageGetInformationForPlugInWithProcessID(WKPageRef pageRef, pid_t plugInProcessID, WKPageGetInformationForPlugInWithProcessIDBlock block)
</del><ins>+void WKPageGetPlugInInformation(WKPageRef pageRef, pid_t plugInProcessID, WKPageGetPlugInInformationBlock block)
</ins><span class="cx"> {
</span><del>-    toImpl(pageRef)-&gt;getInformationForPlugInWithProcessID(plugInProcessID, DictionaryCallback::create(Block_copy(block), callGetInformationForPlugInWithProcessIDBlockAndDispose));
</del><ins>+    toImpl(pageRef)-&gt;getPlugInInformation(plugInProcessID, DictionaryCallback::create(Block_copy(block), callGetPlugInInformationBlockAndDispose));
</ins><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICmacWKPagePrivateMach"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/mac/WKPagePrivateMac.h (151053 => 151054)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/mac/WKPagePrivateMac.h        2013-05-31 23:32:29 UTC (rev 151053)
+++ trunk/Source/WebKit2/UIProcess/API/C/mac/WKPagePrivateMac.h        2013-05-31 23:32:53 UTC (rev 151054)
</span><span class="lines">@@ -35,8 +35,8 @@
</span><span class="cx"> WK_EXPORT pid_t WKPageGetProcessIdentifier(WKPageRef page);
</span><span class="cx"> WK_EXPORT bool WKPageIsURLKnownHSTSHost(WKPageRef page, WKURLRef url);
</span><span class="cx"> 
</span><del>-typedef void (^WKPageGetInformationForPlugInWithProcessIDBlock)(WKDictionaryRef, WKErrorRef);
-WK_EXPORT void WKPageGetInformationForPlugInWithProcessID(WKPageRef, pid_t plugInProcessID, WKPageGetInformationForPlugInWithProcessIDBlock);
</del><ins>+typedef void (^WKPageGetPlugInInformationBlock)(WKDictionaryRef, WKErrorRef);
+WK_EXPORT void WKPageGetPlugInInformation(WKPageRef, pid_t plugInProcessID, WKPageGetPlugInInformationBlock);
</ins><span class="cx"> 
</span><span class="cx"> #ifdef __cplusplus
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessPluginsPluginProcessManagerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Plugins/PluginProcessManager.h (151053 => 151054)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Plugins/PluginProcessManager.h        2013-05-31 23:32:29 UTC (rev 151053)
+++ trunk/Source/WebKit2/UIProcess/Plugins/PluginProcessManager.h        2013-05-31 23:32:53 UTC (rev 151054)
</span><span class="lines">@@ -63,8 +63,8 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx">     void setProcessSuppressionEnabled(bool);
</span><del>-    PluginProcessProxy* plugInProcessWithProcessID(pid_t plugInProcessID) const;
-    PluginProcessProxy* plugInProcessWithToken(uint64_t plugInProcessToken) const;
</del><ins>+    PluginProcessProxy* findPlugInProcessByID(pid_t plugInProcessID) const;
+    PluginProcessProxy* findPlugInProcessByToken(uint64_t plugInProcessToken) const;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> private:
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessPluginsmacPluginProcessManagerMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Plugins/mac/PluginProcessManagerMac.mm (151053 => 151054)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Plugins/mac/PluginProcessManagerMac.mm        2013-05-31 23:32:29 UTC (rev 151053)
+++ trunk/Source/WebKit2/UIProcess/Plugins/mac/PluginProcessManagerMac.mm        2013-05-31 23:32:53 UTC (rev 151054)
</span><span class="lines">@@ -39,7 +39,7 @@
</span><span class="cx">         m_pluginProcesses[i]-&gt;setProcessSuppressionEnabled(processSuppressionEnabled);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PluginProcessProxy* PluginProcessManager::plugInProcessWithProcessID(pid_t plugInProcessID) const
</del><ins>+PluginProcessProxy* PluginProcessManager::findPlugInProcessByID(pid_t plugInProcessID) const
</ins><span class="cx"> {
</span><span class="cx">     for (size_t i = 0; i &lt; m_pluginProcesses.size(); ++i) {
</span><span class="cx">         if (m_pluginProcesses[i]-&gt;processIdentifier() == plugInProcessID)
</span><span class="lines">@@ -48,7 +48,7 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PluginProcessProxy* PluginProcessManager::plugInProcessWithToken(uint64_t plugInProcessToken) const
</del><ins>+PluginProcessProxy* PluginProcessManager::findPlugInProcessByToken(uint64_t plugInProcessToken) const
</ins><span class="cx"> {
</span><span class="cx">     for (size_t i = 0; i &lt; m_pluginProcesses.size(); ++i) {
</span><span class="cx">         if (m_pluginProcesses[i]-&gt;pluginProcessToken() == plugInProcessToken)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (151053 => 151054)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2013-05-31 23:32:29 UTC (rev 151053)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2013-05-31 23:32:53 UTC (rev 151054)
</span><span class="lines">@@ -538,7 +538,7 @@
</span><span class="cx"> 
</span><span class="cx">     ColorSpaceData colorSpace();
</span><span class="cx"> 
</span><del>-    void getInformationForPlugInWithProcessID(pid_t plugInProcessID, PassRefPtr&lt;DictionaryCallback&gt;);
</del><ins>+    void getPlugInInformation(pid_t plugInProcessID, PassRefPtr&lt;DictionaryCallback&gt;);
</ins><span class="cx">     void containsPlugInCallback(bool containsPlugIn, uint64_t plugInToken, uint64_t callbackID);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacWebPageProxyMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm (151053 => 151054)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm        2013-05-31 23:32:29 UTC (rev 151053)
+++ trunk/Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm        2013-05-31 23:32:53 UTC (rev 151054)
</span><span class="lines">@@ -459,7 +459,7 @@
</span><span class="cx">     m_pageClient-&gt;setPluginComplexTextInputState(pluginComplexTextInputIdentifier, static_cast&lt;PluginComplexTextInputState&gt;(pluginComplexTextInputState));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPageProxy::getInformationForPlugInWithProcessID(pid_t plugInProcessID, PassRefPtr&lt;DictionaryCallback&gt; prpCallback)
</del><ins>+void WebPageProxy::getPlugInInformation(pid_t plugInProcessID, PassRefPtr&lt;DictionaryCallback&gt; prpCallback)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr&lt;DictionaryCallback&gt; callback = prpCallback;
</span><span class="cx">     if (!isValid()) {
</span><span class="lines">@@ -467,13 +467,13 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    PluginProcessProxy* pluginProcessProxy = PluginProcessManager::shared().plugInProcessWithProcessID(plugInProcessID);
-    if (!pluginProcessProxy)
</del><ins>+    PluginProcessProxy* plugInProcessProxy = PluginProcessManager::shared().findPlugInProcessByID(plugInProcessID);
+    if (!plugInProcessProxy)
</ins><span class="cx">         callback-&gt;performCallbackWithReturnValue(0);
</span><span class="cx"> 
</span><span class="cx">     uint64_t callbackID = callback-&gt;callbackID();
</span><del>-    m_plugInInformationCallbacks.set(callbackID, callback.get());
-    m_process-&gt;send(Messages::WebPage::ContainsPluginViewsWithPluginProcessToken(pluginProcessProxy-&gt;pluginProcessToken(), callbackID), m_pageID);
</del><ins>+    m_plugInInformationCallbacks.set(callbackID, callback.release());
+    m_process-&gt;send(Messages::WebPage::ContainsPluginViewsWithPluginProcessToken(plugInProcessProxy-&gt;pluginProcessToken(), callbackID), m_pageID);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPageProxy::containsPlugInCallback(bool containsPlugIn, uint64_t plugInToken, uint64_t callbackID)
</span><span class="lines">@@ -489,7 +489,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    PluginProcessProxy* plugInProcessProxy = PluginProcessManager::shared().plugInProcessWithToken(plugInToken);
</del><ins>+    PluginProcessProxy* plugInProcessProxy = PluginProcessManager::shared().findPlugInProcessByToken(plugInToken);
</ins><span class="cx">     ASSERT(plugInProcessProxy);
</span><span class="cx"> 
</span><span class="cx">     ImmutableDictionary::MapType map;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessPluginsPDFSimplePDFPluginh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Plugins/PDF/SimplePDFPlugin.h (151053 => 151054)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Plugins/PDF/SimplePDFPlugin.h        2013-05-31 23:32:29 UTC (rev 151053)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PDF/SimplePDFPlugin.h        2013-05-31 23:32:53 UTC (rev 151054)
</span><span class="lines">@@ -191,8 +191,6 @@
</span><span class="cx"> 
</span><span class="cx">     virtual String getSelectionString() const OVERRIDE { return String(); }
</span><span class="cx"> 
</span><del>-    virtual uint64_t plugInProcessToken() const OVERRIDE { return 0; }
-
</del><span class="cx">     WebCore::IntSize m_scrollOffset;
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="lines">@@ -204,6 +202,8 @@
</span><span class="cx"> 
</span><span class="cx">     virtual bool shouldAlwaysAutoStart() const OVERRIDE { return true; }
</span><span class="cx"> 
</span><ins>+    virtual uint64_t plugInProcessToken() const OVERRIDE { return 0; }
+
</ins><span class="cx">     WebCore::IntSize m_size;
</span><span class="cx"> 
</span><span class="cx">     WebCore::KURL m_sourceURL;
</span></span></pre>
</div>
</div>

</body>
</html>