Modified: trunk/Source/WebCore/loader/SubframeLoader.cpp (156921 => 156922)
--- trunk/Source/WebCore/loader/SubframeLoader.cpp 2013-10-04 22:46:15 UTC (rev 156921)
+++ trunk/Source/WebCore/loader/SubframeLoader.cpp 2013-10-04 22:49:40 UTC (rev 156922)
@@ -64,7 +64,7 @@
using namespace HTMLNames;
-SubframeLoader::SubframeLoader(Frame* frame)
+SubframeLoader::SubframeLoader(Frame& frame)
: m_containsPlugins(false)
, m_frame(frame)
{
@@ -109,9 +109,9 @@
bool SubframeLoader::pluginIsLoadable(HTMLPlugInImageElement* pluginElement, const URL& url, const String& mimeType)
{
if (MIMETypeRegistry::isJavaAppletMIMEType(mimeType)) {
- if (!m_frame->settings().isJavaEnabled())
+ if (!m_frame.settings().isJavaEnabled())
return false;
- if (document() && document()->securityOrigin()->isLocal() && !m_frame->settings().isJavaEnabledForLocalFiles())
+ if (document() && document()->securityOrigin()->isLocal() && !m_frame.settings().isJavaEnabledForLocalFiles())
return false;
}
@@ -120,7 +120,7 @@
return false;
if (!document()->securityOrigin()->canDisplay(url)) {
- FrameLoader::reportLocalLoadFailed(m_frame, url.string());
+ FrameLoader::reportLocalLoadFailed(&m_frame, url.string());
return false;
}
@@ -134,7 +134,7 @@
return false;
}
- if (!m_frame->loader().mixedContentChecker().canRunInsecureContent(document()->securityOrigin(), url))
+ if (!m_frame.loader().mixedContentChecker().canRunInsecureContent(document()->securityOrigin(), url))
return false;
}
@@ -246,12 +246,12 @@
if (!url.isEmpty())
completedURL = completeURL(url);
- if (!m_frame->document()->securityOrigin()->canDisplay(completedURL)) {
+ if (!m_frame.document()->securityOrigin()->canDisplay(completedURL)) {
FrameLoader::reportLocalLoadFailed(m_frame, completedURL.string());
return 0;
}
- if (!m_frame->document()->contentSecurityPolicy()->allowMediaFromSource(completedURL))
+ if (!m_frame.document()->contentSecurityPolicy()->allowMediaFromSource(completedURL))
return 0;
HTMLMediaElement* mediaElement = toHTMLMediaElement(node);
@@ -263,10 +263,10 @@
else if (mediaElement->isVideo())
size = RenderVideo::defaultSize();
- if (!m_frame->loader().mixedContentChecker().canRunInsecureContent(m_frame->document()->securityOrigin(), completedURL))
+ if (!m_frame.loader().mixedContentChecker().canRunInsecureContent(m_frame.document()->securityOrigin(), completedURL))
return 0;
- RefPtr<Widget> widget = m_frame->loader().client().createMediaPlayerProxyPlugin(size, mediaElement, completedURL,
+ RefPtr<Widget> widget = m_frame.loader().client().createMediaPlayerProxyPlugin(size, mediaElement, completedURL,
paramNames, paramValues, "application/x-media-element-proxy-plugin");
if (widget && renderer) {
@@ -294,7 +294,7 @@
if (!codeBaseURLString.isEmpty()) {
URL codeBaseURL = completeURL(codeBaseURLString);
if (!element->document().securityOrigin()->canDisplay(codeBaseURL)) {
- FrameLoader::reportLocalLoadFailed(m_frame, codeBaseURL.string());
+ FrameLoader::reportLocalLoadFailed(&m_frame, codeBaseURL.string());
return 0;
}
@@ -305,12 +305,12 @@
}
if (baseURLString.isEmpty())
- baseURLString = m_frame->document()->baseURL().string();
+ baseURLString = m_frame.document()->baseURL().string();
URL baseURL = completeURL(baseURLString);
RefPtr<Widget> widget;
if (allowPlugins(AboutToInstantiatePlugin))
- widget = m_frame->loader().client().createJavaAppletWidget(size, element, baseURL, paramNames, paramValues);
+ widget = m_frame.loader().client().createJavaAppletWidget(size, element, baseURL, paramNames, paramValues);
logPluginRequest(document()->page(), element->serviceType(), String(), widget);
@@ -330,9 +330,9 @@
{
Frame* frame = ownerElement->contentFrame();
if (frame)
- frame->navigationScheduler().scheduleLocationChange(m_frame->document()->securityOrigin(), url.string(), m_frame->loader().outgoingReferrer(), lockHistory, lockBackForwardList);
+ frame->navigationScheduler().scheduleLocationChange(m_frame.document()->securityOrigin(), url.string(), m_frame.loader().outgoingReferrer(), lockHistory, lockBackForwardList);
else
- frame = loadSubframe(ownerElement, url, frameName, m_frame->loader().outgoingReferrer());
+ frame = loadSubframe(ownerElement, url, frameName, m_frame.loader().outgoingReferrer());
ASSERT(ownerElement->contentFrame() == frame || !ownerElement->contentFrame());
return ownerElement->contentFrame();
@@ -340,7 +340,7 @@
Frame* SubframeLoader::loadSubframe(HTMLFrameOwnerElement* ownerElement, const URL& url, const String& name, const String& referrer)
{
- RefPtr<Frame> protect(m_frame);
+ Ref<Frame> protect(m_frame);
bool allowsScrolling = true;
int marginWidth = -1;
@@ -353,15 +353,15 @@
}
if (!ownerElement->document().securityOrigin()->canDisplay(url)) {
- FrameLoader::reportLocalLoadFailed(m_frame, url.string());
+ FrameLoader::reportLocalLoadFailed(&m_frame, url.string());
return 0;
}
String referrerToUse = SecurityPolicy::generateReferrerHeader(ownerElement->document().referrerPolicy(), url, referrer);
- RefPtr<Frame> frame = m_frame->loader().client().createFrame(url, name, ownerElement, referrerToUse, allowsScrolling, marginWidth, marginHeight);
+ RefPtr<Frame> frame = m_frame.loader().client().createFrame(url, name, ownerElement, referrerToUse, allowsScrolling, marginWidth, marginHeight);
if (!frame) {
- m_frame->loader().checkCallImplicitClose();
+ m_frame.loader().checkCallImplicitClose();
return 0;
}
@@ -378,7 +378,7 @@
if (renderer && renderer->isWidget() && view)
toRenderWidget(renderer)->setWidget(view);
- m_frame->loader().checkCallImplicitClose();
+ m_frame.loader().checkCallImplicitClose();
// Some loads are performed synchronously (e.g., about:blank and loads
// cancelled by returning a null ResourceRequest from requestFromDelegate).
@@ -397,28 +397,28 @@
bool SubframeLoader::allowPlugins(ReasonForCallingAllowPlugins reason)
{
- bool allowed = m_frame->loader().client().allowPlugins(m_frame->settings().arePluginsEnabled());
+ bool allowed = m_frame.loader().client().allowPlugins(m_frame.settings().arePluginsEnabled());
if (!allowed && reason == AboutToInstantiatePlugin)
- m_frame->loader().client().didNotAllowPlugins();
+ m_frame.loader().client().didNotAllowPlugins();
return allowed;
}
bool SubframeLoader::shouldUsePlugin(const URL& url, const String& mimeType, bool shouldPreferPlugInsForImages, bool hasFallback, bool& useFallback)
{
- if (m_frame->loader().client().shouldAlwaysUsePluginDocument(mimeType)) {
+ if (m_frame.loader().client().shouldAlwaysUsePluginDocument(mimeType)) {
useFallback = false;
return true;
}
// Allow other plug-ins to win over QuickTime because if the user has installed a plug-in that
// can handle TIFF (which QuickTime can also handle) they probably intended to override QT.
- if (m_frame->page() && (mimeType == "image/tiff" || mimeType == "image/tif" || mimeType == "image/x-tiff")) {
- String pluginName = m_frame->page()->pluginData().pluginNameForMimeType(mimeType);
+ if (m_frame.page() && (mimeType == "image/tiff" || mimeType == "image/tif" || mimeType == "image/x-tiff")) {
+ String pluginName = m_frame.page()->pluginData().pluginNameForMimeType(mimeType);
if (!pluginName.isEmpty() && !pluginName.contains("QuickTime", false))
return true;
}
- ObjectContentType objectType = m_frame->loader().client().objectContentType(url, mimeType, shouldPreferPlugInsForImages);
+ ObjectContentType objectType = m_frame.loader().client().objectContentType(url, mimeType, shouldPreferPlugInsForImages);
// If an object's content can't be handled and it has no fallback, let
// it be handled as a plugin to show the broken plugin icon.
useFallback = objectType == ObjectContentNone && hasFallback;
@@ -427,7 +427,7 @@
Document* SubframeLoader::document() const
{
- return m_frame->document();
+ return m_frame.document();
}
bool SubframeLoader::loadPlugin(HTMLPlugInImageElement* pluginElement, const URL& url, const String& mimeType,
@@ -443,7 +443,7 @@
IntSize contentSize = roundedIntSize(LayoutSize(renderer->contentWidth(), renderer->contentHeight()));
bool loadManually = document()->isPluginDocument() && !m_containsPlugins && toPluginDocument(document())->shouldLoadPluginManually();
- RefPtr<Widget> widget = m_frame->loader().client().createPlugin(contentSize,
+ RefPtr<Widget> widget = m_frame.loader().client().createPlugin(contentSize,
pluginElement, url, paramNames, paramValues, mimeType, loadManually);
if (!widget) {
@@ -464,8 +464,8 @@
URL SubframeLoader::completeURL(const String& url) const
{
- ASSERT(m_frame->document());
- return m_frame->document()->completeURL(url);
+ ASSERT(m_frame.document());
+ return m_frame.document()->completeURL(url);
}
} // namespace WebCore