Title: [232815] trunk/Source
Revision
232815
Author
you...@apple.com
Date
2018-06-13 15:22:07 -0700 (Wed, 13 Jun 2018)

Log Message

Supported plugin check should be based on plugin identifier
https://bugs.webkit.org/show_bug.cgi?id=186578
<rdar://problem/40523828>

Reviewed by Darin Adler.

Source/WebCore:

Rename SupportedPluginName in SupportedPluginIdentifier.
Add cross-platform support for plug-in identifier.

Update built-in PDF plug-in to check its identifier instead of its name.
This is stronger as the name may change according localization.

* loader/EmptyClients.cpp:
* plugins/PluginData.cpp:
(WebCore::isBuiltInPDFPlugIn):
(WebCore::PluginData::initPlugins):
* plugins/PluginData.h:
(WebCore::operator==):
(WebCore::isSupportedPlugin):
(WebCore::SupportedPluginIdentifier::decode):
(WebCore::SupportedPluginIdentifier::encode const):
(WebCore::SupportedPluginName::decode): Deleted.
(WebCore::SupportedPluginName::encode const): Deleted.
* plugins/PluginInfoProvider.h:

Source/WebKit:

Refactoring to move from Plugin name to Plugin identifier.
Set built-in pdf plugin identifier.
This allows making sure that the PDF plug-in check might not change according localization.

* Scripts/webkit/messages.py:
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<PluginInfo>::encode):
(IPC::ArgumentCoder<PluginInfo>::decode):
* UIProcess/Plugins/PluginInfoStore.cpp:
(WebKit::PluginInfoStore::supportedPluginIdentifiers):
(WebKit::PluginInfoStore::addSupportedPlugin):
(WebKit::PluginInfoStore::supportedPluginNames): Deleted.
* UIProcess/Plugins/PluginInfoStore.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::getPlugins):
* UIProcess/WebProcessProxy.h:
* UIProcess/WebProcessProxy.messages.in:
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::pluginInfo):
* WebProcess/Plugins/WebPluginInfoProvider.cpp:
(WebKit::WebPluginInfoProvider::pluginInfo):
(WebKit::WebPluginInfoProvider::webVisiblePluginInfo):
(WebKit::WebPluginInfoProvider::populatePluginCache):
* WebProcess/Plugins/WebPluginInfoProvider.h:

Source/WebKitLegacy/mac:

* WebCoreSupport/WebPluginInfoProvider.h:
* WebCoreSupport/WebPluginInfoProvider.mm:
(WebPluginInfoProvider::pluginInfo):
(WebPluginInfoProvider::webVisiblePluginInfo):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (232814 => 232815)


--- trunk/Source/WebCore/ChangeLog	2018-06-13 22:16:10 UTC (rev 232814)
+++ trunk/Source/WebCore/ChangeLog	2018-06-13 22:22:07 UTC (rev 232815)
@@ -1,3 +1,30 @@
+2018-06-13  Youenn Fablet  <you...@apple.com>
+
+        Supported plugin check should be based on plugin identifier
+        https://bugs.webkit.org/show_bug.cgi?id=186578
+        <rdar://problem/40523828>
+
+        Reviewed by Darin Adler.
+
+        Rename SupportedPluginName in SupportedPluginIdentifier.
+        Add cross-platform support for plug-in identifier.
+
+        Update built-in PDF plug-in to check its identifier instead of its name.
+        This is stronger as the name may change according localization.
+
+        * loader/EmptyClients.cpp:
+        * plugins/PluginData.cpp:
+        (WebCore::isBuiltInPDFPlugIn):
+        (WebCore::PluginData::initPlugins):
+        * plugins/PluginData.h:
+        (WebCore::operator==):
+        (WebCore::isSupportedPlugin):
+        (WebCore::SupportedPluginIdentifier::decode):
+        (WebCore::SupportedPluginIdentifier::encode const):
+        (WebCore::SupportedPluginName::decode): Deleted.
+        (WebCore::SupportedPluginName::encode const): Deleted.
+        * plugins/PluginInfoProvider.h:
+
 2018-06-13  Chris Dumez  <cdu...@apple.com>
 
         PSON: http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-collusion.html ASSERTS with process swap enabled

Modified: trunk/Source/WebCore/loader/EmptyClients.cpp (232814 => 232815)


--- trunk/Source/WebCore/loader/EmptyClients.cpp	2018-06-13 22:16:10 UTC (rev 232814)
+++ trunk/Source/WebCore/loader/EmptyClients.cpp	2018-06-13 22:22:07 UTC (rev 232815)
@@ -326,7 +326,7 @@
 
 class EmptyPluginInfoProvider final : public PluginInfoProvider {
     void refreshPlugins() final { };
-    Vector<PluginInfo> pluginInfo(Page&, std::optional<Vector<SupportedPluginName>>&) final { return { }; }
+    Vector<PluginInfo> pluginInfo(Page&, std::optional<Vector<SupportedPluginIdentifier>>&) final { return { }; }
     Vector<PluginInfo> webVisiblePluginInfo(Page&, const URL&) final { return { }; }
 };
 

Modified: trunk/Source/WebCore/plugins/PluginData.cpp (232814 => 232815)


--- trunk/Source/WebCore/plugins/PluginData.cpp	2018-06-13 22:16:10 UTC (rev 232814)
+++ trunk/Source/WebCore/plugins/PluginData.cpp	2018-06-13 22:22:07 UTC (rev 232815)
@@ -52,9 +52,9 @@
 }
 
 #if PLATFORM(COCOA)
-static inline bool isBuiltInPDFPlugIn(const PluginInfo& plugIn)
+static inline bool isBuiltInPDFPlugIn(const PluginInfo& plugin)
 {
-    return plugIn.name == builtInPDFPluginName();
+    return equalLettersIgnoringASCIICase(plugin.bundleIdentifier, "com.apple.webkit.builtinpdfplugin");
 }
 #else
 static inline bool isBuiltInPDFPlugIn(const PluginInfo&)
@@ -190,7 +190,7 @@
 {
     ASSERT(m_plugins.isEmpty());
 
-    m_plugins = m_page.pluginInfoProvider().pluginInfo(m_page, m_supportedPluginNames);
+    m_plugins = m_page.pluginInfoProvider().pluginInfo(m_page, m_supportedPluginIdentifiers);
 }
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/plugins/PluginData.h (232814 => 232815)


--- trunk/Source/WebCore/plugins/PluginData.h	2018-06-13 22:16:10 UTC (rev 232814)
+++ trunk/Source/WebCore/plugins/PluginData.h	2018-06-13 22:22:07 UTC (rev 232815)
@@ -73,8 +73,8 @@
 
     PluginLoadClientPolicy clientLoadPolicy;
 
+    String bundleIdentifier;
 #if PLATFORM(MAC)
-    String bundleIdentifier;
     String versionString;
 #endif
 };
@@ -81,19 +81,19 @@
 
 inline bool operator==(PluginInfo& a, PluginInfo& b)
 {
-    bool result = a.name == b.name && a.file == b.file && a.desc == b.desc && a.mimes == b.mimes && a.isApplicationPlugin == b.isApplicationPlugin && a.clientLoadPolicy == b.clientLoadPolicy;
+    bool result = a.name == b.name && a.file == b.file && a.desc == b.desc && a.mimes == b.mimes && a.isApplicationPlugin == b.isApplicationPlugin && a.clientLoadPolicy == b.clientLoadPolicy && a.bundleIdentifier == b.bundleIdentifier;
 #if PLATFORM(MAC)
-    result = result && a.bundleIdentifier == b.bundleIdentifier && a.versionString == b.versionString;
+    result = result && a.versionString == b.versionString;
 #endif
     return result;
 }
 
-struct SupportedPluginName {
+struct SupportedPluginIdentifier {
     String matchingDomain;
-    String pluginName;
+    String pluginIdentifier;
 
     template<class Encoder> void encode(Encoder&) const;
-    template<class Decoder> static std::optional<SupportedPluginName> decode(Decoder&);
+    template<class Decoder> static std::optional<SupportedPluginIdentifier> decode(Decoder&);
 };
 
 // FIXME: merge with PluginDatabase in the future
@@ -128,7 +128,7 @@
 protected:
     Page& m_page;
     Vector<PluginInfo> m_plugins;
-    std::optional<Vector<SupportedPluginName>> m_supportedPluginNames;
+    std::optional<Vector<SupportedPluginIdentifier>> m_supportedPluginIdentifiers;
 
     struct CachedVisiblePlugins {
         URL pageURL;
@@ -137,14 +137,14 @@
     mutable CachedVisiblePlugins m_cachedVisiblePlugins;
 };
 
-inline bool isSupportedPlugin(const Vector<SupportedPluginName>& pluginNames, const URL& pageURL, const String& pluginName)
+inline bool isSupportedPlugin(const Vector<SupportedPluginIdentifier>& pluginIdentifiers, const URL& pageURL, const String& pluginIdentifier)
 {
-    return pluginNames.findMatching([&] (auto&& plugin) {
-        return pageURL.isMatchingDomain(plugin.matchingDomain) && plugin.pluginName == pluginName;
+    return pluginIdentifiers.findMatching([&] (auto&& plugin) {
+        return pageURL.isMatchingDomain(plugin.matchingDomain) && plugin.pluginIdentifier == pluginIdentifier;
     }) != notFound;
 }
 
-template<class Decoder> inline std::optional<SupportedPluginName> SupportedPluginName::decode(Decoder& decoder)
+template<class Decoder> inline std::optional<SupportedPluginIdentifier> SupportedPluginIdentifier::decode(Decoder& decoder)
 {
     std::optional<String> matchingDomain;
     decoder >> matchingDomain;
@@ -151,18 +151,18 @@
     if (!matchingDomain)
         return std::nullopt;
 
-    std::optional<String> pluginName;
-    decoder >> pluginName;
-    if (!pluginName)
+    std::optional<String> pluginIdentifier;
+    decoder >> pluginIdentifier;
+    if (!pluginIdentifier)
         return std::nullopt;
 
-    return SupportedPluginName { WTFMove(matchingDomain.value()), WTFMove(pluginName.value()) };
+    return SupportedPluginIdentifier { WTFMove(matchingDomain.value()), WTFMove(pluginIdentifier.value()) };
 }
 
-template<class Encoder> inline void SupportedPluginName::encode(Encoder& encoder) const
+template<class Encoder> inline void SupportedPluginIdentifier::encode(Encoder& encoder) const
 {
     encoder << matchingDomain;
-    encoder << pluginName;
+    encoder << pluginIdentifier;
 }
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/plugins/PluginInfoProvider.h (232814 => 232815)


--- trunk/Source/WebCore/plugins/PluginInfoProvider.h	2018-06-13 22:16:10 UTC (rev 232814)
+++ trunk/Source/WebCore/plugins/PluginInfoProvider.h	2018-06-13 22:22:07 UTC (rev 232815)
@@ -39,7 +39,7 @@
     void addPage(Page&);
     void removePage(Page&);
 
-    virtual Vector<PluginInfo> pluginInfo(Page&, std::optional<Vector<SupportedPluginName>>&) = 0;
+    virtual Vector<PluginInfo> pluginInfo(Page&, std::optional<Vector<SupportedPluginIdentifier>>&) = 0;
     virtual Vector<PluginInfo> webVisiblePluginInfo(Page&, const URL&) = 0;
 
 private:

Modified: trunk/Source/WebKit/ChangeLog (232814 => 232815)


--- trunk/Source/WebKit/ChangeLog	2018-06-13 22:16:10 UTC (rev 232814)
+++ trunk/Source/WebKit/ChangeLog	2018-06-13 22:22:07 UTC (rev 232815)
@@ -1,3 +1,36 @@
+2018-06-13  Youenn Fablet  <you...@apple.com>
+
+        Supported plugin check should be based on plugin identifier
+        https://bugs.webkit.org/show_bug.cgi?id=186578
+        <rdar://problem/40523828>
+
+        Reviewed by Darin Adler.
+
+        Refactoring to move from Plugin name to Plugin identifier.
+        Set built-in pdf plugin identifier.
+        This allows making sure that the PDF plug-in check might not change according localization.
+
+        * Scripts/webkit/messages.py:
+        * Shared/WebCoreArgumentCoders.cpp:
+        (IPC::ArgumentCoder<PluginInfo>::encode):
+        (IPC::ArgumentCoder<PluginInfo>::decode):
+        * UIProcess/Plugins/PluginInfoStore.cpp:
+        (WebKit::PluginInfoStore::supportedPluginIdentifiers):
+        (WebKit::PluginInfoStore::addSupportedPlugin):
+        (WebKit::PluginInfoStore::supportedPluginNames): Deleted.
+        * UIProcess/Plugins/PluginInfoStore.h:
+        * UIProcess/WebProcessProxy.cpp:
+        (WebKit::WebProcessProxy::getPlugins):
+        * UIProcess/WebProcessProxy.h:
+        * UIProcess/WebProcessProxy.messages.in:
+        * WebProcess/Plugins/PDF/PDFPlugin.mm:
+        (WebKit::PDFPlugin::pluginInfo):
+        * WebProcess/Plugins/WebPluginInfoProvider.cpp:
+        (WebKit::WebPluginInfoProvider::pluginInfo):
+        (WebKit::WebPluginInfoProvider::webVisiblePluginInfo):
+        (WebKit::WebPluginInfoProvider::populatePluginCache):
+        * WebProcess/Plugins/WebPluginInfoProvider.h:
+
 2018-06-13  Chris Dumez  <cdu...@apple.com>
 
         PSON: http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-collusion.html ASSERTS with process swap enabled

Modified: trunk/Source/WebKit/Scripts/webkit/messages.py (232814 => 232815)


--- trunk/Source/WebKit/Scripts/webkit/messages.py	2018-06-13 22:16:10 UTC (rev 232814)
+++ trunk/Source/WebKit/Scripts/webkit/messages.py	2018-06-13 22:22:07 UTC (rev 232815)
@@ -409,7 +409,7 @@
         'WebCore::ShippingMethodUpdate': ['<WebCore/ApplePaySessionPaymentRequest.h>'],
         'WebCore::ShouldNotifyWhenResolved': ['<WebCore/ServiceWorkerTypes.h>'],
         'WebCore::ShouldSample': ['<WebCore/DiagnosticLoggingClient.h>'],
-        'WebCore::SupportedPluginName': ['<WebCore/PluginData.h>'],
+        'WebCore::SupportedPluginIdentifier': ['<WebCore/PluginData.h>'],
         'WebCore::TextCheckingRequestData': ['<WebCore/TextChecking.h>'],
         'WebCore::TextCheckingResult': ['<WebCore/TextCheckerClient.h>'],
         'WebCore::TextIndicatorData': ['<WebCore/TextIndicator.h>'],

Modified: trunk/Source/WebKit/Shared/WebCoreArgumentCoders.cpp (232814 => 232815)


--- trunk/Source/WebKit/Shared/WebCoreArgumentCoders.cpp	2018-06-13 22:16:10 UTC (rev 232814)
+++ trunk/Source/WebKit/Shared/WebCoreArgumentCoders.cpp	2018-06-13 22:22:07 UTC (rev 232815)
@@ -963,8 +963,8 @@
     encoder << pluginInfo.mimes;
     encoder << pluginInfo.isApplicationPlugin;
     encoder.encodeEnum(pluginInfo.clientLoadPolicy);
+    encoder << pluginInfo.bundleIdentifier;
 #if PLATFORM(MAC)
-    encoder << pluginInfo.bundleIdentifier;
     encoder << pluginInfo.versionString;
 #endif
 }
@@ -984,9 +984,9 @@
         return std::nullopt;
     if (!decoder.decodeEnum(pluginInfo.clientLoadPolicy))
         return std::nullopt;
-#if PLATFORM(MAC)
     if (!decoder.decode(pluginInfo.bundleIdentifier))
         return std::nullopt;
+#if PLATFORM(MAC)
     if (!decoder.decode(pluginInfo.versionString))
         return std::nullopt;
 #endif

Modified: trunk/Source/WebKit/UIProcess/Plugins/PluginInfoStore.cpp (232814 => 232815)


--- trunk/Source/WebKit/UIProcess/Plugins/PluginInfoStore.cpp	2018-06-13 22:16:10 UTC (rev 232814)
+++ trunk/Source/WebKit/UIProcess/Plugins/PluginInfoStore.cpp	2018-06-13 22:22:07 UTC (rev 232815)
@@ -224,22 +224,22 @@
     }) != notFound;
 }
 
-std::optional<Vector<SupportedPluginName>> PluginInfoStore::supportedPluginNames()
+std::optional<Vector<SupportedPluginIdentifier>> PluginInfoStore::supportedPluginIdentifiers()
 {
     if (!m_supportedPlugins)
         return std::nullopt;
 
     return WTF::map(*m_supportedPlugins, [] (auto&& item) {
-        return SupportedPluginName { item.matchingDomain, item.name };
+        return SupportedPluginIdentifier { item.matchingDomain, item.identifier };
     });
 }
 
-void PluginInfoStore::addSupportedPlugin(String&& domainName, String&& name, HashSet<String>&& mimeTypes, HashSet<String> extensions)
+void PluginInfoStore::addSupportedPlugin(String&& domainName, String&& identifier, HashSet<String>&& mimeTypes, HashSet<String> extensions)
 {
     if (!m_supportedPlugins)
         m_supportedPlugins = Vector<SupportedPlugin> { };
 
-    m_supportedPlugins->append(SupportedPlugin { WTFMove(domainName), WTFMove(name), WTFMove(mimeTypes), WTFMove(extensions) });
+    m_supportedPlugins->append(SupportedPlugin { WTFMove(domainName), WTFMove(identifier), WTFMove(mimeTypes), WTFMove(extensions) });
 }
 
 PluginModuleInfo PluginInfoStore::infoForPluginWithPath(const String& pluginPath) const

Modified: trunk/Source/WebKit/UIProcess/Plugins/PluginInfoStore.h (232814 => 232815)


--- trunk/Source/WebKit/UIProcess/Plugins/PluginInfoStore.h	2018-06-13 22:16:10 UTC (rev 232814)
+++ trunk/Source/WebKit/UIProcess/Plugins/PluginInfoStore.h	2018-06-13 22:22:07 UTC (rev 232815)
@@ -64,8 +64,8 @@
     static PluginModuleLoadPolicy defaultLoadPolicyForPlugin(const PluginModuleInfo&);
 
     bool isSupportedPlugin(const String& mimeType, const WebCore::URL& pluginURL, const String& frameURLString, const WebCore::URL& pageURL);
-    std::optional<Vector<WebCore::SupportedPluginName>> supportedPluginNames();
-    void addSupportedPlugin(String&& matchingDomain, String&& name, HashSet<String>&& mimeTypes, HashSet<String> extensions);
+    std::optional<Vector<WebCore::SupportedPluginIdentifier>> supportedPluginIdentifiers();
+    void addSupportedPlugin(String&& matchingDomain, String&& identifier, HashSet<String>&& mimeTypes, HashSet<String> extensions);
     void clearSupportedPlugins() { m_supportedPlugins = std::nullopt; }
 
 private:
@@ -98,7 +98,7 @@
 
     struct SupportedPlugin {
         String matchingDomain;
-        String name;
+        String identifier;
         HashSet<String> mimeTypes;
         HashSet<String> extensions;
     };

Modified: trunk/Source/WebKit/UIProcess/WebProcessProxy.cpp (232814 => 232815)


--- trunk/Source/WebKit/UIProcess/WebProcessProxy.cpp	2018-06-13 22:16:10 UTC (rev 232814)
+++ trunk/Source/WebKit/UIProcess/WebProcessProxy.cpp	2018-06-13 22:22:07 UTC (rev 232815)
@@ -560,12 +560,12 @@
 }
 
 #if ENABLE(NETSCAPE_PLUGIN_API)
-void WebProcessProxy::getPlugins(bool refresh, Vector<PluginInfo>& plugins, Vector<PluginInfo>& applicationPlugins, std::optional<Vector<WebCore::SupportedPluginName>>& supportedPluginNames)
+void WebProcessProxy::getPlugins(bool refresh, Vector<PluginInfo>& plugins, Vector<PluginInfo>& applicationPlugins, std::optional<Vector<WebCore::SupportedPluginIdentifier>>& supportedPluginIdentifiers)
 {
     if (refresh)
         m_processPool->pluginInfoStore().refresh();
 
-    supportedPluginNames = m_processPool->pluginInfoStore().supportedPluginNames();
+    supportedPluginIdentifiers = m_processPool->pluginInfoStore().supportedPluginIdentifiers();
 
     Vector<PluginModuleInfo> pluginModules = m_processPool->pluginInfoStore().plugins();
     for (size_t i = 0; i < pluginModules.size(); ++i)

Modified: trunk/Source/WebKit/UIProcess/WebProcessProxy.h (232814 => 232815)


--- trunk/Source/WebKit/UIProcess/WebProcessProxy.h	2018-06-13 22:16:10 UTC (rev 232814)
+++ trunk/Source/WebKit/UIProcess/WebProcessProxy.h	2018-06-13 22:22:07 UTC (rev 232815)
@@ -267,7 +267,7 @@
 
     // Plugins
 #if ENABLE(NETSCAPE_PLUGIN_API)
-    void getPlugins(bool refresh, Vector<WebCore::PluginInfo>& plugins, Vector<WebCore::PluginInfo>& applicationPlugins, std::optional<Vector<WebCore::SupportedPluginName>>&);
+    void getPlugins(bool refresh, Vector<WebCore::PluginInfo>& plugins, Vector<WebCore::PluginInfo>& applicationPlugins, std::optional<Vector<WebCore::SupportedPluginIdentifier>>&);
 #endif // ENABLE(NETSCAPE_PLUGIN_API)
 #if ENABLE(NETSCAPE_PLUGIN_API)
     void getPluginProcessConnection(uint64_t pluginProcessToken, Messages::WebProcessProxy::GetPluginProcessConnection::DelayedReply&&);

Modified: trunk/Source/WebKit/UIProcess/WebProcessProxy.messages.in (232814 => 232815)


--- trunk/Source/WebKit/UIProcess/WebProcessProxy.messages.in	2018-06-13 22:16:10 UTC (rev 232814)
+++ trunk/Source/WebKit/UIProcess/WebProcessProxy.messages.in	2018-06-13 22:22:07 UTC (rev 232815)
@@ -33,7 +33,7 @@
 
     # Plugin messages.
 #if ENABLE(NETSCAPE_PLUGIN_API)
-    GetPlugins(bool refresh) -> (Vector<WebCore::PluginInfo> plugins, Vector<WebCore::PluginInfo> applicationPlugins, struct std::optional<Vector<WebCore::SupportedPluginName>> supportedPluginNames)
+    GetPlugins(bool refresh) -> (Vector<WebCore::PluginInfo> plugins, Vector<WebCore::PluginInfo> applicationPlugins, struct std::optional<Vector<WebCore::SupportedPluginIdentifier>> supportedPluginIdentifiers)
     GetPluginProcessConnection(uint64_t pluginProcessToken) -> (IPC::Attachment connectionHandle, bool supportsAsynchronousInitialization) Delayed
 #endif
     GetNetworkProcessConnection() -> (IPC::Attachment connectionHandle) Delayed

Modified: trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm (232814 => 232815)


--- trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm	2018-06-13 22:16:10 UTC (rev 232814)
+++ trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm	2018-06-13 22:22:07 UTC (rev 232815)
@@ -651,6 +651,7 @@
     info.name = builtInPDFPluginName();
     info.isApplicationPlugin = true;
     info.clientLoadPolicy = PluginLoadClientPolicyUndefined;
+    info.bundleIdentifier = ASCIILiteral("com.apple.webkit.builtinpdfplugin");
 
     MimeClassInfo pdfMimeClassInfo;
     pdfMimeClassInfo.type = "application/pdf";

Modified: trunk/Source/WebKit/WebProcess/Plugins/WebPluginInfoProvider.cpp (232814 => 232815)


--- trunk/Source/WebKit/WebProcess/Plugins/WebPluginInfoProvider.cpp	2018-06-13 22:16:10 UTC (rev 232814)
+++ trunk/Source/WebKit/WebProcess/Plugins/WebPluginInfoProvider.cpp	2018-06-13 22:22:07 UTC (rev 232815)
@@ -97,18 +97,18 @@
 #endif
 }
 
-Vector<PluginInfo> WebPluginInfoProvider::pluginInfo(Page& page, std::optional<Vector<SupportedPluginName>>& supportedPluginNames)
+Vector<PluginInfo> WebPluginInfoProvider::pluginInfo(Page& page, std::optional<Vector<SupportedPluginIdentifier>>& supportedPluginIdentifiers)
 {
 #if ENABLE(NETSCAPE_PLUGIN_API)
     populatePluginCache(page);
 
-    if (m_cachedSupportedPluginNames)
-        supportedPluginNames = *m_cachedSupportedPluginNames;
+    if (m_cachedSupportedPluginIdentifiers)
+        supportedPluginIdentifiers = *m_cachedSupportedPluginIdentifiers;
 
     return page.mainFrame().loader().subframeLoader().allowPlugins() ? m_cachedPlugins : m_cachedApplicationPlugins;
 #else
     UNUSED_PARAM(page);
-    UNUSED_PARAM(supportedPluginNames);
+    UNUSED_PARAM(supportedPluginIdentifiers);
     return { };
 #endif // ENABLE(NETSCAPE_PLUGIN_API)
 }
@@ -115,11 +115,11 @@
 
 Vector<WebCore::PluginInfo> WebPluginInfoProvider::webVisiblePluginInfo(Page& page, const WebCore::URL& url)
 {
-    std::optional<Vector<WebCore::SupportedPluginName>> supportedPluginNames;
-    auto plugins = pluginInfo(page, supportedPluginNames);
+    std::optional<Vector<WebCore::SupportedPluginIdentifier>> supportedPluginIdentifiers;
+    auto plugins = pluginInfo(page, supportedPluginIdentifiers);
 
     plugins.removeAllMatching([&] (auto& plugin) {
-        return supportedPluginNames && !isSupportedPlugin(*supportedPluginNames, url, plugin.name);
+        return supportedPluginIdentifiers && !isSupportedPlugin(*supportedPluginIdentifiers, url, plugin.bundleIdentifier);
     });
 
 #if PLATFORM(MAC)
@@ -147,7 +147,7 @@
         HangDetectionDisabler hangDetectionDisabler;
 
         if (!WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebProcessProxy::GetPlugins(m_shouldRefreshPlugins),
-            Messages::WebProcessProxy::GetPlugins::Reply(m_cachedPlugins, m_cachedApplicationPlugins, m_cachedSupportedPluginNames), 0,
+            Messages::WebProcessProxy::GetPlugins::Reply(m_cachedPlugins, m_cachedApplicationPlugins, m_cachedSupportedPluginIdentifiers), 0,
             Seconds::infinity(), IPC::SendSyncOption::DoNotProcessIncomingMessagesWhenWaitingForSyncReply))
             return;
 

Modified: trunk/Source/WebKit/WebProcess/Plugins/WebPluginInfoProvider.h (232814 => 232815)


--- trunk/Source/WebKit/WebProcess/Plugins/WebPluginInfoProvider.h	2018-06-13 22:16:10 UTC (rev 232814)
+++ trunk/Source/WebKit/WebProcess/Plugins/WebPluginInfoProvider.h	2018-06-13 22:22:07 UTC (rev 232815)
@@ -45,7 +45,7 @@
 private:
     WebPluginInfoProvider();
 
-    Vector<WebCore::PluginInfo> pluginInfo(WebCore::Page&, std::optional<Vector<WebCore::SupportedPluginName>>&) final;
+    Vector<WebCore::PluginInfo> pluginInfo(WebCore::Page&, std::optional<Vector<WebCore::SupportedPluginIdentifier>>&) final;
     Vector<WebCore::PluginInfo> webVisiblePluginInfo(WebCore::Page&, const WebCore::URL&) final;
     void refreshPlugins() override;
 
@@ -68,7 +68,7 @@
     bool m_shouldRefreshPlugins { false };
     Vector<WebCore::PluginInfo> m_cachedPlugins;
     Vector<WebCore::PluginInfo> m_cachedApplicationPlugins;
-    std::optional<Vector<WebCore::SupportedPluginName>> m_cachedSupportedPluginNames;
+    std::optional<Vector<WebCore::SupportedPluginIdentifier>> m_cachedSupportedPluginIdentifiers;
 #endif
 };
 

Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (232814 => 232815)


--- trunk/Source/WebKitLegacy/mac/ChangeLog	2018-06-13 22:16:10 UTC (rev 232814)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog	2018-06-13 22:22:07 UTC (rev 232815)
@@ -1,3 +1,16 @@
+2018-06-13  Youenn Fablet  <you...@apple.com>
+
+        Supported plugin check should be based on plugin identifier
+        https://bugs.webkit.org/show_bug.cgi?id=186578
+        <rdar://problem/40523828>
+
+        Reviewed by Darin Adler.
+
+        * WebCoreSupport/WebPluginInfoProvider.h:
+        * WebCoreSupport/WebPluginInfoProvider.mm:
+        (WebPluginInfoProvider::pluginInfo):
+        (WebPluginInfoProvider::webVisiblePluginInfo):
+
 2018-06-13  Chris Dumez  <cdu...@apple.com>
 
         PSON: http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-collusion.html ASSERTS with process swap enabled

Modified: trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebPluginInfoProvider.h (232814 => 232815)


--- trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebPluginInfoProvider.h	2018-06-13 22:16:10 UTC (rev 232814)
+++ trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebPluginInfoProvider.h	2018-06-13 22:22:07 UTC (rev 232815)
@@ -34,7 +34,7 @@
 
 private:
     void refreshPlugins() override;
-    Vector<WebCore::PluginInfo> pluginInfo(WebCore::Page&, std::optional<Vector<WebCore::SupportedPluginName>>&) final;
+    Vector<WebCore::PluginInfo> pluginInfo(WebCore::Page&, std::optional<Vector<WebCore::SupportedPluginIdentifier>>&) final;
     Vector<WebCore::PluginInfo> webVisiblePluginInfo(WebCore::Page&, const WebCore::URL&) final;
 
     WebPluginInfoProvider();

Modified: trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebPluginInfoProvider.mm (232814 => 232815)


--- trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebPluginInfoProvider.mm	2018-06-13 22:16:10 UTC (rev 232814)
+++ trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebPluginInfoProvider.mm	2018-06-13 22:22:07 UTC (rev 232815)
@@ -55,7 +55,7 @@
     [[WebPluginDatabase sharedDatabaseIfExists] refresh];
 }
 
-Vector<WebCore::PluginInfo> WebPluginInfoProvider::pluginInfo(WebCore::Page& page, std::optional<Vector<SupportedPluginName>>&)
+Vector<WebCore::PluginInfo> WebPluginInfoProvider::pluginInfo(WebCore::Page& page, std::optional<Vector<SupportedPluginIdentifier>>&)
 {
     Vector<WebCore::PluginInfo> plugins;
 
@@ -76,6 +76,6 @@
 
 Vector<WebCore::PluginInfo> WebPluginInfoProvider::webVisiblePluginInfo(WebCore::Page& page, const WebCore::URL&)
 {
-    std::optional<Vector<SupportedPluginName>> supportedPluginNames;
-    return pluginInfo(page, supportedPluginNames);
+    std::optional<Vector<SupportedPluginIdentifier>> supportedPluginIdentifiers;
+    return pluginInfo(page, supportedPluginIdentifiers);
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to