Changeset 229390 in webkit
- Timestamp:
- Mar 7, 2018 6:06:39 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 29 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r229378 r229390 1 2018-03-07 Youenn Fablet <youenn@apple.com> 2 3 Match unsupported plugins based on domains and not origin 4 https://bugs.webkit.org/show_bug.cgi?id=183384 5 6 Reviewed by Chris Dumez. 7 8 Move from an origin-keyed map to a vector of plugins. 9 We iterate through the vector and a match happens if the page host name ends with the provided matching domain. 10 This allows supporting rules for *.mydomain.com by passing 'mydomain.com'. 11 Covered by existing tests. 12 We are not testing subdomains like www.localhost since there is no support in our CI but this is tested through Unit tests. 13 14 * loader/EmptyClients.cpp: 15 * platform/URL.cpp: 16 (WebCore::URL::isMatchingDomain const): 17 * platform/URL.h: 18 * plugins/PluginData.h: 19 (WebCore::isSupportedPlugin): 20 (WebCore::SupportedPluginName::decode): 21 (WebCore::SupportedPluginName::encode const): 22 * plugins/PluginInfoProvider.h: 23 1 24 2017-12-18 Youenn Fablet <youenn@apple.com> 2 25 -
trunk/Source/WebCore/loader/EmptyClients.cpp
r228587 r229390 326 326 class EmptyPluginInfoProvider final : public PluginInfoProvider { 327 327 void refreshPlugins() final { }; 328 void getPluginInfo(Page&, Vector<PluginInfo>&, std::optional< SupportedPluginNames>&) final { }328 void getPluginInfo(Page&, Vector<PluginInfo>&, std::optional<Vector<SupportedPluginName>>&) final { } 329 329 void getWebVisiblePluginInfo(Page&, Vector<PluginInfo>&) final { } 330 330 }; -
trunk/Source/WebCore/platform/URL.cpp
r228323 r229390 775 775 776 776 return true; 777 } 778 779 bool URL::isMatchingDomain(const String& domain) const 780 { 781 // We restrict it to HTTP for simplicity since we do not want to match data, blob or file based URLs. 782 if (isNull() || !protocolIsInHTTPFamily()) 783 return false; 784 785 if (domain.isEmpty()) 786 return true; 787 788 auto host = this->host(); 789 if (!host.endsWith(domain)) 790 return false; 791 792 return host.length() == domain.length() || host.characterAt(host.length() - domain.length() - 1) == '.'; 777 793 } 778 794 -
trunk/Source/WebCore/platform/URL.h
r228483 r229390 142 142 bool cannotBeABaseURL() const { return m_cannotBeABaseURL; } 143 143 144 WEBCORE_EXPORT bool isMatchingDomain(const String&) const; 145 144 146 WEBCORE_EXPORT bool setProtocol(const String&); 145 147 void setHost(const String&); -
trunk/Source/WebCore/plugins/PluginData.h
r228587 r229390 21 21 #pragma once 22 22 23 #include " SecurityOriginData.h"23 #include "URL.h" 24 24 #include <wtf/HashMap.h> 25 25 #include <wtf/HashSet.h> … … 89 89 } 90 90 91 struct SupportedPluginName s{92 HashSet<String> allOriginPlugins;93 HashMap<SecurityOriginData, HashSet<String>> originSpecificPlugins;91 struct SupportedPluginName { 92 String matchingDomain; 93 String pluginName; 94 94 95 95 template<class Encoder> void encode(Encoder&) const; 96 template<class Decoder> static std::optional<SupportedPluginName s> decode(Decoder&);96 template<class Decoder> static std::optional<SupportedPluginName> decode(Decoder&); 97 97 }; 98 98 … … 127 127 Page& m_page; 128 128 Vector<PluginInfo> m_plugins; 129 std::optional< SupportedPluginNames> m_supportedPluginNames;129 std::optional<Vector<SupportedPluginName>> m_supportedPluginNames; 130 130 }; 131 131 132 inline bool isSupportedPlugin( SupportedPluginNames& pluginNames, SecurityOriginData& origin, const String& pluginName)132 inline bool isSupportedPlugin(const Vector<SupportedPluginName>& pluginNames, const URL& pageURL, const String& pluginName) 133 133 { 134 auto iterator = pluginNames.originSpecificPlugins.find(origin); 135 if (iterator != pluginNames.originSpecificPlugins.end()) { 136 if (iterator->value.contains(pluginName)) 137 return true; 138 } 139 140 return pluginNames.allOriginPlugins.contains(pluginName); 134 return pluginNames.findMatching([&] (auto&& plugin) { 135 return pageURL.isMatchingDomain(plugin.matchingDomain) && plugin.pluginName == pluginName; 136 }) != notFound; 141 137 } 142 138 143 template<class Decoder> inline std::optional<SupportedPluginName s> SupportedPluginNames::decode(Decoder& decoder)139 template<class Decoder> inline std::optional<SupportedPluginName> SupportedPluginName::decode(Decoder& decoder) 144 140 { 145 std::optional< HashSet<String>> allOriginPlugins;146 decoder >> allOriginPlugins;147 if (! allOriginPlugins)141 std::optional<String> matchingDomain; 142 decoder >> matchingDomain; 143 if (!matchingDomain) 148 144 return std::nullopt; 149 145 150 std::optional< HashMap<SecurityOriginData, HashSet<String>>> originSpecificPlugins;151 decoder >> originSpecificPlugins;152 if (! originSpecificPlugins)146 std::optional<String> pluginName; 147 decoder >> pluginName; 148 if (!pluginName) 153 149 return std::nullopt; 154 150 155 return SupportedPluginName s { WTFMove(allOriginPlugins.value()), WTFMove(originSpecificPlugins.value()) };151 return SupportedPluginName { WTFMove(matchingDomain.value()), WTFMove(pluginName.value()) }; 156 152 } 157 153 158 template<class Encoder> inline void SupportedPluginName s::encode(Encoder& encoder) const154 template<class Encoder> inline void SupportedPluginName::encode(Encoder& encoder) const 159 155 { 160 encoder << allOriginPlugins;161 encoder << originSpecificPlugins;156 encoder << matchingDomain; 157 encoder << pluginName; 162 158 } 163 159 -
trunk/Source/WebCore/plugins/PluginInfoProvider.h
r228587 r229390 40 40 void removePage(Page&); 41 41 42 virtual void getPluginInfo(Page&, Vector<PluginInfo>&, std::optional< SupportedPluginNames>&) = 0;42 virtual void getPluginInfo(Page&, Vector<PluginInfo>&, std::optional<Vector<SupportedPluginName>>&) = 0; 43 43 virtual void getWebVisiblePluginInfo(Page&, Vector<PluginInfo>&) = 0; 44 44 -
trunk/Source/WebKit/ChangeLog
r229386 r229390 1 2018-03-07 Youenn Fablet <youenn@apple.com> 2 3 Match unsupported plugins based on domains and not origin 4 https://bugs.webkit.org/show_bug.cgi?id=183384 5 6 Reviewed by Chris Dumez. 7 8 Moved from a HashMap of plugins to a Vector of plugins since we cannot match exactly based on the origin. 9 10 * Scripts/webkit/messages.py: 11 * UIProcess/API/C/WKContext.cpp: 12 (WKContextAddSupportedPlugin): 13 * UIProcess/API/Cocoa/WKProcessPool.mm: 14 (-[WKProcessPool _addSupportedPlugin:named:withMimeTypes:withExtensions:]): 15 * UIProcess/Plugins/PluginInfoStore.cpp: 16 (WebKit::PluginInfoStore::isSupportedPlugin): 17 (WebKit::PluginInfoStore::supportedPluginNames): 18 (WebKit::PluginInfoStore::addSupportedPlugin): 19 * UIProcess/Plugins/PluginInfoStore.h: 20 * UIProcess/WebProcessPool.cpp: 21 (WebKit::WebProcessPool::addSupportedPlugin): 22 * UIProcess/WebProcessPool.h: 23 * UIProcess/WebProcessProxy.cpp: 24 (WebKit::WebProcessProxy::getPlugins): 25 * UIProcess/WebProcessProxy.h: 26 * UIProcess/WebProcessProxy.messages.in: 27 * WebProcess/Plugins/WebPluginInfoProvider.cpp: 28 (WebKit::WebPluginInfoProvider::getPluginInfo): 29 (WebKit::WebPluginInfoProvider::getWebVisiblePluginInfo): 30 * WebProcess/Plugins/WebPluginInfoProvider.h: 31 1 32 2018-03-07 Brent Fulgham <bfulgham@apple.com> 2 33 -
trunk/Source/WebKit/Scripts/webkit/messages.py
r228587 r229390 399 399 'WebCore::ShouldNotifyWhenResolved': ['<WebCore/ServiceWorkerTypes.h>'], 400 400 'WebCore::ShouldSample': ['<WebCore/DiagnosticLoggingClient.h>'], 401 'WebCore::SupportedPluginName s': ['<WebCore/PluginData.h>'],401 'WebCore::SupportedPluginName': ['<WebCore/PluginData.h>'], 402 402 'WebCore::TextCheckingRequestData': ['<WebCore/TextChecking.h>'], 403 403 'WebCore::TextCheckingResult': ['<WebCore/TextCheckerClient.h>'], -
trunk/Source/WebKit/UIProcess/API/C/WKContext.cpp
r228942 r229390 622 622 } 623 623 624 void WKContextAddSupportedPlugin(WKContextRef contextRef, WKStringRef originRef, WKStringRef nameRef, WKArrayRef mimeTypesRef, WKArrayRef extensionsRef)624 void WKContextAddSupportedPlugin(WKContextRef contextRef, WKStringRef domainRef, WKStringRef nameRef, WKArrayRef mimeTypesRef, WKArrayRef extensionsRef) 625 625 { 626 626 #if ENABLE(NETSCAPE_PLUGIN_API) … … 635 635 extensions.add(toWTFString(static_cast<WKStringRef>(WKArrayGetItemAtIndex(extensionsRef, i)))); 636 636 637 RefPtr<SecurityOrigin> origin; 638 if (!WKStringIsEmpty(originRef)) 639 origin = SecurityOrigin::createFromString(toWTFString(originRef)); 640 toImpl(contextRef)->addSupportedPlugin(origin.get(), toWTFString(nameRef), WTFMove(mimeTypes), WTFMove(extensions)); 637 toImpl(contextRef)->addSupportedPlugin(toWTFString(domainRef), toWTFString(nameRef), WTFMove(mimeTypes), WTFMove(extensions)); 641 638 #endif 642 639 } -
trunk/Source/WebKit/UIProcess/API/C/WKContextPrivate.h
r228587 r229390 113 113 WK_EXPORT WKProcessID WKContextGetDatabaseProcessIdentifier(WKContextRef context); 114 114 115 WK_EXPORT void WKContextAddSupportedPlugin(WKContextRef context, WKStringRef origin, WKStringRef name, WKArrayRef mimeTypes, WKArrayRef extensions);115 WK_EXPORT void WKContextAddSupportedPlugin(WKContextRef context, WKStringRef domain, WKStringRef name, WKArrayRef mimeTypes, WKArrayRef extensions); 116 116 WK_EXPORT void WKContextClearSupportedPlugins(WKContextRef context); 117 117 -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm
r228587 r229390 398 398 } 399 399 400 - (void)_addSupportedPlugin:(NSString *) origin named:(NSString *) name withMimeTypes: (NSSet<NSString *> *) nsMimeTypes withExtensions: (NSSet<NSString *> *) nsExtensions400 - (void)_addSupportedPlugin:(NSString *) domain named:(NSString *) name withMimeTypes: (NSSet<NSString *> *) nsMimeTypes withExtensions: (NSSet<NSString *> *) nsExtensions 401 401 { 402 402 HashSet<String> mimeTypes; … … 407 407 extensions.add(extension); 408 408 409 _processPool->addSupportedPlugin( [origin length] ? WebCore::SecurityOrigin::createFromString(origin).ptr() : nullptr, name, WTFMove(mimeTypes), WTFMove(extensions));409 _processPool->addSupportedPlugin(domain, name, WTFMove(mimeTypes), WTFMove(extensions)); 410 410 } 411 411 -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKProcessPoolPrivate.h
r228587 r229390 73 73 - (void)_setAutomationSession:(_WKAutomationSession *)automationSession WK_API_AVAILABLE(macosx(10.12), ios(10.0)); 74 74 75 - (void)_addSupportedPlugin:(NSString *) origin named:(NSString *) name withMimeTypes: (NSSet<NSString *> *) mimeTypes withExtensions: (NSSet<NSString *> *) extensions WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));75 - (void)_addSupportedPlugin:(NSString *) domain named:(NSString *) name withMimeTypes: (NSSet<NSString *> *) mimeTypes withExtensions: (NSSet<NSString *> *) extensions WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); 76 76 - (void)_clearSupportedPlugins WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); 77 77 -
trunk/Source/WebKit/UIProcess/Plugins/PluginInfoStore.cpp
r228587 r229390 30 30 31 31 #include "PluginModuleInfo.h" 32 #include <WebCore/MIMETypeRegistry.h> 33 #include <WebCore/SecurityOrigin.h> 32 34 #include <WebCore/URL.h> 33 #include <WebCore/MIMETypeRegistry.h>34 35 #include <algorithm> 35 36 #include <wtf/ListHashSet.h> … … 215 216 bool PluginInfoStore::isSupportedPlugin(const String& mimeType, const URL& pluginURL, const String&, const URL& pageURL) 216 217 { 217 // We check only pageURL Stringfor consistency with WebProcess visible plugins.218 // We check only pageURL for consistency with WebProcess visible plugins. 218 219 if (!m_supportedPlugins) 219 220 return true; 220 221 221 for (auto& plugin : m_supportedPlugins->originSpecificPlugins.get(SecurityOriginData { pageURL.protocol().toString(), pageURL.host(), pageURL.port() })) { 222 if (isSupportedPlugin(plugin, mimeType, pluginURL)) 223 return true; 224 } 225 for (auto& plugin : m_supportedPlugins->allOriginPlugins) { 226 if (isSupportedPlugin(plugin, mimeType, pluginURL)) 227 return true; 228 } 229 return false; 230 } 231 232 std::optional<SupportedPluginNames> PluginInfoStore::supportedPluginNames() 222 return m_supportedPlugins->findMatching([&] (auto&& plugin) { 223 return pageURL.isMatchingDomain(plugin.matchingDomain) && isSupportedPlugin(plugin, mimeType, pluginURL); 224 }) != notFound; 225 } 226 227 std::optional<Vector<SupportedPluginName>> PluginInfoStore::supportedPluginNames() 233 228 { 234 229 if (!m_supportedPlugins) 235 230 return std::nullopt; 236 231 237 HashSet<String> allOriginPlugins; 238 for (auto& plugin : m_supportedPlugins->allOriginPlugins) 239 allOriginPlugins.add(plugin.name); 240 241 HashMap<SecurityOriginData, HashSet<String>> originSpecificPlugins; 242 for (auto& keyValue : m_supportedPlugins->originSpecificPlugins) { 243 HashSet<String> names; 244 for (auto& plugin : keyValue.value) 245 names.add(plugin.name); 246 originSpecificPlugins.add(keyValue.key, WTFMove(names)); 247 } 248 return SupportedPluginNames { WTFMove(allOriginPlugins), WTFMove(originSpecificPlugins) }; 249 } 250 251 void PluginInfoStore::addSupportedPlugin(const SecurityOrigin* origin, String&& name, HashSet<String>&& mimeTypes, HashSet<String> extensions) 232 return WTF::map(*m_supportedPlugins, [] (auto&& item) { 233 return SupportedPluginName { item.matchingDomain, item.name }; 234 }); 235 } 236 237 void PluginInfoStore::addSupportedPlugin(String&& domainName, String&& name, HashSet<String>&& mimeTypes, HashSet<String> extensions) 252 238 { 253 239 if (!m_supportedPlugins) 254 m_supportedPlugins = SupportedPlugins { }; 255 256 SupportedPlugin plugin { WTFMove(name), WTFMove(mimeTypes), WTFMove(extensions) }; 257 if (!origin) { 258 m_supportedPlugins->allOriginPlugins.append(WTFMove(plugin)); 259 return; 260 } 261 m_supportedPlugins->originSpecificPlugins.ensure(SecurityOriginData::fromSecurityOrigin(*origin), [] { 262 return Vector<SupportedPlugin> { }; 263 }).iterator->value.append(WTFMove(plugin)); 240 m_supportedPlugins = Vector<SupportedPlugin> { }; 241 242 m_supportedPlugins->append(SupportedPlugin { WTFMove(domainName), WTFMove(name), WTFMove(mimeTypes), WTFMove(extensions) }); 264 243 } 265 244 -
trunk/Source/WebKit/UIProcess/Plugins/PluginInfoStore.h
r228587 r229390 65 65 66 66 bool isSupportedPlugin(const String& mimeType, const WebCore::URL& pluginURL, const String& frameURLString, const WebCore::URL& pageURL); 67 std::optional< WebCore::SupportedPluginNames> supportedPluginNames();68 void addSupportedPlugin( const WebCore::SecurityOrigin*, String&& name, HashSet<String>&& mimeTypes, HashSet<String> extensions);67 std::optional<Vector<WebCore::SupportedPluginName>> supportedPluginNames(); 68 void addSupportedPlugin(String&& matchingDomain, String&& name, HashSet<String>&& mimeTypes, HashSet<String> extensions); 69 69 void clearSupportedPlugins() { m_supportedPlugins = std::nullopt; } 70 70 … … 98 98 99 99 struct SupportedPlugin { 100 String matchingDomain; 100 101 String name; 101 102 HashSet<String> mimeTypes; 102 103 HashSet<String> extensions; 103 104 }; 104 struct SupportedPlugins {105 Vector<SupportedPlugin> allOriginPlugins;106 HashMap<WebCore::SecurityOriginData, Vector<SupportedPlugin>> originSpecificPlugins;107 };108 105 static bool isSupportedPlugin(const SupportedPlugin&, const String& mimeType, const WebCore::URL& pluginURL); 109 106 110 std::optional< SupportedPlugins> m_supportedPlugins;107 std::optional<Vector<SupportedPlugin>> m_supportedPlugins; 111 108 }; 112 109 -
trunk/Source/WebKit/UIProcess/WebProcessPool.cpp
r228942 r229390 1794 1794 #endif 1795 1795 1796 void WebProcessPool::addSupportedPlugin(S ecurityOrigin* origin, String&& name, HashSet<String>&& mimeTypes, HashSet<String> extensions)1796 void WebProcessPool::addSupportedPlugin(String&& matchingDomain, String&& name, HashSet<String>&& mimeTypes, HashSet<String> extensions) 1797 1797 { 1798 1798 #if ENABLE(NETSCAPE_PLUGIN_API) 1799 m_pluginInfoStore.addSupportedPlugin( origin, WTFMove(name), WTFMove(mimeTypes), WTFMove(extensions));1799 m_pluginInfoStore.addSupportedPlugin(WTFMove(matchingDomain), WTFMove(name), WTFMove(mimeTypes), WTFMove(extensions)); 1800 1800 #else 1801 UNUSED_PARAM( origin);1801 UNUSED_PARAM(matchingDomain); 1802 1802 UNUSED_PARAM(name); 1803 1803 UNUSED_PARAM(mimeTypes); -
trunk/Source/WebKit/UIProcess/WebProcessPool.h
r229140 r229390 203 203 #endif 204 204 205 void addSupportedPlugin( WebCore::SecurityOrigin*, String&& name, HashSet<String>&& mimeTypes, HashSet<String> extensions);205 void addSupportedPlugin(String&& matchingDomain, String&& name, HashSet<String>&& mimeTypes, HashSet<String> extensions); 206 206 void clearSupportedPlugins(); 207 207 -
trunk/Source/WebKit/UIProcess/WebProcessProxy.cpp
r229178 r229390 571 571 572 572 #if ENABLE(NETSCAPE_PLUGIN_API) 573 void WebProcessProxy::getPlugins(bool refresh, Vector<PluginInfo>& plugins, Vector<PluginInfo>& applicationPlugins, std::optional< WebCore::SupportedPluginNames>& supportedPluginNames)573 void WebProcessProxy::getPlugins(bool refresh, Vector<PluginInfo>& plugins, Vector<PluginInfo>& applicationPlugins, std::optional<Vector<WebCore::SupportedPluginName>>& supportedPluginNames) 574 574 { 575 575 if (refresh) -
trunk/Source/WebKit/UIProcess/WebProcessProxy.h
r229178 r229390 239 239 // Plugins 240 240 #if ENABLE(NETSCAPE_PLUGIN_API) 241 void getPlugins(bool refresh, Vector<WebCore::PluginInfo>& plugins, Vector<WebCore::PluginInfo>& applicationPlugins, std::optional< WebCore::SupportedPluginNames>&);241 void getPlugins(bool refresh, Vector<WebCore::PluginInfo>& plugins, Vector<WebCore::PluginInfo>& applicationPlugins, std::optional<Vector<WebCore::SupportedPluginName>>&); 242 242 #endif // ENABLE(NETSCAPE_PLUGIN_API) 243 243 #if ENABLE(NETSCAPE_PLUGIN_API) -
trunk/Source/WebKit/UIProcess/WebProcessProxy.messages.in
r228587 r229390 34 34 # Plugin messages. 35 35 #if ENABLE(NETSCAPE_PLUGIN_API) 36 GetPlugins(bool refresh) -> (Vector<WebCore::PluginInfo> plugins, Vector<WebCore::PluginInfo> applicationPlugins, struct std::optional< WebCore::SupportedPluginNames> supportedPluginNames)36 GetPlugins(bool refresh) -> (Vector<WebCore::PluginInfo> plugins, Vector<WebCore::PluginInfo> applicationPlugins, struct std::optional<Vector<WebCore::SupportedPluginName>> supportedPluginNames) 37 37 GetPluginProcessConnection(uint64_t pluginProcessToken) -> (IPC::Attachment connectionHandle, bool supportsAsynchronousInitialization) Delayed 38 38 #endif -
trunk/Source/WebKit/WebProcess/Plugins/WebPluginInfoProvider.cpp
r228587 r229390 36 36 #include <WebCore/MainFrame.h> 37 37 #include <WebCore/Page.h> 38 #include <WebCore/SecurityOriginData.h>39 38 #include <WebCore/SubframeLoader.h> 40 39 #include <wtf/text/StringHash.h> … … 98 97 } 99 98 100 void WebPluginInfoProvider::getPluginInfo(Page& page, Vector<PluginInfo>& plugins, std::optional< SupportedPluginNames>& supportedPluginNames)99 void WebPluginInfoProvider::getPluginInfo(Page& page, Vector<PluginInfo>& plugins, std::optional<Vector<SupportedPluginName>>& supportedPluginNames) 101 100 { 102 101 #if ENABLE(NETSCAPE_PLUGIN_API) … … 122 121 ASSERT_ARG(plugins, plugins.isEmpty()); 123 122 124 std::optional< WebCore::SupportedPluginNames> supportedPluginNames;123 std::optional<Vector<WebCore::SupportedPluginName>> supportedPluginNames; 125 124 getPluginInfo(page, plugins, supportedPluginNames); 126 125 127 126 auto* document = page.mainFrame().document(); 127 128 if (document && supportedPluginNames) { 129 plugins.removeAllMatching([&] (auto& plugin) { 130 return !isSupportedPlugin(*supportedPluginNames, document->url(), plugin.name); 131 }); 132 } 133 134 #if PLATFORM(MAC) 128 135 auto* origin = document ? &document->securityOrigin(): nullptr; 129 130 if (origin && supportedPluginNames) {131 auto originData = SecurityOriginData::fromSecurityOrigin(*origin);132 plugins.removeAllMatching([&] (auto& plugin) {133 return !isSupportedPlugin(*supportedPluginNames, originData, plugin.name);134 });135 }136 137 #if PLATFORM(MAC)138 136 if (origin && origin->isLocal()) 139 137 return; -
trunk/Source/WebKit/WebProcess/Plugins/WebPluginInfoProvider.h
r228587 r229390 46 46 WebPluginInfoProvider(); 47 47 48 void getPluginInfo(WebCore::Page&, Vector<WebCore::PluginInfo>&, std::optional< WebCore::SupportedPluginNames>&) final;48 void getPluginInfo(WebCore::Page&, Vector<WebCore::PluginInfo>&, std::optional<Vector<WebCore::SupportedPluginName>>&) final; 49 49 void getWebVisiblePluginInfo(WebCore::Page&, Vector<WebCore::PluginInfo>&) final; 50 50 void refreshPlugins() override; … … 69 69 Vector<WebCore::PluginInfo> m_cachedPlugins; 70 70 Vector<WebCore::PluginInfo> m_cachedApplicationPlugins; 71 std::optional< WebCore::SupportedPluginNames> m_cachedSupportedPluginNames;71 std::optional<Vector<WebCore::SupportedPluginName>> m_cachedSupportedPluginNames; 72 72 #endif 73 73 }; -
trunk/Source/WebKitLegacy/mac/ChangeLog
r229297 r229390 1 2018-03-07 Youenn Fablet <youenn@apple.com> 2 3 Match unsupported plugins based on domains and not origin 4 https://bugs.webkit.org/show_bug.cgi?id=183384 5 6 Reviewed by Chris Dumez. 7 8 * WebCoreSupport/WebPluginInfoProvider.h: 9 * WebCoreSupport/WebPluginInfoProvider.mm: 10 (WebPluginInfoProvider::getPluginInfo): 11 (WebPluginInfoProvider::getWebVisiblePluginInfo): 12 1 13 2018-03-05 Andy Estes <aestes@apple.com> 2 14 -
trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebPluginInfoProvider.h
r228587 r229390 35 35 private: 36 36 void refreshPlugins() override; 37 void getPluginInfo(WebCore::Page&, Vector<WebCore::PluginInfo>&, std::optional< WebCore::SupportedPluginNames>&) final;37 void getPluginInfo(WebCore::Page&, Vector<WebCore::PluginInfo>&, std::optional<Vector<WebCore::SupportedPluginName>>&) final; 38 38 void getWebVisiblePluginInfo(WebCore::Page&, Vector<WebCore::PluginInfo>&) final; 39 39 -
trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebPluginInfoProvider.mm
r228587 r229390 56 56 } 57 57 58 void WebPluginInfoProvider::getPluginInfo(WebCore::Page& page, Vector<WebCore::PluginInfo>& plugins, std::optional< SupportedPluginNames>&)58 void WebPluginInfoProvider::getPluginInfo(WebCore::Page& page, Vector<WebCore::PluginInfo>& plugins, std::optional<Vector<SupportedPluginName>>&) 59 59 { 60 60 BEGIN_BLOCK_OBJC_EXCEPTIONS; … … 72 72 void WebPluginInfoProvider::getWebVisiblePluginInfo(WebCore::Page& page, Vector<WebCore::PluginInfo>& plugins) 73 73 { 74 std::optional< SupportedPluginNames> supportedPluginNames;74 std::optional<Vector<SupportedPluginName>> supportedPluginNames; 75 75 getPluginInfo(page, plugins, supportedPluginNames); 76 76 } -
trunk/Source/WebKitLegacy/win/WebCoreSupport/WebPluginInfoProvider.cpp
r228587 r229390 50 50 } 51 51 52 void WebPluginInfoProvider::getPluginInfo(WebCore::Page& page, Vector<WebCore::PluginInfo>& outPlugins, std::optional< WebCore::SupportedPluginNames>&)52 void WebPluginInfoProvider::getPluginInfo(WebCore::Page& page, Vector<WebCore::PluginInfo>& outPlugins, std::optional<Vector<WebCore::SupportedPluginName>>&) 53 53 { 54 54 const Vector<PluginPackage*>& plugins = PluginDatabase::installedPlugins()->plugins(); … … 85 85 void WebPluginInfoProvider::getWebVisiblePluginInfo(WebCore::Page& page, Vector<WebCore::PluginInfo>& plugins) 86 86 { 87 std::optional< WebCore::SupportedPluginNames> supportedPluginNames;87 std::optional<Vector<WebCore::SupportedPluginName>> supportedPluginNames; 88 88 getPluginInfo(page, plugins, supportedPluginNames); 89 89 } -
trunk/Source/WebKitLegacy/win/WebCoreSupport/WebPluginInfoProvider.h
r228587 r229390 37 37 private: 38 38 void refreshPlugins() final; 39 void getPluginInfo(WebCore::Page&, Vector<WebCore::PluginInfo>&, std::optional< WebCore::SupportedPluginNames>&) final;39 void getPluginInfo(WebCore::Page&, Vector<WebCore::PluginInfo>&, std::optional<Vector<WebCore::SupportedPluginName>>&) final; 40 40 void getWebVisiblePluginInfo(WebCore::Page&, Vector<WebCore::PluginInfo>&) final; 41 41 #if PLATFORM(MAC) -
trunk/Tools/ChangeLog
r229381 r229390 1 2018-03-07 Youenn Fablet <youenn@apple.com> 2 3 Match unsupported plugins based on domains and not origin 4 https://bugs.webkit.org/show_bug.cgi?id=183384 5 6 Reviewed by Chris Dumez. 7 8 * TestWebKitAPI/Tests/WebCore/URL.cpp: 9 (TestWebKitAPI::TEST_F): 10 * WebKitTestRunner/TestController.cpp: 11 (WTR::TestController::setPluginSupportedMode): Update to whitelist 12 localhost and not http://localhost:8080 13 1 14 2018-03-07 Jonathan Bedard <jbedard@apple.com> 2 15 -
trunk/Tools/TestWebKitAPI/Tests/WebCore/URL.cpp
r228323 r229390 265 265 } 266 266 267 TEST_F(URLTest, HostIsMatchingDomain) 268 { 269 URL url = createURL("http://www.webkit.org"); 270 271 EXPECT_TRUE(url.isMatchingDomain(String { })); 272 EXPECT_TRUE(url.isMatchingDomain(emptyString())); 273 EXPECT_TRUE(url.isMatchingDomain(ASCIILiteral("org"))); 274 EXPECT_TRUE(url.isMatchingDomain(ASCIILiteral("webkit.org"))); 275 EXPECT_TRUE(url.isMatchingDomain(ASCIILiteral("www.webkit.org"))); 276 277 EXPECT_FALSE(url.isMatchingDomain(ASCIILiteral("rg"))); 278 EXPECT_FALSE(url.isMatchingDomain(ASCIILiteral(".org"))); 279 EXPECT_FALSE(url.isMatchingDomain(ASCIILiteral("ww.webkit.org"))); 280 EXPECT_FALSE(url.isMatchingDomain(ASCIILiteral("http://www.webkit.org"))); 281 282 url = createURL("file:///www.webkit.org"); 283 284 EXPECT_FALSE(url.isMatchingDomain(String { })); 285 EXPECT_FALSE(url.isMatchingDomain(emptyString())); 286 EXPECT_FALSE(url.isMatchingDomain(ASCIILiteral("org"))); 287 EXPECT_FALSE(url.isMatchingDomain(ASCIILiteral("webkit.org"))); 288 EXPECT_FALSE(url.isMatchingDomain(ASCIILiteral("www.webkit.org"))); 289 290 URL emptyURL; 291 EXPECT_FALSE(emptyURL.isMatchingDomain(String { })); 292 EXPECT_FALSE(emptyURL.isMatchingDomain(emptyString())); 293 } 294 267 295 } // namespace TestWebKitAPI -
trunk/Tools/WebKitTestRunner/TestController.cpp
r229349 r229390 1704 1704 WKRetainPtr<WKMutableArrayRef> emptyArray = adoptWK(WKMutableArrayCreate()); 1705 1705 WKRetainPtr<WKStringRef> allOrigins = adoptWK(WKStringCreateWithUTF8CString("")); 1706 WKRetainPtr<WKStringRef> specificOrigin = adoptWK(WKStringCreateWithUTF8CString(" http://localhost:8080"));1706 WKRetainPtr<WKStringRef> specificOrigin = adoptWK(WKStringCreateWithUTF8CString("localhost")); 1707 1707 1708 1708 WKRetainPtr<WKStringRef> pdfName = adoptWK(WKStringCreateWithUTF8CString("My personal PDF"));
Note: See TracChangeset
for help on using the changeset viewer.