⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 185420 in webkit


Ignore:
Timestamp:
Jun 10, 2015, 9:57:20 AM (11 years ago)
Author:
andersca@apple.com
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:
Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r185418 r185420  
     12015-06-09  Anders Carlsson  <andersca@apple.com>
     2
     3        Support fetching website data
     4        https://bugs.webkit.org/show_bug.cgi?id=145828
     5
     6        Reviewed by Darin Adler.
     7
     8        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
     9        (WebKit::WebsiteDataStore::fetchData):
     10        (WebKit::WebsiteDataStore::plugins):
     11        * UIProcess/WebsiteData/WebsiteDataStore.h:
     12
    1132015-06-10  Zan Dobersek  <zdobersek@igalia.com>
    214
  • trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp

    r185386 r185420  
    3838#include <wtf/RunLoop.h>
    3939
     40#if ENABLE(NETSCAPE_PLUGIN_API)
     41#include "PluginProcessManager.h"
     42#endif
     43
    4044namespace WebKit {
    4145
    … …  
    378382    }
    379383
     384#if ENABLE(NETSCAPE_PLUGIN_API)
     385    if (dataTypes & WebsiteDataTypePlugInData && isPersistent()) {
     386        class State {
     387        public:
     388            static void fetchData(Ref<CallbackAggregator>&& callbackAggregator, Vector<PluginModuleInfo>&& plugins)
     389            {
     390                new State(WTF::move(callbackAggregator), WTF::move(plugins));
     391            }
     392
     393        private:
     394            State(Ref<CallbackAggregator>&& callbackAggregator, Vector<PluginModuleInfo>&& plugins)
     395                : m_callbackAggregator(WTF::move(callbackAggregator))
     396                , m_plugins(WTF::move(plugins))
     397            {
     398                m_callbackAggregator->addPendingCallback();
     399
     400                fetchWebsiteDataForNextPlugin();
     401            }
     402
     403            ~State()
     404            {
     405                ASSERT(m_plugins.isEmpty());
     406            }
     407
     408            void fetchWebsiteDataForNextPlugin()
     409            {
     410                if (m_plugins.isEmpty()) {
     411                    WebsiteData websiteData;
     412                    websiteData.hostNamesWithPluginData = WTF::move(m_hostNames);
     413
     414                    m_callbackAggregator->removePendingCallback(WTF::move(websiteData));
     415
     416                    delete this;
     417                    return;
     418                }
     419
     420                auto plugin = m_plugins.takeLast();
     421                PluginProcessManager::singleton().fetchWebsiteData(plugin, [this](Vector<String> hostNames) {
     422                    for (auto& hostName : hostNames)
     423                        m_hostNames.add(WTF::move(hostName));
     424                    fetchWebsiteDataForNextPlugin();
     425                });
     426            }
     427
     428            Ref<CallbackAggregator> m_callbackAggregator;
     429            Vector<PluginModuleInfo> m_plugins;
     430            HashSet<String> m_hostNames;
     431        };
     432
     433        State::fetchData(*callbackAggregator, plugins());
     434    }
     435#endif
     436
    380437    callbackAggregator->callIfNeeded();
    381438}
    … …  
    824881}
    825882
     883#if ENABLE(NETSCAPE_PLUGIN_API)
     884Vector<PluginModuleInfo> WebsiteDataStore::plugins() const
     885{
     886    Vector<PluginModuleInfo> plugins;
     887
     888    for (auto processPool : processPools()) {
     889        for (auto& plugin : processPool->pluginInfoStore().plugins())
     890            plugins.append(plugin);
     891    }
     892
     893    return plugins;
     894}
     895#endif
     896
    826897Vector<RefPtr<WebCore::SecurityOrigin>> WebsiteDataStore::mediaKeyOrigins(const String& mediaKeysStorageDirectory)
    827898{
  • trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.h

    r184912 r185420  
    4949struct WebsiteDataRecord;
    5050
     51#if ENABLE(NETSCAPE_PLUGIN_API)
     52struct PluginModuleInfo;
     53#endif
     54
    5155class WebsiteDataStore : public RefCounted<WebsiteDataStore>, public WebProcessLifetimeObserver {
    5256public:
    … …  
    9397    HashSet<RefPtr<WebProcessPool>> processPools() const;
    9498
     99#if ENABLE(NETSCAPE_PLUGIN_API)
     100    Vector<PluginModuleInfo> plugins() const;
     101#endif
     102
    95103    static Vector<RefPtr<WebCore::SecurityOrigin>> mediaKeyOrigins(const String& mediaKeysStorageDirectory);
    96104    static void removeMediaKeys(const String& mediaKeysStorageDirectory, std::chrono::system_clock::time_point modifiedSince);
Note: See TracChangeset for help on using the changeset viewer.