<!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>[185717] trunk/Source/WebCore</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/185717">185717</a></dd>
<dt>Author</dt> <dd>conrad_shultz@apple.com</dd>
<dt>Date</dt> <dd>2015-06-18 12:32:15 -0700 (Thu, 18 Jun 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>REGRESSION: js/dom/navigator-plugins-crash.html asserts a lot
https://bugs.webkit.org/show_bug.cgi?id=144399

Reviewed by Darin Adler.

Earlier work made the array of web-visible plug-ins dynamic, but allowed DOMPlugin (and, indirectly by extension,
DOMMimeType) to continue keeping a reference to a plug-in in terms of an index into that array. This superficially
appeared correct since DOMPlugin immutably holds onto a PluginData instance, which in turn immutably holds onto a
Page instance. PluginStrategy::getWebVisiblePluginInfo() is passed this Page, which is used to determine the contents
of the plugin array. The expectation was that keeping an index would still be safe since the Page is not changing,
but this is not strictly correct since relevant attributes of the Page and/or the available plugins may still change.

It's not entirely clear why the test failures are intermittent and occur only on certain configurations, but address
them by eliminating the incorrect storage of indexes in favor of keeping copies of the relevant plugin info itself.

* plugins/DOMMimeType.cpp:
(WebCore::DOMMimeType::DOMMimeType):
Instead of storing the MIME type index, retrieve and store the MIME class info and plugin info.
(WebCore::DOMMimeType::type):
Directly access the m_mimeClassInfo member.
(WebCore::DOMMimeType::suffixes):
Ditto.
(WebCore::DOMMimeType::description):
Ditto.
(WebCore::DOMMimeType::enabledPlugin):
Directly access the m_pluginInfo member.
(WebCore::DOMMimeType::mimeClassInfo): Deleted.

* plugins/DOMMimeType.h:
Update member variables.

* plugins/DOMPlugin.cpp:
(WebCore::DOMPlugin::DOMPlugin):
Instead of storing the plugin index, store the plugin info directly.
(WebCore::DOMPlugin::name):
Directly access m_pluginInfo.
(WebCore::DOMPlugin::filename):
Ditto.
(WebCore::DOMPlugin::description):
Ditto.
(WebCore::DOMPlugin::length):
Ditto.
(WebCore::DOMPlugin::item):
Access m_pluginInfo directly; find the matching plug-in based on matching PluginInfo (for which an overloaded
comparator is supplied below).
(WebCore::DOMPlugin::pluginInfo): Deleted.

* plugins/DOMPlugin.h:
Update member variables.
(WebCore::DOMPlugin::create):
Accept a PluginInfo instead of a plugin index.

* plugins/DOMPluginArray.cpp:
(WebCore::DOMPluginArray::item):
(WebCore::DOMPluginArray::namedItem):

* plugins/PluginData.h:
(WebCore::operator==):
Added; compare PluginInfo structs on the basis of member equality.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorepluginsDOMMimeTypecpp">trunk/Source/WebCore/plugins/DOMMimeType.cpp</a></li>
<li><a href="#trunkSourceWebCorepluginsDOMMimeTypeh">trunk/Source/WebCore/plugins/DOMMimeType.h</a></li>
<li><a href="#trunkSourceWebCorepluginsDOMPlugincpp">trunk/Source/WebCore/plugins/DOMPlugin.cpp</a></li>
<li><a href="#trunkSourceWebCorepluginsDOMPluginh">trunk/Source/WebCore/plugins/DOMPlugin.h</a></li>
<li><a href="#trunkSourceWebCorepluginsDOMPluginArraycpp">trunk/Source/WebCore/plugins/DOMPluginArray.cpp</a></li>
<li><a href="#trunkSourceWebCorepluginsPluginDatah">trunk/Source/WebCore/plugins/PluginData.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (185716 => 185717)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-06-18 19:21:22 UTC (rev 185716)
+++ trunk/Source/WebCore/ChangeLog        2015-06-18 19:32:15 UTC (rev 185717)
</span><span class="lines">@@ -1,3 +1,65 @@
</span><ins>+2015-06-17  Conrad Shultz  &lt;conrad_shultz@apple.com&gt;
+
+        REGRESSION: js/dom/navigator-plugins-crash.html asserts a lot
+        https://bugs.webkit.org/show_bug.cgi?id=144399
+
+        Reviewed by Darin Adler.
+
+        Earlier work made the array of web-visible plug-ins dynamic, but allowed DOMPlugin (and, indirectly by extension,
+        DOMMimeType) to continue keeping a reference to a plug-in in terms of an index into that array. This superficially
+        appeared correct since DOMPlugin immutably holds onto a PluginData instance, which in turn immutably holds onto a
+        Page instance. PluginStrategy::getWebVisiblePluginInfo() is passed this Page, which is used to determine the contents
+        of the plugin array. The expectation was that keeping an index would still be safe since the Page is not changing,
+        but this is not strictly correct since relevant attributes of the Page and/or the available plugins may still change.
+
+        It's not entirely clear why the test failures are intermittent and occur only on certain configurations, but address
+        them by eliminating the incorrect storage of indexes in favor of keeping copies of the relevant plugin info itself.
+
+        * plugins/DOMMimeType.cpp:
+        (WebCore::DOMMimeType::DOMMimeType):
+        Instead of storing the MIME type index, retrieve and store the MIME class info and plugin info.
+        (WebCore::DOMMimeType::type):
+        Directly access the m_mimeClassInfo member.
+        (WebCore::DOMMimeType::suffixes):
+        Ditto.
+        (WebCore::DOMMimeType::description):
+        Ditto.
+        (WebCore::DOMMimeType::enabledPlugin):
+        Directly access the m_pluginInfo member.
+        (WebCore::DOMMimeType::mimeClassInfo): Deleted.
+
+        * plugins/DOMMimeType.h:
+        Update member variables.
+
+        * plugins/DOMPlugin.cpp:
+        (WebCore::DOMPlugin::DOMPlugin):
+        Instead of storing the plugin index, store the plugin info directly.
+        (WebCore::DOMPlugin::name):
+        Directly access m_pluginInfo.
+        (WebCore::DOMPlugin::filename):
+        Ditto.
+        (WebCore::DOMPlugin::description):
+        Ditto.
+        (WebCore::DOMPlugin::length):
+        Ditto.
+        (WebCore::DOMPlugin::item):
+        Access m_pluginInfo directly; find the matching plug-in based on matching PluginInfo (for which an overloaded
+        comparator is supplied below).
+        (WebCore::DOMPlugin::pluginInfo): Deleted.
+
+        * plugins/DOMPlugin.h:
+        Update member variables.
+        (WebCore::DOMPlugin::create):
+        Accept a PluginInfo instead of a plugin index.
+
+        * plugins/DOMPluginArray.cpp:
+        (WebCore::DOMPluginArray::item):
+        (WebCore::DOMPluginArray::namedItem):
+
+        * plugins/PluginData.h:
+        (WebCore::operator==):
+        Added; compare PluginInfo structs on the basis of member equality.
+
</ins><span class="cx"> 2015-06-17  Alex Christensen  &lt;achristensen@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         [Content Extensions] Log blocked loads to the WebInspector console
</span></span></pre></div>
<a id="trunkSourceWebCorepluginsDOMMimeTypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/plugins/DOMMimeType.cpp (185716 => 185717)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/plugins/DOMMimeType.cpp        2015-06-18 19:21:22 UTC (rev 185716)
+++ trunk/Source/WebCore/plugins/DOMMimeType.cpp        2015-06-18 19:32:15 UTC (rev 185717)
</span><span class="lines">@@ -32,8 +32,12 @@
</span><span class="cx"> DOMMimeType::DOMMimeType(PassRefPtr&lt;PluginData&gt; pluginData, Frame* frame, unsigned index)
</span><span class="cx">     : FrameDestructionObserver(frame)
</span><span class="cx">     , m_pluginData(pluginData)
</span><del>-    , m_index(index)
</del><span class="cx"> {
</span><ins>+    Vector&lt;MimeClassInfo&gt; mimes;
+    Vector&lt;size_t&gt; mimePluginIndices;
+    m_pluginData-&gt;getWebVisibleMimesAndPluginIndices(mimes, mimePluginIndices);
+    m_mimeClassInfo = mimes[index];
+    m_pluginInfo = m_pluginData-&gt;webVisiblePlugins()[mimePluginIndices[index]];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> DOMMimeType::~DOMMimeType()
</span><span class="lines">@@ -42,12 +46,12 @@
</span><span class="cx"> 
</span><span class="cx"> String DOMMimeType::type() const
</span><span class="cx"> {
</span><del>-    return mimeClassInfo().type;
</del><ins>+    return m_mimeClassInfo.type;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> String DOMMimeType::suffixes() const
</span><span class="cx"> {
</span><del>-    const Vector&lt;String&gt;&amp; extensions = mimeClassInfo().extensions;
</del><ins>+    const Vector&lt;String&gt;&amp; extensions = m_mimeClassInfo.extensions;
</ins><span class="cx"> 
</span><span class="cx">     StringBuilder builder;
</span><span class="cx">     for (size_t i = 0; i &lt; extensions.size(); ++i) {
</span><span class="lines">@@ -60,17 +64,9 @@
</span><span class="cx"> 
</span><span class="cx"> String DOMMimeType::description() const
</span><span class="cx"> {
</span><del>-    return mimeClassInfo().desc;
</del><ins>+    return m_mimeClassInfo.desc;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-MimeClassInfo DOMMimeType::mimeClassInfo() const
-{
-    Vector&lt;MimeClassInfo&gt; mimes;
-    Vector&lt;size_t&gt; mimePluginIndices;
-    m_pluginData-&gt;getWebVisibleMimesAndPluginIndices(mimes, mimePluginIndices);
-    return mimes[m_index];
-}
-
</del><span class="cx"> PassRefPtr&lt;DOMPlugin&gt; DOMMimeType::enabledPlugin() const
</span><span class="cx"> {
</span><span class="cx">     if (!m_frame || !m_frame-&gt;page() || !m_frame-&gt;page()-&gt;mainFrame().loader().subframeLoader().allowPlugins(NotAboutToInstantiatePlugin))
</span><span class="lines">@@ -79,7 +75,7 @@
</span><span class="cx">     Vector&lt;MimeClassInfo&gt; mimes;
</span><span class="cx">     Vector&lt;size_t&gt; mimePluginIndices;
</span><span class="cx">     m_pluginData-&gt;getWebVisibleMimesAndPluginIndices(mimes, mimePluginIndices);
</span><del>-    return DOMPlugin::create(m_pluginData.get(), m_frame, mimePluginIndices[m_index]);
</del><ins>+    return DOMPlugin::create(m_pluginData.get(), m_frame, m_pluginInfo);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorepluginsDOMMimeTypeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/plugins/DOMMimeType.h (185716 => 185717)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/plugins/DOMMimeType.h        2015-06-18 19:21:22 UTC (rev 185716)
+++ trunk/Source/WebCore/plugins/DOMMimeType.h        2015-06-18 19:32:15 UTC (rev 185717)
</span><span class="lines">@@ -42,11 +42,10 @@
</span><span class="cx">     PassRefPtr&lt;DOMPlugin&gt; enabledPlugin() const;
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    MimeClassInfo mimeClassInfo() const;
-
</del><span class="cx">     DOMMimeType(PassRefPtr&lt;PluginData&gt;, Frame*, unsigned index);
</span><ins>+    MimeClassInfo m_mimeClassInfo;
</ins><span class="cx">     RefPtr&lt;PluginData&gt; m_pluginData;
</span><del>-    unsigned m_index;
</del><ins>+    PluginInfo m_pluginInfo;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorepluginsDOMPlugincpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/plugins/DOMPlugin.cpp (185716 => 185717)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/plugins/DOMPlugin.cpp        2015-06-18 19:21:22 UTC (rev 185716)
+++ trunk/Source/WebCore/plugins/DOMPlugin.cpp        2015-06-18 19:32:15 UTC (rev 185717)
</span><span class="lines">@@ -25,10 +25,10 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-DOMPlugin::DOMPlugin(PluginData* pluginData, Frame* frame, unsigned index)
</del><ins>+DOMPlugin::DOMPlugin(PluginData* pluginData, Frame* frame, PluginInfo pluginInfo)
</ins><span class="cx">     : FrameDestructionObserver(frame)
</span><span class="cx">     , m_pluginData(pluginData)
</span><del>-    , m_index(index)
</del><ins>+    , m_pluginInfo(WTF::move(pluginInfo))
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -38,41 +38,37 @@
</span><span class="cx"> 
</span><span class="cx"> String DOMPlugin::name() const
</span><span class="cx"> {
</span><del>-    return pluginInfo().name;
</del><ins>+    return m_pluginInfo.name;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> String DOMPlugin::filename() const
</span><span class="cx"> {
</span><del>-    return pluginInfo().file;
</del><ins>+    return m_pluginInfo.file;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> String DOMPlugin::description() const
</span><span class="cx"> {
</span><del>-    return pluginInfo().desc;
</del><ins>+    return m_pluginInfo.desc;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> unsigned DOMPlugin::length() const
</span><span class="cx"> {
</span><del>-    return pluginInfo().mimes.size();
</del><ins>+    return m_pluginInfo.mimes.size();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-PluginInfo DOMPlugin::pluginInfo() const
-{
-    return m_pluginData-&gt;webVisiblePlugins()[m_index];
-}
-
</del><span class="cx"> PassRefPtr&lt;DOMMimeType&gt; DOMPlugin::item(unsigned index)
</span><span class="cx"> {
</span><del>-    if (index &gt;= pluginInfo().mimes.size())
</del><ins>+    if (index &gt;= m_pluginInfo.mimes.size())
</ins><span class="cx">         return 0;
</span><span class="cx"> 
</span><del>-    MimeClassInfo mime = pluginInfo().mimes[index];
</del><ins>+    MimeClassInfo mime = m_pluginInfo.mimes[index];
</ins><span class="cx"> 
</span><span class="cx">     Vector&lt;MimeClassInfo&gt; mimes;
</span><span class="cx">     Vector&lt;size_t&gt; mimePluginIndices;
</span><ins>+    Vector&lt;PluginInfo&gt; plugins = m_pluginData-&gt;webVisiblePlugins();
</ins><span class="cx">     m_pluginData-&gt;getWebVisibleMimesAndPluginIndices(mimes, mimePluginIndices);
</span><span class="cx">     for (unsigned i = 0; i &lt; mimes.size(); ++i) {
</span><del>-        if (mimes[i] == mime &amp;&amp; mimePluginIndices[i] == m_index)
</del><ins>+        if (mimes[i] == mime &amp;&amp; plugins[mimePluginIndices[i]] == m_pluginInfo)
</ins><span class="cx">             return DOMMimeType::create(m_pluginData.get(), m_frame, i);
</span><span class="cx">     }
</span><span class="cx">     return 0;
</span></span></pre></div>
<a id="trunkSourceWebCorepluginsDOMPluginh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/plugins/DOMPlugin.h (185716 => 185717)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/plugins/DOMPlugin.h        2015-06-18 19:21:22 UTC (rev 185716)
+++ trunk/Source/WebCore/plugins/DOMPlugin.h        2015-06-18 19:32:15 UTC (rev 185717)
</span><span class="lines">@@ -33,7 +33,7 @@
</span><span class="cx"> 
</span><span class="cx"> class DOMPlugin : public ScriptWrappable, public RefCounted&lt;DOMPlugin&gt;, public FrameDestructionObserver {
</span><span class="cx"> public:
</span><del>-    static Ref&lt;DOMPlugin&gt; create(PluginData* pluginData, Frame* frame, unsigned index) { return adoptRef(*new DOMPlugin(pluginData, frame, index)); }
</del><ins>+    static Ref&lt;DOMPlugin&gt; create(PluginData* pluginData, Frame* frame, PluginInfo pluginInfo) { return adoptRef(*new DOMPlugin(pluginData, frame, WTF::move(pluginInfo))); }
</ins><span class="cx">     ~DOMPlugin();
</span><span class="cx"> 
</span><span class="cx">     String name() const;
</span><span class="lines">@@ -47,11 +47,9 @@
</span><span class="cx">     PassRefPtr&lt;DOMMimeType&gt; namedItem(const AtomicString&amp; propertyName);
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    PluginInfo pluginInfo() const;
-
-    DOMPlugin(PluginData*, Frame*, unsigned index);
</del><ins>+    DOMPlugin(PluginData*, Frame*, PluginInfo);
</ins><span class="cx">     RefPtr&lt;PluginData&gt; m_pluginData;
</span><del>-    unsigned m_index;
</del><ins>+    PluginInfo m_pluginInfo;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorepluginsDOMPluginArraycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/plugins/DOMPluginArray.cpp (185716 => 185717)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/plugins/DOMPluginArray.cpp        2015-06-18 19:21:22 UTC (rev 185716)
+++ trunk/Source/WebCore/plugins/DOMPluginArray.cpp        2015-06-18 19:32:15 UTC (rev 185717)
</span><span class="lines">@@ -61,7 +61,7 @@
</span><span class="cx">     const Vector&lt;PluginInfo&gt;&amp; plugins = data-&gt;webVisiblePlugins();
</span><span class="cx">     if (index &gt;= plugins.size())
</span><span class="cx">         return 0;
</span><del>-    return DOMPlugin::create(data, m_frame, index);
</del><ins>+    return DOMPlugin::create(data, m_frame, plugins[index]);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool DOMPluginArray::canGetItemsForName(const AtomicString&amp; propertyName)
</span><span class="lines">@@ -83,10 +83,9 @@
</span><span class="cx">     if (!data)
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><del>-    const Vector&lt;PluginInfo&gt;&amp; plugins = data-&gt;webVisiblePlugins();
-    for (unsigned i = 0; i &lt; plugins.size(); ++i) {
-        if (plugins[i].name == propertyName)
-            return DOMPlugin::create(data, m_frame, i);
</del><ins>+    for (auto&amp; plugin : data-&gt;webVisiblePlugins()) {
+        if (plugin.name == propertyName)
+            return DOMPlugin::create(data, m_frame, plugin);
</ins><span class="cx">     }
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorepluginsPluginDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/plugins/PluginData.h (185716 => 185717)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/plugins/PluginData.h        2015-06-18 19:21:22 UTC (rev 185716)
+++ trunk/Source/WebCore/plugins/PluginData.h        2015-06-18 19:32:15 UTC (rev 185717)
</span><span class="lines">@@ -73,6 +73,15 @@
</span><span class="cx"> #endif
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+inline bool operator==(PluginInfo&amp; a, PluginInfo&amp; b)
+{
+    bool result = a.name == b.name &amp;&amp; a.file == b.file &amp;&amp; a.desc == b.desc &amp;&amp; a.mimes == b.mimes &amp;&amp; a.isApplicationPlugin == b.isApplicationPlugin &amp;&amp; a.clientLoadPolicy == b.clientLoadPolicy;
+#if PLATFORM(MAC)
+    result = result &amp;&amp; a.bundleIdentifier == b.bundleIdentifier &amp;&amp; a.versionString == b.versionString;
+#endif
+    return result;
+}
+
</ins><span class="cx"> // FIXME: merge with PluginDatabase in the future
</span><span class="cx"> class PluginData : public RefCounted&lt;PluginData&gt; {
</span><span class="cx"> public:
</span></span></pre>
</div>
</div>

</body>
</html>