<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[199691] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/199691">199691</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-04-18 15:28:33 -0700 (Mon, 18 Apr 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Source/WebCore:
Declare a virtual function in PluginStrategy to be implemented by subclasses.
https://bugs.webkit.org/show_bug.cgi?id=156540

Patch by Tina Liu &lt;iting_liu@apple.com&gt; on 2016-04-18
Reviewed by Anders Carlsson.

* plugins/PluginStrategy.h:

Source/WebKit/mac:
Overrode a virtual function of WebCore::PluginStrategy
https://bugs.webkit.org/show_bug.cgi?id=156540

Patch by Tina Liu &lt;iting_liu@apple.com&gt; on 2016-04-18
Reviewed by Anders Carlsson.

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

Source/WebKit2:
Implement functions to set plug-in load policies for private browsing mode
https://bugs.webkit.org/show_bug.cgi?id=156540

Patch by Tina Liu &lt;iting_liu@apple.com&gt; on 2016-04-18
Reviewed by Anders Carlsson.

This patch implements API and wrappers for clients to set policies to use when using
private browsing. WebPlatformStrategies would return which policies to use depending
on whether the page is in private browsing mode.

* Shared/WebProcessCreationParameters.h:
Add a hash map for plug-in load policies for private browsing.
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode):
(WebKit::WebProcessCreationParameters::decode):

* UIProcess/API/C/mac/WKContextPrivateMac.h:
* UIProcess/API/C/mac/WKContextPrivateMac.mm:
(WKContextSetPrivateBrowsingPluginLoadClientPolicy):
Add a wrapper.

* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::createNewWebProcess):
Set the WebProcessCreationParameters's pluginLoadClientPoliciesForPrivateBrowsing.
(WebKit::WebProcessPool::setPluginLoadClientPolicyForBrowsingMode):
A helper function that sets plug-in policies to the corresponding instance variable:
m_pluginLoadClientPolicies for general browsing and m_pluginLoadClientPoliciesForPrivateBrowsing
for private browsing. The logic is extracted from the original setPluginLoadClientPolicy.
While we are here, get rid of the .contains() lookup as .get() will just return a
constructed object if the key is not found.
(WebKit::WebProcessPool::setPluginLoadClientPolicy):
Switch to use the helper function to set policies.
(WebKit::WebProcessPool::setPrivateBrowsingPluginLoadClientPolicy):
Ditto. Also send a message to the WebProcess for setting policies for private browsing.
(WebKit::WebProcessPool::clearPluginClientPolicies):
Clear plug-ins' private browsing policies.

* WebProcess/WebCoreSupport/WebPlatformStrategies.h:
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::setPluginLoadClientPolicyForBrowsingMode):
Ditto as WebProcessPool::setPluginLoadClientPolicyForBrowsingMode.
(WebKit::WebPlatformStrategies::setPluginLoadClientPolicy):
Switch to use setPluginLoadClientPolicyForBrowsingMode to set policies.
(WebKit::WebPlatformStrategies::setPrivateBrowsingPluginLoadClientPolicy):
Use setPluginLoadClientPolicyForBrowsingMode to set policies for private browsing.
(WebKit::WebPlatformStrategies::clearPluginClientPolicies):
Clear plug-ins' private browsing policies.
(WebKit::WebPlatformStrategies::longestMatchedWildcardHostForHost):
Add an argument for private browsing. Read from the corresponding ivar.
(WebKit::WebPlatformStrategies::replaceHostWithMatchedWildcardHost):
Ditto.
(WebKit::WebPlatformStrategies::pluginLoadClientPolicyForHost): Deleted.
Renamed this function as pluginLoadClientPolicyForHostForBrowsingMode.
(WebKit::WebPlatformStrategies::pluginLoadClientPolicyForHostForBrowsingMode):
Ditto.
(WebKit::WebPlatformStrategies::populatePluginCache):
Get the plug-in load policies for a specific host based on the page's session status. If the page
is using ephemeral session, use the private browsing policies.

* WebProcess/WebProcess.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
Switch to call the helper function setPluginLoadClientPolicyFromCreationParameters.
(WebKit::WebProcess::setPluginLoadClientPolicies):
Logic moved from initializeWebProcess. Call PluginStrategy::setPluginLoadClientPolicy or
PluginStrategy::setPrivateBrowsingPluginLoadClientPolicy depending on the input argument.
(WebKit::WebProcess::setPrivateBrowsingPluginLoadClientPolicy):
Add a wrapper to call PluginStrategy::setPrivateBrowsingPluginLoadClientPolicy.

* WebProcess/WebProcess.messages.in:
Declare an entry for setPrivateBrowsingPluginLoadClientPolicy.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorepluginsPluginStrategyh">trunk/Source/WebCore/plugins/PluginStrategy.h</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebCoreSupportWebPlatformStrategiesh">trunk/Source/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h</a></li>
<li><a href="#trunkSourceWebKitmacWebCoreSupportWebPlatformStrategiesmm">trunk/Source/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedWebProcessCreationParameterscpp">trunk/Source/WebKit2/Shared/WebProcessCreationParameters.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharedWebProcessCreationParametersh">trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICmacWKContextPrivateMach">trunk/Source/WebKit2/UIProcess/API/C/mac/WKContextPrivateMac.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICmacWKContextPrivateMacmm">trunk/Source/WebKit2/UIProcess/API/C/mac/WKContextPrivateMac.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebProcessPoolcpp">trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebProcessPoolh">trunk/Source/WebKit2/UIProcess/WebProcessPool.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebPlatformStrategiescpp">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebPlatformStrategiesh">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebProcesscpp">trunk/Source/WebKit2/WebProcess/WebProcess.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebProcessh">trunk/Source/WebKit2/WebProcess/WebProcess.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebProcessmessagesin">trunk/Source/WebKit2/WebProcess/WebProcess.messages.in</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (199690 => 199691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-04-18 22:09:27 UTC (rev 199690)
+++ trunk/Source/WebCore/ChangeLog        2016-04-18 22:28:33 UTC (rev 199691)
</span><span class="lines">@@ -1,3 +1,12 @@
</span><ins>+2016-04-18  Tina Liu  &lt;iting_liu@apple.com&gt;
+
+        Declare a virtual function in PluginStrategy to be implemented by subclasses.
+        https://bugs.webkit.org/show_bug.cgi?id=156540
+
+        Reviewed by Anders Carlsson.
+
+        * plugins/PluginStrategy.h:
+
</ins><span class="cx"> 2016-04-18  Eric Carlson  &lt;eric.carlson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [iOS] don't toggle playback when media engine rate changes
</span></span></pre></div>
<a id="trunkSourceWebCorepluginsPluginStrategyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/plugins/PluginStrategy.h (199690 => 199691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/plugins/PluginStrategy.h        2016-04-18 22:09:27 UTC (rev 199690)
+++ trunk/Source/WebCore/plugins/PluginStrategy.h        2016-04-18 22:28:33 UTC (rev 199691)
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx">     virtual void getWebVisiblePluginInfo(const Page*, Vector&lt;PluginInfo&gt;&amp;) = 0;
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx">     virtual void setPluginLoadClientPolicy(PluginLoadClientPolicy, const String&amp; host, const String&amp; bundleIdentifier, const String&amp; versionString) = 0;
</span><ins>+    virtual void setPrivateBrowsingPluginLoadClientPolicy(PluginLoadClientPolicy, const String&amp; host, const String&amp; bundleIdentifier, const String&amp; versionString) = 0;
</ins><span class="cx">     virtual void clearPluginClientPolicies() = 0;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (199690 => 199691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2016-04-18 22:09:27 UTC (rev 199690)
+++ trunk/Source/WebKit/mac/ChangeLog        2016-04-18 22:28:33 UTC (rev 199691)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-04-18  Tina Liu  &lt;iting_liu@apple.com&gt;
+
+        Overrode a virtual function of WebCore::PluginStrategy
+        https://bugs.webkit.org/show_bug.cgi?id=156540
+
+        Reviewed by Anders Carlsson.
+
+        * WebCoreSupport/WebPlatformStrategies.h:
+        * WebCoreSupport/WebPlatformStrategies.mm:
+        (WebPlatformStrategies::setPrivateBrowsingPluginLoadClientPolicy):
+
</ins><span class="cx"> 2016-04-18  Brent Fulgham  &lt;bfulgham@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         CSP: Remove stubs for dynamically-added favicons (via link rel=&quot;icon&quot;)
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebCoreSupportWebPlatformStrategiesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h (199690 => 199691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h        2016-04-18 22:09:27 UTC (rev 199690)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h        2016-04-18 22:28:33 UTC (rev 199691)
</span><span class="lines">@@ -64,6 +64,7 @@
</span><span class="cx">     void getWebVisiblePluginInfo(const WebCore::Page*, Vector&lt;WebCore::PluginInfo&gt;&amp;) override;
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx">     void setPluginLoadClientPolicy(WebCore::PluginLoadClientPolicy, const String&amp;, const String&amp;, const String&amp;) override;
</span><ins>+    void setPrivateBrowsingPluginLoadClientPolicy(WebCore::PluginLoadClientPolicy, const String&amp;, const String&amp;, const String&amp;) override;
</ins><span class="cx">     void clearPluginClientPolicies() override;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebCoreSupportWebPlatformStrategiesmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm (199690 => 199691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm        2016-04-18 22:09:27 UTC (rev 199690)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm        2016-04-18 22:28:33 UTC (rev 199691)
</span><span class="lines">@@ -150,6 +150,10 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebPlatformStrategies::setPrivateBrowsingPluginLoadClientPolicy(PluginLoadClientPolicy, const String&amp;, const String&amp;, const String&amp;)
+{
+}
+
</ins><span class="cx"> void WebPlatformStrategies::clearPluginClientPolicies()
</span><span class="cx"> {
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (199690 => 199691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-04-18 22:09:27 UTC (rev 199690)
+++ trunk/Source/WebKit2/ChangeLog        2016-04-18 22:28:33 UTC (rev 199691)
</span><span class="lines">@@ -1,3 +1,77 @@
</span><ins>+2016-04-18  Tina Liu  &lt;iting_liu@apple.com&gt;
+
+        Implement functions to set plug-in load policies for private browsing mode
+        https://bugs.webkit.org/show_bug.cgi?id=156540
+
+        Reviewed by Anders Carlsson.
+
+        This patch implements API and wrappers for clients to set policies to use when using
+        private browsing. WebPlatformStrategies would return which policies to use depending
+        on whether the page is in private browsing mode.
+
+        * Shared/WebProcessCreationParameters.h:
+        Add a hash map for plug-in load policies for private browsing.
+        * Shared/WebProcessCreationParameters.cpp:
+        (WebKit::WebProcessCreationParameters::encode):
+        (WebKit::WebProcessCreationParameters::decode):
+
+        * UIProcess/API/C/mac/WKContextPrivateMac.h:
+        * UIProcess/API/C/mac/WKContextPrivateMac.mm:
+        (WKContextSetPrivateBrowsingPluginLoadClientPolicy):
+        Add a wrapper.
+
+        * UIProcess/WebProcessPool.h:
+        * UIProcess/WebProcessPool.cpp:
+        (WebKit::WebProcessPool::createNewWebProcess):
+        Set the WebProcessCreationParameters's pluginLoadClientPoliciesForPrivateBrowsing.
+        (WebKit::WebProcessPool::setPluginLoadClientPolicyForBrowsingMode):
+        A helper function that sets plug-in policies to the corresponding instance variable:
+        m_pluginLoadClientPolicies for general browsing and m_pluginLoadClientPoliciesForPrivateBrowsing
+        for private browsing. The logic is extracted from the original setPluginLoadClientPolicy.
+        While we are here, get rid of the .contains() lookup as .get() will just return a
+        constructed object if the key is not found.
+        (WebKit::WebProcessPool::setPluginLoadClientPolicy):
+        Switch to use the helper function to set policies.
+        (WebKit::WebProcessPool::setPrivateBrowsingPluginLoadClientPolicy):
+        Ditto. Also send a message to the WebProcess for setting policies for private browsing.
+        (WebKit::WebProcessPool::clearPluginClientPolicies):
+        Clear plug-ins' private browsing policies.
+
+        * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
+        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
+        (WebKit::WebPlatformStrategies::setPluginLoadClientPolicyForBrowsingMode):
+        Ditto as WebProcessPool::setPluginLoadClientPolicyForBrowsingMode.
+        (WebKit::WebPlatformStrategies::setPluginLoadClientPolicy):
+        Switch to use setPluginLoadClientPolicyForBrowsingMode to set policies.
+        (WebKit::WebPlatformStrategies::setPrivateBrowsingPluginLoadClientPolicy):
+        Use setPluginLoadClientPolicyForBrowsingMode to set policies for private browsing.
+        (WebKit::WebPlatformStrategies::clearPluginClientPolicies):
+        Clear plug-ins' private browsing policies.
+        (WebKit::WebPlatformStrategies::longestMatchedWildcardHostForHost):
+        Add an argument for private browsing. Read from the corresponding ivar.
+        (WebKit::WebPlatformStrategies::replaceHostWithMatchedWildcardHost):
+        Ditto.
+        (WebKit::WebPlatformStrategies::pluginLoadClientPolicyForHost): Deleted.
+        Renamed this function as pluginLoadClientPolicyForHostForBrowsingMode.
+        (WebKit::WebPlatformStrategies::pluginLoadClientPolicyForHostForBrowsingMode):
+        Ditto.
+        (WebKit::WebPlatformStrategies::populatePluginCache):
+        Get the plug-in load policies for a specific host based on the page's session status. If the page
+        is using ephemeral session, use the private browsing policies.
+
+        * WebProcess/WebProcess.h:
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::initializeWebProcess):
+        Switch to call the helper function setPluginLoadClientPolicyFromCreationParameters.
+        (WebKit::WebProcess::setPluginLoadClientPolicies):
+        Logic moved from initializeWebProcess. Call PluginStrategy::setPluginLoadClientPolicy or
+        PluginStrategy::setPrivateBrowsingPluginLoadClientPolicy depending on the input argument.
+        (WebKit::WebProcess::setPrivateBrowsingPluginLoadClientPolicy):
+        Add a wrapper to call PluginStrategy::setPrivateBrowsingPluginLoadClientPolicy.
+
+        * WebProcess/WebProcess.messages.in:
+        Declare an entry for setPrivateBrowsingPluginLoadClientPolicy.
+
</ins><span class="cx"> 2016-04-18  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [WK2][iOS] Only adjust network responses' MIME type for QuickLook in the context of a main resource load
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebProcessCreationParameterscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebProcessCreationParameters.cpp (199690 => 199691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebProcessCreationParameters.cpp        2016-04-18 22:09:27 UTC (rev 199690)
+++ trunk/Source/WebKit2/Shared/WebProcessCreationParameters.cpp        2016-04-18 22:28:33 UTC (rev 199691)
</span><span class="lines">@@ -138,6 +138,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(NETSCAPE_PLUGIN_API)
</span><span class="cx">     encoder &lt;&lt; pluginLoadClientPolicies;
</span><ins>+    encoder &lt;&lt; pluginLoadClientPoliciesForPrivateBrowsing;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if TARGET_OS_IPHONE || (PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101100)
</span><span class="lines">@@ -293,6 +294,8 @@
</span><span class="cx"> #if ENABLE(NETSCAPE_PLUGIN_API)
</span><span class="cx">     if (!decoder.decode(parameters.pluginLoadClientPolicies))
</span><span class="cx">         return false;
</span><ins>+    if (!decoder.decode(parameters.pluginLoadClientPoliciesForPrivateBrowsing))
+        return false;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if TARGET_OS_IPHONE || (PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101100)
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebProcessCreationParametersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h (199690 => 199691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h        2016-04-18 22:09:27 UTC (rev 199690)
+++ trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h        2016-04-18 22:28:33 UTC (rev 199691)
</span><span class="lines">@@ -163,6 +163,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(NETSCAPE_PLUGIN_API)
</span><span class="cx">     HashMap&lt;String, HashMap&lt;String, HashMap&lt;String, uint8_t&gt;&gt;&gt; pluginLoadClientPolicies;
</span><ins>+    HashMap&lt;String, HashMap&lt;String, HashMap&lt;String, uint8_t&gt;&gt;&gt; pluginLoadClientPoliciesForPrivateBrowsing;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if TARGET_OS_IPHONE || (PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101100)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICmacWKContextPrivateMach"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/mac/WKContextPrivateMac.h (199690 => 199691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/mac/WKContextPrivateMac.h        2016-04-18 22:09:27 UTC (rev 199690)
+++ trunk/Source/WebKit2/UIProcess/API/C/mac/WKContextPrivateMac.h        2016-04-18 22:28:33 UTC (rev 199691)
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx"> WK_EXPORT bool WKContextIsPlugInUpdateAvailable(WKContextRef context, WKStringRef plugInBundleIdentifier);
</span><span class="cx"> 
</span><span class="cx"> WK_EXPORT void WKContextSetPluginLoadClientPolicy(WKContextRef context, WKPluginLoadClientPolicy policy, WKStringRef host, WKStringRef bundleIdentifier, WKStringRef versionString);
</span><ins>+WK_EXPORT void WKContextSetPrivateBrowsingPluginLoadClientPolicy(WKContextRef context, WKPluginLoadClientPolicy policy, WKStringRef host, WKStringRef bundleIdentifier, WKStringRef versionString);
</ins><span class="cx"> WK_EXPORT void WKContextClearPluginClientPolicies(WKContextRef context);
</span><span class="cx"> 
</span><span class="cx"> WK_EXPORT WKDictionaryRef WKContextCopyPlugInInfoForBundleIdentifier(WKContextRef context, WKStringRef plugInBundleIdentifier);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICmacWKContextPrivateMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/mac/WKContextPrivateMac.mm (199690 => 199691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/mac/WKContextPrivateMac.mm        2016-04-18 22:09:27 UTC (rev 199690)
+++ trunk/Source/WebKit2/UIProcess/API/C/mac/WKContextPrivateMac.mm        2016-04-18 22:28:33 UTC (rev 199691)
</span><span class="lines">@@ -59,6 +59,13 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WKContextSetPrivateBrowsingPluginLoadClientPolicy(WKContextRef contextRef, WKPluginLoadClientPolicy policy, WKStringRef host, WKStringRef bundleIdentifier, WKStringRef versionString)
+{
+#if ENABLE(NETSCAPE_PLUGIN_API)
+    toImpl(contextRef)-&gt;setPrivateBrowsingPluginLoadClientPolicy(toPluginLoadClientPolicy(policy), toWTFString(host), toWTFString(bundleIdentifier), toWTFString(versionString));
+#endif
+}
+
</ins><span class="cx"> void WKContextClearPluginClientPolicies(WKContextRef contextRef)
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(NETSCAPE_PLUGIN_API)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebProcessPoolcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp (199690 => 199691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp        2016-04-18 22:09:27 UTC (rev 199690)
+++ trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp        2016-04-18 22:28:33 UTC (rev 199691)
</span><span class="lines">@@ -624,6 +624,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(NETSCAPE_PLUGIN_API)
</span><span class="cx">     parameters.pluginLoadClientPolicies = m_pluginLoadClientPolicies;
</span><ins>+    parameters.pluginLoadClientPoliciesForPrivateBrowsing = m_pluginLoadClientPoliciesForPrivateBrowsing;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if OS(LINUX)
</span><span class="lines">@@ -1321,29 +1322,37 @@
</span><span class="cx">     m_client.plugInInformationBecameAvailable(this, API::Array::create(WTFMove(plugins)).ptr());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebProcessPool::setPluginLoadClientPolicy(WebCore::PluginLoadClientPolicy policy, const String&amp; host, const String&amp; bundleIdentifier, const String&amp; versionString)
</del><ins>+void WebProcessPool::setPluginLoadClientPolicyForPrivateBrowsing(PrivateBrowsing privateBrowsing, WebCore::PluginLoadClientPolicy policy, const String&amp; host, const String&amp; bundleIdentifier, const String&amp; versionString)
</ins><span class="cx"> {
</span><span class="cx"> #if ENABLE(NETSCAPE_PLUGIN_API)
</span><del>-    HashMap&lt;String, HashMap&lt;String, uint8_t&gt;&gt; policiesByIdentifier;
-    if (m_pluginLoadClientPolicies.contains(host))
-        policiesByIdentifier = m_pluginLoadClientPolicies.get(host);
</del><ins>+    auto&amp; pluginLoadClientPolicies = privateBrowsing == PrivateBrowsing::Yes ? m_pluginLoadClientPolicies : m_pluginLoadClientPoliciesForPrivateBrowsing;
</ins><span class="cx"> 
</span><del>-    HashMap&lt;String, uint8_t&gt; versionsToPolicies;
-    if (policiesByIdentifier.contains(bundleIdentifier))
-        versionsToPolicies = policiesByIdentifier.get(bundleIdentifier);
</del><ins>+    HashMap&lt;String, HashMap&lt;String, uint8_t&gt;&gt; policiesByIdentifier = pluginLoadClientPolicies.get(host);
+    HashMap&lt;String, uint8_t&gt; versionsToPolicies = policiesByIdentifier.get(bundleIdentifier);
</ins><span class="cx"> 
</span><span class="cx">     versionsToPolicies.set(versionString, policy);
</span><span class="cx">     policiesByIdentifier.set(bundleIdentifier, versionsToPolicies);
</span><del>-    m_pluginLoadClientPolicies.set(host, policiesByIdentifier);
</del><ins>+    pluginLoadClientPolicies.set(host, policiesByIdentifier);
</ins><span class="cx"> #endif
</span><ins>+}
</ins><span class="cx"> 
</span><ins>+void WebProcessPool::setPluginLoadClientPolicy(WebCore::PluginLoadClientPolicy policy, const String&amp; host, const String&amp; bundleIdentifier, const String&amp; versionString)
+{
+    setPluginLoadClientPolicyForPrivateBrowsing(PrivateBrowsing::No, policy, host, bundleIdentifier, versionString);
</ins><span class="cx">     sendToAllProcesses(Messages::WebProcess::SetPluginLoadClientPolicy(policy, host, bundleIdentifier, versionString));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebProcessPool::setPrivateBrowsingPluginLoadClientPolicy(WebCore::PluginLoadClientPolicy policy, const String&amp; host, const String&amp; bundleIdentifier, const String&amp; versionString)
+{
+    setPluginLoadClientPolicyForPrivateBrowsing(PrivateBrowsing::Yes, policy, host, bundleIdentifier, versionString);
+    sendToAllProcesses(Messages::WebProcess::SetPrivateBrowsingPluginLoadClientPolicy(policy, host, bundleIdentifier, versionString));
+}
+
</ins><span class="cx"> void WebProcessPool::clearPluginClientPolicies()
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(NETSCAPE_PLUGIN_API)
</span><span class="cx">     m_pluginLoadClientPolicies.clear();
</span><ins>+    m_pluginLoadClientPoliciesForPrivateBrowsing.clear();
</ins><span class="cx"> #endif
</span><span class="cx">     sendToAllProcesses(Messages::WebProcess::ClearPluginClientPolicies());
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebProcessPoolh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebProcessPool.h (199690 => 199691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebProcessPool.h        2016-04-18 22:09:27 UTC (rev 199690)
+++ trunk/Source/WebKit2/UIProcess/WebProcessPool.h        2016-04-18 22:28:33 UTC (rev 199691)
</span><span class="lines">@@ -184,6 +184,10 @@
</span><span class="cx">     PluginInfoStore&amp; pluginInfoStore() { return m_pluginInfoStore; }
</span><span class="cx"> 
</span><span class="cx">     void setPluginLoadClientPolicy(WebCore::PluginLoadClientPolicy, const String&amp; host, const String&amp; bundleIdentifier, const String&amp; versionString);
</span><ins>+    enum class PrivateBrowsing { Yes, No };
+    void setPluginLoadClientPolicyForPrivateBrowsing(PrivateBrowsing, WebCore::PluginLoadClientPolicy, const String&amp; host, const String&amp; bundleIdentifier, const String&amp; versionString);
+    void setPrivateBrowsingPluginLoadClientPolicy(WebCore::PluginLoadClientPolicy, const String&amp; host, const String&amp; bundleIdentifier, const String&amp; versionString);
+
</ins><span class="cx">     void clearPluginClientPolicies();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -538,6 +542,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(NETSCAPE_PLUGIN_API)
</span><span class="cx">     HashMap&lt;String, HashMap&lt;String, HashMap&lt;String, uint8_t&gt;&gt;&gt; m_pluginLoadClientPolicies;
</span><ins>+    HashMap&lt;String, HashMap&lt;String, HashMap&lt;String, uint8_t&gt;&gt;&gt; m_pluginLoadClientPoliciesForPrivateBrowsing;
</ins><span class="cx"> #endif
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebPlatformStrategiescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp (199690 => 199691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp        2016-04-18 22:09:27 UTC (rev 199690)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp        2016-04-18 22:28:33 UTC (rev 199691)
</span><span class="lines">@@ -218,28 +218,36 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span><del>-void WebPlatformStrategies::setPluginLoadClientPolicy(PluginLoadClientPolicy clientPolicy, const String&amp; host, const String&amp; bundleIdentifier, const String&amp; versionString)
</del><ins>+void WebPlatformStrategies::setPluginLoadClientPolicyForPrivateBrowsing(PrivateBrowsing privateBrowsing, PluginLoadClientPolicy clientPolicy, const String&amp; host, const String&amp; bundleIdentifier, const String&amp; versionString)
</ins><span class="cx"> {
</span><span class="cx">     String hostToSet = host.isNull() || !host.length() ? &quot;*&quot; : host;
</span><span class="cx">     String bundleIdentifierToSet = bundleIdentifier.isNull() || !bundleIdentifier.length() ? &quot;*&quot; : bundleIdentifier;
</span><span class="cx">     String versionStringToSet = versionString.isNull() || !versionString.length() ? &quot;*&quot; : versionString;
</span><span class="cx"> 
</span><del>-    PluginPolicyMapsByIdentifier policiesByIdentifier;
-    if (m_hostsToPluginIdentifierData.contains(hostToSet))
-        policiesByIdentifier = m_hostsToPluginIdentifierData.get(hostToSet);
</del><ins>+    auto&amp; hostsToPluginIdentifierData = privateBrowsing == PrivateBrowsing::Yes ? m_hostsToPluginIdentifierDataInPrivateBrowsing : m_hostsToPluginIdentifierData;
</ins><span class="cx"> 
</span><del>-    PluginLoadClientPoliciesByBundleVersion versionsToPolicies;
-    if (policiesByIdentifier.contains(bundleIdentifierToSet))
-        versionsToPolicies = policiesByIdentifier.get(bundleIdentifierToSet);
</del><ins>+    PluginPolicyMapsByIdentifier policiesByIdentifier = hostsToPluginIdentifierData.get(hostToSet);
+    PluginLoadClientPoliciesByBundleVersion versionsToPolicies = policiesByIdentifier.get(bundleIdentifierToSet);
</ins><span class="cx"> 
</span><span class="cx">     versionsToPolicies.set(versionStringToSet, clientPolicy);
</span><span class="cx">     policiesByIdentifier.set(bundleIdentifierToSet, versionsToPolicies);
</span><del>-    m_hostsToPluginIdentifierData.set(hostToSet, policiesByIdentifier);
</del><ins>+    hostsToPluginIdentifierData.set(hostToSet, policiesByIdentifier);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebPlatformStrategies::setPluginLoadClientPolicy(PluginLoadClientPolicy clientPolicy, const String&amp; host, const String&amp; bundleIdentifier, const String&amp; versionString)
+{
+    setPluginLoadClientPolicyForPrivateBrowsing(PrivateBrowsing::No, clientPolicy, host, bundleIdentifier, versionString);
+}
+
+void WebPlatformStrategies::setPrivateBrowsingPluginLoadClientPolicy(PluginLoadClientPolicy clientPolicy, const String&amp; host, const String&amp; bundleIdentifier, const String&amp; versionString)
+{
+    setPluginLoadClientPolicyForPrivateBrowsing(PrivateBrowsing::Yes, clientPolicy, host, bundleIdentifier, versionString);
+}
+
</ins><span class="cx"> void WebPlatformStrategies::clearPluginClientPolicies()
</span><span class="cx"> {
</span><span class="cx">     m_hostsToPluginIdentifierData.clear();
</span><ins>+    m_hostsToPluginIdentifierDataInPrivateBrowsing.clear();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif
</span><span class="lines">@@ -247,11 +255,12 @@
</span><span class="cx"> #if ENABLE(NETSCAPE_PLUGIN_API)
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx"> 
</span><del>-String WebPlatformStrategies::longestMatchedWildcardHostForHost(const String&amp; host) const
</del><ins>+String WebPlatformStrategies::longestMatchedWildcardHostForHost(const String&amp; host, PrivateBrowsing privateBrowsing) const
</ins><span class="cx"> {
</span><span class="cx">     String longestMatchedHost;
</span><span class="cx"> 
</span><del>-    for (auto&amp; key : m_hostsToPluginIdentifierData.keys()) {
</del><ins>+    auto&amp; hostsToPluginIdentifierData = privateBrowsing == PrivateBrowsing::Yes ? m_hostsToPluginIdentifierDataInPrivateBrowsing : m_hostsToPluginIdentifierData;
+    for (auto&amp; key : hostsToPluginIdentifierData.keys()) {
</ins><span class="cx">         if (key.contains('*') &amp;&amp; key != &quot;*&quot; &amp;&amp; stringMatchesWildcardString(host, key)) {
</span><span class="cx">             if (key.length() &gt; longestMatchedHost.length())
</span><span class="cx">                 longestMatchedHost = key;
</span><span class="lines">@@ -263,38 +272,40 @@
</span><span class="cx">     return longestMatchedHost;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool WebPlatformStrategies::replaceHostWithMatchedWildcardHost(String&amp; host, const String&amp; identifier) const
</del><ins>+bool WebPlatformStrategies::replaceHostWithMatchedWildcardHost(String&amp; host, const String&amp; identifier, PrivateBrowsing privateBrowsing) const
</ins><span class="cx"> {
</span><del>-    String matchedWildcardHost = longestMatchedWildcardHostForHost(host);
</del><ins>+    String matchedWildcardHost = longestMatchedWildcardHostForHost(host, privateBrowsing);
</ins><span class="cx"> 
</span><span class="cx">     if (matchedWildcardHost.isNull())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    auto plugInIdentifierData = m_hostsToPluginIdentifierData.find(matchedWildcardHost);
-    if (plugInIdentifierData == m_hostsToPluginIdentifierData.end() || !plugInIdentifierData-&gt;value.contains(identifier))
</del><ins>+    auto&amp; hostsToPluginIdentifierData = privateBrowsing == PrivateBrowsing::Yes ? m_hostsToPluginIdentifierDataInPrivateBrowsing : m_hostsToPluginIdentifierData;
+    auto plugInIdentifierData = hostsToPluginIdentifierData.find(matchedWildcardHost);
+    if (plugInIdentifierData == hostsToPluginIdentifierData.end() || !plugInIdentifierData-&gt;value.contains(identifier))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     host = matchedWildcardHost;
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool WebPlatformStrategies::pluginLoadClientPolicyForHost(const String&amp; host, const PluginInfo&amp; info, PluginLoadClientPolicy&amp; policy) const
</del><ins>+bool WebPlatformStrategies::pluginLoadClientPolicyForHostForPrivateBrowsing(PrivateBrowsing privateBrowsing, const String&amp; host, const PluginInfo&amp; info, PluginLoadClientPolicy&amp; policy) const
</ins><span class="cx"> {
</span><span class="cx">     String hostToLookUp = host;
</span><span class="cx">     String identifier = info.bundleIdentifier;
</span><span class="cx"> 
</span><del>-    auto policiesByIdentifierIterator = m_hostsToPluginIdentifierData.find(hostToLookUp);
</del><ins>+    auto&amp; hostsToPluginIdentifierData = privateBrowsing == PrivateBrowsing::Yes ? m_hostsToPluginIdentifierDataInPrivateBrowsing : m_hostsToPluginIdentifierData;
+    auto policiesByIdentifierIterator = hostsToPluginIdentifierData.find(hostToLookUp);
</ins><span class="cx"> 
</span><del>-    if (!identifier.isNull() &amp;&amp; policiesByIdentifierIterator == m_hostsToPluginIdentifierData.end()) {
-        if (!replaceHostWithMatchedWildcardHost(hostToLookUp, identifier))
</del><ins>+    if (!identifier.isNull() &amp;&amp; policiesByIdentifierIterator == hostsToPluginIdentifierData.end()) {
+        if (!replaceHostWithMatchedWildcardHost(hostToLookUp, identifier, privateBrowsing))
</ins><span class="cx">             hostToLookUp = &quot;*&quot;;
</span><del>-        policiesByIdentifierIterator = m_hostsToPluginIdentifierData.find(hostToLookUp);
-        if (hostToLookUp != &quot;*&quot; &amp;&amp; policiesByIdentifierIterator == m_hostsToPluginIdentifierData.end()) {
</del><ins>+        policiesByIdentifierIterator = hostsToPluginIdentifierData.find(hostToLookUp);
+        if (hostToLookUp != &quot;*&quot; &amp;&amp; policiesByIdentifierIterator == hostsToPluginIdentifierData.end()) {
</ins><span class="cx">             hostToLookUp = &quot;*&quot;;
</span><del>-            policiesByIdentifierIterator = m_hostsToPluginIdentifierData.find(hostToLookUp);
</del><ins>+            policiesByIdentifierIterator = hostsToPluginIdentifierData.find(hostToLookUp);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><del>-    if (policiesByIdentifierIterator == m_hostsToPluginIdentifierData.end())
</del><ins>+    if (policiesByIdentifierIterator == hostsToPluginIdentifierData.end())
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     auto&amp; policiesByIdentifier = policiesByIdentifierIterator-&gt;value;
</span><span class="lines">@@ -345,7 +356,7 @@
</span><span class="cx">     String pageHost = page.mainFrame().loader().documentLoader()-&gt;responseURL().host();
</span><span class="cx">     for (PluginInfo&amp; info : m_cachedPlugins) {
</span><span class="cx">         PluginLoadClientPolicy clientPolicy;
</span><del>-        if (pluginLoadClientPolicyForHost(pageHost, info, clientPolicy))
</del><ins>+        if (pluginLoadClientPolicyForHostForPrivateBrowsing(page.usesEphemeralSession() ? PrivateBrowsing::Yes : PrivateBrowsing::No, pageHost, info, clientPolicy))
</ins><span class="cx">             info.clientLoadPolicy = clientPolicy;
</span><span class="cx">     }
</span><span class="cx"> #else
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebPlatformStrategiesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.h (199690 => 199691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.h        2016-04-18 22:09:27 UTC (rev 199690)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.h        2016-04-18 22:28:33 UTC (rev 199691)
</span><span class="lines">@@ -70,6 +70,7 @@
</span><span class="cx">     typedef HashMap&lt;String, PluginLoadClientPoliciesByBundleVersion&gt; PluginPolicyMapsByIdentifier;
</span><span class="cx"> 
</span><span class="cx">     void setPluginLoadClientPolicy(WebCore::PluginLoadClientPolicy, const String&amp; host, const String&amp; bundleIdentifier, const String&amp; versionString) override;
</span><ins>+    void setPrivateBrowsingPluginLoadClientPolicy(WebCore::PluginLoadClientPolicy, const String&amp; host, const String&amp; bundleIdentifier, const String&amp; versionString) override;
</ins><span class="cx">     void clearPluginClientPolicies() override;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -112,9 +113,12 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx">     HashMap&lt;String, PluginPolicyMapsByIdentifier&gt; m_hostsToPluginIdentifierData;
</span><del>-    bool pluginLoadClientPolicyForHost(const String&amp;, const WebCore::PluginInfo&amp;, WebCore::PluginLoadClientPolicy&amp;) const;
-    String longestMatchedWildcardHostForHost(const String&amp; host) const;
-    bool replaceHostWithMatchedWildcardHost(String&amp; host, const String&amp; identifier) const;
</del><ins>+    HashMap&lt;String, PluginPolicyMapsByIdentifier&gt; m_hostsToPluginIdentifierDataInPrivateBrowsing;
+    enum class PrivateBrowsing { Yes, No };
+    String longestMatchedWildcardHostForHost(const String&amp; host, PrivateBrowsing) const;
+    bool pluginLoadClientPolicyForHostForPrivateBrowsing(PrivateBrowsing, const String&amp;, const WebCore::PluginInfo&amp;, WebCore::PluginLoadClientPolicy&amp;) const;
+    bool replaceHostWithMatchedWildcardHost(String&amp; host, const String&amp; identifier, PrivateBrowsing) const;
+    void setPluginLoadClientPolicyForPrivateBrowsing(PrivateBrowsing, WebCore::PluginLoadClientPolicy, const String&amp; host, const String&amp; bundleIdentifier, const String&amp; versionString);
</ins><span class="cx"> #endif // PLATFORM(MAC)
</span><span class="cx"> #endif // ENABLE(NETSCAPE_PLUGIN_API)
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebProcess.cpp (199690 => 199691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2016-04-18 22:09:27 UTC (rev 199690)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2016-04-18 22:28:33 UTC (rev 199691)
</span><span class="lines">@@ -385,14 +385,26 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(NETSCAPE_PLUGIN_API) &amp;&amp; PLATFORM(MAC)
</span><del>-    for (auto hostIter = parameters.pluginLoadClientPolicies.begin(); hostIter != parameters.pluginLoadClientPolicies.end(); ++hostIter) {
</del><ins>+    setPluginLoadClientPolicies(parameters.pluginLoadClientPoliciesForPrivateBrowsing, PrivateBrowsing::Yes);
+    setPluginLoadClientPolicies(parameters.pluginLoadClientPolicies, PrivateBrowsing::No);
+#endif
+}
+
+#if ENABLE(NETSCAPE_PLUGIN_API) &amp;&amp; PLATFORM(MAC)
+void WebProcess::setPluginLoadClientPolicies(const HashMap&lt;String, HashMap&lt;String, HashMap&lt;String, uint8_t&gt;&gt;&gt; &amp;pluginPolicies, PrivateBrowsing privateBrowsing)
+{
+    for (auto hostIter = pluginPolicies.begin(); hostIter != pluginPolicies.end(); ++hostIter) {
</ins><span class="cx">         for (auto bundleIdentifierIter = hostIter-&gt;value.begin(); bundleIdentifierIter != hostIter-&gt;value.end(); ++bundleIdentifierIter) {
</span><del>-            for (auto versionIter = bundleIdentifierIter-&gt;value.begin(); versionIter != bundleIdentifierIter-&gt;value.end(); ++versionIter)
-                platformStrategies()-&gt;pluginStrategy()-&gt;setPluginLoadClientPolicy(static_cast&lt;PluginLoadClientPolicy&gt;(versionIter-&gt;value), hostIter-&gt;key, bundleIdentifierIter-&gt;key, versionIter-&gt;key);
</del><ins>+            for (auto versionIter = bundleIdentifierIter-&gt;value.begin(); versionIter != bundleIdentifierIter-&gt;value.end(); ++versionIter) {
+                if (privateBrowsing == PrivateBrowsing::No)
+                    platformStrategies()-&gt;pluginStrategy()-&gt;setPluginLoadClientPolicy(static_cast&lt;PluginLoadClientPolicy&gt;(versionIter-&gt;value), hostIter-&gt;key, bundleIdentifierIter-&gt;key, versionIter-&gt;key);
+                else
+                    platformStrategies()-&gt;pluginStrategy()-&gt;setPrivateBrowsingPluginLoadClientPolicy(static_cast&lt;PluginLoadClientPolicy&gt;(versionIter-&gt;value), hostIter-&gt;key, bundleIdentifierIter-&gt;key, versionIter-&gt;key);
+            }
</ins><span class="cx">         }
</span><span class="cx">     }
</span><ins>+}
</ins><span class="cx"> #endif
</span><del>-}
</del><span class="cx"> 
</span><span class="cx"> void WebProcess::ensureNetworkProcessConnection()
</span><span class="cx"> {
</span><span class="lines">@@ -873,6 +885,13 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebProcess::setPrivateBrowsingPluginLoadClientPolicy(uint8_t policy, const String&amp; host, const String&amp; bundleIdentifier, const String&amp; versionString)
+{
+#if ENABLE(NETSCAPE_PLUGIN_API) &amp;&amp; PLATFORM(MAC)
+    platformStrategies()-&gt;pluginStrategy()-&gt;setPrivateBrowsingPluginLoadClientPolicy(static_cast&lt;PluginLoadClientPolicy&gt;(policy), host, bundleIdentifier, versionString);
+#endif
+}
+
</ins><span class="cx"> void WebProcess::clearPluginClientPolicies()
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(NETSCAPE_PLUGIN_API) &amp;&amp; PLATFORM(MAC)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebProcessh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebProcess.h (199690 => 199691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebProcess.h        2016-04-18 22:09:27 UTC (rev 199690)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.h        2016-04-18 22:28:33 UTC (rev 199691)
</span><span class="lines">@@ -127,6 +127,7 @@
</span><span class="cx">     void plugInDidStartFromOrigin(const String&amp; pageOrigin, const String&amp; pluginOrigin, const String&amp; mimeType, WebCore::SessionID);
</span><span class="cx">     void plugInDidReceiveUserInteraction(const String&amp; pageOrigin, const String&amp; pluginOrigin, const String&amp; mimeType, WebCore::SessionID);
</span><span class="cx">     void setPluginLoadClientPolicy(uint8_t policy, const String&amp; host, const String&amp; bundleIdentifier, const String&amp; versionString);
</span><ins>+    void setPrivateBrowsingPluginLoadClientPolicy(uint8_t policy, const String&amp; host, const String&amp; bundleIdentifier, const String&amp; versionString);
</ins><span class="cx">     void clearPluginClientPolicies();
</span><span class="cx"> 
</span><span class="cx">     bool fullKeyboardAccessEnabled() const { return m_fullKeyboardAccessEnabled; }
</span><span class="lines">@@ -368,6 +369,10 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(NETSCAPE_PLUGIN_API)
</span><ins>+#if PLATFORM(MAC)
+    enum class PrivateBrowsing { Yes, No };
+    void setPluginLoadClientPolicies(const HashMap&lt;String, HashMap&lt;String, HashMap&lt;String, uint8_t&gt;&gt;&gt;&amp;, PrivateBrowsing);
+#endif
</ins><span class="cx">     RefPtr&lt;PluginProcessConnectionManager&gt; m_pluginProcessConnectionManager;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebProcessmessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebProcess.messages.in (199690 => 199691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebProcess.messages.in        2016-04-18 22:09:27 UTC (rev 199690)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.messages.in        2016-04-18 22:28:33 UTC (rev 199691)
</span><span class="lines">@@ -57,6 +57,7 @@
</span><span class="cx">     ResetPlugInAutoStartOriginDefaultHashes(HashMap&lt;uint32_t,double&gt; hashes)
</span><span class="cx">     ResetPlugInAutoStartOriginHashes(HashMap&lt;WebCore::SessionID, HashMap&lt;uint32_t,double&gt;&gt; hashes)
</span><span class="cx">     SetPluginLoadClientPolicy(uint8_t policy, String host, String bundleIdentifier, String versionString)
</span><ins>+    SetPrivateBrowsingPluginLoadClientPolicy(uint8_t policy, String host, String bundleIdentifier, String versionString)
</ins><span class="cx">     ClearPluginClientPolicies()
</span><span class="cx"> 
</span><span class="cx">     void StartMemorySampler(WebKit::SandboxExtension::Handle sampleLogFileHandle, String sampleLogFilePath, double interval);
</span></span></pre>
</div>
</div>

</body>
</html>