Revert r199691.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 May 2016 07:31:59 +0000 (07:31 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 May 2016 07:31:59 +0000 (07:31 +0000)
https://bugs.webkit.org/show_bug.cgi?id=157645
<rdar://problem/26235373>

Patch by Tina Liu <iting_liu@apple.com> on 2016-05-13
Reviewed by Darin Adler.

Source/WebCore:

* plugins/PluginStrategy.h:

Source/WebKit/mac:

* WebCoreSupport/WebPlatformStrategies.h:
* WebCoreSupport/WebPlatformStrategies.mm:
(WebPlatformStrategies::setPrivateBrowsingPluginLoadClientPolicy): Deleted.

Source/WebKit2:

* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode): Deleted.
(WebKit::WebProcessCreationParameters::decode): Deleted.
* Shared/WebProcessCreationParameters.h:
* UIProcess/API/C/mac/WKContextPrivateMac.h:
* UIProcess/API/C/mac/WKContextPrivateMac.mm:
(WKContextSetPrivateBrowsingPluginLoadClientPolicy): Deleted.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::setPluginLoadClientPolicy):
(WebKit::WebProcessPool::createNewWebProcess): Deleted.
(WebKit::WebProcessPool::setPluginLoadClientPolicyForPrivateBrowsing): Deleted.
(WebKit::WebProcessPool::setPrivateBrowsingPluginLoadClientPolicy): Deleted.
(WebKit::WebProcessPool::clearPluginClientPolicies): Deleted.
* UIProcess/WebProcessPool.h:
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::setPluginLoadClientPolicy):
(WebKit::WebPlatformStrategies::longestMatchedWildcardHostForHost):
(WebKit::WebPlatformStrategies::replaceHostWithMatchedWildcardHost):
(WebKit::WebPlatformStrategies::pluginLoadClientPolicyForHost):
(WebKit::WebPlatformStrategies::populatePluginCache):
(WebKit::WebPlatformStrategies::setPluginLoadClientPolicyForPrivateBrowsing): Deleted.
(WebKit::WebPlatformStrategies::setPrivateBrowsingPluginLoadClientPolicy): Deleted.
(WebKit::WebPlatformStrategies::clearPluginClientPolicies): Deleted.
(WebKit::WebPlatformStrategies::pluginLoadClientPolicyForHostForPrivateBrowsing): Deleted.
* WebProcess/WebCoreSupport/WebPlatformStrategies.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
(WebKit::WebProcess::setPluginLoadClientPolicies): Deleted.
(WebKit::WebProcess::setPrivateBrowsingPluginLoadClientPolicy): Deleted.
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

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

17 files changed:
Source/WebCore/ChangeLog
Source/WebCore/plugins/PluginStrategy.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h
Source/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebProcessCreationParameters.cpp
Source/WebKit2/Shared/WebProcessCreationParameters.h
Source/WebKit2/UIProcess/API/C/mac/WKContextPrivateMac.h
Source/WebKit2/UIProcess/API/C/mac/WKContextPrivateMac.mm
Source/WebKit2/UIProcess/WebProcessPool.cpp
Source/WebKit2/UIProcess/WebProcessPool.h
Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.h
Source/WebKit2/WebProcess/WebProcess.cpp
Source/WebKit2/WebProcess/WebProcess.h
Source/WebKit2/WebProcess/WebProcess.messages.in

index 3e03915..00802e4 100644 (file)
@@ -1,3 +1,13 @@
+2016-05-13  Tina Liu  <iting_liu@apple.com>
+
+        Revert r199691.
+        https://bugs.webkit.org/show_bug.cgi?id=157645
+        <rdar://problem/26235373>
+
+        Reviewed by Darin Adler.
+
+        * plugins/PluginStrategy.h:
+
 2016-05-12  Chris Dumez  <cdumez@apple.com>
 
         Drop WorkerGlobalScope's custom GetOwnPropertySlot() implementation
index bb71d48..3a40ceb 100644 (file)
@@ -39,7 +39,6 @@ public:
     virtual void getWebVisiblePluginInfo(const Page*, Vector<PluginInfo>&) = 0;
 #if PLATFORM(MAC)
     virtual void setPluginLoadClientPolicy(PluginLoadClientPolicy, const String& host, const String& bundleIdentifier, const String& versionString) = 0;
-    virtual void setPrivateBrowsingPluginLoadClientPolicy(PluginLoadClientPolicy, const String& host, const String& bundleIdentifier, const String& versionString) = 0;
     virtual void clearPluginClientPolicies() = 0;
 #endif
 
index ccaaa88..dad0f6c 100644 (file)
@@ -1,3 +1,15 @@
+2016-05-13  Tina Liu  <iting_liu@apple.com>
+
+        Revert r199691.
+        https://bugs.webkit.org/show_bug.cgi?id=157645
+        <rdar://problem/26235373>
+
+        Reviewed by Darin Adler.
+
+        * WebCoreSupport/WebPlatformStrategies.h:
+        * WebCoreSupport/WebPlatformStrategies.mm:
+        (WebPlatformStrategies::setPrivateBrowsingPluginLoadClientPolicy): Deleted.
+
 2016-05-12  Jiewen Tan  <jiewen_tan@apple.com>
 
         Unreviewed build fix for r200799.
index d1e4a8b..307a079 100644 (file)
@@ -64,7 +64,6 @@ private:
     void getWebVisiblePluginInfo(const WebCore::Page*, Vector<WebCore::PluginInfo>&) override;
 #if PLATFORM(MAC)
     void setPluginLoadClientPolicy(WebCore::PluginLoadClientPolicy, const String&, const String&, const String&) override;
-    void setPrivateBrowsingPluginLoadClientPolicy(WebCore::PluginLoadClientPolicy, const String&, const String&, const String&) override;
     void clearPluginClientPolicies() override;
 #endif
 
index c0be1ea..d5b08fd 100644 (file)
@@ -150,10 +150,6 @@ void WebPlatformStrategies::setPluginLoadClientPolicy(PluginLoadClientPolicy, co
 {
 }
 
-void WebPlatformStrategies::setPrivateBrowsingPluginLoadClientPolicy(PluginLoadClientPolicy, const String&, const String&, const String&)
-{
-}
-
 void WebPlatformStrategies::clearPluginClientPolicies()
 {
 }
index 1407585..c462e82 100644 (file)
@@ -1,3 +1,43 @@
+2016-05-13  Tina Liu  <iting_liu@apple.com>
+
+        Revert r199691.
+        https://bugs.webkit.org/show_bug.cgi?id=157645
+        <rdar://problem/26235373>
+
+        Reviewed by Darin Adler.
+
+        * Shared/WebProcessCreationParameters.cpp:
+        (WebKit::WebProcessCreationParameters::encode): Deleted.
+        (WebKit::WebProcessCreationParameters::decode): Deleted.
+        * Shared/WebProcessCreationParameters.h:
+        * UIProcess/API/C/mac/WKContextPrivateMac.h:
+        * UIProcess/API/C/mac/WKContextPrivateMac.mm:
+        (WKContextSetPrivateBrowsingPluginLoadClientPolicy): Deleted.
+        * UIProcess/WebProcessPool.cpp:
+        (WebKit::WebProcessPool::setPluginLoadClientPolicy):
+        (WebKit::WebProcessPool::createNewWebProcess): Deleted.
+        (WebKit::WebProcessPool::setPluginLoadClientPolicyForPrivateBrowsing): Deleted.
+        (WebKit::WebProcessPool::setPrivateBrowsingPluginLoadClientPolicy): Deleted.
+        (WebKit::WebProcessPool::clearPluginClientPolicies): Deleted.
+        * UIProcess/WebProcessPool.h:
+        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
+        (WebKit::WebPlatformStrategies::setPluginLoadClientPolicy):
+        (WebKit::WebPlatformStrategies::longestMatchedWildcardHostForHost):
+        (WebKit::WebPlatformStrategies::replaceHostWithMatchedWildcardHost):
+        (WebKit::WebPlatformStrategies::pluginLoadClientPolicyForHost):
+        (WebKit::WebPlatformStrategies::populatePluginCache):
+        (WebKit::WebPlatformStrategies::setPluginLoadClientPolicyForPrivateBrowsing): Deleted.
+        (WebKit::WebPlatformStrategies::setPrivateBrowsingPluginLoadClientPolicy): Deleted.
+        (WebKit::WebPlatformStrategies::clearPluginClientPolicies): Deleted.
+        (WebKit::WebPlatformStrategies::pluginLoadClientPolicyForHostForPrivateBrowsing): Deleted.
+        * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::initializeWebProcess):
+        (WebKit::WebProcess::setPluginLoadClientPolicies): Deleted.
+        (WebKit::WebProcess::setPrivateBrowsingPluginLoadClientPolicy): Deleted.
+        * WebProcess/WebProcess.h:
+        * WebProcess/WebProcess.messages.in:
+
 2016-05-12  Daniel Bates  <dabates@apple.com>
 
         Use SecTask SPI to retrieve code signing identifier for user directory suffix
index e5ca1fb..a531e45 100644 (file)
@@ -136,7 +136,6 @@ void WebProcessCreationParameters::encode(IPC::ArgumentEncoder& encoder) const
 
 #if ENABLE(NETSCAPE_PLUGIN_API)
     encoder << pluginLoadClientPolicies;
-    encoder << pluginLoadClientPoliciesForPrivateBrowsing;
 #endif
 
 #if TARGET_OS_IPHONE || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
@@ -290,8 +289,6 @@ bool WebProcessCreationParameters::decode(IPC::ArgumentDecoder& decoder, WebProc
 #if ENABLE(NETSCAPE_PLUGIN_API)
     if (!decoder.decode(parameters.pluginLoadClientPolicies))
         return false;
-    if (!decoder.decode(parameters.pluginLoadClientPoliciesForPrivateBrowsing))
-        return false;
 #endif
 
 #if TARGET_OS_IPHONE || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
index a70ce62..add84f3 100644 (file)
@@ -161,7 +161,6 @@ struct WebProcessCreationParameters {
 
 #if ENABLE(NETSCAPE_PLUGIN_API)
     HashMap<String, HashMap<String, HashMap<String, uint8_t>>> pluginLoadClientPolicies;
-    HashMap<String, HashMap<String, HashMap<String, uint8_t>>> pluginLoadClientPoliciesForPrivateBrowsing;
 #endif
 
 #if TARGET_OS_IPHONE || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
index bc93ba1..1611d93 100644 (file)
@@ -39,7 +39,6 @@ WK_EXPORT void WKContextSetProcessSuppressionEnabled(WKContextRef context, bool
 WK_EXPORT bool WKContextIsPlugInUpdateAvailable(WKContextRef context, WKStringRef plugInBundleIdentifier);
 
 WK_EXPORT void WKContextSetPluginLoadClientPolicy(WKContextRef context, WKPluginLoadClientPolicy policy, WKStringRef host, WKStringRef bundleIdentifier, WKStringRef versionString);
-WK_EXPORT void WKContextSetPrivateBrowsingPluginLoadClientPolicy(WKContextRef context, WKPluginLoadClientPolicy policy, WKStringRef host, WKStringRef bundleIdentifier, WKStringRef versionString);
 WK_EXPORT void WKContextClearPluginClientPolicies(WKContextRef context);
 
 WK_EXPORT WKDictionaryRef WKContextCopyPlugInInfoForBundleIdentifier(WKContextRef context, WKStringRef plugInBundleIdentifier);
index 9e9243e..4c192b6 100644 (file)
@@ -59,13 +59,6 @@ void WKContextSetPluginLoadClientPolicy(WKContextRef contextRef, WKPluginLoadCli
 #endif
 }
 
-void WKContextSetPrivateBrowsingPluginLoadClientPolicy(WKContextRef contextRef, WKPluginLoadClientPolicy policy, WKStringRef host, WKStringRef bundleIdentifier, WKStringRef versionString)
-{
-#if ENABLE(NETSCAPE_PLUGIN_API)
-    toImpl(contextRef)->setPrivateBrowsingPluginLoadClientPolicy(toPluginLoadClientPolicy(policy), toWTFString(host), toWTFString(bundleIdentifier), toWTFString(versionString));
-#endif
-}
-
 void WKContextClearPluginClientPolicies(WKContextRef contextRef)
 {
 #if ENABLE(NETSCAPE_PLUGIN_API)
index bdae5f2..3965428 100644 (file)
@@ -619,7 +619,6 @@ WebProcessProxy& WebProcessPool::createNewWebProcess()
 
 #if ENABLE(NETSCAPE_PLUGIN_API)
     parameters.pluginLoadClientPolicies = m_pluginLoadClientPolicies;
-    parameters.pluginLoadClientPoliciesForPrivateBrowsing = m_pluginLoadClientPoliciesForPrivateBrowsing;
 #endif
 
 #if OS(LINUX)
@@ -1303,37 +1302,29 @@ void WebProcessPool::pluginInfoStoreDidLoadPlugins(PluginInfoStore* store)
     m_client.plugInInformationBecameAvailable(this, API::Array::create(WTFMove(plugins)).ptr());
 }
 
-void WebProcessPool::setPluginLoadClientPolicyForPrivateBrowsing(PrivateBrowsing privateBrowsing, WebCore::PluginLoadClientPolicy policy, const String& host, const String& bundleIdentifier, const String& versionString)
+void WebProcessPool::setPluginLoadClientPolicy(WebCore::PluginLoadClientPolicy policy, const String& host, const String& bundleIdentifier, const String& versionString)
 {
 #if ENABLE(NETSCAPE_PLUGIN_API)
-    auto& pluginLoadClientPolicies = privateBrowsing == PrivateBrowsing::Yes ? m_pluginLoadClientPolicies : m_pluginLoadClientPoliciesForPrivateBrowsing;
+    HashMap<String, HashMap<String, uint8_t>> policiesByIdentifier;
+    if (m_pluginLoadClientPolicies.contains(host))
+        policiesByIdentifier = m_pluginLoadClientPolicies.get(host);
 
-    HashMap<String, HashMap<String, uint8_t>> policiesByIdentifier = pluginLoadClientPolicies.get(host);
-    HashMap<String, uint8_t> versionsToPolicies = policiesByIdentifier.get(bundleIdentifier);
+    HashMap<String, uint8_t> versionsToPolicies;
+    if (policiesByIdentifier.contains(bundleIdentifier))
+        versionsToPolicies = policiesByIdentifier.get(bundleIdentifier);
 
     versionsToPolicies.set(versionString, policy);
     policiesByIdentifier.set(bundleIdentifier, versionsToPolicies);
-    pluginLoadClientPolicies.set(host, policiesByIdentifier);
+    m_pluginLoadClientPolicies.set(host, policiesByIdentifier);
 #endif
-}
 
-void WebProcessPool::setPluginLoadClientPolicy(WebCore::PluginLoadClientPolicy policy, const String& host, const String& bundleIdentifier, const String& versionString)
-{
-    setPluginLoadClientPolicyForPrivateBrowsing(PrivateBrowsing::No, policy, host, bundleIdentifier, versionString);
     sendToAllProcesses(Messages::WebProcess::SetPluginLoadClientPolicy(policy, host, bundleIdentifier, versionString));
 }
 
-void WebProcessPool::setPrivateBrowsingPluginLoadClientPolicy(WebCore::PluginLoadClientPolicy policy, const String& host, const String& bundleIdentifier, const String& versionString)
-{
-    setPluginLoadClientPolicyForPrivateBrowsing(PrivateBrowsing::Yes, policy, host, bundleIdentifier, versionString);
-    sendToAllProcesses(Messages::WebProcess::SetPrivateBrowsingPluginLoadClientPolicy(policy, host, bundleIdentifier, versionString));
-}
-
 void WebProcessPool::clearPluginClientPolicies()
 {
 #if ENABLE(NETSCAPE_PLUGIN_API)
     m_pluginLoadClientPolicies.clear();
-    m_pluginLoadClientPoliciesForPrivateBrowsing.clear();
 #endif
     sendToAllProcesses(Messages::WebProcess::ClearPluginClientPolicies());
 }
index 9fd1433..d57b09e 100644 (file)
@@ -184,10 +184,6 @@ public:
     PluginInfoStore& pluginInfoStore() { return m_pluginInfoStore; }
 
     void setPluginLoadClientPolicy(WebCore::PluginLoadClientPolicy, const String& host, const String& bundleIdentifier, const String& versionString);
-    enum class PrivateBrowsing { Yes, No };
-    void setPluginLoadClientPolicyForPrivateBrowsing(PrivateBrowsing, WebCore::PluginLoadClientPolicy, const String& host, const String& bundleIdentifier, const String& versionString);
-    void setPrivateBrowsingPluginLoadClientPolicy(WebCore::PluginLoadClientPolicy, const String& host, const String& bundleIdentifier, const String& versionString);
-
     void clearPluginClientPolicies();
 #endif
 
@@ -542,7 +538,6 @@ private:
 
 #if ENABLE(NETSCAPE_PLUGIN_API)
     HashMap<String, HashMap<String, HashMap<String, uint8_t>>> m_pluginLoadClientPolicies;
-    HashMap<String, HashMap<String, HashMap<String, uint8_t>>> m_pluginLoadClientPoliciesForPrivateBrowsing;
 #endif
 };
 
index 734b3b2..023c3d1 100644 (file)
@@ -218,36 +218,28 @@ void WebPlatformStrategies::getWebVisiblePluginInfo(const Page* page, Vector<Plu
 }
 
 #if PLATFORM(MAC)
-void WebPlatformStrategies::setPluginLoadClientPolicyForPrivateBrowsing(PrivateBrowsing privateBrowsing, PluginLoadClientPolicy clientPolicy, const String& host, const String& bundleIdentifier, const String& versionString)
+void WebPlatformStrategies::setPluginLoadClientPolicy(PluginLoadClientPolicy clientPolicy, const String& host, const String& bundleIdentifier, const String& versionString)
 {
     String hostToSet = host.isNull() || !host.length() ? "*" : host;
     String bundleIdentifierToSet = bundleIdentifier.isNull() || !bundleIdentifier.length() ? "*" : bundleIdentifier;
     String versionStringToSet = versionString.isNull() || !versionString.length() ? "*" : versionString;
 
-    auto& hostsToPluginIdentifierData = privateBrowsing == PrivateBrowsing::Yes ? m_hostsToPluginIdentifierDataInPrivateBrowsing : m_hostsToPluginIdentifierData;
+    PluginPolicyMapsByIdentifier policiesByIdentifier;
+    if (m_hostsToPluginIdentifierData.contains(hostToSet))
+        policiesByIdentifier = m_hostsToPluginIdentifierData.get(hostToSet);
 
-    PluginPolicyMapsByIdentifier policiesByIdentifier = hostsToPluginIdentifierData.get(hostToSet);
-    PluginLoadClientPoliciesByBundleVersion versionsToPolicies = policiesByIdentifier.get(bundleIdentifierToSet);
+    PluginLoadClientPoliciesByBundleVersion versionsToPolicies;
+    if (policiesByIdentifier.contains(bundleIdentifierToSet))
+        versionsToPolicies = policiesByIdentifier.get(bundleIdentifierToSet);
 
     versionsToPolicies.set(versionStringToSet, clientPolicy);
     policiesByIdentifier.set(bundleIdentifierToSet, versionsToPolicies);
-    hostsToPluginIdentifierData.set(hostToSet, policiesByIdentifier);
-}
-
-void WebPlatformStrategies::setPluginLoadClientPolicy(PluginLoadClientPolicy clientPolicy, const String& host, const String& bundleIdentifier, const String& versionString)
-{
-    setPluginLoadClientPolicyForPrivateBrowsing(PrivateBrowsing::No, clientPolicy, host, bundleIdentifier, versionString);
-}
-
-void WebPlatformStrategies::setPrivateBrowsingPluginLoadClientPolicy(PluginLoadClientPolicy clientPolicy, const String& host, const String& bundleIdentifier, const String& versionString)
-{
-    setPluginLoadClientPolicyForPrivateBrowsing(PrivateBrowsing::Yes, clientPolicy, host, bundleIdentifier, versionString);
+    m_hostsToPluginIdentifierData.set(hostToSet, policiesByIdentifier);
 }
 
 void WebPlatformStrategies::clearPluginClientPolicies()
 {
     m_hostsToPluginIdentifierData.clear();
-    m_hostsToPluginIdentifierDataInPrivateBrowsing.clear();
 }
 
 #endif
@@ -255,12 +247,11 @@ void WebPlatformStrategies::clearPluginClientPolicies()
 #if ENABLE(NETSCAPE_PLUGIN_API)
 #if PLATFORM(MAC)
 
-String WebPlatformStrategies::longestMatchedWildcardHostForHost(const String& host, PrivateBrowsing privateBrowsing) const
+String WebPlatformStrategies::longestMatchedWildcardHostForHost(const String& host) const
 {
     String longestMatchedHost;
 
-    auto& hostsToPluginIdentifierData = privateBrowsing == PrivateBrowsing::Yes ? m_hostsToPluginIdentifierDataInPrivateBrowsing : m_hostsToPluginIdentifierData;
-    for (auto& key : hostsToPluginIdentifierData.keys()) {
+    for (auto& key : m_hostsToPluginIdentifierData.keys()) {
         if (key.contains('*') && key != "*" && stringMatchesWildcardString(host, key)) {
             if (key.length() > longestMatchedHost.length())
                 longestMatchedHost = key;
@@ -272,40 +263,38 @@ String WebPlatformStrategies::longestMatchedWildcardHostForHost(const String& ho
     return longestMatchedHost;
 }
 
-bool WebPlatformStrategies::replaceHostWithMatchedWildcardHost(String& host, const String& identifier, PrivateBrowsing privateBrowsing) const
+bool WebPlatformStrategies::replaceHostWithMatchedWildcardHost(String& host, const String& identifier) const
 {
-    String matchedWildcardHost = longestMatchedWildcardHostForHost(host, privateBrowsing);
+    String matchedWildcardHost = longestMatchedWildcardHostForHost(host);
 
     if (matchedWildcardHost.isNull())
         return false;
 
-    auto& hostsToPluginIdentifierData = privateBrowsing == PrivateBrowsing::Yes ? m_hostsToPluginIdentifierDataInPrivateBrowsing : m_hostsToPluginIdentifierData;
-    auto plugInIdentifierData = hostsToPluginIdentifierData.find(matchedWildcardHost);
-    if (plugInIdentifierData == hostsToPluginIdentifierData.end() || !plugInIdentifierData->value.contains(identifier))
+    auto plugInIdentifierData = m_hostsToPluginIdentifierData.find(matchedWildcardHost);
+    if (plugInIdentifierData == m_hostsToPluginIdentifierData.end() || !plugInIdentifierData->value.contains(identifier))
         return false;
 
     host = matchedWildcardHost;
     return true;
 }
 
-bool WebPlatformStrategies::pluginLoadClientPolicyForHostForPrivateBrowsing(PrivateBrowsing privateBrowsing, const String& host, const PluginInfo& info, PluginLoadClientPolicy& policy) const
+bool WebPlatformStrategies::pluginLoadClientPolicyForHost(const String& host, const PluginInfo& info, PluginLoadClientPolicy& policy) const
 {
     String hostToLookUp = host;
     String identifier = info.bundleIdentifier;
 
-    auto& hostsToPluginIdentifierData = privateBrowsing == PrivateBrowsing::Yes ? m_hostsToPluginIdentifierDataInPrivateBrowsing : m_hostsToPluginIdentifierData;
-    auto policiesByIdentifierIterator = hostsToPluginIdentifierData.find(hostToLookUp);
+    auto policiesByIdentifierIterator = m_hostsToPluginIdentifierData.find(hostToLookUp);
 
-    if (!identifier.isNull() && policiesByIdentifierIterator == hostsToPluginIdentifierData.end()) {
-        if (!replaceHostWithMatchedWildcardHost(hostToLookUp, identifier, privateBrowsing))
+    if (!identifier.isNull() && policiesByIdentifierIterator == m_hostsToPluginIdentifierData.end()) {
+        if (!replaceHostWithMatchedWildcardHost(hostToLookUp, identifier))
             hostToLookUp = "*";
-        policiesByIdentifierIterator = hostsToPluginIdentifierData.find(hostToLookUp);
-        if (hostToLookUp != "*" && policiesByIdentifierIterator == hostsToPluginIdentifierData.end()) {
+        policiesByIdentifierIterator = m_hostsToPluginIdentifierData.find(hostToLookUp);
+        if (hostToLookUp != "*" && policiesByIdentifierIterator == m_hostsToPluginIdentifierData.end()) {
             hostToLookUp = "*";
-            policiesByIdentifierIterator = hostsToPluginIdentifierData.find(hostToLookUp);
+            policiesByIdentifierIterator = m_hostsToPluginIdentifierData.find(hostToLookUp);
         }
     }
-    if (policiesByIdentifierIterator == hostsToPluginIdentifierData.end())
+    if (policiesByIdentifierIterator == m_hostsToPluginIdentifierData.end())
         return false;
 
     auto& policiesByIdentifier = policiesByIdentifierIterator->value;
@@ -356,7 +345,7 @@ void WebPlatformStrategies::populatePluginCache(const WebCore::Page& page)
     String pageHost = page.mainFrame().loader().documentLoader()->responseURL().host();
     for (PluginInfo& info : m_cachedPlugins) {
         PluginLoadClientPolicy clientPolicy;
-        if (pluginLoadClientPolicyForHostForPrivateBrowsing(page.usesEphemeralSession() ? PrivateBrowsing::Yes : PrivateBrowsing::No, pageHost, info, clientPolicy))
+        if (pluginLoadClientPolicyForHost(pageHost, info, clientPolicy))
             info.clientLoadPolicy = clientPolicy;
     }
 #else
index 055314e..7b81c63 100644 (file)
@@ -70,7 +70,6 @@ private:
     typedef HashMap<String, PluginLoadClientPoliciesByBundleVersion> PluginPolicyMapsByIdentifier;
 
     void setPluginLoadClientPolicy(WebCore::PluginLoadClientPolicy, const String& host, const String& bundleIdentifier, const String& versionString) override;
-    void setPrivateBrowsingPluginLoadClientPolicy(WebCore::PluginLoadClientPolicy, const String& host, const String& bundleIdentifier, const String& versionString) override;
     void clearPluginClientPolicies() override;
 #endif
 
@@ -113,12 +112,9 @@ private:
 
 #if PLATFORM(MAC)
     HashMap<String, PluginPolicyMapsByIdentifier> m_hostsToPluginIdentifierData;
-    HashMap<String, PluginPolicyMapsByIdentifier> m_hostsToPluginIdentifierDataInPrivateBrowsing;
-    enum class PrivateBrowsing { Yes, No };
-    String longestMatchedWildcardHostForHost(const String& host, PrivateBrowsing) const;
-    bool pluginLoadClientPolicyForHostForPrivateBrowsing(PrivateBrowsing, const String&, const WebCore::PluginInfo&, WebCore::PluginLoadClientPolicy&) const;
-    bool replaceHostWithMatchedWildcardHost(String& host, const String& identifier, PrivateBrowsing) const;
-    void setPluginLoadClientPolicyForPrivateBrowsing(PrivateBrowsing, WebCore::PluginLoadClientPolicy, const String& host, const String& bundleIdentifier, const String& versionString);
+    bool pluginLoadClientPolicyForHost(const String&, const WebCore::PluginInfo&, WebCore::PluginLoadClientPolicy&) const;
+    String longestMatchedWildcardHostForHost(const String& host) const;
+    bool replaceHostWithMatchedWildcardHost(String& host, const String& identifier) const;
 #endif // PLATFORM(MAC)
 #endif // ENABLE(NETSCAPE_PLUGIN_API)
 };
index 2303213..f92a2cb 100644 (file)
@@ -390,26 +390,14 @@ void WebProcess::initializeWebProcess(WebProcessCreationParameters&& parameters)
 #endif
 
 #if ENABLE(NETSCAPE_PLUGIN_API) && PLATFORM(MAC)
-    setPluginLoadClientPolicies(parameters.pluginLoadClientPoliciesForPrivateBrowsing, PrivateBrowsing::Yes);
-    setPluginLoadClientPolicies(parameters.pluginLoadClientPolicies, PrivateBrowsing::No);
-#endif
-}
-
-#if ENABLE(NETSCAPE_PLUGIN_API) && PLATFORM(MAC)
-void WebProcess::setPluginLoadClientPolicies(const HashMap<String, HashMap<String, HashMap<String, uint8_t>>> &pluginPolicies, PrivateBrowsing privateBrowsing)
-{
-    for (auto hostIter = pluginPolicies.begin(); hostIter != pluginPolicies.end(); ++hostIter) {
+    for (auto hostIter = parameters.pluginLoadClientPolicies.begin(); hostIter != parameters.pluginLoadClientPolicies.end(); ++hostIter) {
         for (auto bundleIdentifierIter = hostIter->value.begin(); bundleIdentifierIter != hostIter->value.end(); ++bundleIdentifierIter) {
-            for (auto versionIter = bundleIdentifierIter->value.begin(); versionIter != bundleIdentifierIter->value.end(); ++versionIter) {
-                if (privateBrowsing == PrivateBrowsing::No)
-                    platformStrategies()->pluginStrategy()->setPluginLoadClientPolicy(static_cast<PluginLoadClientPolicy>(versionIter->value), hostIter->key, bundleIdentifierIter->key, versionIter->key);
-                else
-                    platformStrategies()->pluginStrategy()->setPrivateBrowsingPluginLoadClientPolicy(static_cast<PluginLoadClientPolicy>(versionIter->value), hostIter->key, bundleIdentifierIter->key, versionIter->key);
-            }
+            for (auto versionIter = bundleIdentifierIter->value.begin(); versionIter != bundleIdentifierIter->value.end(); ++versionIter)
+                platformStrategies()->pluginStrategy()->setPluginLoadClientPolicy(static_cast<PluginLoadClientPolicy>(versionIter->value), hostIter->key, bundleIdentifierIter->key, versionIter->key);
         }
     }
-}
 #endif
+}
 
 void WebProcess::ensureNetworkProcessConnection()
 {
@@ -884,13 +872,6 @@ void WebProcess::setPluginLoadClientPolicy(uint8_t policy, const String& host, c
 #endif
 }
 
-void WebProcess::setPrivateBrowsingPluginLoadClientPolicy(uint8_t policy, const String& host, const String& bundleIdentifier, const String& versionString)
-{
-#if ENABLE(NETSCAPE_PLUGIN_API) && PLATFORM(MAC)
-    platformStrategies()->pluginStrategy()->setPrivateBrowsingPluginLoadClientPolicy(static_cast<PluginLoadClientPolicy>(policy), host, bundleIdentifier, versionString);
-#endif
-}
-
 void WebProcess::clearPluginClientPolicies()
 {
 #if ENABLE(NETSCAPE_PLUGIN_API) && PLATFORM(MAC)
index 4c7600c..350bdf7 100644 (file)
@@ -128,7 +128,6 @@ public:
     void plugInDidStartFromOrigin(const String& pageOrigin, const String& pluginOrigin, const String& mimeType, WebCore::SessionID);
     void plugInDidReceiveUserInteraction(const String& pageOrigin, const String& pluginOrigin, const String& mimeType, WebCore::SessionID);
     void setPluginLoadClientPolicy(uint8_t policy, const String& host, const String& bundleIdentifier, const String& versionString);
-    void setPrivateBrowsingPluginLoadClientPolicy(uint8_t policy, const String& host, const String& bundleIdentifier, const String& versionString);
     void clearPluginClientPolicies();
 
     bool fullKeyboardAccessEnabled() const { return m_fullKeyboardAccessEnabled; }
@@ -371,10 +370,6 @@ private:
 #endif
 
 #if ENABLE(NETSCAPE_PLUGIN_API)
-#if PLATFORM(MAC)
-    enum class PrivateBrowsing { Yes, No };
-    void setPluginLoadClientPolicies(const HashMap<String, HashMap<String, HashMap<String, uint8_t>>>&, PrivateBrowsing);
-#endif
     RefPtr<PluginProcessConnectionManager> m_pluginProcessConnectionManager;
 #endif
 
index 10a454c..39aedd5 100644 (file)
@@ -57,7 +57,6 @@ messages -> WebProcess LegacyReceiver {
     ResetPlugInAutoStartOriginDefaultHashes(HashMap<uint32_t,double> hashes)
     ResetPlugInAutoStartOriginHashes(HashMap<WebCore::SessionID, HashMap<uint32_t,double>> hashes)
     SetPluginLoadClientPolicy(uint8_t policy, String host, String bundleIdentifier, String versionString)
-    SetPrivateBrowsingPluginLoadClientPolicy(uint8_t policy, String host, String bundleIdentifier, String versionString)
     ClearPluginClientPolicies()
 
     void StartMemorySampler(WebKit::SandboxExtension::Handle sampleLogFileHandle, String sampleLogFilePath, double interval);