Supported plugin check should be based on plugin identifier
authoryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Jun 2018 22:22:07 +0000 (22:22 +0000)
committeryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Jun 2018 22:22:07 +0000 (22:22 +0000)
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):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@232815 268f45cc-cd09-0410-ab3c-d52691b4dbfc

19 files changed:
Source/WebCore/ChangeLog
Source/WebCore/loader/EmptyClients.cpp
Source/WebCore/plugins/PluginData.cpp
Source/WebCore/plugins/PluginData.h
Source/WebCore/plugins/PluginInfoProvider.h
Source/WebKit/ChangeLog
Source/WebKit/Scripts/webkit/messages.py
Source/WebKit/Shared/WebCoreArgumentCoders.cpp
Source/WebKit/UIProcess/Plugins/PluginInfoStore.cpp
Source/WebKit/UIProcess/Plugins/PluginInfoStore.h
Source/WebKit/UIProcess/WebProcessProxy.cpp
Source/WebKit/UIProcess/WebProcessProxy.h
Source/WebKit/UIProcess/WebProcessProxy.messages.in
Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm
Source/WebKit/WebProcess/Plugins/WebPluginInfoProvider.cpp
Source/WebKit/WebProcess/Plugins/WebPluginInfoProvider.h
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/WebCoreSupport/WebPluginInfoProvider.h
Source/WebKitLegacy/mac/WebCoreSupport/WebPluginInfoProvider.mm

index 99e2840..0e81413 100644 (file)
@@ -1,3 +1,30 @@
+2018-06-13  Youenn Fablet  <youenn@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  <cdumez@apple.com>
 
         PSON: http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-collusion.html ASSERTS with process swap enabled
index c33bc03..3576655 100644 (file)
@@ -326,7 +326,7 @@ class EmptyPaymentCoordinatorClient final : public PaymentCoordinatorClient {
 
 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 { }; }
 };
 
index b4662ca..46c4c57 100644 (file)
@@ -52,9 +52,9 @@ const Vector<PluginInfo>& PluginData::webVisiblePlugins() const
 }
 
 #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 @@ void PluginData::initPlugins()
 {
     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
index 167852d..44500fa 100644 (file)
@@ -73,27 +73,27 @@ struct PluginInfo {
 
     PluginLoadClientPolicy clientLoadPolicy;
 
-#if PLATFORM(MAC)
     String bundleIdentifier;
+#if PLATFORM(MAC)
     String versionString;
 #endif
 };
 
 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 @@ private:
 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,32 +137,32 @@ protected:
     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;
     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
index 072f083..b4ab462 100644 (file)
@@ -39,7 +39,7 @@ public:
     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:
index 0cc0322..3b5789b 100644 (file)
@@ -1,3 +1,36 @@
+2018-06-13  Youenn Fablet  <youenn@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  <cdumez@apple.com>
 
         PSON: http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-collusion.html ASSERTS with process swap enabled
index 16e2867..2881f5f 100644 (file)
@@ -409,7 +409,7 @@ def headers_for_type(type):
         '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>'],
index 94d3591..c926508 100644 (file)
@@ -963,8 +963,8 @@ void ArgumentCoder<PluginInfo>::encode(Encoder& encoder, const PluginInfo& plugi
     encoder << pluginInfo.mimes;
     encoder << pluginInfo.isApplicationPlugin;
     encoder.encodeEnum(pluginInfo.clientLoadPolicy);
-#if PLATFORM(MAC)
     encoder << pluginInfo.bundleIdentifier;
+#if PLATFORM(MAC)
     encoder << pluginInfo.versionString;
 #endif
 }
@@ -984,9 +984,9 @@ std::optional<WebCore::PluginInfo> ArgumentCoder<PluginInfo>::decode(Decoder& de
         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
index d850f3b..6ebb6ca 100644 (file)
@@ -224,22 +224,22 @@ bool PluginInfoStore::isSupportedPlugin(const String& mimeType, const URL& plugi
     }) != 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
index 2da1549..8b2f04e 100644 (file)
@@ -64,8 +64,8 @@ public:
     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 @@ private:
 
     struct SupportedPlugin {
         String matchingDomain;
-        String name;
+        String identifier;
         HashSet<String> mimeTypes;
         HashSet<String> extensions;
     };
index 092748b..5457eb4 100644 (file)
@@ -560,12 +560,12 @@ void WebProcessProxy::updateBackForwardItem(const BackForwardListItemState& item
 }
 
 #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)
index 7d63dc5..c46d291 100644 (file)
@@ -267,7 +267,7 @@ private:
 
     // 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&&);
index 9e539f5..fc808af 100644 (file)
@@ -33,7 +33,7 @@ messages -> WebProcessProxy LegacyReceiver {
 
     # 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
index c1ac4d5..203db1a 100644 (file)
@@ -651,6 +651,7 @@ PluginInfo PDFPlugin::pluginInfo()
     info.name = builtInPDFPluginName();
     info.isApplicationPlugin = true;
     info.clientLoadPolicy = PluginLoadClientPolicyUndefined;
+    info.bundleIdentifier = ASCIILiteral("com.apple.webkit.builtinpdfplugin");
 
     MimeClassInfo pdfMimeClassInfo;
     pdfMimeClassInfo.type = "application/pdf";
index 4bd1db6..50f9eaa 100644 (file)
@@ -97,29 +97,29 @@ void WebPluginInfoProvider::refreshPlugins()
 #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)
 }
 
 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 @@ void WebPluginInfoProvider::populatePluginCache(const WebCore::Page& page)
         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;
 
index 2a1bdd0..1bbad5a 100644 (file)
@@ -45,7 +45,7 @@ public:
 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 @@ private:
     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
 };
 
index 8a12041..7dc50fd 100644 (file)
@@ -1,3 +1,16 @@
+2018-06-13  Youenn Fablet  <youenn@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  <cdumez@apple.com>
 
         PSON: http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-collusion.html ASSERTS with process swap enabled
index 8132472..d1ab551 100644 (file)
@@ -34,7 +34,7 @@ public:
 
 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();
index 2ede19a..e34ec73 100644 (file)
@@ -55,7 +55,7 @@ void WebPluginInfoProvider::refreshPlugins()
     [[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::pluginInfo(WebCore::Page& pag
 
 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);
 }