<!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>[180575] 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/180575">180575</a></dd>
<dt>Author</dt> <dd>andersca@apple.com</dd>
<dt>Date</dt> <dd>2015-02-24 10:55:10 -0800 (Tue, 24 Feb 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Implement more of the data fetching API
https://bugs.webkit.org/show_bug.cgi?id=141975
Reviewed by Andreas Kling.
Source/WebCore:
Add API for getting origins in a given session that has cached data.
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::originsWithCache):
Source/WebKit2:
* Shared/WebsiteData/WebsiteData.cpp: Added.
(WebKit::WebsiteData::Entry::encode):
(WebKit::WebsiteData::Entry::decode):
(WebKit::WebsiteData::encode):
(WebKit::WebsiteData::decode):
* Shared/WebsiteData/WebsiteData.h: Added.
Add a new WebsiteData class that will store website data. Currently it only stores
origin + website data type, but in the future it is going to store more things, like
host names that have cookies associated.
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::~WebProcessProxy):
Assert that we don't have any pending fetch data callbacks.
(WebKit::WebProcessProxy::connectionDidClose):
Invoke any pending fetch website data callbacks.
(WebKit::WebProcessProxy::didFetchWebsiteData):
Grab the callback and invoke it.
(WebKit::WebProcessProxy::fetchWebsiteData):
Set up a pending callback and send a FetchWebsiteData message to the web process.
* UIProcess/WebProcessProxy.h:
Add new member.
* UIProcess/WebProcessProxy.messages.in:
Add a DidFetchWebsiteData message.
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::computeWebProcessAccessTypeForDataFetch):
Return the web process access type for the given set of data types.
(WebKit::WebsiteDataStore::fetchData):
Set up a callback aggregator that will assemble the needed website data into a vector of website data records.
(WebKit::computeNetworkProcessAccessTypeForDataRemoval):
(WebKit::computeWebProcessAccessTypeForDataRemoval):
Rename these functions to indicate that they are about data removal.
(WebKit::WebsiteDataStore::removeData):
Append "ForDataRemoval" to function calls.
* WebKit2.xcodeproj/project.pbxproj:
Add new files.
* WebProcess/Storage/StorageAreaMap.cpp:
(WebKit::StorageAreaMap::StorageAreaMap):
Tighten types.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::fetchWebsiteData):
For now, just fetch memory cache data.
* WebProcess/WebProcess.h:
Add new members.
* WebProcess/WebProcess.messages.in:
Add FetchWebsiteData message.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreloadercacheMemoryCachecpp">trunk/Source/WebCore/loader/cache/MemoryCache.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadercacheMemoryCacheh">trunk/Source/WebCore/loader/cache/MemoryCache.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebProcessProxycpp">trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebProcessProxyh">trunk/Source/WebKit2/UIProcess/WebProcessProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebProcessProxymessagesin">trunk/Source/WebKit2/UIProcess/WebProcessProxy.messages.in</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebsiteDataWebsiteDataStorecpp">trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebKit2WebProcessStorageStorageAreaMapcpp">trunk/Source/WebKit2/WebProcess/Storage/StorageAreaMap.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebProcesscpp">trunk/Source/WebKit2/WebProcess/WebProcess.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebProcessh">trunk/Source/WebKit2/WebProcess/WebProcess.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebProcessmessagesin">trunk/Source/WebKit2/WebProcess/WebProcess.messages.in</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2SharedWebsiteDataWebsiteDatacpp">trunk/Source/WebKit2/Shared/WebsiteData/WebsiteData.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharedWebsiteDataWebsiteDatah">trunk/Source/WebKit2/Shared/WebsiteData/WebsiteData.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (180574 => 180575)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-02-24 18:47:54 UTC (rev 180574)
+++ trunk/Source/WebCore/ChangeLog        2015-02-24 18:55:10 UTC (rev 180575)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2015-02-24 Anders Carlsson <andersca@apple.com>
+
+ Implement more of the data fetching API
+ https://bugs.webkit.org/show_bug.cgi?id=141975
+
+ Reviewed by Andreas Kling.
+
+ Add API for getting origins in a given session that has cached data.
+
+ * loader/cache/MemoryCache.cpp:
+ (WebCore::MemoryCache::originsWithCache):
+
</ins><span class="cx"> 2015-02-24 Simon Fraser <simon.fraser@apple.com>
</span><span class="cx">
</span><span class="cx"> Use nullptr in more places in FrameView, RenderView, RenderObject
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheMemoryCachecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/MemoryCache.cpp (180574 => 180575)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/MemoryCache.cpp        2015-02-24 18:47:54 UTC (rev 180574)
+++ trunk/Source/WebCore/loader/cache/MemoryCache.cpp        2015-02-24 18:55:10 UTC (rev 180575)
</span><span class="lines">@@ -562,6 +562,28 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+HashSet<RefPtr<SecurityOrigin>> MemoryCache::originsWithCache(SessionID sessionID) const
+{
+ HashSet<RefPtr<SecurityOrigin>> origins;
+
+ auto it = m_sessionResources.find(sessionID);
+ if (it != m_sessionResources.end()) {
+
+ for (auto& keyValue : *it->value) {
+ auto& resource = *keyValue.value;
+#if ENABLE(CACHE_PARTITIONING)
+ auto& partitionName = keyValue.key.second;
+ if (!partitionName.isEmpty())
+ origins.add(SecurityOrigin::create("http", partitionName, 0));
+ else
+#endif
+ origins.add(SecurityOrigin::create(resource.url()));
+ }
+ }
+
+ return origins;
+}
+
</ins><span class="cx"> void MemoryCache::removeFromLiveDecodedResourcesList(CachedResource& resource)
</span><span class="cx"> {
</span><span class="cx"> m_liveDecodedResources.remove(&resource);
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheMemoryCacheh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/MemoryCache.h (180574 => 180575)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/MemoryCache.h        2015-02-24 18:47:54 UTC (rev 180574)
+++ trunk/Source/WebCore/loader/cache/MemoryCache.h        2015-02-24 18:55:10 UTC (rev 180575)
</span><span class="lines">@@ -148,6 +148,7 @@
</span><span class="cx"> typedef HashSet<RefPtr<SecurityOrigin>> SecurityOriginSet;
</span><span class="cx"> WEBCORE_EXPORT void removeResourcesWithOrigin(SecurityOrigin&);
</span><span class="cx"> WEBCORE_EXPORT void getOriginsWithCache(SecurityOriginSet& origins);
</span><ins>+ WEBCORE_EXPORT HashSet<RefPtr<SecurityOrigin>> originsWithCache(SessionID) const;
</ins><span class="cx">
</span><span class="cx"> #if USE(CG)
</span><span class="cx"> // FIXME: Remove the USE(CG) once we either make NativeImagePtr a smart pointer on all platforms or
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (180574 => 180575)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-02-24 18:47:54 UTC (rev 180574)
+++ trunk/Source/WebKit2/ChangeLog        2015-02-24 18:55:10 UTC (rev 180575)
</span><span class="lines">@@ -1,3 +1,70 @@
</span><ins>+2015-02-24 Anders Carlsson <andersca@apple.com>
+
+ Implement more of the data fetching API
+ https://bugs.webkit.org/show_bug.cgi?id=141975
+
+ Reviewed by Andreas Kling.
+
+ * Shared/WebsiteData/WebsiteData.cpp: Added.
+ (WebKit::WebsiteData::Entry::encode):
+ (WebKit::WebsiteData::Entry::decode):
+ (WebKit::WebsiteData::encode):
+ (WebKit::WebsiteData::decode):
+ * Shared/WebsiteData/WebsiteData.h: Added.
+ Add a new WebsiteData class that will store website data. Currently it only stores
+ origin + website data type, but in the future it is going to store more things, like
+ host names that have cookies associated.
+
+ * UIProcess/WebProcessProxy.cpp:
+ (WebKit::WebProcessProxy::~WebProcessProxy):
+ Assert that we don't have any pending fetch data callbacks.
+
+ (WebKit::WebProcessProxy::connectionDidClose):
+ Invoke any pending fetch website data callbacks.
+
+ (WebKit::WebProcessProxy::didFetchWebsiteData):
+ Grab the callback and invoke it.
+
+ (WebKit::WebProcessProxy::fetchWebsiteData):
+ Set up a pending callback and send a FetchWebsiteData message to the web process.
+
+ * UIProcess/WebProcessProxy.h:
+ Add new member.
+
+ * UIProcess/WebProcessProxy.messages.in:
+ Add a DidFetchWebsiteData message.
+
+ * UIProcess/WebsiteData/WebsiteDataStore.cpp:
+ (WebKit::computeWebProcessAccessTypeForDataFetch):
+ Return the web process access type for the given set of data types.
+
+ (WebKit::WebsiteDataStore::fetchData):
+ Set up a callback aggregator that will assemble the needed website data into a vector of website data records.
+
+ (WebKit::computeNetworkProcessAccessTypeForDataRemoval):
+ (WebKit::computeWebProcessAccessTypeForDataRemoval):
+ Rename these functions to indicate that they are about data removal.
+
+ (WebKit::WebsiteDataStore::removeData):
+ Append "ForDataRemoval" to function calls.
+
+ * WebKit2.xcodeproj/project.pbxproj:
+ Add new files.
+
+ * WebProcess/Storage/StorageAreaMap.cpp:
+ (WebKit::StorageAreaMap::StorageAreaMap):
+ Tighten types.
+
+ * WebProcess/WebProcess.cpp:
+ (WebKit::WebProcess::fetchWebsiteData):
+ For now, just fetch memory cache data.
+
+ * WebProcess/WebProcess.h:
+ Add new members.
+
+ * WebProcess/WebProcess.messages.in:
+ Add FetchWebsiteData message.
+
</ins><span class="cx"> 2015-02-24 Yusuke Suzuki <utatane.tea@gmail.com>
</span><span class="cx">
</span><span class="cx"> REGRESSION(r179429): Can't type comments in Facebook
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebsiteDataWebsiteDatacpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/Shared/WebsiteData/WebsiteData.cpp (0 => 180575)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebsiteData/WebsiteData.cpp         (rev 0)
+++ trunk/Source/WebKit2/Shared/WebsiteData/WebsiteData.cpp        2015-02-24 18:55:10 UTC (rev 180575)
</span><span class="lines">@@ -0,0 +1,66 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebsiteData.h"
+
+#include "ArgumentCoders.h"
+#include "SecurityOriginData.h"
+
+namespace WebKit {
+
+void WebsiteData::Entry::encode(IPC::ArgumentEncoder& encoder) const
+{
+ encoder << SecurityOriginData::fromSecurityOrigin(*origin);
+ encoder.encodeEnum(type);
+}
+
+bool WebsiteData::Entry::decode(IPC::ArgumentDecoder& decoder, WebsiteData::Entry& result)
+{
+ SecurityOriginData securityOriginData;
+ if (!decoder.decode(securityOriginData))
+ return false;
+
+ if (!decoder.decodeEnum(result.type))
+ return false;
+
+ result.origin = securityOriginData.securityOrigin();
+ return true;
+}
+
+void WebsiteData::encode(IPC::ArgumentEncoder& encoder) const
+{
+ encoder << entries;
+}
+
+bool WebsiteData::decode(IPC::ArgumentDecoder& decoder, WebsiteData& result)
+{
+ if (!decoder.decode(result.entries))
+ return false;
+
+ return true;
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebKit2SharedWebsiteDataWebsiteDatah"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/Shared/WebsiteData/WebsiteData.h (0 => 180575)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebsiteData/WebsiteData.h         (rev 0)
+++ trunk/Source/WebKit2/Shared/WebsiteData/WebsiteData.h        2015-02-24 18:55:10 UTC (rev 180575)
</span><span class="lines">@@ -0,0 +1,57 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebsiteData_h
+#define WebsiteData_h
+
+#include "WebsiteDataTypes.h"
+#include <WebCore/SecurityOrigin.h>
+#include <wtf/Vector.h>
+
+namespace IPC {
+class ArgumentDecoder;
+class ArgumentEncoder;
+}
+
+namespace WebKit {
+
+struct WebsiteData {
+ struct Entry {
+ RefPtr<WebCore::SecurityOrigin> origin;
+ WebsiteDataTypes type;
+
+ void encode(IPC::ArgumentEncoder&) const;
+ static bool decode(IPC::ArgumentDecoder&, WebsiteData::Entry&);
+ };
+
+ Vector<Entry> entries;
+
+ void encode(IPC::ArgumentEncoder&) const;
+ static bool decode(IPC::ArgumentDecoder&, WebsiteData&);
+};
+
+}
+
+#endif // WebsiteData_h
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebProcessProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp (180574 => 180575)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp        2015-02-24 18:47:54 UTC (rev 180574)
+++ trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp        2015-02-24 18:55:10 UTC (rev 180575)
</span><span class="lines">@@ -49,6 +49,7 @@
</span><span class="cx"> #include "WebProcessPool.h"
</span><span class="cx"> #include "WebProcessProxyMessages.h"
</span><span class="cx"> #include "WebUserContentControllerProxy.h"
</span><ins>+#include "WebsiteData.h"
</ins><span class="cx"> #include <WebCore/SuddenTermination.h>
</span><span class="cx"> #include <WebCore/URL.h>
</span><span class="cx"> #include <stdio.h>
</span><span class="lines">@@ -113,6 +114,7 @@
</span><span class="cx">
</span><span class="cx"> WebProcessProxy::~WebProcessProxy()
</span><span class="cx"> {
</span><ins>+ ASSERT(m_pendingFetchWebsiteDataCallbacks.isEmpty());
</ins><span class="cx"> ASSERT(m_pendingDeleteWebsiteDataCallbacks.isEmpty());
</span><span class="cx">
</span><span class="cx"> if (m_webConnection)
</span><span class="lines">@@ -146,6 +148,10 @@
</span><span class="cx"> {
</span><span class="cx"> ASSERT(this->connection() == &connection);
</span><span class="cx">
</span><ins>+ for (const auto& callback : m_pendingFetchWebsiteDataCallbacks.values())
+ callback({ });
+ m_pendingFetchWebsiteDataCallbacks.clear();
+
</ins><span class="cx"> for (const auto& callback : m_pendingDeleteWebsiteDataCallbacks.values())
</span><span class="cx"> callback();
</span><span class="cx"> m_pendingDeleteWebsiteDataCallbacks.clear();
</span><span class="lines">@@ -597,6 +603,12 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void WebProcessProxy::didFetchWebsiteData(uint64_t callbackID, const WebsiteData& websiteData)
+{
+ auto callback = m_pendingFetchWebsiteDataCallbacks.take(callbackID);
+ callback(websiteData);
+}
+
</ins><span class="cx"> void WebProcessProxy::didDeleteWebsiteData(uint64_t callbackID)
</span><span class="cx"> {
</span><span class="cx"> auto callback = m_pendingDeleteWebsiteDataCallbacks.take(callbackID);
</span><span class="lines">@@ -638,6 +650,16 @@
</span><span class="cx"> page->viewStateDidChange(ViewState::IsVisuallyIdle);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void WebProcessProxy::fetchWebsiteData(SessionID sessionID, WebsiteDataTypes dataTypes, std::function<void (WebsiteData)> completionHandler)
+{
+ ASSERT(canSendMessage());
+
+ uint64_t callbackID = generateCallbackID();
+ m_pendingFetchWebsiteDataCallbacks.add(callbackID, WTF::move(completionHandler));
+
+ send(Messages::WebProcess::FetchWebsiteData(sessionID, dataTypes, callbackID), 0);
+}
+
</ins><span class="cx"> void WebProcessProxy::deleteWebsiteData(SessionID sessionID, WebsiteDataTypes dataTypes, std::chrono::system_clock::time_point modifiedSince, std::function<void ()> completionHandler)
</span><span class="cx"> {
</span><span class="cx"> ASSERT(canSendMessage());
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebProcessProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebProcessProxy.h (180574 => 180575)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebProcessProxy.h        2015-02-24 18:47:54 UTC (rev 180574)
+++ trunk/Source/WebKit2/UIProcess/WebProcessProxy.h        2015-02-24 18:55:10 UTC (rev 180575)
</span><span class="lines">@@ -122,6 +122,7 @@
</span><span class="cx"> void didSaveToPageCache();
</span><span class="cx"> void releasePageCache();
</span><span class="cx">
</span><ins>+ void fetchWebsiteData(WebCore::SessionID, WebsiteDataTypes, std::function<void (WebsiteData)> completionHandler);
</ins><span class="cx"> void deleteWebsiteData(WebCore::SessionID, WebsiteDataTypes, std::chrono::system_clock::time_point modifiedSince, std::function<void ()> completionHandler);
</span><span class="cx">
</span><span class="cx"> void enableSuddenTermination();
</span><span class="lines">@@ -168,6 +169,7 @@
</span><span class="cx">
</span><span class="cx"> void shouldTerminate(bool& shouldTerminate);
</span><span class="cx">
</span><ins>+ void didFetchWebsiteData(uint64_t callbackID, const WebsiteData&);
</ins><span class="cx"> void didDeleteWebsiteData(uint64_t callbackID);
</span><span class="cx">
</span><span class="cx"> // Plugins
</span><span class="lines">@@ -225,6 +227,7 @@
</span><span class="cx"> std::unique_ptr<DownloadProxyMap> m_downloadProxyMap;
</span><span class="cx"> CustomProtocolManagerProxy m_customProtocolManagerProxy;
</span><span class="cx">
</span><ins>+ HashMap<uint64_t, std::function<void (WebsiteData)>> m_pendingFetchWebsiteDataCallbacks;
</ins><span class="cx"> HashMap<uint64_t, std::function<void ()>> m_pendingDeleteWebsiteDataCallbacks;
</span><span class="cx">
</span><span class="cx"> int m_numberOfTimesSuddenTerminationWasDisabled;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebProcessProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebProcessProxy.messages.in (180574 => 180575)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebProcessProxy.messages.in        2015-02-24 18:47:54 UTC (rev 180574)
+++ trunk/Source/WebKit2/UIProcess/WebProcessProxy.messages.in        2015-02-24 18:55:10 UTC (rev 180575)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> EnableSuddenTermination()
</span><span class="cx"> DisableSuddenTermination()
</span><span class="cx">
</span><ins>+ DidFetchWebsiteData(uint64_t callbackID, struct WebKit::WebsiteData websiteData)
</ins><span class="cx"> DidDeleteWebsiteData(uint64_t callbackID)
</span><span class="cx">
</span><span class="cx"> # Plugin messages.
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebsiteDataWebsiteDataStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp (180574 => 180575)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp        2015-02-24 18:47:54 UTC (rev 180574)
+++ trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp        2015-02-24 18:55:10 UTC (rev 180575)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #include "APIWebsiteDataRecord.h"
</span><span class="cx"> #include "StorageManager.h"
</span><span class="cx"> #include "WebProcessPool.h"
</span><ins>+#include "WebsiteData.h"
</ins><span class="cx"> #include <wtf/RunLoop.h>
</span><span class="cx">
</span><span class="cx"> namespace WebKit {
</span><span class="lines">@@ -99,10 +100,93 @@
</span><span class="cx"> Launch,
</span><span class="cx"> };
</span><span class="cx">
</span><del>-static ProcessAccessType computeNetworkProcessAccessType(WebsiteDataTypes dataTypes, bool isNonPersistentStore)
</del><ins>+static ProcessAccessType computeWebProcessAccessTypeForDataFetch(WebsiteDataTypes dataTypes, bool isNonPersistentStore)
</ins><span class="cx"> {
</span><span class="cx"> ProcessAccessType processAccessType = ProcessAccessType::None;
</span><span class="cx">
</span><ins>+ if (dataTypes & WebsiteDataTypeMemoryCache)
+ return ProcessAccessType::OnlyIfLaunched;
+
+ return processAccessType;
+}
+
+void WebsiteDataStore::fetchData(WebsiteDataTypes dataTypes, std::function<void (Vector<WebsiteDataRecord>)> completionHandler)
+{
+ struct CallbackAggregator final : public RefCounted<CallbackAggregator> {
+ explicit CallbackAggregator(std::function<void (Vector<WebsiteDataRecord>)> completionHandler)
+ : completionHandler(WTF::move(completionHandler))
+ {
+ }
+
+ ~CallbackAggregator()
+ {
+ ASSERT(!pendingCallbacks);
+ }
+
+ void addPendingCallback()
+ {
+ pendingCallbacks++;
+ }
+
+ void removePendingCallback(WebsiteData websiteData)
+ {
+ ASSERT(pendingCallbacks);
+ --pendingCallbacks;
+
+ // FIXME: Do something with the website data.
+ callIfNeeded();
+ }
+
+ void callIfNeeded()
+ {
+ if (pendingCallbacks)
+ return;
+
+ RefPtr<CallbackAggregator> callbackAggregator(this);
+ RunLoop::main().dispatch([callbackAggregator] {
+ // FIXME: Pass data records to the completion handler.
+ callbackAggregator->completionHandler({ });
+ });
+ }
+
+ unsigned pendingCallbacks = 0;
+ std::function<void (Vector<WebsiteDataRecord>)> completionHandler;
+ };
+
+ RefPtr<CallbackAggregator> callbackAggregator = adoptRef(new CallbackAggregator(WTF::move(completionHandler)));
+
+ auto webProcessAccessType = computeWebProcessAccessTypeForDataFetch(dataTypes, isNonPersistent());
+ if (webProcessAccessType != ProcessAccessType::None) {
+ for (auto& process : processes()) {
+ switch (webProcessAccessType) {
+ case ProcessAccessType::OnlyIfLaunched:
+ if (!process->canSendMessage())
+ continue;
+ break;
+
+ case ProcessAccessType::Launch:
+ // FIXME: Handle this.
+ ASSERT_NOT_REACHED();
+ break;
+
+ case ProcessAccessType::None:
+ ASSERT_NOT_REACHED();
+ }
+
+ callbackAggregator->addPendingCallback();
+ process->fetchWebsiteData(m_sessionID, dataTypes, [callbackAggregator](WebsiteData websiteData) {
+ callbackAggregator->removePendingCallback(WTF::move(websiteData));
+ });
+ }
+ }
+
+ callbackAggregator->callIfNeeded();
+}
+
+static ProcessAccessType computeNetworkProcessAccessTypeForDataRemoval(WebsiteDataTypes dataTypes, bool isNonPersistentStore)
+{
+ ProcessAccessType processAccessType = ProcessAccessType::None;
+
</ins><span class="cx"> if (dataTypes & WebsiteDataTypeCookies) {
</span><span class="cx"> if (isNonPersistentStore)
</span><span class="cx"> processAccessType = std::max(processAccessType, ProcessAccessType::OnlyIfLaunched);
</span><span class="lines">@@ -116,7 +200,7 @@
</span><span class="cx"> return processAccessType;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static ProcessAccessType computeWebProcessAccessType(WebsiteDataTypes dataTypes, bool isNonPersistentStore)
</del><ins>+static ProcessAccessType computeWebProcessAccessTypeForDataRemoval(WebsiteDataTypes dataTypes, bool isNonPersistentStore)
</ins><span class="cx"> {
</span><span class="cx"> UNUSED_PARAM(isNonPersistentStore);
</span><span class="cx">
</span><span class="lines">@@ -128,13 +212,6 @@
</span><span class="cx"> return processAccessType;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WebsiteDataStore::fetchData(WebsiteDataTypes, std::function<void (Vector<WebsiteDataRecord>)> completionHandler)
-{
- // FIXME: Actually fetch data.
- RunLoop::main().dispatch([completionHandler] {
- completionHandler({ });
- });
-}
</del><span class="cx">
</span><span class="cx"> void WebsiteDataStore::removeData(WebsiteDataTypes dataTypes, std::chrono::system_clock::time_point modifiedSince, std::function<void ()> completionHandler)
</span><span class="cx"> {
</span><span class="lines">@@ -169,7 +246,7 @@
</span><span class="cx">
</span><span class="cx"> RefPtr<CallbackAggregator> callbackAggregator = adoptRef(new CallbackAggregator(WTF::move(completionHandler)));
</span><span class="cx">
</span><del>- auto networkProcessAccessType = computeNetworkProcessAccessType(dataTypes, isNonPersistent());
</del><ins>+ auto networkProcessAccessType = computeNetworkProcessAccessTypeForDataRemoval(dataTypes, isNonPersistent());
</ins><span class="cx"> if (networkProcessAccessType != ProcessAccessType::None) {
</span><span class="cx"> HashSet<WebProcessPool*> processPools;
</span><span class="cx"> for (auto& process : processes())
</span><span class="lines">@@ -197,7 +274,7 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>- auto webProcessAccessType = computeWebProcessAccessType(dataTypes, isNonPersistent());
</del><ins>+ auto webProcessAccessType = computeWebProcessAccessTypeForDataRemoval(dataTypes, isNonPersistent());
</ins><span class="cx"> if (webProcessAccessType != ProcessAccessType::None) {
</span><span class="cx"> for (auto& process : processes()) {
</span><span class="cx"> switch (webProcessAccessType) {
</span></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (180574 => 180575)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2015-02-24 18:47:54 UTC (rev 180574)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2015-02-24 18:55:10 UTC (rev 180575)
</span><span class="lines">@@ -254,6 +254,8 @@
</span><span class="cx">                 1A4832CC1A9BC465008B4DFE /* _WKWebsiteDataRecord.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A4832CA1A9BC465008B4DFE /* _WKWebsiteDataRecord.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 1A4832CE1A9BC484008B4DFE /* _WKWebsiteDataRecordInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A4832CD1A9BC484008B4DFE /* _WKWebsiteDataRecordInternal.h */; };
</span><span class="cx">                 1A4832D11A9BDC2F008B4DFE /* WebsiteDataRecord.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A4832CF1A9BD821008B4DFE /* WebsiteDataRecord.h */; };
</span><ins>+                1A4832D61A9CDF96008B4DFE /* WebsiteData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A4832D41A9CDF96008B4DFE /* WebsiteData.cpp */; };
+                1A4832D71A9CDF96008B4DFE /* WebsiteData.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A4832D51A9CDF96008B4DFE /* WebsiteData.h */; };
</ins><span class="cx">                 1A4A9C5512B816CF008FE984 /* NetscapePluginModule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A4A9C5312B816CF008FE984 /* NetscapePluginModule.cpp */; };
</span><span class="cx">                 1A4A9C5612B816CF008FE984 /* NetscapePluginModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A4A9C5412B816CF008FE984 /* NetscapePluginModule.h */; };
</span><span class="cx">                 1A4A9C9A12B821CD008FE984 /* NetscapePluginModuleMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A4A9C9912B821CD008FE984 /* NetscapePluginModuleMac.mm */; };
</span><span class="lines">@@ -2332,6 +2334,8 @@
</span><span class="cx">                 1A4832CA1A9BC465008B4DFE /* _WKWebsiteDataRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKWebsiteDataRecord.h; sourceTree = "<group>"; };
</span><span class="cx">                 1A4832CD1A9BC484008B4DFE /* _WKWebsiteDataRecordInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKWebsiteDataRecordInternal.h; sourceTree = "<group>"; };
</span><span class="cx">                 1A4832CF1A9BD821008B4DFE /* WebsiteDataRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebsiteDataRecord.h; sourceTree = "<group>"; };
</span><ins>+                1A4832D41A9CDF96008B4DFE /* WebsiteData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebsiteData.cpp; sourceTree = "<group>"; };
+                1A4832D51A9CDF96008B4DFE /* WebsiteData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebsiteData.h; sourceTree = "<group>"; };
</ins><span class="cx">                 1A4A9C5312B816CF008FE984 /* NetscapePluginModule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NetscapePluginModule.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 1A4A9C5412B816CF008FE984 /* NetscapePluginModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetscapePluginModule.h; sourceTree = "<group>"; };
</span><span class="cx">                 1A4A9C9912B821CD008FE984 /* NetscapePluginModuleMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NetscapePluginModuleMac.mm; sourceTree = "<group>"; };
</span><span class="lines">@@ -4877,6 +4881,8 @@
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="cx">                                 1ABF43791A368050003FB0E6 /* WebsiteDataTypes.h */,
</span><ins>+                                1A4832D41A9CDF96008B4DFE /* WebsiteData.cpp */,
+                                1A4832D51A9CDF96008B4DFE /* WebsiteData.h */,
</ins><span class="cx">                         );
</span><span class="cx">                         path = WebsiteData;
</span><span class="cx">                         sourceTree = "<group>";
</span><span class="lines">@@ -7458,6 +7464,7 @@
</span><span class="cx">                         files = (
</span><span class="cx">                                 2D7F13101A702FBA009A6FBD /* ProcessType.h in Headers */,
</span><span class="cx">                                 37A5E01418BBF93F000A081E /* _WKActivatedElementInfo.h in Headers */,
</span><ins>+                                1A4832D71A9CDF96008B4DFE /* WebsiteData.h in Headers */,
</ins><span class="cx">                                 379A873618BBFA4300588AF2 /* _WKActivatedElementInfoInternal.h in Headers */,
</span><span class="cx">                                 A1A4FE5A18DCE9FA00B5EA8A /* _WKDownload.h in Headers */,
</span><span class="cx">                                 A1A4FE6118DD54A400B5EA8A /* _WKDownloadDelegate.h in Headers */,
</span><span class="lines">@@ -9486,6 +9493,7 @@
</span><span class="cx">                                 31A67E0C165B2A99006CBA66 /* PlugInAutoStartProvider.cpp in Sources */,
</span><span class="cx">                                 1A8EF4CC1252403700F7067F /* PluginControllerProxy.cpp in Sources */,
</span><span class="cx">                                 1A2D91A61281D739001EB962 /* PluginControllerProxyMac.mm in Sources */,
</span><ins>+                                1A4832D61A9CDF96008B4DFE /* WebsiteData.cpp in Sources */,
</ins><span class="cx">                                 1A8EF96E1252AF6B00F7067F /* PluginControllerProxyMessageReceiver.cpp in Sources */,
</span><span class="cx">                                 1A17977F137EE82C00F97D45 /* PluginCreationParameters.cpp in Sources */,
</span><span class="cx">                                 7C3F8C90173AF52D007B7F39 /* PluginInformation.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessStorageStorageAreaMapcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Storage/StorageAreaMap.cpp (180574 => 180575)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Storage/StorageAreaMap.cpp        2015-02-24 18:47:54 UTC (rev 180574)
+++ trunk/Source/WebKit2/WebProcess/Storage/StorageAreaMap.cpp        2015-02-24 18:55:10 UTC (rev 180575)
</span><span class="lines">@@ -71,14 +71,14 @@
</span><span class="cx"> switch (m_storageType) {
</span><span class="cx"> case WebCore::LocalStorage:
</span><span class="cx"> if (SecurityOrigin* topLevelOrigin = storageNamespace->topLevelOrigin())
</span><del>- WebProcess::singleton().parentProcessConnection()->send(Messages::StorageManager::CreateTransientLocalStorageMap(m_storageMapID, storageNamespace->storageNamespaceID(), SecurityOriginData::fromSecurityOrigin(*topLevelOrigin), SecurityOriginData::fromSecurityOrigin(m_securityOrigin.get())), 0);
</del><ins>+ WebProcess::singleton().parentProcessConnection()->send(Messages::StorageManager::CreateTransientLocalStorageMap(m_storageMapID, storageNamespace->storageNamespaceID(), SecurityOriginData::fromSecurityOrigin(*topLevelOrigin), SecurityOriginData::fromSecurityOrigin(m_securityOrigin)), 0);
</ins><span class="cx"> else
</span><del>- WebProcess::singleton().parentProcessConnection()->send(Messages::StorageManager::CreateLocalStorageMap(m_storageMapID, storageNamespace->storageNamespaceID(), SecurityOriginData::fromSecurityOrigin(m_securityOrigin.get())), 0);
</del><ins>+ WebProcess::singleton().parentProcessConnection()->send(Messages::StorageManager::CreateLocalStorageMap(m_storageMapID, storageNamespace->storageNamespaceID(), SecurityOriginData::fromSecurityOrigin(m_securityOrigin)), 0);
</ins><span class="cx">
</span><span class="cx"> break;
</span><span class="cx">
</span><span class="cx"> case WebCore::SessionStorage:
</span><del>- WebProcess::singleton().parentProcessConnection()->send(Messages::StorageManager::CreateSessionStorageMap(m_storageMapID, storageNamespace->storageNamespaceID(), SecurityOriginData::fromSecurityOrigin(m_securityOrigin.get())), 0);
</del><ins>+ WebProcess::singleton().parentProcessConnection()->send(Messages::StorageManager::CreateSessionStorageMap(m_storageMapID, storageNamespace->storageNamespaceID(), SecurityOriginData::fromSecurityOrigin(m_securityOrigin)), 0);
</ins><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebProcess.cpp (180574 => 180575)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2015-02-24 18:47:54 UTC (rev 180574)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2015-02-24 18:55:10 UTC (rev 180575)
</span><span class="lines">@@ -61,6 +61,7 @@
</span><span class="cx"> #include "WebProcessPoolMessages.h"
</span><span class="cx"> #include "WebProcessProxyMessages.h"
</span><span class="cx"> #include "WebResourceCacheManager.h"
</span><ins>+#include "WebsiteData.h"
</ins><span class="cx"> #include "WebsiteDataTypes.h"
</span><span class="cx"> #include <JavaScriptCore/JSLock.h>
</span><span class="cx"> #include <JavaScriptCore/MemoryStatistics.h>
</span><span class="lines">@@ -1133,6 +1134,18 @@
</span><span class="cx"> PageCache::singleton().pruneToSizeNow(0, PruningReason::MemoryPressure);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void WebProcess::fetchWebsiteData(WebCore::SessionID sessionID, uint64_t websiteDataTypes, uint64_t callbackID)
+{
+ WebsiteData websiteData;
+
+ if (websiteDataTypes & WebsiteDataTypeMemoryCache) {
+ for (auto& origin : MemoryCache::singleton().originsWithCache(sessionID))
+ websiteData.entries.append(WebsiteData::Entry { origin, WebsiteDataTypeMemoryCache });
+ }
+
+ parentProcessConnection()->send(Messages::WebProcessProxy::DidFetchWebsiteData(callbackID, websiteData), 0);
+}
+
</ins><span class="cx"> void WebProcess::deleteWebsiteData(SessionID sessionID, uint64_t websiteDataTypes, std::chrono::system_clock::time_point modifiedSince, uint64_t callbackID)
</span><span class="cx"> {
</span><span class="cx"> UNUSED_PARAM(modifiedSince);
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebProcessh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebProcess.h (180574 => 180575)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebProcess.h        2015-02-24 18:47:54 UTC (rev 180574)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.h        2015-02-24 18:55:10 UTC (rev 180575)
</span><span class="lines">@@ -259,6 +259,7 @@
</span><span class="cx">
</span><span class="cx"> void releasePageCache();
</span><span class="cx">
</span><ins>+ void fetchWebsiteData(WebCore::SessionID, uint64_t websiteDataTypes, uint64_t callbackID);
</ins><span class="cx"> void deleteWebsiteData(WebCore::SessionID, uint64_t websiteDataTypes, std::chrono::system_clock::time_point modifiedSince, uint64_t callbackID);
</span><span class="cx">
</span><span class="cx"> #if USE(SOUP)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebProcessmessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebProcess.messages.in (180574 => 180575)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebProcess.messages.in        2015-02-24 18:47:54 UTC (rev 180574)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.messages.in        2015-02-24 18:55:10 UTC (rev 180575)
</span><span class="lines">@@ -79,6 +79,7 @@
</span><span class="cx">
</span><span class="cx"> ReleasePageCache()
</span><span class="cx">
</span><ins>+ FetchWebsiteData(WebCore::SessionID sessionID, uint64_t websiteDataTypes, uint64_t callbackID)
</ins><span class="cx"> DeleteWebsiteData(WebCore::SessionID sessionID, uint64_t websiteDataTypes, std::chrono::system_clock::time_point modifiedSince, uint64_t callbackID)
</span><span class="cx">
</span><span class="cx"> SetProcessSuppressionEnabled(bool flag)
</span></span></pre>
</div>
</div>
</body>
</html>