Changeset 185420 in webkit
- Timestamp:
- Jun 10, 2015, 9:57:20 AM (11 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/WebsiteData/WebsiteDataStore.cpp (modified) (3 diffs)
-
UIProcess/WebsiteData/WebsiteDataStore.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r185418 r185420 1 2015-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 1 13 2015-06-10 Zan Dobersek <zdobersek@igalia.com> 2 14 -
trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp
r185386 r185420 38 38 #include <wtf/RunLoop.h> 39 39 40 #if ENABLE(NETSCAPE_PLUGIN_API) 41 #include "PluginProcessManager.h" 42 #endif 43 40 44 namespace WebKit { 41 45 … … 378 382 } 379 383 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 380 437 callbackAggregator->callIfNeeded(); 381 438 } … … 824 881 } 825 882 883 #if ENABLE(NETSCAPE_PLUGIN_API) 884 Vector<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 826 897 Vector<RefPtr<WebCore::SecurityOrigin>> WebsiteDataStore::mediaKeyOrigins(const String& mediaKeysStorageDirectory) 827 898 { -
trunk/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.h
r184912 r185420 49 49 struct WebsiteDataRecord; 50 50 51 #if ENABLE(NETSCAPE_PLUGIN_API) 52 struct PluginModuleInfo; 53 #endif 54 51 55 class WebsiteDataStore : public RefCounted<WebsiteDataStore>, public WebProcessLifetimeObserver { 52 56 public: … … 93 97 HashSet<RefPtr<WebProcessPool>> processPools() const; 94 98 99 #if ENABLE(NETSCAPE_PLUGIN_API) 100 Vector<PluginModuleInfo> plugins() const; 101 #endif 102 95 103 static Vector<RefPtr<WebCore::SecurityOrigin>> mediaKeyOrigins(const String& mediaKeysStorageDirectory); 96 104 static void removeMediaKeys(const String& mediaKeysStorageDirectory, std::chrono::system_clock::time_point modifiedSince);
Note:
See TracChangeset
for help on using the changeset viewer.