<!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>[150295] 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/150295">150295</a></dd>
<dt>Author</dt> <dd>andersca@apple.com</dd>
<dt>Date</dt> <dd>2013-05-17 13:41:51 -0700 (Fri, 17 May 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>WKKeyValueStorageManagerGetKeyValueStorageOrigins should get origins from the UI process
https://bugs.webkit.org/show_bug.cgi?id=116346
&lt;rdar://problem/13852829&gt;

Reviewed by Andreas Kling.

Source/WebCore:

Export the UTF8Encoding symbol.

* WebCore.exp.in:

Source/WebKit2:

* UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
(WebKit::LocalStorageDatabaseTracker::origins):
New helper function to return all the tracked origins.

* UIProcess/Storage/StorageManager.cpp:
(WebKit::StorageManager::StorageManager):
Initialize the UTF-8 encoding.

(WebKit::StorageManager::getOrigins):
Call getOriginsInternal on our queue.

(WebKit::callCallbackFunction):
Helper function for calling the callback function.

(WebKit::StorageManager::getOriginsInternal):
Get the origins and make sure we call the callback with the given function dispatcher.

* UIProcess/WebKeyValueStorageManagerProxy.cpp:
(WebKit::didGetKeyValueStorageOriginsCallback):
Construct the array of WebSecurityOrigin objects and call the callback.

(WebKit::WebKeyValueStorageManagerProxy::getKeyValueStorageOrigins):
Call StorageManager::getOrigins.

Source/WTF:

Add forward declaration for Function.

* wtf/Forward.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtfForwardh">trunk/Source/WTF/wtf/Forward.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessStorageLocalStorageDatabaseTrackercpp">trunk/Source/WebKit2/UIProcess/Storage/LocalStorageDatabaseTracker.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessStorageLocalStorageDatabaseTrackerh">trunk/Source/WebKit2/UIProcess/Storage/LocalStorageDatabaseTracker.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessStorageStorageManagercpp">trunk/Source/WebKit2/UIProcess/Storage/StorageManager.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessStorageStorageManagerh">trunk/Source/WebKit2/UIProcess/Storage/StorageManager.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebKeyValueStorageManagerProxycpp">trunk/Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (150294 => 150295)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog        2013-05-17 20:32:43 UTC (rev 150294)
+++ trunk/Source/WTF/ChangeLog        2013-05-17 20:41:51 UTC (rev 150295)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2013-05-17  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+        WKKeyValueStorageManagerGetKeyValueStorageOrigins should get origins from the UI process
+        https://bugs.webkit.org/show_bug.cgi?id=116346
+        &lt;rdar://problem/13852829&gt;
+
+        Reviewed by Andreas Kling.
+
+        Add forward declaration for Function.
+
+        * wtf/Forward.h:
+
</ins><span class="cx"> 2013-05-17  Patrick Gansterer  &lt;paroga@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         [CMake] Remove invalid include paths
</span></span></pre></div>
<a id="trunkSourceWTFwtfForwardh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/Forward.h (150294 => 150295)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/Forward.h        2013-05-17 20:32:43 UTC (rev 150294)
+++ trunk/Source/WTF/wtf/Forward.h        2013-05-17 20:41:51 UTC (rev 150295)
</span><span class="lines">@@ -44,6 +44,7 @@
</span><span class="cx">     class Encoder;
</span><span class="cx">     class Float32Array;
</span><span class="cx">     class Float64Array;
</span><ins>+    class FunctionDispatcher;
</ins><span class="cx">     class Int8Array;
</span><span class="cx">     class Int16Array;
</span><span class="cx">     class Int32Array;
</span><span class="lines">@@ -77,6 +78,7 @@
</span><span class="cx"> using WTF::Decoder;
</span><span class="cx"> using WTF::Float32Array;
</span><span class="cx"> using WTF::Float64Array;
</span><ins>+using WTF::FunctionDispatcher;
</ins><span class="cx"> using WTF::Int8Array;
</span><span class="cx"> using WTF::Int16Array;
</span><span class="cx"> using WTF::Int32Array;
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (150294 => 150295)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2013-05-17 20:32:43 UTC (rev 150294)
+++ trunk/Source/WebCore/ChangeLog        2013-05-17 20:41:51 UTC (rev 150295)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2013-05-17  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+        WKKeyValueStorageManagerGetKeyValueStorageOrigins should get origins from the UI process
+        https://bugs.webkit.org/show_bug.cgi?id=116346
+        &lt;rdar://problem/13852829&gt;
+
+        Reviewed by Andreas Kling.
+
+        Export the UTF8Encoding symbol.
+
+        * WebCore.exp.in:
+
</ins><span class="cx"> 2013-05-17  Andreas Kling  &lt;akling@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Apply FINAL to the RenderObject hierarchy.
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (150294 => 150295)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2013-05-17 20:32:43 UTC (rev 150294)
+++ trunk/Source/WebCore/WebCore.exp.in        2013-05-17 20:41:51 UTC (rev 150295)
</span><span class="lines">@@ -226,6 +226,7 @@
</span><span class="cx"> __ZN7WebCore12TextIterator8subrangeEPNS_5RangeEii
</span><span class="cx"> __ZN7WebCore12TextIteratorC1EPKNS_5RangeENS_20TextIteratorBehaviorE
</span><span class="cx"> __ZN7WebCore12TextIteratorD1Ev
</span><ins>+__ZN7WebCore12UTF8EncodingEv
</ins><span class="cx"> __ZN7WebCore12cacheStorageEv
</span><span class="cx"> __ZN7WebCore12createMarkupEPKNS_5RangeEPN3WTF6VectorIPNS_4NodeELm0ENS3_15CrashOnOverflowEEENS_23EAnnotateForInterchangeEbNS_13EAbsoluteURLsE
</span><span class="cx"> __ZN7WebCore12deleteCookieERKNS_21NetworkStorageSessionERKNS_4KURLERKN3WTF6StringE
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (150294 => 150295)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2013-05-17 20:32:43 UTC (rev 150294)
+++ trunk/Source/WebKit2/ChangeLog        2013-05-17 20:41:51 UTC (rev 150295)
</span><span class="lines">@@ -1,3 +1,35 @@
</span><ins>+2013-05-17  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+        WKKeyValueStorageManagerGetKeyValueStorageOrigins should get origins from the UI process
+        https://bugs.webkit.org/show_bug.cgi?id=116346
+        &lt;rdar://problem/13852829&gt;
+
+        Reviewed by Andreas Kling.
+
+        * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
+        (WebKit::LocalStorageDatabaseTracker::origins):
+        New helper function to return all the tracked origins.
+
+        * UIProcess/Storage/StorageManager.cpp:
+        (WebKit::StorageManager::StorageManager):
+        Initialize the UTF-8 encoding.
+
+        (WebKit::StorageManager::getOrigins):
+        Call getOriginsInternal on our queue.
+
+        (WebKit::callCallbackFunction):
+        Helper function for calling the callback function.
+
+        (WebKit::StorageManager::getOriginsInternal):
+        Get the origins and make sure we call the callback with the given function dispatcher.
+
+        * UIProcess/WebKeyValueStorageManagerProxy.cpp:
+        (WebKit::didGetKeyValueStorageOriginsCallback):
+        Construct the array of WebSecurityOrigin objects and call the callback.
+
+        (WebKit::WebKeyValueStorageManagerProxy::getKeyValueStorageOrigins):
+        Call StorageManager::getOrigins.
+
</ins><span class="cx"> 2013-05-16  Alexey Proskuryakov  &lt;ap@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Text input is largely broken when there are subframes loading
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessStorageLocalStorageDatabaseTrackercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Storage/LocalStorageDatabaseTracker.cpp (150294 => 150295)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Storage/LocalStorageDatabaseTracker.cpp        2013-05-17 20:32:43 UTC (rev 150294)
+++ trunk/Source/WebKit2/UIProcess/Storage/LocalStorageDatabaseTracker.cpp        2013-05-17 20:41:51 UTC (rev 150295)
</span><span class="lines">@@ -70,6 +70,17 @@
</span><span class="cx">     removeDatabaseWithOriginIdentifier(securityOrigin-&gt;databaseIdentifier());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+Vector&lt;RefPtr&lt;WebCore::SecurityOrigin&gt;&gt; LocalStorageDatabaseTracker::origins() const
+{
+    Vector&lt;RefPtr&lt;SecurityOrigin&gt;&gt; origins;
+    origins.reserveInitialCapacity(m_origins.size());
+
+    for (HashSet&lt;String&gt;::const_iterator it = m_origins.begin(), end = m_origins.end(); it != end; ++it)
+        origins.uncheckedAppend(SecurityOrigin::createFromDatabaseIdentifier(*it));
+
+    return origins;
+}
+
</ins><span class="cx"> void LocalStorageDatabaseTracker::setLocalStorageDirectoryInternal(const String&amp; localStorageDirectory)
</span><span class="cx"> {
</span><span class="cx">     if (m_database.isOpen())
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessStorageLocalStorageDatabaseTrackerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Storage/LocalStorageDatabaseTracker.h (150294 => 150295)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Storage/LocalStorageDatabaseTracker.h        2013-05-17 20:32:43 UTC (rev 150294)
+++ trunk/Source/WebKit2/UIProcess/Storage/LocalStorageDatabaseTracker.h        2013-05-17 20:41:51 UTC (rev 150295)
</span><span class="lines">@@ -53,6 +53,8 @@
</span><span class="cx">     void didOpenDatabaseWithOrigin(WebCore::SecurityOrigin*);
</span><span class="cx">     void deleteEmptyDatabaseWithOrigin(WebCore::SecurityOrigin*);
</span><span class="cx"> 
</span><ins>+    Vector&lt;RefPtr&lt;WebCore::SecurityOrigin&gt;&gt; origins() const;
+
</ins><span class="cx"> private:
</span><span class="cx">     explicit LocalStorageDatabaseTracker(PassRefPtr&lt;WorkQueue&gt;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessStorageStorageManagercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Storage/StorageManager.cpp (150294 => 150295)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Storage/StorageManager.cpp        2013-05-17 20:32:43 UTC (rev 150294)
+++ trunk/Source/WebKit2/UIProcess/Storage/StorageManager.cpp        2013-05-17 20:41:51 UTC (rev 150295)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> #include &quot;WorkQueue.h&quot;
</span><span class="cx"> #include &lt;WebCore/SecurityOriginHash.h&gt;
</span><span class="cx"> #include &lt;WebCore/StorageMap.h&gt;
</span><ins>+#include &lt;WebCore/TextEncoding.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><span class="lines">@@ -335,6 +336,8 @@
</span><span class="cx">     : m_queue(WorkQueue::create(&quot;com.apple.WebKit.StorageManager&quot;))
</span><span class="cx">     , m_localStorageDatabaseTracker(LocalStorageDatabaseTracker::create(m_queue))
</span><span class="cx"> {
</span><ins>+    // Make sure the encoding is initialized before we start dispatching things to the queue.
+    UTF8Encoding();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> StorageManager::~StorageManager()
</span><span class="lines">@@ -378,6 +381,11 @@
</span><span class="cx">     m_queue-&gt;dispatch(bind(&amp;StorageManager::invalidateConnectionInternal, this, RefPtr&lt;CoreIPC::Connection&gt;(webProcessProxy-&gt;connection())));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void StorageManager::getOrigins(FunctionDispatcher* callbackDispatcher, void* context, void (*callback)(const Vector&lt;RefPtr&lt;WebCore::SecurityOrigin&gt;&gt;&amp; securityOrigins, void* context))
+{
+    m_queue-&gt;dispatch(bind(&amp;StorageManager::getOriginsInternal, this, RefPtr&lt;FunctionDispatcher&gt;(callbackDispatcher), context, callback));
+}
+
</ins><span class="cx"> void StorageManager::createLocalStorageMap(CoreIPC::Connection* connection, uint64_t storageMapID, uint64_t storageNamespaceID, const SecurityOriginData&amp; securityOriginData)
</span><span class="cx"> {
</span><span class="cx">     std::pair&lt;RefPtr&lt;CoreIPC::Connection&gt;, uint64_t&gt; connectionAndStorageMapIDPair(connection, storageMapID);
</span><span class="lines">@@ -558,4 +566,16 @@
</span><span class="cx">     return result.iterator-&gt;value.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static void callCallbackFunction(void* context, void (*callbackFunction)(const Vector&lt;RefPtr&lt;WebCore::SecurityOrigin&gt;&gt;&amp; securityOrigins, void* context), Vector&lt;RefPtr&lt;WebCore::SecurityOrigin&gt;&gt;* securityOriginsPtr)
+{
+    OwnPtr&lt;Vector&lt;RefPtr&lt;WebCore::SecurityOrigin&gt;&gt;&gt; securityOrigins = adoptPtr(securityOriginsPtr);
+    callbackFunction(*securityOrigins, context);
+}
+
+void StorageManager::getOriginsInternal(FunctionDispatcher* dispatcher, void* context, void (*callbackFunction)(const Vector&lt;RefPtr&lt;WebCore::SecurityOrigin&gt;&gt;&amp; securityOrigins, void* context))
+{
+    OwnPtr&lt;Vector&lt;RefPtr&lt;WebCore::SecurityOrigin&gt;&gt;&gt; securityOrigins = adoptPtr(new Vector&lt;RefPtr&lt;WebCore::SecurityOrigin&gt;&gt;(m_localStorageDatabaseTracker-&gt;origins()));
+    dispatcher-&gt;dispatch(bind(callCallbackFunction, context, callbackFunction, securityOrigins.leakPtr()));
+}
+
</ins><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessStorageStorageManagerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Storage/StorageManager.h (150294 => 150295)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Storage/StorageManager.h        2013-05-17 20:32:43 UTC (rev 150294)
+++ trunk/Source/WebKit2/UIProcess/Storage/StorageManager.h        2013-05-17 20:41:51 UTC (rev 150295)
</span><span class="lines">@@ -27,12 +27,17 @@
</span><span class="cx"> #define StorageManager_h
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Connection.h&quot;
</span><ins>+#include &lt;wtf/Forward.h&gt;
</ins><span class="cx"> #include &lt;wtf/PassRefPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/ThreadSafeRefCounted.h&gt;
</span><span class="cx"> #include &lt;wtf/text/StringHash.h&gt;
</span><span class="cx"> 
</span><span class="cx"> class WorkQueue;
</span><span class="cx"> 
</span><ins>+namespace WebCore {
+class SecurityOrigin;
+}
+
</ins><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><span class="cx"> struct SecurityOriginData;
</span><span class="lines">@@ -54,6 +59,10 @@
</span><span class="cx">     void processWillOpenConnection(WebProcessProxy*);
</span><span class="cx">     void processWillCloseConnection(WebProcessProxy*);
</span><span class="cx"> 
</span><ins>+    // FIXME: Instead of a context + C function, this should take a WTF::Function, but we currently don't
+    // support arguments in functions.
+    void getOrigins(FunctionDispatcher* callbackDispatcher, void* context, void (*callback)(const Vector&lt;RefPtr&lt;WebCore::SecurityOrigin&gt;&gt;&amp; securityOrigins, void* context));
+
</ins><span class="cx"> private:
</span><span class="cx">     StorageManager();
</span><span class="cx"> 
</span><span class="lines">@@ -84,6 +93,8 @@
</span><span class="cx">     class LocalStorageNamespace;
</span><span class="cx">     LocalStorageNamespace* getOrCreateLocalStorageNamespace(uint64_t storageNamespaceID);
</span><span class="cx"> 
</span><ins>+    void getOriginsInternal(FunctionDispatcher* callbackDispatcher, void* context, void (*callback)(const Vector&lt;RefPtr&lt;WebCore::SecurityOrigin&gt;&gt;&amp; securityOrigins, void* context));
+
</ins><span class="cx">     RefPtr&lt;WorkQueue&gt; m_queue;
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;LocalStorageDatabaseTracker&gt; m_localStorageDatabaseTracker;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebKeyValueStorageManagerProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.cpp (150294 => 150295)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.cpp        2013-05-17 20:32:43 UTC (rev 150294)
+++ trunk/Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.cpp        2013-05-17 20:41:51 UTC (rev 150295)
</span><span class="lines">@@ -32,6 +32,8 @@
</span><span class="cx"> #include &quot;WebKeyValueStorageManagerProxyMessages.h&quot;
</span><span class="cx"> #include &quot;WebSecurityOrigin.h&quot;
</span><span class="cx"> 
</span><ins>+using namespace WebCore;
+
</ins><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><span class="cx"> const char* WebKeyValueStorageManagerProxy::supplementName()
</span><span class="lines">@@ -81,15 +83,23 @@
</span><span class="cx">     APIObject::deref();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebKeyValueStorageManagerProxy::getKeyValueStorageOrigins(PassRefPtr&lt;ArrayCallback&gt; prpCallback)
</del><ins>+static void didGetKeyValueStorageOriginsCallback(const Vector&lt;RefPtr&lt;WebCore::SecurityOrigin&gt;&gt;&amp; securityOrigins, void* context)
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;ArrayCallback&gt; callback = prpCallback;
-    uint64_t callbackID = callback-&gt;callbackID();
-    m_arrayCallbacks.set(callbackID, callback.release());
</del><ins>+    RefPtr&lt;ArrayCallback&gt; callback = adoptRef(static_cast&lt;ArrayCallback*&gt;(context));
</ins><span class="cx"> 
</span><del>-    // FIXME (Multi-WebProcess): &lt;rdar://problem/12239765&gt; Should key-value storage be handled in the web process?
-    context()-&gt;sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebKeyValueStorageManager::GetKeyValueStorageOrigins(callbackID));
</del><ins>+    Vector&lt;RefPtr&lt;APIObject&gt;&gt; webSecurityOrigins;
+    webSecurityOrigins.reserveInitialCapacity(securityOrigins.size());
+
+    for (unsigned i = 0; i &lt; securityOrigins.size(); ++i)
+        webSecurityOrigins.uncheckedAppend(WebSecurityOrigin::create(securityOrigins[i]));
+
+    callback-&gt;performCallbackWithReturnValue(ImmutableArray::adopt(webSecurityOrigins).get());
</ins><span class="cx"> }
</span><ins>+
+void WebKeyValueStorageManagerProxy::getKeyValueStorageOrigins(PassRefPtr&lt;ArrayCallback&gt; prpCallback)
+{
+    context()-&gt;storageManager().getOrigins(RunLoop::main(), prpCallback.leakRef(), didGetKeyValueStorageOriginsCallback);
+}
</ins><span class="cx">     
</span><span class="cx"> void WebKeyValueStorageManagerProxy::didGetKeyValueStorageOrigins(const Vector&lt;SecurityOriginData&gt;&amp; originDatas, uint64_t callbackID)
</span><span class="cx"> {
</span></span></pre>
</div>
</div>

</body>
</html>