<!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>[150227] 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/150227">150227</a></dd>
<dt>Author</dt> <dd>timothy_horton@apple.com</dd>
<dt>Date</dt> <dd>2013-05-16 17:42:03 -0700 (Thu, 16 May 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>PDFPlugins don't load when plugins are disabled, but they should
https://bugs.webkit.org/show_bug.cgi?id=75790
&lt;rdar://problem/11650197&gt;

Reviewed by Anders Carlsson.

Make it possible to load &quot;application&quot; plug-ins even if settings or the FrameLoaderClient
say that plug-ins should be disabled, providing a mechanism for WebKit* to offer built-in
functionality which happens to use the plug-in infrastructure, and which also doesn't
unexpectedly disappear for users with plug-ins off.

* WebCore.exp.in:
Export SubframeLoader::allowPlugins().
Update signature for PluginData::supportsMimeType to include the AllowedPluginTypes argument.

* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocument):
Load PluginData even if plug-ins are disabled, but if that is the case, only
create a PluginDocument for application plug-ins.

* html/PluginDocument.cpp:
(WebCore::PluginDocumentParser::appendBytes):
Don't bail if plug-ins are disabled, because we could still be a PluginDocument
for an application plug-in.

* page/Page.cpp:
(WebCore::Page::pluginData):
Allow PluginData to be constructed even if plug-ins are disabled, as there might
be application plug-ins that we want to load anyway.

* platform/mac/MIMETypeRegistryMac.mm:
(WebCore::MIMETypeRegistry::isApplicationPluginMIMEType):
On Mac, if we have PDFPlugin, we can support PDF and PostScript with a native application plug-in.

* plugins/PluginData.cpp:
(WebCore::PluginData::supportsMimeType):
Add an AllowedPluginTypes argument to supportsMimeType, allowing callers to specify
whether they are looking for any plug-in, or are looking only for application plug-ins.

* plugins/PluginData.h:
(PluginInfo): Added an isApplicationPlugin field, to specify whether this is a &quot;built-in&quot; plug-in.
(PluginData): Add the aforementioned AllowedPluginTypes enum and the argument to supportsMimeType.

Support loading &quot;application&quot; plug-ins even if plug-ins are explicitly disabled.

Make PDFPlugin and SimplePDFPlugin &quot;application&quot; plug-ins, so they can
be loaded even if plug-ins are disabled.

* Platform/CoreIPC/HandleMessage.h:
(CoreIPC::callMemberFunction):
Add a 5-argument, 3-reply version of callMemberFunction.

* Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
(WebKit::NetscapePluginModule::getPluginInfo):
NPAPI plug-ins are not application plug-ins.

* Shared/WebCoreArgumentCoders.cpp:
(CoreIPC::::encode):
(CoreIPC::::decode):
Encode/decode the new isApplicationPlugin field on PluginInfo.

* UIProcess/Plugins/PluginInfoStore.cpp:
(WebKit::PluginInfoStore::findPluginForMIMEType):
(WebKit::PluginInfoStore::findPluginForExtension):
(WebKit::PluginInfoStore::findPlugin):
* UIProcess/Plugins/PluginInfoStore.h:
(PluginInfoStore):
Give PluginInfoStore's findPlugin method and its private helper
methods an argument allowing them to only match application plug-ins.

(WebKit::WebPageProxy::findPlugin):
* UIProcess/WebPageProxy.h:
(WebPageProxy):
* UIProcess/WebPageProxy.messages.in:
Add an argument allowing findPlugin to restrict its search to only application plug-ins.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::objectContentType):
Previously, this caller depended on pluginData() returning null if
plug-ins were disabled. Since that is no longer the case, we have to
check if we can use plug-ins, and otherwise ignore non-application-plug-ins.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::createPlugin):
When going to search for a plug-in, ask subframeLoader whether or not
it's OK to use ordinary non-application plug-ins, and pass that information
on to the UIProcess when performing the search.

(WebKit::WebPage::canPluginHandleResponse): Ditto.
(WebKit::WebPage::canShowMIMEType):
Ensure that canShowMIMEType returns true if we have an application plug-in
that can display a particular MIME type, even if we're not allowed to load plug-ins.

* Plugins/WebBasePluginPackage.mm:
(-[WebBasePluginPackage getPluginInfoFromPLists]):
* Plugins/WebNetscapePluginPackage.mm:
(-[WebNetscapePluginPackage getPluginInfoFromResources]):
Nothing loaded via WebBasePluginPackage or WebNetscapePluginPackage
is an application plugin.

* WebView/WebFrame.mm:
(-[WebFrame _canProvideDocumentSource]):
Previously, this caller depended on pluginData() returning null if
plug-ins were disabled. Since that is no longer the case, we have to
check if we can use plug-ins, and otherwise ignore non-application-plug-ins.

* WebCoreSupport/FrameLoaderClientQt.cpp:
(WebCore::FrameLoaderClientQt::objectContentType):
Previously, this caller depended on pluginData() returning null if
plug-ins were disabled. Since that is no longer the case, we have to
check if we can use plug-ins, and otherwise ignore non-application-plug-ins.

* WebView.cpp:
(WebView::canShowMIMEType):
Previously, this caller depended on pluginData() returning null if
plug-ins were disabled. Since that is no longer the case, we have to
check if we can use plug-ins, and otherwise ignore non-application-plug-ins.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebCoredomDOMImplementationcpp">trunk/Source/WebCore/dom/DOMImplementation.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlPluginDocumentcpp">trunk/Source/WebCore/html/PluginDocument.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderSubframeLoadercpp">trunk/Source/WebCore/loader/SubframeLoader.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePagecpp">trunk/Source/WebCore/page/Page.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmacMIMETypeRegistryMacmm">trunk/Source/WebCore/platform/mac/MIMETypeRegistryMac.mm</a></li>
<li><a href="#trunkSourceWebCorepluginsPluginDatacpp">trunk/Source/WebCore/plugins/PluginData.cpp</a></li>
<li><a href="#trunkSourceWebCorepluginsPluginDatah">trunk/Source/WebCore/plugins/PluginData.h</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacPluginsWebBasePluginPackagemm">trunk/Source/WebKit/mac/Plugins/WebBasePluginPackage.mm</a></li>
<li><a href="#trunkSourceWebKitmacPluginsWebNetscapePluginPackagemm">trunk/Source/WebKit/mac/Plugins/WebNetscapePluginPackage.mm</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebFramemm">trunk/Source/WebKit/mac/WebView/WebFrame.mm</a></li>
<li><a href="#trunkSourceWebKitqtChangeLog">trunk/Source/WebKit/qt/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitqtWebCoreSupportFrameLoaderClientQtcpp">trunk/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp</a></li>
<li><a href="#trunkSourceWebKitwinChangeLog">trunk/Source/WebKit/win/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitwinWebViewcpp">trunk/Source/WebKit/win/WebView.cpp</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2PlatformCoreIPCHandleMessageh">trunk/Source/WebKit2/Platform/CoreIPC/HandleMessage.h</a></li>
<li><a href="#trunkSourceWebKit2SharedPluginsNetscapemacNetscapePluginModuleMacmm">trunk/Source/WebKit2/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm</a></li>
<li><a href="#trunkSourceWebKit2SharedWebCoreArgumentCoderscpp">trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessPluginsPluginInfoStorecpp">trunk/Source/WebKit2/UIProcess/Plugins/PluginInfoStore.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessPluginsPluginInfoStoreh">trunk/Source/WebKit2/UIProcess/Plugins/PluginInfoStore.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxycpp">trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxyh">trunk/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxymessagesin">trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in</a></li>
<li><a href="#trunkSourceWebKit2WebProcessPluginsPDFSimplePDFPluginmm">trunk/Source/WebKit2/WebProcess/Plugins/PDF/SimplePDFPlugin.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebFrameLoaderClientcpp">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (150226 => 150227)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2013-05-17 00:36:49 UTC (rev 150226)
+++ trunk/Source/WebCore/ChangeLog        2013-05-17 00:42:03 UTC (rev 150227)
</span><span class="lines">@@ -1,3 +1,48 @@
</span><ins>+2013-05-16  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+        PDFPlugins don't load when plugins are disabled, but they should
+        https://bugs.webkit.org/show_bug.cgi?id=75790
+        &lt;rdar://problem/11650197&gt;
+
+        Reviewed by Anders Carlsson.
+
+        Make it possible to load &quot;application&quot; plug-ins even if settings or the FrameLoaderClient
+        say that plug-ins should be disabled, providing a mechanism for WebKit* to offer built-in
+        functionality which happens to use the plug-in infrastructure, and which also doesn't
+        unexpectedly disappear for users with plug-ins off.
+
+        * WebCore.exp.in:
+        Export SubframeLoader::allowPlugins().
+        Update signature for PluginData::supportsMimeType to include the AllowedPluginTypes argument.
+
+        * dom/DOMImplementation.cpp:
+        (WebCore::DOMImplementation::createDocument):
+        Load PluginData even if plug-ins are disabled, but if that is the case, only
+        create a PluginDocument for application plug-ins.
+
+        * html/PluginDocument.cpp:
+        (WebCore::PluginDocumentParser::appendBytes):
+        Don't bail if plug-ins are disabled, because we could still be a PluginDocument
+        for an application plug-in.
+
+        * page/Page.cpp:
+        (WebCore::Page::pluginData):
+        Allow PluginData to be constructed even if plug-ins are disabled, as there might
+        be application plug-ins that we want to load anyway.
+
+        * platform/mac/MIMETypeRegistryMac.mm:
+        (WebCore::MIMETypeRegistry::isApplicationPluginMIMEType):
+        On Mac, if we have PDFPlugin, we can support PDF and PostScript with a native application plug-in.
+
+        * plugins/PluginData.cpp:
+        (WebCore::PluginData::supportsMimeType):
+        Add an AllowedPluginTypes argument to supportsMimeType, allowing callers to specify
+        whether they are looking for any plug-in, or are looking only for application plug-ins.
+
+        * plugins/PluginData.h:
+        (PluginInfo): Added an isApplicationPlugin field, to specify whether this is a &quot;built-in&quot; plug-in.
+        (PluginData): Add the aforementioned AllowedPluginTypes enum and the argument to supportsMimeType.
+
</ins><span class="cx"> 2013-05-16  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [BlackBerry] Crash due to an assert running test editing/execCommand/indent-paragraphs.html
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (150226 => 150227)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2013-05-17 00:36:49 UTC (rev 150226)
+++ trunk/Source/WebCore/WebCore.exp.in        2013-05-17 00:42:03 UTC (rev 150227)
</span><span class="lines">@@ -400,6 +400,7 @@
</span><span class="cx"> __ZN7WebCore14StorageTracker32syncFileSystemAndTrackerDatabaseEv
</span><span class="cx"> __ZN7WebCore14StorageTracker7originsERN3WTF6VectorINS1_6RefPtrINS_14SecurityOriginEEELm0ENS1_15CrashOnOverflowEEE
</span><span class="cx"> __ZN7WebCore14StorageTracker7trackerEv
</span><ins>+__ZN7WebCore14SubframeLoader12allowPluginsENS_28ReasonForCallingAllowPluginsE
</ins><span class="cx"> __ZN7WebCore14cookiesEnabledERKNS_21NetworkStorageSessionERKNS_4KURLES5_
</span><span class="cx"> __ZN7WebCore14decodeHostNameEP8NSString
</span><span class="cx"> __ZN7WebCore14encodeHostNameEP8NSString
</span><span class="lines">@@ -1271,7 +1272,7 @@
</span><span class="cx"> __ZNK7WebCore10Credential4userEv
</span><span class="cx"> __ZNK7WebCore10Credential7isEmptyEv
</span><span class="cx"> __ZNK7WebCore10Credential8passwordEv
</span><del>-__ZNK7WebCore10PluginData16supportsMimeTypeERKN3WTF6StringE
</del><ins>+__ZNK7WebCore10PluginData16supportsMimeTypeERKN3WTF6StringENS0_18AllowedPluginTypesE
</ins><span class="cx"> __ZNK7WebCore10RenderText16linesBoundingBoxEv
</span><span class="cx"> __ZNK7WebCore10RenderText9firstRunXEv
</span><span class="cx"> __ZNK7WebCore10RenderText9firstRunYEv
</span></span></pre></div>
<a id="trunkSourceWebCoredomDOMImplementationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/DOMImplementation.cpp (150226 => 150227)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/DOMImplementation.cpp        2013-05-17 00:36:49 UTC (rev 150226)
+++ trunk/Source/WebCore/dom/DOMImplementation.cpp        2013-05-17 00:42:03 UTC (rev 150227)
</span><span class="lines">@@ -397,12 +397,17 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     PluginData* pluginData = 0;
</span><del>-    if (frame &amp;&amp; frame-&gt;page() &amp;&amp; frame-&gt;loader()-&gt;subframeLoader()-&gt;allowPlugins(NotAboutToInstantiatePlugin))
</del><ins>+    PluginData::AllowedPluginTypes allowedPluginTypes = PluginData::OnlyApplicationPlugins;
+    if (frame &amp;&amp; frame-&gt;page()) {
+        if (frame-&gt;loader()-&gt;subframeLoader()-&gt;allowPlugins(NotAboutToInstantiatePlugin))
+            allowedPluginTypes = PluginData::AllPlugins;
+
</ins><span class="cx">         pluginData = frame-&gt;page()-&gt;pluginData();
</span><ins>+    }
</ins><span class="cx"> 
</span><span class="cx">     // PDF is one image type for which a plugin can override built-in support.
</span><span class="cx">     // We do not want QuickTime to take over all image types, obviously.
</span><del>-    if ((MIMETypeRegistry::isPDFOrPostScriptMIMEType(type)) &amp;&amp; pluginData &amp;&amp; pluginData-&gt;supportsMimeType(type))
</del><ins>+    if ((MIMETypeRegistry::isPDFOrPostScriptMIMEType(type)) &amp;&amp; pluginData &amp;&amp; pluginData-&gt;supportsMimeType(type, allowedPluginTypes))
</ins><span class="cx">         return PluginDocument::create(frame, url);
</span><span class="cx">     if (Image::supportsType(type))
</span><span class="cx">         return ImageDocument::create(frame, url);
</span><span class="lines">@@ -418,7 +423,7 @@
</span><span class="cx">     // Everything else except text/plain can be overridden by plugins. In particular, Adobe SVG Viewer should be used for SVG, if installed.
</span><span class="cx">     // Disallowing plug-ins to use text/plain prevents plug-ins from hijacking a fundamental type that the browser is expected to handle,
</span><span class="cx">     // and also serves as an optimization to prevent loading the plug-in database in the common case.
</span><del>-    if (type != &quot;text/plain&quot; &amp;&amp; ((pluginData &amp;&amp; pluginData-&gt;supportsMimeType(type)) || (frame &amp;&amp; frame-&gt;loader()-&gt;client()-&gt;shouldAlwaysUsePluginDocument(type))))
</del><ins>+    if (type != &quot;text/plain&quot; &amp;&amp; ((pluginData &amp;&amp; pluginData-&gt;supportsMimeType(type, allowedPluginTypes)) || (frame &amp;&amp; frame-&gt;loader()-&gt;client()-&gt;shouldAlwaysUsePluginDocument(type))))
</ins><span class="cx">         return PluginDocument::create(frame, url);
</span><span class="cx">     if (isTextMIMEType(type))
</span><span class="cx">         return TextDocument::create(frame, url);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlPluginDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/PluginDocument.cpp (150226 => 150227)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/PluginDocument.cpp        2013-05-17 00:36:49 UTC (rev 150226)
+++ trunk/Source/WebCore/html/PluginDocument.cpp        2013-05-17 00:42:03 UTC (rev 150227)
</span><span class="lines">@@ -112,7 +112,7 @@
</span><span class="cx">     if (!frame)
</span><span class="cx">         return;
</span><span class="cx">     Settings* settings = frame-&gt;settings();
</span><del>-    if (!settings || !frame-&gt;loader()-&gt;subframeLoader()-&gt;allowPlugins(NotAboutToInstantiatePlugin))
</del><ins>+    if (!settings)
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     document()-&gt;updateLayout();
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderSubframeLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/SubframeLoader.cpp (150226 => 150227)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/SubframeLoader.cpp        2013-05-17 00:36:49 UTC (rev 150226)
+++ trunk/Source/WebCore/loader/SubframeLoader.cpp        2013-05-17 00:42:03 UTC (rev 150227)
</span><span class="lines">@@ -147,7 +147,6 @@
</span><span class="cx"> 
</span><span class="cx"> bool SubframeLoader::requestPlugin(HTMLPlugInImageElement* ownerElement, const KURL&amp; url, const String&amp; mimeType, const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues, bool useFallback)
</span><span class="cx"> {
</span><del>-
</del><span class="cx">     // Application plug-ins are plug-ins implemented by the user agent, for example Qt plug-ins,
</span><span class="cx">     // as opposed to third-party code such as Flash. The user agent decides whether or not they are
</span><span class="cx">     // permitted, rather than WebKit.
</span></span></pre></div>
<a id="trunkSourceWebCorepagePagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Page.cpp (150226 => 150227)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Page.cpp        2013-05-17 00:36:49 UTC (rev 150226)
+++ trunk/Source/WebCore/page/Page.cpp        2013-05-17 00:42:03 UTC (rev 150227)
</span><span class="lines">@@ -513,8 +513,6 @@
</span><span class="cx"> 
</span><span class="cx"> PluginData* Page::pluginData() const
</span><span class="cx"> {
</span><del>-    if (!mainFrame()-&gt;loader()-&gt;subframeLoader()-&gt;allowPlugins(NotAboutToInstantiatePlugin))
-        return 0;
</del><span class="cx">     if (!m_pluginData)
</span><span class="cx">         m_pluginData = PluginData::create(this);
</span><span class="cx">     return m_pluginData.get();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacMIMETypeRegistryMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/MIMETypeRegistryMac.mm (150226 => 150227)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/MIMETypeRegistryMac.mm        2013-05-17 00:36:49 UTC (rev 150226)
+++ trunk/Source/WebCore/platform/mac/MIMETypeRegistryMac.mm        2013-05-17 00:42:03 UTC (rev 150227)
</span><span class="lines">@@ -59,8 +59,17 @@
</span><span class="cx">     return wkGetPreferredExtensionForMIMEType(type);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool MIMETypeRegistry::isApplicationPluginMIMEType(const String&amp;)
</del><ins>+bool MIMETypeRegistry::isApplicationPluginMIMEType(const String&amp; MIMEType)
</ins><span class="cx"> {
</span><ins>+#if ENABLE(PDFKIT_PLUGIN)
+    // FIXME: This should test if we're actually going to use PDFPlugin,
+    // but we only know that in WebKit2 at the moment. This is not a problem
+    // in practice because if we don't have PDFPlugin and we go to instantiate the
+    // plugin, there won't exist an application plugin supporting these MIME types.
+    if (isPDFOrPostScriptMIMEType(MIMEType))
+        return true;
+#endif
+
</ins><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepluginsPluginDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/plugins/PluginData.cpp (150226 => 150227)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/plugins/PluginData.cpp        2013-05-17 00:36:49 UTC (rev 150226)
+++ trunk/Source/WebCore/plugins/PluginData.cpp        2013-05-17 00:42:03 UTC (rev 150227)
</span><span class="lines">@@ -42,11 +42,12 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool PluginData::supportsMimeType(const String&amp; mimeType) const
</del><ins>+bool PluginData::supportsMimeType(const String&amp; mimeType, const AllowedPluginTypes allowedPluginTypes) const
</ins><span class="cx"> {
</span><del>-    for (unsigned i = 0; i &lt; m_mimes.size(); ++i)
-        if (m_mimes[i].type == mimeType)
</del><ins>+    for (unsigned i = 0; i &lt; m_mimes.size(); ++i) {
+        if (m_mimes[i].type == mimeType &amp;&amp; (allowedPluginTypes == AllPlugins || m_plugins[m_mimePluginIndices[i]].isApplicationPlugin))
</ins><span class="cx">             return true;
</span><ins>+    }
</ins><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepluginsPluginDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/plugins/PluginData.h (150226 => 150227)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/plugins/PluginData.h        2013-05-17 00:36:49 UTC (rev 150226)
+++ trunk/Source/WebCore/plugins/PluginData.h        2013-05-17 00:42:03 UTC (rev 150227)
</span><span class="lines">@@ -45,6 +45,7 @@
</span><span class="cx">     String file;
</span><span class="cx">     String desc;
</span><span class="cx">     Vector&lt;MimeClassInfo&gt; mimes;
</span><ins>+    bool isApplicationPlugin;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> // FIXME: merge with PluginDatabase in the future
</span><span class="lines">@@ -55,8 +56,13 @@
</span><span class="cx">     const Vector&lt;PluginInfo&gt;&amp; plugins() const { return m_plugins; }
</span><span class="cx">     const Vector&lt;MimeClassInfo&gt;&amp; mimes() const { return m_mimes; }
</span><span class="cx">     const Vector&lt;size_t&gt;&amp; mimePluginIndices() const { return m_mimePluginIndices; }
</span><del>-    
-    bool supportsMimeType(const String&amp; mimeType) const;
</del><ins>+
+    enum AllowedPluginTypes {
+        AllPlugins,
+        OnlyApplicationPlugins
+    };
+
+    bool supportsMimeType(const String&amp; mimeType, const AllowedPluginTypes) const;
</ins><span class="cx">     String pluginNameForMimeType(const String&amp; mimeType) const;
</span><span class="cx">     String pluginFileForMimeType(const String&amp; mimeType) const;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (150226 => 150227)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2013-05-17 00:36:49 UTC (rev 150226)
+++ trunk/Source/WebKit/mac/ChangeLog        2013-05-17 00:42:03 UTC (rev 150227)
</span><span class="lines">@@ -1,3 +1,24 @@
</span><ins>+2013-05-16  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+        PDFPlugins don't load when plugins are disabled, but they should
+        https://bugs.webkit.org/show_bug.cgi?id=75790
+        &lt;rdar://problem/11650197&gt;
+
+        Reviewed by Anders Carlsson.
+
+        * Plugins/WebBasePluginPackage.mm:
+        (-[WebBasePluginPackage getPluginInfoFromPLists]):
+        * Plugins/WebNetscapePluginPackage.mm:
+        (-[WebNetscapePluginPackage getPluginInfoFromResources]):
+        Nothing loaded via WebBasePluginPackage or WebNetscapePluginPackage
+        is an application plugin.
+
+        * WebView/WebFrame.mm:
+        (-[WebFrame _canProvideDocumentSource]):
+        Previously, this caller depended on pluginData() returning null if
+        plug-ins were disabled. Since that is no longer the case, we have to
+        check if we can use plug-ins, and otherwise ignore non-application-plug-ins.
+
</ins><span class="cx"> 2013-05-16  Andreas Kling  &lt;akling@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Page::chrome() should return a reference.
</span></span></pre></div>
<a id="trunkSourceWebKitmacPluginsWebBasePluginPackagemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/Plugins/WebBasePluginPackage.mm (150226 => 150227)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/Plugins/WebBasePluginPackage.mm        2013-05-17 00:36:49 UTC (rev 150226)
+++ trunk/Source/WebKit/mac/Plugins/WebBasePluginPackage.mm        2013-05-17 00:42:03 UTC (rev 150227)
</span><span class="lines">@@ -263,6 +263,8 @@
</span><span class="cx">         description = filename;
</span><span class="cx">     pluginInfo.desc = description;
</span><span class="cx"> 
</span><ins>+    pluginInfo.isApplicationPlugin = false;
+
</ins><span class="cx">     return YES;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitmacPluginsWebNetscapePluginPackagemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/Plugins/WebNetscapePluginPackage.mm (150226 => 150227)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/Plugins/WebNetscapePluginPackage.mm        2013-05-17 00:36:49 UTC (rev 150226)
+++ trunk/Source/WebKit/mac/Plugins/WebNetscapePluginPackage.mm        2013-05-17 00:42:03 UTC (rev 150227)
</span><span class="lines">@@ -144,6 +144,8 @@
</span><span class="cx">     if (!theName)
</span><span class="cx">         theName = filename;
</span><span class="cx">     pluginInfo.name = theName;
</span><ins>+
+    pluginInfo.isApplicationPlugin = false;
</ins><span class="cx">     
</span><span class="cx">     [self closeResourceFile:resRef];
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebFramemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebFrame.mm (150226 => 150227)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebFrame.mm        2013-05-17 00:36:49 UTC (rev 150226)
+++ trunk/Source/WebKit/mac/WebView/WebFrame.mm        2013-05-17 00:42:03 UTC (rev 150227)
</span><span class="lines">@@ -799,9 +799,10 @@
</span><span class="cx">     String mimeType = frame-&gt;document()-&gt;loader()-&gt;writer()-&gt;mimeType();
</span><span class="cx">     PluginData* pluginData = frame-&gt;page() ? frame-&gt;page()-&gt;pluginData() : 0;
</span><span class="cx"> 
</span><del>-    if (WebCore::DOMImplementation::isTextMIMEType(mimeType) ||
-        Image::supportsType(mimeType) ||
-        (pluginData &amp;&amp; pluginData-&gt;supportsMimeType(mimeType)))
</del><ins>+    if (WebCore::DOMImplementation::isTextMIMEType(mimeType)
+        || Image::supportsType(mimeType)
+        || (pluginData &amp;&amp; pluginData-&gt;supportsMimeType(mimeType, PluginData::AllPlugins) &amp;&amp; frame-&gt;loader()-&gt;subframeLoader()-&gt;allowPlugins(NotAboutToInstantiatePlugin))
+        || (pluginData &amp;&amp; pluginData-&gt;supportsMimeType(mimeType, PluginData::OnlyApplicationPlugins)))
</ins><span class="cx">         return NO;
</span><span class="cx"> 
</span><span class="cx">     return YES;
</span></span></pre></div>
<a id="trunkSourceWebKitqtChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/qt/ChangeLog (150226 => 150227)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/qt/ChangeLog        2013-05-17 00:36:49 UTC (rev 150226)
+++ trunk/Source/WebKit/qt/ChangeLog        2013-05-17 00:42:03 UTC (rev 150227)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2013-05-16  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+        PDFPlugins don't load when plugins are disabled, but they should
+        https://bugs.webkit.org/show_bug.cgi?id=75790
+        &lt;rdar://problem/11650197&gt;
+
+        Reviewed by Anders Carlsson.
+
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (WebCore::FrameLoaderClientQt::objectContentType):
+        Previously, this caller depended on pluginData() returning null if
+        plug-ins were disabled. Since that is no longer the case, we have to
+        check if we can use plug-ins, and otherwise ignore non-application-plug-ins.
+
</ins><span class="cx"> 2013-05-16  Andreas Kling  &lt;akling@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Page::chrome() should return a reference.
</span></span></pre></div>
<a id="trunkSourceWebKitqtWebCoreSupportFrameLoaderClientQtcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp (150226 => 150227)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp        2013-05-17 00:36:49 UTC (rev 150226)
+++ trunk/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp        2013-05-17 00:42:03 UTC (rev 150227)
</span><span class="lines">@@ -1359,9 +1359,13 @@
</span><span class="cx">     ObjectContentType plugInType = ObjectContentNone;
</span><span class="cx">     if (arePluginsEnabled &amp;&amp; PluginDatabase::installedPlugins()-&gt;isMIMETypeRegistered(mimeType))
</span><span class="cx">         plugInType = ObjectContentNetscapePlugin;
</span><del>-    else if (m_frame-&gt;page() &amp;&amp; m_frame-&gt;page()-&gt;pluginData() &amp;&amp; m_frame-&gt;page()-&gt;pluginData()-&gt;supportsMimeType(mimeType))
-        plugInType = ObjectContentOtherPlugin;
-        
</del><ins>+    else if (m_frame-&gt;page() &amp;&amp; m_frame-&gt;page()-&gt;pluginData()) {
+        bool allowPlugins = m_frame-&gt;loader()-&gt;subframeLoader()-&gt;allowPlugins(NotAboutToInstantiatePlugin);
+        if ((m_frame-&gt;page()-&gt;pluginData()-&gt;supportsMimeType(mimeType, PluginData::AllPlugins) &amp;&amp; allowPlugins)
+            || m_frame-&gt;page()-&gt;pluginData()-&gt;supportsMimeType(mimeType, PluginData::OnlyApplicationPlugins))
+                plugInType = ObjectContentOtherPlugin;
+    }
+
</ins><span class="cx">     if (MIMETypeRegistry::isSupportedImageMIMEType(mimeType))
</span><span class="cx">         return shouldPreferPlugInsForImages &amp;&amp; plugInType != ObjectContentNone ? plugInType : ObjectContentImage;
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/ChangeLog (150226 => 150227)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/ChangeLog        2013-05-17 00:36:49 UTC (rev 150226)
+++ trunk/Source/WebKit/win/ChangeLog        2013-05-17 00:42:03 UTC (rev 150227)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2013-05-16  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+        PDFPlugins don't load when plugins are disabled, but they should
+        https://bugs.webkit.org/show_bug.cgi?id=75790
+        &lt;rdar://problem/11650197&gt;
+
+        Reviewed by Anders Carlsson.
+
+        * WebView.cpp:
+        (WebView::canShowMIMEType):
+        Previously, this caller depended on pluginData() returning null if
+        plug-ins were disabled. Since that is no longer the case, we have to
+        check if we can use plug-ins, and otherwise ignore non-application-plug-ins.
+
</ins><span class="cx"> 2013-05-16  Andreas Kling  &lt;akling@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Page::chrome() should return a reference.
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebView.cpp (150226 => 150227)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebView.cpp        2013-05-17 00:36:49 UTC (rev 150226)
+++ trunk/Source/WebKit/win/WebView.cpp        2013-05-17 00:42:03 UTC (rev 150227)
</span><span class="lines">@@ -2526,11 +2526,20 @@
</span><span class="cx">     if (!canShow)
</span><span class="cx">         return E_POINTER;
</span><span class="cx"> 
</span><del>-    *canShow = MIMETypeRegistry::isSupportedImageMIMEType(mimeTypeStr) ||
-        MIMETypeRegistry::isSupportedNonImageMIMEType(mimeTypeStr) ||
-        (m_page &amp;&amp; m_page-&gt;pluginData() &amp;&amp; m_page-&gt;pluginData()-&gt;supportsMimeType(mimeTypeStr)) ||
-        shouldUseEmbeddedView(mimeTypeStr);
-    
</del><ins>+    Frame* coreFrame = core(m_mainFrame);
+    bool allowPlugins = coreFrame &amp;&amp; coreFrame-&gt;loader()-&gt;subframeLoader()-&gt;allowPlugins(NotAboutToInstantiatePlugin);
+
+    *canShow = MIMETypeRegistry::isSupportedImageMIMEType(mimeTypeStr)
+        || MIMETypeRegistry::isSupportedNonImageMIMEType(mimeTypeStr);
+
+    if (!*canShow &amp;&amp; m_page &amp;&amp; m_page-&gt;pluginData()) {
+        *canShow = (m_page-&gt;pluginData()-&gt;supportsMimeType(mimeTypeStr, PluginData::AllPlugins) &amp;&amp; allowPlugins)
+            || m_page-&gt;pluginData()-&gt;supportsMimeType(mimeTypeStr, PluginData::OnlyApplicationPlugins);
+    }
+
+    if (!*canShow)
+        *canShow = shouldUseEmbeddedView(mimeTypeStr);
+
</ins><span class="cx">     return S_OK;
</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 (150226 => 150227)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2013-05-17 00:36:49 UTC (rev 150226)
+++ trunk/Source/WebKit2/ChangeLog        2013-05-17 00:42:03 UTC (rev 150227)
</span><span class="lines">@@ -1,3 +1,61 @@
</span><ins>+2013-05-16  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+        PDFPlugins don't load when plugins are disabled, but they should
+        https://bugs.webkit.org/show_bug.cgi?id=75790
+        &lt;rdar://problem/11650197&gt;
+
+        Reviewed by Anders Carlsson.
+
+        Support loading &quot;application&quot; plug-ins even if plug-ins are explicitly disabled.
+
+        Make PDFPlugin and SimplePDFPlugin &quot;application&quot; plug-ins, so they can
+        be loaded even if plug-ins are disabled.
+
+        * Platform/CoreIPC/HandleMessage.h:
+        (CoreIPC::callMemberFunction):
+        Add a 5-argument, 3-reply version of callMemberFunction.
+
+        * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
+        (WebKit::NetscapePluginModule::getPluginInfo):
+        NPAPI plug-ins are not application plug-ins.
+
+        * Shared/WebCoreArgumentCoders.cpp:
+        (CoreIPC::::encode):
+        (CoreIPC::::decode):
+        Encode/decode the new isApplicationPlugin field on PluginInfo.
+
+        * UIProcess/Plugins/PluginInfoStore.cpp:
+        (WebKit::PluginInfoStore::findPluginForMIMEType):
+        (WebKit::PluginInfoStore::findPluginForExtension):
+        (WebKit::PluginInfoStore::findPlugin):
+        * UIProcess/Plugins/PluginInfoStore.h:
+        (PluginInfoStore):
+        Give PluginInfoStore's findPlugin method and its private helper
+        methods an argument allowing them to only match application plug-ins.
+
+        (WebKit::WebPageProxy::findPlugin):
+        * UIProcess/WebPageProxy.h:
+        (WebPageProxy):
+        * UIProcess/WebPageProxy.messages.in:
+        Add an argument allowing findPlugin to restrict its search to only application plug-ins.
+
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebKit::WebFrameLoaderClient::objectContentType):
+        Previously, this caller depended on pluginData() returning null if
+        plug-ins were disabled. Since that is no longer the case, we have to
+        check if we can use plug-ins, and otherwise ignore non-application-plug-ins.
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::createPlugin):
+        When going to search for a plug-in, ask subframeLoader whether or not
+        it's OK to use ordinary non-application plug-ins, and pass that information
+        on to the UIProcess when performing the search.
+
+        (WebKit::WebPage::canPluginHandleResponse): Ditto.
+        (WebKit::WebPage::canShowMIMEType):
+        Ensure that canShowMIMEType returns true if we have an application plug-in
+        that can display a particular MIME type, even if we're not allowed to load plug-ins.
+
</ins><span class="cx"> 2013-05-16  Michał Pakuła vel Rutka  &lt;m.pakula@samsung.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [EFL][WK2] Make Ewk_Context_Menu Ewk_Object
</span></span></pre></div>
<a id="trunkSourceWebKit2PlatformCoreIPCHandleMessageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Platform/CoreIPC/HandleMessage.h (150226 => 150227)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Platform/CoreIPC/HandleMessage.h        2013-05-17 00:36:49 UTC (rev 150226)
+++ trunk/Source/WebKit2/Platform/CoreIPC/HandleMessage.h        2013-05-17 00:42:03 UTC (rev 150227)
</span><span class="lines">@@ -197,6 +197,12 @@
</span><span class="cx">     (object-&gt;*function)(args.argument1, args.argument2, args.argument3, args.argument4, replyArgs.argument1, replyArgs.argument2, replyArgs.argument3);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+template&lt;typename C, typename MF, typename P1, typename P2, typename P3, typename P4, typename P5, typename R1, typename R2, typename R3&gt;
+void callMemberFunction(const Arguments5&lt;P1, P2, P3, P4, P5&gt;&amp; args, Arguments3&lt;R1, R2, R3&gt;&amp; replyArgs, C* object, MF function)
+{
+    (object-&gt;*function)(args.argument1, args.argument2, args.argument3, args.argument4, args.argument5, replyArgs.argument1, replyArgs.argument2, replyArgs.argument3);
+}
+
</ins><span class="cx"> // Dispatch functions with delayed reply arguments.
</span><span class="cx"> template&lt;typename C, typename MF, typename R&gt;
</span><span class="cx"> void callMemberFunction(const Arguments0&amp;, PassRefPtr&lt;R&gt; delayedReply, C* object, MF function)
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedPluginsNetscapemacNetscapePluginModuleMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm (150226 => 150227)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm        2013-05-17 00:36:49 UTC (rev 150226)
+++ trunk/Source/WebKit2/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm        2013-05-17 00:42:03 UTC (rev 150227)
</span><span class="lines">@@ -395,6 +395,8 @@
</span><span class="cx">         plugin.info.name = plugin.info.file;
</span><span class="cx">     if (plugin.info.desc.isNull())
</span><span class="cx">         plugin.info.desc = plugin.info.file;
</span><ins>+
+    plugin.info.isApplicationPlugin = false;
</ins><span class="cx">     
</span><span class="cx">     return true;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebCoreArgumentCoderscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp (150226 => 150227)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp        2013-05-17 00:36:49 UTC (rev 150226)
+++ trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp        2013-05-17 00:42:03 UTC (rev 150227)
</span><span class="lines">@@ -166,7 +166,7 @@
</span><span class="cx"> 
</span><span class="cx"> void ArgumentCoder&lt;PluginInfo&gt;::encode(ArgumentEncoder&amp; encoder, const PluginInfo&amp; pluginInfo)
</span><span class="cx"> {
</span><del>-    encoder &lt;&lt; pluginInfo.name &lt;&lt; pluginInfo.file &lt;&lt; pluginInfo.desc &lt;&lt; pluginInfo.mimes;
</del><ins>+    encoder &lt;&lt; pluginInfo.name &lt;&lt; pluginInfo.file &lt;&lt; pluginInfo.desc &lt;&lt; pluginInfo.mimes &lt;&lt; pluginInfo.isApplicationPlugin;
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> bool ArgumentCoder&lt;PluginInfo&gt;::decode(ArgumentDecoder&amp; decoder, PluginInfo&amp; pluginInfo)
</span><span class="lines">@@ -179,6 +179,8 @@
</span><span class="cx">         return false;
</span><span class="cx">     if (!decoder.decode(pluginInfo.mimes))
</span><span class="cx">         return false;
</span><ins>+    if (!decoder.decode(pluginInfo.isApplicationPlugin))
+        return false;
</ins><span class="cx"> 
</span><span class="cx">     return true;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessPluginsPluginInfoStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Plugins/PluginInfoStore.cpp (150226 => 150227)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Plugins/PluginInfoStore.cpp        2013-05-17 00:36:49 UTC (rev 150226)
+++ trunk/Source/WebKit2/UIProcess/Plugins/PluginInfoStore.cpp        2013-05-17 00:42:03 UTC (rev 150227)
</span><span class="lines">@@ -121,12 +121,15 @@
</span><span class="cx">     return m_plugins;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PluginModuleInfo PluginInfoStore::findPluginForMIMEType(const String&amp; mimeType) const
</del><ins>+PluginModuleInfo PluginInfoStore::findPluginForMIMEType(const String&amp; mimeType, PluginData::AllowedPluginTypes allowedPluginTypes) const
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(!mimeType.isNull());
</span><span class="cx">     
</span><span class="cx">     for (size_t i = 0; i &lt; m_plugins.size(); ++i) {
</span><span class="cx">         const PluginModuleInfo&amp; plugin = m_plugins[i];
</span><ins>+
+        if (allowedPluginTypes == PluginData::OnlyApplicationPlugins &amp;&amp; !plugin.info.isApplicationPlugin)
+            continue;
</ins><span class="cx">         
</span><span class="cx">         for (size_t j = 0; j &lt; plugin.info.mimes.size(); ++j) {
</span><span class="cx">             const MimeClassInfo&amp; mimeClassInfo = plugin.info.mimes[j];
</span><span class="lines">@@ -138,16 +141,19 @@
</span><span class="cx">     return PluginModuleInfo();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PluginModuleInfo PluginInfoStore::findPluginForExtension(const String&amp; extension, String&amp; mimeType) const
</del><ins>+PluginModuleInfo PluginInfoStore::findPluginForExtension(const String&amp; extension, String&amp; mimeType, PluginData::AllowedPluginTypes allowedPluginTypes) const
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(!extension.isNull());
</span><span class="cx">     
</span><span class="cx">     for (size_t i = 0; i &lt; m_plugins.size(); ++i) {
</span><span class="cx">         const PluginModuleInfo&amp; plugin = m_plugins[i];
</span><del>-        
</del><ins>+
+        if (allowedPluginTypes == PluginData::OnlyApplicationPlugins &amp;&amp; !plugin.info.isApplicationPlugin)
+            continue;
+
</ins><span class="cx">         for (size_t j = 0; j &lt; plugin.info.mimes.size(); ++j) {
</span><span class="cx">             const MimeClassInfo&amp; mimeClassInfo = plugin.info.mimes[j];
</span><del>-            
</del><ins>+
</ins><span class="cx">             const Vector&lt;String&gt;&amp; extensions = mimeClassInfo.extensions;
</span><span class="cx">             
</span><span class="cx">             if (std::find(extensions.begin(), extensions.end(), extension) != extensions.end()) {
</span><span class="lines">@@ -198,13 +204,13 @@
</span><span class="cx"> 
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-PluginModuleInfo PluginInfoStore::findPlugin(String&amp; mimeType, const KURL&amp; url)
</del><ins>+PluginModuleInfo PluginInfoStore::findPlugin(String&amp; mimeType, const KURL&amp; url, PluginData::AllowedPluginTypes allowedPluginTypes)
</ins><span class="cx"> {
</span><span class="cx">     loadPluginsIfNecessary();
</span><span class="cx">     
</span><span class="cx">     // First, check if we can get the plug-in based on its MIME type.
</span><span class="cx">     if (!mimeType.isNull()) {
</span><del>-        PluginModuleInfo plugin = findPluginForMIMEType(mimeType);
</del><ins>+        PluginModuleInfo plugin = findPluginForMIMEType(mimeType, allowedPluginTypes);
</ins><span class="cx">         if (!plugin.path.isNull())
</span><span class="cx">             return plugin;
</span><span class="cx">     }
</span><span class="lines">@@ -212,14 +218,14 @@
</span><span class="cx">     // Next, check if any plug-ins claim to support the URL extension.
</span><span class="cx">     String extension = pathExtension(url).lower();
</span><span class="cx">     if (!extension.isNull() &amp;&amp; mimeType.isEmpty()) {
</span><del>-        PluginModuleInfo plugin = findPluginForExtension(extension, mimeType);
</del><ins>+        PluginModuleInfo plugin = findPluginForExtension(extension, mimeType, allowedPluginTypes);
</ins><span class="cx">         if (!plugin.path.isNull())
</span><span class="cx">             return plugin;
</span><span class="cx">         
</span><span class="cx">         // Finally, try to get the MIME type from the extension in a platform specific manner and use that.
</span><span class="cx">         String extensionMimeType = getMIMETypeForExtension(extension);
</span><span class="cx">         if (!extensionMimeType.isNull()) {
</span><del>-            PluginModuleInfo plugin = findPluginForMIMEType(extensionMimeType);
</del><ins>+            PluginModuleInfo plugin = findPluginForMIMEType(extensionMimeType, allowedPluginTypes);
</ins><span class="cx">             if (!plugin.path.isNull()) {
</span><span class="cx">                 mimeType = extensionMimeType;
</span><span class="cx">                 return plugin;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessPluginsPluginInfoStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Plugins/PluginInfoStore.h (150226 => 150227)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Plugins/PluginInfoStore.h        2013-05-17 00:36:49 UTC (rev 150226)
+++ trunk/Source/WebKit2/UIProcess/Plugins/PluginInfoStore.h        2013-05-17 00:42:03 UTC (rev 150227)
</span><span class="lines">@@ -30,6 +30,8 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;PluginModuleInfo.h&quot;
</span><span class="cx"> 
</span><ins>+#include &lt;WebCore/PluginData.h&gt;
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx">     class KURL;
</span><span class="cx"> }
</span><span class="lines">@@ -61,7 +63,7 @@
</span><span class="cx">     // Returns the info for a plug-in that can handle the given MIME type.
</span><span class="cx">     // If the MIME type is null, the file extension of the given url will be used to infer the
</span><span class="cx">     // plug-in type. In that case, mimeType will be filled in with the right MIME type.
</span><del>-    PluginModuleInfo findPlugin(String&amp; mimeType, const WebCore::KURL&amp;);
</del><ins>+    PluginModuleInfo findPlugin(String&amp; mimeType, const WebCore::KURL&amp;, WebCore::PluginData::AllowedPluginTypes = WebCore::PluginData::AllPlugins);
</ins><span class="cx"> 
</span><span class="cx">     // Returns the info for the plug-in with the given bundle identifier.
</span><span class="cx">     PluginModuleInfo findPluginWithBundleIdentifier(const String&amp; bundleIdentifier);
</span><span class="lines">@@ -76,8 +78,8 @@
</span><span class="cx">     PluginInfoStoreClient* client() const { return m_client; }
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    PluginModuleInfo findPluginForMIMEType(const String&amp; mimeType) const;
-    PluginModuleInfo findPluginForExtension(const String&amp; extension, String&amp; mimeType) const;
</del><ins>+    PluginModuleInfo findPluginForMIMEType(const String&amp; mimeType, WebCore::PluginData::AllowedPluginTypes) const;
+    PluginModuleInfo findPluginForExtension(const String&amp; extension, String&amp; mimeType, WebCore::PluginData::AllowedPluginTypes) const;
</ins><span class="cx"> 
</span><span class="cx">     void loadPluginsIfNecessary();
</span><span class="cx">     static void loadPlugin(Vector&lt;PluginModuleInfo&gt;&amp; plugins, const String&amp; pluginPath);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (150226 => 150227)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2013-05-17 00:36:49 UTC (rev 150226)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2013-05-17 00:42:03 UTC (rev 150227)
</span><span class="lines">@@ -1387,14 +1387,15 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(NETSCAPE_PLUGIN_API)
</span><del>-void WebPageProxy::findPlugin(const String&amp; mimeType, const String&amp; urlString, const String&amp; frameURLString, const String&amp; pageURLString, String&amp; pluginPath, String&amp; newMimeType, uint32_t&amp; pluginLoadPolicy)
</del><ins>+void WebPageProxy::findPlugin(const String&amp; mimeType, const String&amp; urlString, const String&amp; frameURLString, const String&amp; pageURLString, const bool allowOnlyApplicationPlugins, String&amp; pluginPath, String&amp; newMimeType, uint32_t&amp; pluginLoadPolicy)
</ins><span class="cx"> {
</span><span class="cx">     MESSAGE_CHECK_URL(urlString);
</span><span class="cx"> 
</span><span class="cx">     newMimeType = mimeType.lower();
</span><span class="cx">     pluginLoadPolicy = PluginModuleLoadNormally;
</span><del>-    
-    PluginModuleInfo plugin = m_process-&gt;context()-&gt;pluginInfoStore().findPlugin(newMimeType, KURL(KURL(), urlString));
</del><ins>+
+    PluginData::AllowedPluginTypes allowedPluginTypes = allowOnlyApplicationPlugins ? PluginData::OnlyApplicationPlugins : PluginData::AllPlugins;
+    PluginModuleInfo plugin = m_process-&gt;context()-&gt;pluginInfoStore().findPlugin(newMimeType, KURL(KURL(), urlString), allowedPluginTypes);
</ins><span class="cx">     if (!plugin.path)
</span><span class="cx">         return;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (150226 => 150227)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2013-05-17 00:36:49 UTC (rev 150226)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2013-05-17 00:42:03 UTC (rev 150227)
</span><span class="lines">@@ -1044,7 +1044,7 @@
</span><span class="cx">     void sendWheelEvent(const WebWheelEvent&amp;);
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(NETSCAPE_PLUGIN_API)
</span><del>-    void findPlugin(const String&amp; mimeType, const String&amp; urlString, const String&amp; frameURLString, const String&amp; pageURLString, String&amp; pluginPath, String&amp; newMIMEType, uint32_t&amp; pluginLoadPolicy);
</del><ins>+    void findPlugin(const String&amp; mimeType, const String&amp; urlString, const String&amp; frameURLString, const String&amp; pageURLString, const bool allowOnlyApplicationPlugins, String&amp; pluginPath, String&amp; newMIMEType, uint32_t&amp; pluginLoadPolicy);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     PageClient* m_pageClient;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in (150226 => 150227)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2013-05-17 00:36:49 UTC (rev 150226)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2013-05-17 00:42:03 UTC (rev 150227)
</span><span class="lines">@@ -315,7 +315,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(NETSCAPE_PLUGIN_API)
</span><del>-    FindPlugin(WTF::String mimeType, WTF::String urlString, WTF::String frameURLString, WTF::String pageURLString) -&gt; (WTF::String pluginPath, WTF::String newMIMEType, uint32_t pluginLoadPolicy)
</del><ins>+    FindPlugin(WTF::String mimeType, WTF::String urlString, WTF::String frameURLString, WTF::String pageURLString, bool allowOnlyApplicationPlugins) -&gt; (WTF::String pluginPath, WTF::String newMIMEType, uint32_t pluginLoadPolicy)
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     DidUpdateInWindowState()
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessPluginsPDFSimplePDFPluginmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Plugins/PDF/SimplePDFPlugin.mm (150226 => 150227)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Plugins/PDF/SimplePDFPlugin.mm        2013-05-17 00:36:49 UTC (rev 150226)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PDF/SimplePDFPlugin.mm        2013-05-17 00:42:03 UTC (rev 150227)
</span><span class="lines">@@ -177,6 +177,7 @@
</span><span class="cx"> {
</span><span class="cx">     PluginInfo info;
</span><span class="cx">     info.name = builtInPDFPluginName();
</span><ins>+    info.isApplicationPlugin = true;
</ins><span class="cx"> 
</span><span class="cx">     MimeClassInfo pdfMimeClassInfo;
</span><span class="cx">     pdfMimeClassInfo.type = &quot;application/pdf&quot;;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebFrameLoaderClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (150226 => 150227)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp        2013-05-17 00:36:49 UTC (rev 150226)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp        2013-05-17 00:42:03 UTC (rev 150227)
</span><span class="lines">@@ -1425,8 +1425,10 @@
</span><span class="cx">     bool plugInSupportsMIMEType = false;
</span><span class="cx">     if (WebPage* webPage = m_frame-&gt;page()) {
</span><span class="cx">         if (PluginData* pluginData = webPage-&gt;corePage()-&gt;pluginData()) {
</span><del>-            if (pluginData-&gt;supportsMimeType(mimeType))
</del><ins>+            if (pluginData-&gt;supportsMimeType(mimeType, PluginData::AllPlugins) &amp;&amp; webFrame()-&gt;coreFrame()-&gt;loader()-&gt;subframeLoader()-&gt;allowPlugins(NotAboutToInstantiatePlugin))
</ins><span class="cx">                 plugInSupportsMIMEType = true;
</span><ins>+            else if (pluginData-&gt;supportsMimeType(mimeType, PluginData::OnlyApplicationPlugins))
+                plugInSupportsMIMEType = true;
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (150226 => 150227)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2013-05-17 00:36:49 UTC (rev 150226)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2013-05-17 00:42:03 UTC (rev 150227)
</span><span class="lines">@@ -533,7 +533,8 @@
</span><span class="cx">     String frameURLString = frame-&gt;coreFrame()-&gt;loader()-&gt;documentLoader()-&gt;responseURL().string();
</span><span class="cx">     String pageURLString = m_page-&gt;mainFrame()-&gt;loader()-&gt;documentLoader()-&gt;responseURL().string();
</span><span class="cx"> 
</span><del>-    if (!sendSync(Messages::WebPageProxy::FindPlugin(parameters.mimeType, parameters.url.string(), frameURLString, pageURLString), Messages::WebPageProxy::FindPlugin::Reply(pluginPath, newMIMEType, pluginLoadPolicy))) {
</del><ins>+    bool allowOnlyApplicationPlugins = !frame-&gt;coreFrame()-&gt;loader()-&gt;subframeLoader()-&gt;allowPlugins(NotAboutToInstantiatePlugin);
+    if (!sendSync(Messages::WebPageProxy::FindPlugin(parameters.mimeType, parameters.url.string(), frameURLString, pageURLString, allowOnlyApplicationPlugins), Messages::WebPageProxy::FindPlugin::Reply(pluginPath, newMIMEType, pluginLoadPolicy))) {
</ins><span class="cx">         return 0;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -3781,7 +3782,8 @@
</span><span class="cx">     String newMIMEType;
</span><span class="cx">     uint32_t pluginLoadPolicy;
</span><span class="cx"> 
</span><del>-    if (!sendSync(Messages::WebPageProxy::FindPlugin(response.mimeType(), response.url().string(), response.url().string(), response.url().string()), Messages::WebPageProxy::FindPlugin::Reply(pluginPath, newMIMEType, pluginLoadPolicy)))
</del><ins>+    bool allowOnlyApplicationPlugins = !m_mainFrame-&gt;coreFrame()-&gt;loader()-&gt;subframeLoader()-&gt;allowPlugins(NotAboutToInstantiatePlugin);
+    if (!sendSync(Messages::WebPageProxy::FindPlugin(response.mimeType(), response.url().string(), response.url().string(), response.url().string(), allowOnlyApplicationPlugins), Messages::WebPageProxy::FindPlugin::Reply(pluginPath, newMIMEType, pluginLoadPolicy)))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     return pluginLoadPolicy != PluginModuleBlocked &amp;&amp; !pluginPath.isEmpty();
</span><span class="lines">@@ -3929,8 +3931,12 @@
</span><span class="cx">         return true;
</span><span class="cx"> 
</span><span class="cx">     if (PluginData* pluginData = m_page-&gt;pluginData()) {
</span><del>-        if (pluginData-&gt;supportsMimeType(MIMEType) &amp;&amp; m_page-&gt;settings()-&gt;arePluginsEnabled())
</del><ins>+        if (pluginData-&gt;supportsMimeType(MIMEType, PluginData::AllPlugins) &amp;&amp; corePage()-&gt;mainFrame()-&gt;loader()-&gt;subframeLoader()-&gt;allowPlugins(NotAboutToInstantiatePlugin))
</ins><span class="cx">             return true;
</span><ins>+
+        // We can use application plugins even if plugins aren't enabled.
+        if (pluginData-&gt;supportsMimeType(MIMEType, PluginData::OnlyApplicationPlugins))
+            return true;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return false;
</span></span></pre>
</div>
</div>

</body>
</html>