<!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>[205264] 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/205264">205264</a></dd>
<dt>Author</dt> <dd>andersca@apple.com</dd>
<dt>Date</dt> <dd>2016-08-31 12:54:12 -0700 (Wed, 31 Aug 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Use Connection::sendWithReply for the SecItem shim messages
https://bugs.webkit.org/show_bug.cgi?id=161419

Reviewed by Tim Horton.

* DerivedSources.make:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeConnection):
* NetworkProcess/mac/NetworkProcessMac.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcess):
* Shared/mac/SecItemShim.cpp:
(WebKit::workQueue):
(WebKit::sendSecItemRequest):
(WebKit::webSecItemCopyMatching):
(WebKit::webSecItemAdd):
(WebKit::webSecItemUpdate):
(WebKit::webSecItemDelete):
(WebKit::initializeSecItemShim):
(WebKit::responseMap): Deleted.
(WebKit::SecItemShim::singleton): Deleted.
(WebKit::SecItemShim::SecItemShim): Deleted.
(WebKit::generateSecItemRequestID): Deleted.
(WebKit::SecItemShim::secItemResponse): Deleted.
(WebKit::SecItemShim::initialize): Deleted.
(WebKit::SecItemShim::initializeConnection): Deleted.
* Shared/mac/SecItemShim.h:
* Shared/mac/SecItemShim.messages.in: Removed.
* UIProcess/mac/SecItemShimProxy.cpp:
(WebKit::SecItemShimProxy::didReceiveMessage):
(WebKit::SecItemShimProxy::secItemRequest):
* UIProcess/mac/SecItemShimProxy.h:
* UIProcess/mac/SecItemShimProxy.messages.in:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeConnection):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeProcess):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2DerivedSourcesmake">trunk/Source/WebKit2/DerivedSources.make</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkProcesscpp">trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessiosNetworkProcessIOSmm">trunk/Source/WebKit2/NetworkProcess/ios/NetworkProcessIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessmacNetworkProcessMacmm">trunk/Source/WebKit2/NetworkProcess/mac/NetworkProcessMac.mm</a></li>
<li><a href="#trunkSourceWebKit2SharedmacSecItemShimcpp">trunk/Source/WebKit2/Shared/mac/SecItemShim.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharedmacSecItemShimh">trunk/Source/WebKit2/Shared/mac/SecItemShim.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacSecItemShimProxycpp">trunk/Source/WebKit2/UIProcess/mac/SecItemShimProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacSecItemShimProxyh">trunk/Source/WebKit2/UIProcess/mac/SecItemShimProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacSecItemShimProxymessagesin">trunk/Source/WebKit2/UIProcess/mac/SecItemShimProxy.messages.in</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebProcesscpp">trunk/Source/WebKit2/WebProcess/WebProcess.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcesscocoaWebProcessCocoamm">trunk/Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2SharedmacSecItemShimmessagesin">trunk/Source/WebKit2/Shared/mac/SecItemShim.messages.in</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (205263 => 205264)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-08-31 19:53:44 UTC (rev 205263)
+++ trunk/Source/WebKit2/ChangeLog        2016-08-31 19:54:12 UTC (rev 205264)
</span><span class="lines">@@ -1,3 +1,43 @@
</span><ins>+2016-08-30  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+        Use Connection::sendWithReply for the SecItem shim messages
+        https://bugs.webkit.org/show_bug.cgi?id=161419
+
+        Reviewed by Tim Horton.
+
+        * DerivedSources.make:
+        * NetworkProcess/NetworkProcess.cpp:
+        (WebKit::NetworkProcess::initializeConnection):
+        * NetworkProcess/mac/NetworkProcessMac.mm:
+        (WebKit::NetworkProcess::platformInitializeNetworkProcess):
+        * Shared/mac/SecItemShim.cpp:
+        (WebKit::workQueue):
+        (WebKit::sendSecItemRequest):
+        (WebKit::webSecItemCopyMatching):
+        (WebKit::webSecItemAdd):
+        (WebKit::webSecItemUpdate):
+        (WebKit::webSecItemDelete):
+        (WebKit::initializeSecItemShim):
+        (WebKit::responseMap): Deleted.
+        (WebKit::SecItemShim::singleton): Deleted.
+        (WebKit::SecItemShim::SecItemShim): Deleted.
+        (WebKit::generateSecItemRequestID): Deleted.
+        (WebKit::SecItemShim::secItemResponse): Deleted.
+        (WebKit::SecItemShim::initialize): Deleted.
+        (WebKit::SecItemShim::initializeConnection): Deleted.
+        * Shared/mac/SecItemShim.h:
+        * Shared/mac/SecItemShim.messages.in: Removed.
+        * UIProcess/mac/SecItemShimProxy.cpp:
+        (WebKit::SecItemShimProxy::didReceiveMessage):
+        (WebKit::SecItemShimProxy::secItemRequest):
+        * UIProcess/mac/SecItemShimProxy.h:
+        * UIProcess/mac/SecItemShimProxy.messages.in:
+        * WebKit2.xcodeproj/project.pbxproj:
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::initializeConnection):
+        * WebProcess/cocoa/WebProcessCocoa.mm:
+        (WebKit::WebProcess::platformInitializeProcess):
+
</ins><span class="cx"> 2016-08-31  Andreas Kling  &lt;akling@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         DOM event handling should pass Event around by reference.
</span></span></pre></div>
<a id="trunkSourceWebKit2DerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DerivedSources.make (205263 => 205264)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DerivedSources.make        2016-08-31 19:53:44 UTC (rev 205263)
+++ trunk/Source/WebKit2/DerivedSources.make        2016-08-31 19:54:12 UTC (rev 205264)
</span><span class="lines">@@ -110,7 +110,6 @@
</span><span class="cx">     RemoteLayerTreeDrawingAreaProxy \
</span><span class="cx">     RemoteObjectRegistry \
</span><span class="cx">     RemoteScrollingCoordinator \
</span><del>-    SecItemShim \
</del><span class="cx">     SecItemShimProxy \
</span><span class="cx">     SmartMagnificationController \
</span><span class="cx">     StorageAreaMap \
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp (205263 => 205264)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp        2016-08-31 19:53:44 UTC (rev 205263)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp        2016-08-31 19:54:12 UTC (rev 205264)
</span><span class="lines">@@ -245,10 +245,6 @@
</span><span class="cx"> {
</span><span class="cx">     ChildProcess::initializeConnection(connection);
</span><span class="cx"> 
</span><del>-#if ENABLE(SEC_ITEM_SHIM)
-    SecItemShim::singleton().initializeConnection(connection);
-#endif
-
</del><span class="cx">     NetworkProcessSupplementMap::const_iterator it = m_supplements.begin();
</span><span class="cx">     NetworkProcessSupplementMap::const_iterator end = m_supplements.end();
</span><span class="cx">     for (; it != end; ++it)
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessiosNetworkProcessIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/ios/NetworkProcessIOS.mm (205263 => 205264)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/ios/NetworkProcessIOS.mm        2016-08-31 19:53:44 UTC (rev 205263)
+++ trunk/Source/WebKit2/NetworkProcess/ios/NetworkProcessIOS.mm        2016-08-31 19:54:12 UTC (rev 205264)
</span><span class="lines">@@ -86,7 +86,7 @@
</span><span class="cx"> void NetworkProcess::platformInitializeNetworkProcess(const NetworkProcessCreationParameters&amp; parameters)
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(SEC_ITEM_SHIM)
</span><del>-    SecItemShim::singleton().initialize(this);
</del><ins>+    initializeSecItemShim(*this);
</ins><span class="cx"> #endif
</span><span class="cx">     platformInitializeNetworkProcessCocoa(parameters);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessmacNetworkProcessMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/mac/NetworkProcessMac.mm (205263 => 205264)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/mac/NetworkProcessMac.mm        2016-08-31 19:53:44 UTC (rev 205263)
+++ trunk/Source/WebKit2/NetworkProcess/mac/NetworkProcessMac.mm        2016-08-31 19:54:12 UTC (rev 205264)
</span><span class="lines">@@ -100,7 +100,7 @@
</span><span class="cx">     platformInitializeNetworkProcessCocoa(parameters);
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(SEC_ITEM_SHIM)
</span><del>-    SecItemShim::singleton().initialize(this);
</del><ins>+    initializeSecItemShim(*this);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     if (!parameters.httpProxy.isNull() || !parameters.httpsProxy.isNull())
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedmacSecItemShimcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/mac/SecItemShim.cpp (205263 => 205264)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/mac/SecItemShim.cpp        2016-08-31 19:53:44 UTC (rev 205263)
+++ trunk/Source/WebKit2/Shared/mac/SecItemShim.cpp        2016-08-31 19:54:12 UTC (rev 205264)
</span><span class="lines">@@ -33,7 +33,6 @@
</span><span class="cx"> #include &quot;SecItemRequestData.h&quot;
</span><span class="cx"> #include &quot;SecItemResponseData.h&quot;
</span><span class="cx"> #include &quot;SecItemShimLibrary.h&quot;
</span><del>-#include &quot;SecItemShimMessages.h&quot;
</del><span class="cx"> #include &quot;SecItemShimProxyMessages.h&quot;
</span><span class="cx"> #include &lt;Security/Security.h&gt;
</span><span class="cx"> #include &lt;atomic&gt;
</span><span class="lines">@@ -58,54 +57,41 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><del>-static BlockingResponseMap&lt;SecItemResponseData&gt;&amp; responseMap()
</del><ins>+static ChildProcess* sharedProcess;
+
+static WorkQueue&amp; workQueue()
</ins><span class="cx"> {
</span><del>-    static std::once_flag onceFlag;
-    static LazyNeverDestroyed&lt;BlockingResponseMap&lt;SecItemResponseData&gt;&gt; responseMap;
</del><ins>+    static WorkQueue* workQueue;
+    static dispatch_once_t onceToken;
+    dispatch_once(&amp;onceToken, ^{
+        workQueue = &amp;WorkQueue::create(&quot;com.apple.WebKit.SecItemShim&quot;).leakRef();
</ins><span class="cx"> 
</span><del>-    std::call_once(onceFlag, [] {
-        responseMap.construct();
</del><span class="cx">     });
</span><span class="cx"> 
</span><del>-    return responseMap;
</del><ins>+    return *workQueue;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static ChildProcess* sharedProcess;
-
-SecItemShim&amp; SecItemShim::singleton()
</del><ins>+static Optional&lt;SecItemResponseData&gt; sendSecItemRequest(SecItemRequestData::Type requestType, CFDictionaryRef query, CFDictionaryRef attributesToMatch = 0)
</ins><span class="cx"> {
</span><del>-    static SecItemShim* shim;
-    static dispatch_once_t once;
-    dispatch_once(&amp;once, ^{
-        shim = adoptRef(new SecItemShim).leakRef();
-    });
</del><ins>+    Optional&lt;SecItemResponseData&gt; response;
</ins><span class="cx"> 
</span><del>-    return *shim;
-}
</del><ins>+    auto semaphore = adoptOSObject(dispatch_semaphore_create(0));
</ins><span class="cx"> 
</span><del>-SecItemShim::SecItemShim()
-    : m_queue(WorkQueue::create(&quot;com.apple.WebKit.SecItemShim&quot;))
-{
-}
</del><ins>+    sharedProcess-&gt;parentProcessConnection()-&gt;sendWithReply(Messages::SecItemShimProxy::SecItemRequest(SecItemRequestData(requestType, query, attributesToMatch)), 0, workQueue(), [&amp;response, &amp;semaphore](auto reply) {
+        if (reply)
+            response = WTFMove(std::get&lt;0&gt;(*reply));
</ins><span class="cx"> 
</span><del>-static uint64_t generateSecItemRequestID()
-{
-    static std::atomic&lt;int64_t&gt; uniqueSecItemRequestID;
-    return ++uniqueSecItemRequestID;
-}
</del><ins>+        dispatch_semaphore_signal(semaphore.get());
+    });
</ins><span class="cx"> 
</span><del>-static std::unique_ptr&lt;SecItemResponseData&gt; sendSecItemRequest(SecItemRequestData::Type requestType, CFDictionaryRef query, CFDictionaryRef attributesToMatch = 0)
-{
-    uint64_t requestID = generateSecItemRequestID();
-    if (!sharedProcess-&gt;parentProcessConnection()-&gt;send(Messages::SecItemShimProxy::SecItemRequest(requestID, SecItemRequestData(requestType, query, attributesToMatch)), 0))
-        return nullptr;
</del><ins>+    dispatch_semaphore_wait(semaphore.get(), DISPATCH_TIME_FOREVER);
</ins><span class="cx"> 
</span><del>-    return responseMap().waitForResponse(requestID);
</del><ins>+    return response;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static OSStatus webSecItemCopyMatching(CFDictionaryRef query, CFTypeRef* result)
</span><span class="cx"> {
</span><del>-    std::unique_ptr&lt;SecItemResponseData&gt; response = sendSecItemRequest(SecItemRequestData::CopyMatching, query);
</del><ins>+    auto response = sendSecItemRequest(SecItemRequestData::CopyMatching, query);
</ins><span class="cx">     if (!response)
</span><span class="cx">         return errSecInteractionNotAllowed;
</span><span class="cx"> 
</span><span class="lines">@@ -115,7 +101,7 @@
</span><span class="cx"> 
</span><span class="cx"> static OSStatus webSecItemAdd(CFDictionaryRef query, CFTypeRef* result)
</span><span class="cx"> {
</span><del>-    std::unique_ptr&lt;SecItemResponseData&gt; response = sendSecItemRequest(SecItemRequestData::Add, query);
</del><ins>+    auto response = sendSecItemRequest(SecItemRequestData::Add, query);
</ins><span class="cx">     if (!response)
</span><span class="cx">         return errSecInteractionNotAllowed;
</span><span class="cx"> 
</span><span class="lines">@@ -126,7 +112,7 @@
</span><span class="cx"> 
</span><span class="cx"> static OSStatus webSecItemUpdate(CFDictionaryRef query, CFDictionaryRef attributesToUpdate)
</span><span class="cx"> {
</span><del>-    std::unique_ptr&lt;SecItemResponseData&gt; response = sendSecItemRequest(SecItemRequestData::Update, query, attributesToUpdate);
</del><ins>+    auto response = sendSecItemRequest(SecItemRequestData::Update, query, attributesToUpdate);
</ins><span class="cx">     if (!response)
</span><span class="cx">         return errSecInteractionNotAllowed;
</span><span class="cx">     
</span><span class="lines">@@ -135,7 +121,7 @@
</span><span class="cx"> 
</span><span class="cx"> static OSStatus webSecItemDelete(CFDictionaryRef query)
</span><span class="cx"> {
</span><del>-    std::unique_ptr&lt;SecItemResponseData&gt; response = sendSecItemRequest(SecItemRequestData::Delete, query);
</del><ins>+    auto response = sendSecItemRequest(SecItemRequestData::Delete, query);
</ins><span class="cx">     if (!response)
</span><span class="cx">         return errSecInteractionNotAllowed;
</span><span class="cx">     
</span><span class="lines">@@ -142,15 +128,10 @@
</span><span class="cx">     return response-&gt;resultCode();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void SecItemShim::secItemResponse(uint64_t requestID, const SecItemResponseData&amp; response)
</del><ins>+void initializeSecItemShim(ChildProcess&amp; process)
</ins><span class="cx"> {
</span><del>-    responseMap().didReceiveResponse(requestID, std::make_unique&lt;SecItemResponseData&gt;(response));
-}
</del><ins>+    sharedProcess = &amp;process;
</ins><span class="cx"> 
</span><del>-void SecItemShim::initialize(ChildProcess* process)
-{
-    sharedProcess = process;
-
</del><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     struct _CFNFrameworksStubs stubs = {
</span><span class="cx">         .version = 0,
</span><span class="lines">@@ -176,11 +157,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void SecItemShim::initializeConnection(IPC::Connection* connection)
-{
-    connection-&gt;addWorkQueueMessageReceiver(Messages::SecItemShim::messageReceiverName(), &amp;m_queue.get(), this);
-}
-
</del><span class="cx"> } // namespace WebKit
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(SEC_ITEM_SHIM)
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedmacSecItemShimh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/mac/SecItemShim.h (205263 => 205264)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/mac/SecItemShim.h        2016-08-31 19:53:44 UTC (rev 205263)
+++ trunk/Source/WebKit2/Shared/mac/SecItemShim.h        2016-08-31 19:54:12 UTC (rev 205264)
</span><span class="lines">@@ -23,39 +23,14 @@
</span><span class="cx">  * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef SecItemShim_h
-#define SecItemShim_h
-
</del><span class="cx"> #if ENABLE(SEC_ITEM_SHIM)
</span><span class="cx"> 
</span><del>-#include &quot;Connection.h&quot;
-
</del><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><span class="cx"> class ChildProcess;
</span><del>-class SecItemResponseData;
</del><span class="cx"> 
</span><del>-class SecItemShim : public IPC::Connection::WorkQueueMessageReceiver {
-WTF_MAKE_NONCOPYABLE(SecItemShim);
-public:
-    static SecItemShim&amp; singleton();
</del><ins>+void initializeSecItemShim(ChildProcess&amp;);
</ins><span class="cx"> 
</span><del>-    void initialize(ChildProcess*);
-    void initializeConnection(IPC::Connection*);
-
-private:
-    SecItemShim();
-
-    // IPC::Connection::WorkQueueMessageReceiver.
-    void didReceiveMessage(IPC::Connection&amp;, IPC::Decoder&amp;) override;
-
-    void secItemResponse(uint64_t requestID, const SecItemResponseData&amp;);
-
-    Ref&lt;WorkQueue&gt; m_queue;
-};
-
</del><span class="cx"> } // namespace WebKit
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(SEC_ITEM_SHIM)
</span><del>-
-#endif // SecItemShim_h
</del></span></pre></div>
<a id="trunkSourceWebKit2SharedmacSecItemShimmessagesin"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/Shared/mac/SecItemShim.messages.in (205263 => 205264)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/mac/SecItemShim.messages.in        2016-08-31 19:53:44 UTC (rev 205263)
+++ trunk/Source/WebKit2/Shared/mac/SecItemShim.messages.in        2016-08-31 19:54:12 UTC (rev 205264)
</span><span class="lines">@@ -1,29 +0,0 @@
</span><del>-# Copyright (C) 2013 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.
-
-messages -&gt; SecItemShim {
-
-#if ENABLE(SEC_ITEM_SHIM)
-    SecItemResponse(uint64_t requestID, WebKit::SecItemResponseData response)
-#endif
-
-}
</del></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacSecItemShimProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/SecItemShimProxy.cpp (205263 => 205264)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/SecItemShimProxy.cpp        2016-08-31 19:53:44 UTC (rev 205263)
+++ trunk/Source/WebKit2/UIProcess/mac/SecItemShimProxy.cpp        2016-08-31 19:54:12 UTC (rev 205264)
</span><span class="lines">@@ -30,7 +30,6 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;SecItemRequestData.h&quot;
</span><span class="cx"> #include &quot;SecItemResponseData.h&quot;
</span><del>-#include &quot;SecItemShimMessages.h&quot;
</del><span class="cx"> #include &quot;SecItemShimProxyMessages.h&quot;
</span><span class="cx"> #include &lt;Security/SecBase.h&gt;
</span><span class="cx"> #include &lt;Security/SecItem.h&gt;
</span><span class="lines">@@ -57,10 +56,12 @@
</span><span class="cx">     connection.addWorkQueueMessageReceiver(Messages::SecItemShimProxy::messageReceiverName(), &amp;m_queue.get(), this);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void SecItemShimProxy::secItemRequest(IPC::Connection&amp; connection, uint64_t requestID, const SecItemRequestData&amp; request)
</del><ins>+void SecItemShimProxy::didReceiveMessage(IPC::Connection&amp;, IPC::Decoder&amp;)
</ins><span class="cx"> {
</span><del>-    SecItemResponseData response;
</del><ins>+}
</ins><span class="cx"> 
</span><ins>+void SecItemShimProxy::secItemRequest(const SecItemRequestData&amp; request, SecItemResponseData&amp; response)
+{
</ins><span class="cx">     switch (request.type()) {
</span><span class="cx">     case SecItemRequestData::Invalid:
</span><span class="cx">         LOG_ERROR(&quot;SecItemShimProxy::secItemRequest received an invalid data request. Please file a bug if you know how you caused this.&quot;);
</span><span class="lines">@@ -93,8 +94,6 @@
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx">     }
</span><del>-
-    connection.send(Messages::SecItemShim::SecItemResponse(requestID, response), 0);
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacSecItemShimProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/SecItemShimProxy.h (205263 => 205264)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/SecItemShimProxy.h        2016-08-31 19:53:44 UTC (rev 205263)
+++ trunk/Source/WebKit2/UIProcess/mac/SecItemShimProxy.h        2016-08-31 19:54:12 UTC (rev 205264)
</span><span class="lines">@@ -23,8 +23,7 @@
</span><span class="cx">  * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef SecItemShimProxy_h
-#define SecItemShimProxy_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(SEC_ITEM_SHIM)
</span><span class="cx"> 
</span><span class="lines">@@ -33,6 +32,7 @@
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><span class="cx"> class SecItemRequestData;
</span><ins>+class SecItemResponseData;
</ins><span class="cx"> 
</span><span class="cx"> class SecItemShimProxy : public IPC::Connection::WorkQueueMessageReceiver {
</span><span class="cx"> WTF_MAKE_NONCOPYABLE(SecItemShimProxy);
</span><span class="lines">@@ -46,8 +46,9 @@
</span><span class="cx"> 
</span><span class="cx">     // IPC::Connection::WorkQueueMessageReceiver
</span><span class="cx">     void didReceiveMessage(IPC::Connection&amp;, IPC::Decoder&amp;) override;
</span><ins>+    void didReceiveSyncMessage(IPC::Connection&amp;, IPC::Decoder&amp;, std::unique_ptr&lt;IPC::Encoder&gt;&amp;) override;
</ins><span class="cx"> 
</span><del>-    void secItemRequest(IPC::Connection&amp;, uint64_t requestID, const SecItemRequestData&amp;);
</del><ins>+    void secItemRequest(const SecItemRequestData&amp;, SecItemResponseData&amp;);
</ins><span class="cx"> 
</span><span class="cx">     Ref&lt;WorkQueue&gt; m_queue;
</span><span class="cx"> };
</span><span class="lines">@@ -55,5 +56,3 @@
</span><span class="cx"> } // namespace WebKit
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(SEC_ITEM_SHIM)
</span><del>-
-#endif // SecItemShimProxy_h
</del></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacSecItemShimProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/SecItemShimProxy.messages.in (205263 => 205264)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/SecItemShimProxy.messages.in        2016-08-31 19:53:44 UTC (rev 205263)
+++ trunk/Source/WebKit2/UIProcess/mac/SecItemShimProxy.messages.in        2016-08-31 19:54:12 UTC (rev 205264)
</span><span class="lines">@@ -23,7 +23,7 @@
</span><span class="cx"> messages -&gt; SecItemShimProxy {
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(SEC_ITEM_SHIM)
</span><del>-    SecItemRequest(uint64_t requestID, WebKit::SecItemRequestData request) WantsConnection
</del><ins>+    SecItemRequest(WebKit::SecItemRequestData request) -&gt; (WebKit::SecItemResponseData response)
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (205263 => 205264)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2016-08-31 19:53:44 UTC (rev 205263)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2016-08-31 19:54:12 UTC (rev 205264)
</span><span class="lines">@@ -1782,8 +1782,6 @@
</span><span class="cx">                 E170876C16D6CA6900F99226 /* BlobRegistryProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = E170876A16D6CA6900F99226 /* BlobRegistryProxy.h */; };
</span><span class="cx">                 E179088D169BAA62006904C7 /* SecItemShim.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E18E6947169B77C8009B6670 /* SecItemShim.cpp */; };
</span><span class="cx">                 E179088F169BAA6A006904C7 /* SecItemShim.h in Headers */ = {isa = PBXBuildFile; fileRef = E18E6948169B77C8009B6670 /* SecItemShim.h */; };
</span><del>-                E1790890169BAA7F006904C7 /* SecItemShimMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E18E6911169B667B009B6670 /* SecItemShimMessageReceiver.cpp */; };
-                E1790891169BAA82006904C7 /* SecItemShimMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = E18E6912169B667B009B6670 /* SecItemShimMessages.h */; };
</del><span class="cx">                 E1798C7916E6818800240139 /* NetworkBlobRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1798C7716E6818800240139 /* NetworkBlobRegistry.cpp */; };
</span><span class="cx">                 E1798C7A16E6818800240139 /* NetworkBlobRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = E1798C7816E6818800240139 /* NetworkBlobRegistry.h */; };
</span><span class="cx">                 E179FD9C134D38060015B883 /* ArgumentCodersMac.h in Headers */ = {isa = PBXBuildFile; fileRef = E179FD9B134D38060015B883 /* ArgumentCodersMac.h */; };
</span><span class="lines">@@ -3916,9 +3914,6 @@
</span><span class="cx">                 E18E6909169B563F009B6670 /* SecItemShimProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SecItemShimProxy.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E18E690A169B563F009B6670 /* SecItemShimProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SecItemShimProxy.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E18E690D169B57DF009B6670 /* SecItemShimProxy.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SecItemShimProxy.messages.in; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                E18E690F169B5928009B6670 /* SecItemShim.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SecItemShim.messages.in; sourceTree = &quot;&lt;group&gt;&quot;; };
-                E18E6911169B667B009B6670 /* SecItemShimMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SecItemShimMessageReceiver.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                E18E6912169B667B009B6670 /* SecItemShimMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SecItemShimMessages.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 E18E6913169B667B009B6670 /* SecItemShimProxyMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SecItemShimProxyMessageReceiver.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E18E6914169B667B009B6670 /* SecItemShimProxyMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SecItemShimProxyMessages.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E18E6947169B77C8009B6670 /* SecItemShim.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SecItemShim.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -6470,7 +6465,6 @@
</span><span class="cx">                                 51D130521382EAC000351EDD /* SecItemResponseData.h */,
</span><span class="cx">                                 E18E6947169B77C8009B6670 /* SecItemShim.cpp */,
</span><span class="cx">                                 E18E6948169B77C8009B6670 /* SecItemShim.h */,
</span><del>-                                E18E690F169B5928009B6670 /* SecItemShim.messages.in */,
</del><span class="cx">                                 511F8A77138B460900A95F44 /* SecItemShimLibrary.h */,
</span><span class="cx">                                 511F8A78138B460900A95F44 /* SecItemShimLibrary.mm */,
</span><span class="cx">                                 1AA9BAE0184FFAC7003B6BC6 /* WeakObjCPtr.h */,
</span><span class="lines">@@ -7098,8 +7092,6 @@
</span><span class="cx">                                 1AC1338418590C4600F3EC05 /* RemoteObjectRegistryMessages.h */,
</span><span class="cx">                                 0F5947A5187B517600437857 /* RemoteScrollingCoordinatorMessageReceiver.cpp */,
</span><span class="cx">                                 0F5947A6187B517600437857 /* RemoteScrollingCoordinatorMessages.h */,
</span><del>-                                E18E6911169B667B009B6670 /* SecItemShimMessageReceiver.cpp */,
-                                E18E6912169B667B009B6670 /* SecItemShimMessages.h */,
</del><span class="cx">                                 E18E6913169B667B009B6670 /* SecItemShimProxyMessageReceiver.cpp */,
</span><span class="cx">                                 E18E6914169B667B009B6670 /* SecItemShimProxyMessages.h */,
</span><span class="cx">                                 2DE6943B18BD2A68005C15E5 /* SmartMagnificationControllerMessageReceiver.cpp */,
</span><span class="lines">@@ -7778,7 +7770,6 @@
</span><span class="cx">                                 51D130561382EAC000351EDD /* SecItemResponseData.h in Headers */,
</span><span class="cx">                                 E179088F169BAA6A006904C7 /* SecItemShim.h in Headers */,
</span><span class="cx">                                 511F8A7B138B460900A95F44 /* SecItemShimLibrary.h in Headers */,
</span><del>-                                E1790891169BAA82006904C7 /* SecItemShimMessages.h in Headers */,
</del><span class="cx">                                 E18E690C169B563F009B6670 /* SecItemShimProxy.h in Headers */,
</span><span class="cx">                                 E18E6918169B667B009B6670 /* SecItemShimProxyMessages.h in Headers */,
</span><span class="cx">                                 514D9F5719119D35000063A7 /* ServicesController.h in Headers */,
</span><span class="lines">@@ -9262,7 +9253,6 @@
</span><span class="cx">                                 51D130531382EAC000351EDD /* SecItemRequestData.cpp in Sources */,
</span><span class="cx">                                 51D130551382EAC000351EDD /* SecItemResponseData.cpp in Sources */,
</span><span class="cx">                                 E179088D169BAA62006904C7 /* SecItemShim.cpp in Sources */,
</span><del>-                                E1790890169BAA7F006904C7 /* SecItemShimMessageReceiver.cpp in Sources */,
</del><span class="cx">                                 E18E690B169B563F009B6670 /* SecItemShimProxy.cpp in Sources */,
</span><span class="cx">                                 E18E6917169B667B009B6670 /* SecItemShimProxyMessageReceiver.cpp in Sources */,
</span><span class="cx">                                 514D9F5819119D35000063A7 /* ServicesController.mm in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebProcess.cpp (205263 => 205264)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2016-08-31 19:53:44 UTC (rev 205263)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2016-08-31 19:54:12 UTC (rev 205264)
</span><span class="lines">@@ -246,10 +246,6 @@
</span><span class="cx">     m_pluginProcessConnectionManager-&gt;initializeConnection(connection);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if ENABLE(SEC_ITEM_SHIM)
-    SecItemShim::singleton().initializeConnection(connection);
-#endif
-
</del><span class="cx">     for (auto&amp; supplement : m_supplements.values())
</span><span class="cx">         supplement-&gt;initializeConnection(connection);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcesscocoaWebProcessCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm (205263 => 205264)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm        2016-08-31 19:53:44 UTC (rev 205263)
+++ trunk/Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm        2016-08-31 19:54:12 UTC (rev 205264)
</span><span class="lines">@@ -249,7 +249,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(SEC_ITEM_SHIM)
</span><del>-    SecItemShim::singleton().initialize(this);
</del><ins>+    initializeSecItemShim(*this);
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>