Title: [185420] trunk/Source/WebKit2
- Revision
- 185420
- Author
- [email protected]
- Date
- 2015-06-10 09:57:20 -0700 (Wed, 10 Jun 2015)
Log Message
Support fetching website data
https://bugs.webkit.org/show_bug.cgi?id=145828
Reviewed by Darin Adler.
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::fetchData):
(WebKit::WebsiteDataStore::plugins):
* UIProcess/WebsiteData/WebsiteDataStore.h:
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (185419 => 185420)
--- trunk/Source/WebKit2/ChangeLog 2015-06-10 16:43:13 UTC (rev 185419)
+++ trunk/Source/WebKit2/ChangeLog 2015-06-10 16:57:20 UTC (rev 185420)
@@ -1,3 +1,15 @@
+2015-06-09 Anders Carlsson <[email protected]>
+
+ Support fetching website data
+ https://bugs.webkit.org/show_bug.cgi?id=145828
+
+ Reviewed by Darin Adler.
+
+ * UIProcess/WebsiteData/WebsiteDataStore.cpp:
+ (WebKit::WebsiteDataStore::fetchData):
+ (WebKit::WebsiteDataStore::plugins):
+ * UIProcess/WebsiteData/WebsiteDataStore.h:
+
2015-06-10 Zan Dobersek <[email protected]>
Unreviewed. Fixing the build for the GTK port with Clang.
Modified: trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp (185419 => 185420)
--- trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp 2015-06-10 16:43:13 UTC (rev 185419)
+++ trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp 2015-06-10 16:57:20 UTC (rev 185420)
@@ -37,6 +37,10 @@
#include <WebCore/SecurityOrigin.h>
#include <wtf/RunLoop.h>
+#if ENABLE(NETSCAPE_PLUGIN_API)
+#include "PluginProcessManager.h"
+#endif
+
namespace WebKit {
static WebCore::SessionID generateNonPersistentSessionID()
@@ -377,6 +381,59 @@
});
}
+#if ENABLE(NETSCAPE_PLUGIN_API)
+ if (dataTypes & WebsiteDataTypePlugInData && isPersistent()) {
+ class State {
+ public:
+ static void fetchData(Ref<CallbackAggregator>&& callbackAggregator, Vector<PluginModuleInfo>&& plugins)
+ {
+ new State(WTF::move(callbackAggregator), WTF::move(plugins));
+ }
+
+ private:
+ State(Ref<CallbackAggregator>&& callbackAggregator, Vector<PluginModuleInfo>&& plugins)
+ : m_callbackAggregator(WTF::move(callbackAggregator))
+ , m_plugins(WTF::move(plugins))
+ {
+ m_callbackAggregator->addPendingCallback();
+
+ fetchWebsiteDataForNextPlugin();
+ }
+
+ ~State()
+ {
+ ASSERT(m_plugins.isEmpty());
+ }
+
+ void fetchWebsiteDataForNextPlugin()
+ {
+ if (m_plugins.isEmpty()) {
+ WebsiteData websiteData;
+ websiteData.hostNamesWithPluginData = WTF::move(m_hostNames);
+
+ m_callbackAggregator->removePendingCallback(WTF::move(websiteData));
+
+ delete this;
+ return;
+ }
+
+ auto plugin = m_plugins.takeLast();
+ PluginProcessManager::singleton().fetchWebsiteData(plugin, [this](Vector<String> hostNames) {
+ for (auto& hostName : hostNames)
+ m_hostNames.add(WTF::move(hostName));
+ fetchWebsiteDataForNextPlugin();
+ });
+ }
+
+ Ref<CallbackAggregator> m_callbackAggregator;
+ Vector<PluginModuleInfo> m_plugins;
+ HashSet<String> m_hostNames;
+ };
+
+ State::fetchData(*callbackAggregator, plugins());
+ }
+#endif
+
callbackAggregator->callIfNeeded();
}
@@ -823,6 +880,20 @@
return processPools;
}
+#if ENABLE(NETSCAPE_PLUGIN_API)
+Vector<PluginModuleInfo> WebsiteDataStore::plugins() const
+{
+ Vector<PluginModuleInfo> plugins;
+
+ for (auto processPool : processPools()) {
+ for (auto& plugin : processPool->pluginInfoStore().plugins())
+ plugins.append(plugin);
+ }
+
+ return plugins;
+}
+#endif
+
Vector<RefPtr<WebCore::SecurityOrigin>> WebsiteDataStore::mediaKeyOrigins(const String& mediaKeysStorageDirectory)
{
ASSERT(!mediaKeysStorageDirectory.isEmpty());
Modified: trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.h (185419 => 185420)
--- trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.h 2015-06-10 16:43:13 UTC (rev 185419)
+++ trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.h 2015-06-10 16:57:20 UTC (rev 185420)
@@ -48,6 +48,10 @@
class WebProcessPool;
struct WebsiteDataRecord;
+#if ENABLE(NETSCAPE_PLUGIN_API)
+struct PluginModuleInfo;
+#endif
+
class WebsiteDataStore : public RefCounted<WebsiteDataStore>, public WebProcessLifetimeObserver {
public:
struct Configuration {
@@ -92,6 +96,10 @@
HashSet<RefPtr<WebProcessPool>> processPools() const;
+#if ENABLE(NETSCAPE_PLUGIN_API)
+ Vector<PluginModuleInfo> plugins() const;
+#endif
+
static Vector<RefPtr<WebCore::SecurityOrigin>> mediaKeyOrigins(const String& mediaKeysStorageDirectory);
static void removeMediaKeys(const String& mediaKeysStorageDirectory, std::chrono::system_clock::time_point modifiedSince);
static void removeMediaKeys(const String& mediaKeysStorageDirectory, const HashSet<RefPtr<WebCore::SecurityOrigin>>&);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes