<!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>[158962] 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/158962">158962</a></dd>
<dt>Author</dt> <dd>weinig@apple.com</dd>
<dt>Date</dt> <dd>2013-11-08 15:23:16 -0800 (Fri, 08 Nov 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>Teach SubframeLoader a bit about references
https://bugs.webkit.org/show_bug.cgi?id=124076

Reviewed by Anders Carlsson.

* html/HTMLAppletElement.cpp:
* html/HTMLFrameElementBase.cpp:
* html/HTMLMediaElement.cpp:
* loader/SubframeLoader.cpp:
* loader/SubframeLoader.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLAppletElementcpp">trunk/Source/WebCore/html/HTMLAppletElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLFrameElementBasecpp">trunk/Source/WebCore/html/HTMLFrameElementBase.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaElementcpp">trunk/Source/WebCore/html/HTMLMediaElement.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderSubframeLoadercpp">trunk/Source/WebCore/loader/SubframeLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderSubframeLoaderh">trunk/Source/WebCore/loader/SubframeLoader.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (158961 => 158962)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2013-11-08 23:16:25 UTC (rev 158961)
+++ trunk/Source/WebCore/ChangeLog        2013-11-08 23:23:16 UTC (rev 158962)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2013-11-08  Sam Weinig  &lt;sam@webkit.org&gt;
+
+        Teach SubframeLoader a bit about references
+        https://bugs.webkit.org/show_bug.cgi?id=124076
+
+        Reviewed by Anders Carlsson.
+
+        * html/HTMLAppletElement.cpp:
+        * html/HTMLFrameElementBase.cpp:
+        * html/HTMLMediaElement.cpp:
+        * loader/SubframeLoader.cpp:
+        * loader/SubframeLoader.h:
+
</ins><span class="cx"> 2013-11-08  Brady Eidson  &lt;beidson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Blind Windows build-fix attempt after r158959
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLAppletElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLAppletElement.cpp (158961 => 158962)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLAppletElement.cpp        2013-11-08 23:16:25 UTC (rev 158961)
+++ trunk/Source/WebCore/html/HTMLAppletElement.cpp        2013-11-08 23:23:16 UTC (rev 158962)
</span><span class="lines">@@ -160,7 +160,7 @@
</span><span class="cx">     Frame* frame = document().frame();
</span><span class="cx">     ASSERT(frame);
</span><span class="cx"> 
</span><del>-    renderer-&gt;setWidget(frame-&gt;loader().subframeLoader().createJavaAppletWidget(roundedIntSize(LayoutSize(contentWidth, contentHeight)), this, paramNames, paramValues));
</del><ins>+    renderer-&gt;setWidget(frame-&gt;loader().subframeLoader().createJavaAppletWidget(roundedIntSize(LayoutSize(contentWidth, contentHeight)), *this, paramNames, paramValues));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool HTMLAppletElement::canEmbedJava() const
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLFrameElementBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLFrameElementBase.cpp (158961 => 158962)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLFrameElementBase.cpp        2013-11-08 23:16:25 UTC (rev 158961)
+++ trunk/Source/WebCore/html/HTMLFrameElementBase.cpp        2013-11-08 23:23:16 UTC (rev 158962)
</span><span class="lines">@@ -86,7 +86,7 @@
</span><span class="cx">     if (!parentFrame)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    parentFrame-&gt;loader().subframeLoader().requestFrame(this, m_URL, m_frameName, lockHistory, lockBackForwardList);
</del><ins>+    parentFrame-&gt;loader().subframeLoader().requestFrame(*this, m_URL, m_frameName, lockHistory, lockBackForwardList);
</ins><span class="cx">     if (contentFrame())
</span><span class="cx">         contentFrame()-&gt;setInViewSourceMode(viewSourceMode());
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (158961 => 158962)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.cpp        2013-11-08 23:16:25 UTC (rev 158961)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp        2013-11-08 23:23:16 UTC (rev 158962)
</span><span class="lines">@@ -4381,7 +4381,7 @@
</span><span class="cx">     
</span><span class="cx">     // Hang onto the proxy widget so it won't be destroyed if the plug-in is set to
</span><span class="cx">     // display:none
</span><del>-    m_proxyWidget = frame-&gt;loader().subframeLoader().loadMediaPlayerProxyPlugin(this, url, paramNames, paramValues);
</del><ins>+    m_proxyWidget = frame-&gt;loader().subframeLoader().loadMediaPlayerProxyPlugin(*this, url, paramNames, paramValues);
</ins><span class="cx">     if (m_proxyWidget)
</span><span class="cx">         m_needWidgetUpdate = false;
</span><span class="cx"> }
</span><span class="lines">@@ -4398,7 +4398,7 @@
</span><span class="cx">     mediaElement-&gt;getPluginProxyParams(kurl, paramNames, paramValues);
</span><span class="cx">     // FIXME: What if document().frame() is 0?
</span><span class="cx">     SubframeLoader&amp; loader = document().frame()-&gt;loader().subframeLoader();
</span><del>-    loader.loadMediaPlayerProxyPlugin(mediaElement, kurl, paramNames, paramValues);
</del><ins>+    loader.loadMediaPlayerProxyPlugin(*mediaElement, kurl, paramNames, paramValues);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(PLUGIN_PROXY_FOR_VIDEO)
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderSubframeLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/SubframeLoader.cpp (158961 => 158962)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/SubframeLoader.cpp        2013-11-08 23:16:25 UTC (rev 158961)
+++ trunk/Source/WebCore/loader/SubframeLoader.cpp        2013-11-08 23:23:16 UTC (rev 158962)
</span><span class="lines">@@ -75,7 +75,7 @@
</span><span class="cx">     m_containsPlugins = false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool SubframeLoader::requestFrame(HTMLFrameOwnerElement* ownerElement, const String&amp; urlString, const AtomicString&amp; frameName, bool lockHistory, bool lockBackForwardList)
</del><ins>+bool SubframeLoader::requestFrame(HTMLFrameOwnerElement&amp; ownerElement, const String&amp; urlString, const AtomicString&amp; frameName, bool lockHistory, bool lockBackForwardList)
</ins><span class="cx"> {
</span><span class="cx">     // Support for &lt;frame src=&quot;javascript:string&quot;&gt;
</span><span class="cx">     URL scriptURL;
</span><span class="lines">@@ -106,7 +106,7 @@
</span><span class="cx">     return shouldUsePlugin(completedURL, mimeType, shouldPreferPlugInsForImages, false, useFallback);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool SubframeLoader::pluginIsLoadable(HTMLPlugInImageElement* pluginElement, const URL&amp; url, const String&amp; mimeType)
</del><ins>+bool SubframeLoader::pluginIsLoadable(HTMLPlugInImageElement&amp; pluginElement, const URL&amp; url, const String&amp; mimeType)
</ins><span class="cx"> {
</span><span class="cx">     if (MIMETypeRegistry::isJavaAppletMIMEType(mimeType)) {
</span><span class="cx">         if (!m_frame.settings().isJavaEnabled())
</span><span class="lines">@@ -126,10 +126,10 @@
</span><span class="cx"> 
</span><span class="cx">         String declaredMimeType = document()-&gt;isPluginDocument() &amp;&amp; document()-&gt;ownerElement() ?
</span><span class="cx">             document()-&gt;ownerElement()-&gt;fastGetAttribute(HTMLNames::typeAttr) :
</span><del>-            pluginElement-&gt;fastGetAttribute(HTMLNames::typeAttr);
</del><ins>+            pluginElement.fastGetAttribute(HTMLNames::typeAttr);
</ins><span class="cx">         if (!document()-&gt;contentSecurityPolicy()-&gt;allowObjectFromSource(url)
</span><span class="cx">             || !document()-&gt;contentSecurityPolicy()-&gt;allowPluginType(mimeType, declaredMimeType, url)) {
</span><del>-            RenderEmbeddedObject* renderer = pluginElement-&gt;renderEmbeddedObject();
</del><ins>+            RenderEmbeddedObject* renderer = pluginElement.renderEmbeddedObject();
</ins><span class="cx">             renderer-&gt;setPluginUnavailabilityReason(RenderEmbeddedObject::PluginBlockedByContentSecurityPolicy);
</span><span class="cx">             return false;
</span><span class="cx">         }
</span><span class="lines">@@ -141,7 +141,7 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool SubframeLoader::requestPlugin(HTMLPlugInImageElement* ownerElement, const URL&amp; url, const String&amp; mimeType, const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues, bool useFallback)
</del><ins>+bool SubframeLoader::requestPlugin(HTMLPlugInImageElement&amp; ownerElement, const URL&amp; url, const String&amp; mimeType, const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues, bool useFallback)
</ins><span class="cx"> {
</span><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="lines">@@ -152,7 +152,7 @@
</span><span class="cx">     if (!pluginIsLoadable(ownerElement, url, mimeType))
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    ASSERT(ownerElement-&gt;hasTagName(objectTag) || ownerElement-&gt;hasTagName(embedTag));
</del><ins>+    ASSERT(ownerElement.hasTagName(objectTag) || ownerElement.hasTagName(embedTag));
</ins><span class="cx">     return loadPlugin(ownerElement, url, mimeType, paramNames, paramValues, useFallback);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -221,7 +221,7 @@
</span><span class="cx"> 
</span><span class="cx">     bool useFallback;
</span><span class="cx">     if (shouldUsePlugin(completedURL, mimeType, ownerElement.shouldPreferPlugInsForImages(), hasFallbackContent, useFallback)) {
</span><del>-        bool success = requestPlugin(&amp;ownerElement, completedURL, mimeType, paramNames, paramValues, useFallback);
</del><ins>+        bool success = requestPlugin(ownerElement, completedURL, mimeType, paramNames, paramValues, useFallback);
</ins><span class="cx">         logPluginRequest(document()-&gt;page(), mimeType, completedURL, success);
</span><span class="cx">         return success;
</span><span class="cx">     }
</span><span class="lines">@@ -229,14 +229,13 @@
</span><span class="cx">     // If the plug-in element already contains a subframe, loadOrRedirectSubframe will re-use it. Otherwise,
</span><span class="cx">     // it will create a new frame and set it as the RenderWidget's Widget, causing what was previously 
</span><span class="cx">     // in the widget to be torn down.
</span><del>-    return loadOrRedirectSubframe(&amp;ownerElement, completedURL, frameName, true, true);
</del><ins>+    return loadOrRedirectSubframe(ownerElement, completedURL, frameName, true, true);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
</span><del>-PassRefPtr&lt;Widget&gt; SubframeLoader::loadMediaPlayerProxyPlugin(Node* node, const URL&amp; url,
-    const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues)
</del><ins>+PassRefPtr&lt;Widget&gt; SubframeLoader::loadMediaPlayerProxyPlugin(HTMLMediaElement&amp; mediaElement, const URL&amp; url, const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues)
</ins><span class="cx"> {
</span><del>-    ASSERT(node-&gt;hasTagName(videoTag) || isHTMLAudioElement(node));
</del><ins>+    ASSERT(mediaElement.hasTagName(videoTag) || isHTMLAudioElement(mediaElement));
</ins><span class="cx"> 
</span><span class="cx">     URL completedURL;
</span><span class="cx">     if (!url.isEmpty())
</span><span class="lines">@@ -244,26 +243,24 @@
</span><span class="cx"> 
</span><span class="cx">     if (!m_frame.document()-&gt;securityOrigin()-&gt;canDisplay(completedURL)) {
</span><span class="cx">         FrameLoader::reportLocalLoadFailed(m_frame, completedURL.string());
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (!m_frame.document()-&gt;contentSecurityPolicy()-&gt;allowMediaFromSource(completedURL))
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><del>-    HTMLMediaElement* mediaElement = toHTMLMediaElement(node);
-    RenderWidget* renderer = toRenderWidget(node-&gt;renderer());
</del><ins>+    RenderWidget* renderer = toRenderWidget(mediaElement.renderer());
</ins><span class="cx">     IntSize size;
</span><span class="cx"> 
</span><span class="cx">     if (renderer)
</span><span class="cx">         size = roundedIntSize(LayoutSize(renderer-&gt;contentWidth(), renderer-&gt;contentHeight()));
</span><del>-    else if (mediaElement-&gt;isVideo())
</del><ins>+    else if (mediaElement.isVideo())
</ins><span class="cx">         size = RenderVideo::defaultSize();
</span><span class="cx"> 
</span><span class="cx">     if (!m_frame.loader().mixedContentChecker().canRunInsecureContent(m_frame.document()-&gt;securityOrigin(), completedURL))
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><del>-    RefPtr&lt;Widget&gt; widget = m_frame.loader().client().createMediaPlayerProxyPlugin(size, mediaElement, completedURL,
-                                         paramNames, paramValues, &quot;application/x-media-element-proxy-plugin&quot;);
</del><ins>+    RefPtr&lt;Widget&gt; widget = m_frame.loader().client().createMediaPlayerProxyPlugin(size, &amp;mediaElement, completedURL, paramNames, paramValues, &quot;application/x-media-element-proxy-plugin&quot;);
</ins><span class="cx"> 
</span><span class="cx">     if (widget &amp;&amp; renderer) {
</span><span class="cx">         renderer-&gt;setWidget(widget);
</span><span class="lines">@@ -271,11 +268,11 @@
</span><span class="cx">     }
</span><span class="cx">     m_containsPlugins = true;
</span><span class="cx"> 
</span><del>-    return widget ? widget.release() : 0;
</del><ins>+    return widget ? widget.release() : nullptr;
</ins><span class="cx"> }
</span><span class="cx"> #endif // ENABLE(PLUGIN_PROXY_FOR_VIDEO)
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;Widget&gt; SubframeLoader::createJavaAppletWidget(const IntSize&amp; size, HTMLAppletElement* element, const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues)
</del><ins>+PassRefPtr&lt;Widget&gt; SubframeLoader::createJavaAppletWidget(const IntSize&amp; size, HTMLAppletElement&amp; element, const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues)
</ins><span class="cx"> {
</span><span class="cx">     String baseURLString;
</span><span class="cx">     String codeBaseURLString;
</span><span class="lines">@@ -289,15 +286,15 @@
</span><span class="cx"> 
</span><span class="cx">     if (!codeBaseURLString.isEmpty()) {
</span><span class="cx">         URL codeBaseURL = completeURL(codeBaseURLString);
</span><del>-        if (!element-&gt;document().securityOrigin()-&gt;canDisplay(codeBaseURL)) {
</del><ins>+        if (!element.document().securityOrigin()-&gt;canDisplay(codeBaseURL)) {
</ins><span class="cx">             FrameLoader::reportLocalLoadFailed(&amp;m_frame, codeBaseURL.string());
</span><del>-            return 0;
</del><ins>+            return nullptr;
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         const char javaAppletMimeType[] = &quot;application/x-java-applet&quot;;
</span><del>-        if (!element-&gt;document().contentSecurityPolicy()-&gt;allowObjectFromSource(codeBaseURL)
-            || !element-&gt;document().contentSecurityPolicy()-&gt;allowPluginType(javaAppletMimeType, javaAppletMimeType, codeBaseURL))
-            return 0;
</del><ins>+        if (!element.document().contentSecurityPolicy()-&gt;allowObjectFromSource(codeBaseURL)
+            || !element.document().contentSecurityPolicy()-&gt;allowPluginType(javaAppletMimeType, javaAppletMimeType, codeBaseURL))
+            return nullptr;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (baseURLString.isEmpty())
</span><span class="lines">@@ -306,59 +303,59 @@
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;Widget&gt; widget;
</span><span class="cx">     if (allowPlugins(AboutToInstantiatePlugin))
</span><del>-        widget = m_frame.loader().client().createJavaAppletWidget(size, element, baseURL, paramNames, paramValues);
</del><ins>+        widget = m_frame.loader().client().createJavaAppletWidget(size, &amp;element, baseURL, paramNames, paramValues);
</ins><span class="cx"> 
</span><del>-    logPluginRequest(document()-&gt;page(), element-&gt;serviceType(), String(), widget);
</del><ins>+    logPluginRequest(document()-&gt;page(), element.serviceType(), String(), widget);
</ins><span class="cx"> 
</span><span class="cx">     if (!widget) {
</span><del>-        RenderEmbeddedObject* renderer = element-&gt;renderEmbeddedObject();
</del><ins>+        RenderEmbeddedObject* renderer = element.renderEmbeddedObject();
</ins><span class="cx"> 
</span><span class="cx">         if (!renderer-&gt;isPluginUnavailable())
</span><span class="cx">             renderer-&gt;setPluginUnavailabilityReason(RenderEmbeddedObject::PluginMissing);
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     m_containsPlugins = true;
</span><span class="cx">     return widget;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Frame* SubframeLoader::loadOrRedirectSubframe(HTMLFrameOwnerElement* ownerElement, const URL&amp; url, const AtomicString&amp; frameName, bool lockHistory, bool lockBackForwardList)
</del><ins>+Frame* SubframeLoader::loadOrRedirectSubframe(HTMLFrameOwnerElement&amp; ownerElement, const URL&amp; url, const AtomicString&amp; frameName, bool lockHistory, bool lockBackForwardList)
</ins><span class="cx"> {
</span><del>-    Frame* frame = ownerElement-&gt;contentFrame();
</del><ins>+    Frame* frame = ownerElement.contentFrame();
</ins><span class="cx">     if (frame)
</span><span class="cx">         frame-&gt;navigationScheduler().scheduleLocationChange(m_frame.document()-&gt;securityOrigin(), url.string(), m_frame.loader().outgoingReferrer(), lockHistory, lockBackForwardList);
</span><span class="cx">     else
</span><span class="cx">         frame = loadSubframe(ownerElement, url, frameName, m_frame.loader().outgoingReferrer());
</span><span class="cx"> 
</span><del>-    ASSERT(ownerElement-&gt;contentFrame() == frame || !ownerElement-&gt;contentFrame());
-    return ownerElement-&gt;contentFrame();
</del><ins>+    ASSERT(ownerElement.contentFrame() == frame || !ownerElement.contentFrame());
+    return ownerElement.contentFrame();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-Frame* SubframeLoader::loadSubframe(HTMLFrameOwnerElement* ownerElement, const URL&amp; url, const String&amp; name, const String&amp; referrer)
</del><ins>+Frame* SubframeLoader::loadSubframe(HTMLFrameOwnerElement&amp; ownerElement, const URL&amp; url, const String&amp; name, const String&amp; referrer)
</ins><span class="cx"> {
</span><span class="cx">     Ref&lt;Frame&gt; protect(m_frame);
</span><span class="cx"> 
</span><span class="cx">     bool allowsScrolling = true;
</span><span class="cx">     int marginWidth = -1;
</span><span class="cx">     int marginHeight = -1;
</span><del>-    if (ownerElement-&gt;hasTagName(frameTag) || ownerElement-&gt;hasTagName(iframeTag)) {
-        HTMLFrameElementBase* frameElementBase = toHTMLFrameElementBase(ownerElement);
-        allowsScrolling = frameElementBase-&gt;scrollingMode() != ScrollbarAlwaysOff;
-        marginWidth = frameElementBase-&gt;marginWidth();
-        marginHeight = frameElementBase-&gt;marginHeight();
</del><ins>+    if (ownerElement.hasTagName(frameTag) || ownerElement.hasTagName(iframeTag)) {
+        HTMLFrameElementBase&amp; frameElementBase = toHTMLFrameElementBase(ownerElement);
+        allowsScrolling = frameElementBase.scrollingMode() != ScrollbarAlwaysOff;
+        marginWidth = frameElementBase.marginWidth();
+        marginHeight = frameElementBase.marginHeight();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (!ownerElement-&gt;document().securityOrigin()-&gt;canDisplay(url)) {
</del><ins>+    if (!ownerElement.document().securityOrigin()-&gt;canDisplay(url)) {
</ins><span class="cx">         FrameLoader::reportLocalLoadFailed(&amp;m_frame, url.string());
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    String referrerToUse = SecurityPolicy::generateReferrerHeader(ownerElement-&gt;document().referrerPolicy(), url, referrer);
-    RefPtr&lt;Frame&gt; frame = m_frame.loader().client().createFrame(url, name, ownerElement, referrerToUse, allowsScrolling, marginWidth, marginHeight);
</del><ins>+    String referrerToUse = SecurityPolicy::generateReferrerHeader(ownerElement.document().referrerPolicy(), url, referrer);
+    RefPtr&lt;Frame&gt; frame = m_frame.loader().client().createFrame(url, name, &amp;ownerElement, referrerToUse, allowsScrolling, marginWidth, marginHeight);
</ins><span class="cx"> 
</span><span class="cx">     if (!frame)  {
</span><span class="cx">         m_frame.loader().checkCallImplicitClose();
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     // All new frames will have m_isComplete set to true at this point due to synchronously loading
</span><span class="lines">@@ -369,7 +366,7 @@
</span><span class="cx">     // FIXME: Can we remove this entirely? m_isComplete normally gets set to false when a load is committed.
</span><span class="cx">     frame-&gt;loader().started();
</span><span class="cx">    
</span><del>-    RenderObject* renderer = ownerElement-&gt;renderer();
</del><ins>+    RenderObject* renderer = ownerElement.renderer();
</ins><span class="cx">     FrameView* view = frame-&gt;view();
</span><span class="cx">     if (renderer &amp;&amp; renderer-&gt;isWidget() &amp;&amp; view)
</span><span class="cx">         toRenderWidget(renderer)-&gt;setWidget(view);
</span><span class="lines">@@ -423,21 +420,19 @@
</span><span class="cx">     return m_frame.document();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool SubframeLoader::loadPlugin(HTMLPlugInImageElement* pluginElement, const URL&amp; url, const String&amp; mimeType,
-    const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues, bool useFallback)
</del><ins>+bool SubframeLoader::loadPlugin(HTMLPlugInImageElement&amp; pluginElement, const URL&amp; url, const String&amp; mimeType, const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues, bool useFallback)
</ins><span class="cx"> {
</span><del>-    RenderEmbeddedObject* renderer = pluginElement-&gt;renderEmbeddedObject();
</del><ins>+    RenderEmbeddedObject* renderer = pluginElement.renderEmbeddedObject();
</ins><span class="cx"> 
</span><span class="cx">     // FIXME: This code should not depend on renderer!
</span><span class="cx">     if (!renderer || useFallback)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    pluginElement-&gt;subframeLoaderWillCreatePlugIn(url);
</del><ins>+    pluginElement.subframeLoaderWillCreatePlugIn(url);
</ins><span class="cx"> 
</span><span class="cx">     IntSize contentSize = roundedIntSize(LayoutSize(renderer-&gt;contentWidth(), renderer-&gt;contentHeight()));
</span><span class="cx">     bool loadManually = document()-&gt;isPluginDocument() &amp;&amp; !m_containsPlugins &amp;&amp; toPluginDocument(document())-&gt;shouldLoadPluginManually();
</span><del>-    RefPtr&lt;Widget&gt; widget = m_frame.loader().client().createPlugin(contentSize,
-        pluginElement, url, paramNames, paramValues, mimeType, loadManually);
</del><ins>+    RefPtr&lt;Widget&gt; widget = m_frame.loader().client().createPlugin(contentSize, &amp;pluginElement, url, paramNames, paramValues, mimeType, loadManually);
</ins><span class="cx"> 
</span><span class="cx">     if (!widget) {
</span><span class="cx">         if (!renderer-&gt;isPluginUnavailable())
</span><span class="lines">@@ -445,7 +440,7 @@
</span><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    pluginElement-&gt;subframeLoaderDidCreatePlugIn(widget.get());
</del><ins>+    pluginElement.subframeLoaderDidCreatePlugIn(widget.get());
</ins><span class="cx">     renderer-&gt;setWidget(widget);
</span><span class="cx">     m_containsPlugins = true;
</span><span class="cx">  
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderSubframeLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/SubframeLoader.h (158961 => 158962)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/SubframeLoader.h        2013-11-08 23:16:25 UTC (rev 158961)
+++ trunk/Source/WebCore/loader/SubframeLoader.h        2013-11-08 23:23:16 UTC (rev 158962)
</span><span class="lines">@@ -45,12 +45,10 @@
</span><span class="cx"> class FrameLoaderClient;
</span><span class="cx"> class HTMLAppletElement;
</span><span class="cx"> class HTMLFrameOwnerElement;
</span><ins>+class HTMLMediaElement;
</ins><span class="cx"> class HTMLPlugInImageElement;
</span><span class="cx"> class IntSize;
</span><span class="cx"> class URL;
</span><del>-#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
-class Node;
-#endif
</del><span class="cx"> class Widget;
</span><span class="cx"> 
</span><span class="cx"> // This is a slight misnomer. It handles the higher level logic of loading both subframes and plugins.
</span><span class="lines">@@ -61,17 +59,15 @@
</span><span class="cx"> 
</span><span class="cx">     void clear();
</span><span class="cx"> 
</span><del>-    bool requestFrame(HTMLFrameOwnerElement*, const String&amp; url, const AtomicString&amp; frameName, bool lockHistory = true, bool lockBackForwardList = true);    
</del><ins>+    bool requestFrame(HTMLFrameOwnerElement&amp;, const String&amp; url, const AtomicString&amp; frameName, bool lockHistory = true, bool lockBackForwardList = true);
</ins><span class="cx">     bool requestObject(HTMLPlugInImageElement&amp;, const String&amp; url, const AtomicString&amp; frameName,
</span><span class="cx">         const String&amp; serviceType, const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues);
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
</span><del>-    // FIXME: This should take Element* instead of Node*, or better yet the
-    // specific type of Element which this code depends on.
-    PassRefPtr&lt;Widget&gt; loadMediaPlayerProxyPlugin(Node*, const URL&amp;, const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues);
</del><ins>+    PassRefPtr&lt;Widget&gt; loadMediaPlayerProxyPlugin(HTMLMediaElement&amp;, const URL&amp;, const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    PassRefPtr&lt;Widget&gt; createJavaAppletWidget(const IntSize&amp;, HTMLAppletElement*, const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues);
</del><ins>+    PassRefPtr&lt;Widget&gt; createJavaAppletWidget(const IntSize&amp;, HTMLAppletElement&amp;, const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues);
</ins><span class="cx"> 
</span><span class="cx">     bool allowPlugins(ReasonForCallingAllowPlugins);
</span><span class="cx"> 
</span><span class="lines">@@ -80,14 +76,13 @@
</span><span class="cx">     bool resourceWillUsePlugin(const String&amp; url, const String&amp; mimeType, bool shouldPreferPlugInsForImages);
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    bool requestPlugin(HTMLPlugInImageElement*, const URL&amp;, const String&amp; serviceType, const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues, bool useFallback);
-    Frame* loadOrRedirectSubframe(HTMLFrameOwnerElement*, const URL&amp;, const AtomicString&amp; frameName, bool lockHistory, bool lockBackForwardList);
-    Frame* loadSubframe(HTMLFrameOwnerElement*, const URL&amp;, const String&amp; name, const String&amp; referrer);
-    bool loadPlugin(HTMLPlugInImageElement*, const URL&amp;, const String&amp; mimeType,
-        const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues, bool useFallback);
</del><ins>+    bool requestPlugin(HTMLPlugInImageElement&amp;, const URL&amp;, const String&amp; serviceType, const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues, bool useFallback);
+    Frame* loadOrRedirectSubframe(HTMLFrameOwnerElement&amp;, const URL&amp;, const AtomicString&amp; frameName, bool lockHistory, bool lockBackForwardList);
+    Frame* loadSubframe(HTMLFrameOwnerElement&amp;, const URL&amp;, const String&amp; name, const String&amp; referrer);
+    bool loadPlugin(HTMLPlugInImageElement&amp;, const URL&amp;, const String&amp; mimeType, const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues, bool useFallback);
</ins><span class="cx"> 
</span><span class="cx">     bool shouldUsePlugin(const URL&amp;, const String&amp; mimeType, bool shouldPreferPlugInsForImages, bool hasFallback, bool&amp; useFallback);
</span><del>-    bool pluginIsLoadable(HTMLPlugInImageElement*, const URL&amp;, const String&amp; mimeType);
</del><ins>+    bool pluginIsLoadable(HTMLPlugInImageElement&amp;, const URL&amp;, const String&amp; mimeType);
</ins><span class="cx"> 
</span><span class="cx">     Document* document() const;
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>