Commit 7f50aae5 authored by akling@apple.com's avatar akling@apple.com

FrameLoader: frame() and client() should return references.

<https://webkit.org/b/120158>

Reviewed by Anders Carlsson.

These two are never null so change them to return references.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154449 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 88bb5399
2013-08-22 Andreas Kling <akling@apple.com>
FrameLoader: frame() and client() should return references.
<https://webkit.org/b/120158>
Reviewed by Anders Carlsson.
These two are never null so change them to return references.
2013-08-22 Andrei Bucur <abucur@adobe.com>
RenderNamedFlowThread should not create NodeRenderingContext objects
......@@ -152,7 +152,7 @@ RTCPeerConnection::RTCPeerConnection(ScriptExecutionContext* context, PassRefPtr
return;
}
document->frame()->loader()->client()->dispatchWillStartUsingPeerConnectionHandler(m_peerHandler.get());
document->frame()->loader()->client().dispatchWillStartUsingPeerConnectionHandler(m_peerHandler.get());
if (!m_peerHandler->initialize(configuration, constraints)) {
ec = NOT_SUPPORTED_ERR;
......
......@@ -248,7 +248,7 @@ void WebSocketChannel::willOpenSocketStream(SocketStreamHandle* handle)
LOG(Network, "WebSocketChannel %p willOpenSocketStream()", this);
ASSERT(handle);
if (m_document->frame())
m_document->frame()->loader().client()->dispatchWillOpenSocketStream(handle);
m_document->frame()->loader().client().dispatchWillOpenSocketStream(handle);
}
void WebSocketChannel::didOpenSocketStream(SocketStreamHandle* handle)
......
......@@ -1468,7 +1468,7 @@ static id textMarkerRangeFromVisiblePositions(AXObjectCache *cache, VisiblePosit
if (!frame)
return nil;
return frame->loader().client()->accessibilityRemoteObject();
return frame->loader().client().accessibilityRemoteObject();
}
static void convertToVector(NSArray* array, AccessibilityObject::AccessibilityChildrenVector& vector)
......
......@@ -51,9 +51,9 @@ bool ScriptController::canExecuteScripts(ReasonForCallingCanExecuteScripts reaso
return true;
}
const bool allowed = m_frame->loader().client()->allowScript(m_frame->settings().isScriptEnabled());
const bool allowed = m_frame->loader().client().allowScript(m_frame->settings().isScriptEnabled());
if (!allowed && reason == AboutToExecuteScript)
m_frame->loader().client()->didNotAllowScript();
m_frame->loader().client().didNotAllowScript();
return allowed;
}
......
......@@ -375,7 +375,7 @@ PassRefPtr<Document> DOMImplementation::createDocument(const String& type, Frame
// Everything else except text/plain can be overridden by plugins. In particular, Adobe SVG Viewer should be used for SVG, if installed.
// Disallowing plug-ins to use text/plain prevents plug-ins from hijacking a fundamental type that the browser is expected to handle,
// and also serves as an optimization to prevent loading the plug-in database in the common case.
if (type != "text/plain" && ((pluginData && pluginData->supportsMimeType(type, allowedPluginTypes)) || (frame && frame->loader().client()->shouldAlwaysUsePluginDocument(type))))
if (type != "text/plain" && ((pluginData && pluginData->supportsMimeType(type, allowedPluginTypes)) || (frame && frame->loader().client().shouldAlwaysUsePluginDocument(type))))
return PluginDocument::create(frame, url);
if (isTextMIMEType(type))
return TextDocument::create(frame, url);
......
......@@ -4024,7 +4024,7 @@ void Document::documentDidResumeFromPageCache()
frameView->setAnimatorsAreActive();
ASSERT(m_frame);
m_frame->loader().client()->dispatchDidBecomeFrameset(isFrameSet());
m_frame->loader().client().dispatchDidBecomeFrameset(isFrameSet());
}
void Document::registerForPageCacheSuspensionCallbacks(Element* e)
......@@ -4532,7 +4532,7 @@ void Document::initSecurityContext()
// harnesses for web sites.
securityOrigin()->grantUniversalAccess();
} else if (securityOrigin()->isLocal()) {
if (settings->allowUniversalAccessFromFileURLs() || m_frame->loader().client()->shouldForceUniversalAccessFromLocalURL(m_url)) {
if (settings->allowUniversalAccessFromFileURLs() || m_frame->loader().client().shouldForceUniversalAccessFromLocalURL(m_url)) {
// Some clients want local URLs to have universal access, but that setting is dangerous for other clients.
securityOrigin()->grantUniversalAccess();
} else if (!settings->allowFileAccessFromFileURLs()) {
......
......@@ -123,7 +123,7 @@ void CachedFrameBase::restore()
frame.view()->restoreBackingStores();
#endif
frame.loader().client()->didRestoreFromPageCache();
frame.loader().client().didRestoreFromPageCache();
// Reconstruct the FrameTree
for (unsigned i = 0; i < m_childFrames.size(); ++i)
......@@ -183,7 +183,7 @@ CachedFrame::CachedFrame(Frame* frame)
m_document->domWindow()->suspendForPageCache();
frame->loader().client()->savePlatformDataToCachedFrame(this);
frame->loader().client().savePlatformDataToCachedFrame(this);
#if USE(ACCELERATED_COMPOSITING)
if (m_isComposited && pageCache()->shouldClearBackingStores())
......@@ -203,7 +203,7 @@ CachedFrame::CachedFrame(Frame* frame)
if (!m_isMainFrame)
frame->page()->decrementSubframeCount();
frame->loader().client()->didSaveToPageCache();
frame->loader().client().didSaveToPageCache();
#ifndef NDEBUG
if (m_isMainFrame)
......
......@@ -160,7 +160,7 @@ static unsigned logCanCacheFrameDecision(Frame* frame, int indentLevel)
PCLOG(" -The DocumentLoader uses an application cache");
rejectReasons |= 1 << DocumentLoaderUsesApplicationCache;
}
if (!frame->loader().client()->canCachePage()) {
if (!frame->loader().client().canCachePage()) {
PCLOG(" -The client says this frame cannot be cached");
rejectReasons |= 1 << ClientDeniesCaching;
}
......@@ -333,7 +333,7 @@ bool PageCache::canCachePageContainingThisFrame(Frame* frame)
// FIXME: We should investigating caching frames that have an associated
// application cache. <rdar://problem/5917899> tracks that work.
&& documentLoader->applicationCacheHost()->canCacheInPageCache()
&& frameLoader.client()->canCachePage();
&& frameLoader.client().canCachePage();
}
bool PageCache::canCache(Page* page) const
......
......@@ -545,7 +545,7 @@ void HTMLAnchorElement::handleClick(Event* event)
frame->loader().addExtraFieldsToMainResourceRequest(request);
}
frame->loader().client()->startDownload(request, fastGetAttribute(downloadAttr));
frame->loader().client().startDownload(request, fastGetAttribute(downloadAttr));
} else
#endif
frame->loader().urlSelected(kurl, target(), event, false, false, hasRel(RelationNoReferrer) ? NeverSendReferrer : MaybeSendReferrer);
......
......@@ -269,7 +269,7 @@ bool HTMLFormElement::prepareForSubmission(Event* event)
StringPairVector controlNamesAndValues;
getTextFieldValues(controlNamesAndValues);
RefPtr<FormState> formState = FormState::create(this, controlNamesAndValues, document(), NotSubmittedByJavaScript);
frame->loader().client()->dispatchWillSendSubmitEvent(formState.release());
frame->loader().client().dispatchWillSendSubmitEvent(formState.release());
if (dispatchEvent(Event::create(eventNames().submitEvent, true, true)))
m_shouldSubmit = true;
......
......@@ -216,7 +216,7 @@ Node::InsertionNotificationRequest HTMLFrameSetElement::insertedInto(ContainerNo
HTMLElement::insertedInto(insertionPoint);
if (insertionPoint->inDocument()) {
if (Frame* frame = document()->frame())
frame->loader().client()->dispatchDidBecomeFrameset(document()->isFrameSet());
frame->loader().client().dispatchDidBecomeFrameset(document()->isFrameSet());
}
return InsertionDone;
......@@ -227,7 +227,7 @@ void HTMLFrameSetElement::removedFrom(ContainerNode* insertionPoint)
HTMLElement::removedFrom(insertionPoint);
if (insertionPoint->inDocument()) {
if (Frame* frame = document()->frame())
frame->loader().client()->dispatchDidBecomeFrameset(document()->isFrameSet());
frame->loader().client().dispatchDidBecomeFrameset(document()->isFrameSet());
}
}
......
......@@ -567,7 +567,7 @@ RenderObject* HTMLMediaElement::createRenderer(RenderArena* arena, RenderStyle*)
mediaRenderer->setWidget(m_proxyWidget);
if (Frame* frame = document()->frame())
frame->loader().client()->showMediaPlayerProxyPlugin(m_proxyWidget.get());
frame->loader().client().showMediaPlayerProxyPlugin(m_proxyWidget.get());
}
return mediaRenderer;
#else
......@@ -648,7 +648,7 @@ void HTMLMediaElement::didAttachRenderers()
#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
else if (m_proxyWidget) {
if (Frame* frame = document()->frame())
frame->loader().client()->hideMediaPlayerProxyPlugin(m_proxyWidget.get());
frame->loader().client().hideMediaPlayerProxyPlugin(m_proxyWidget.get());
}
#endif
}
......
......@@ -158,7 +158,7 @@ bool HTMLPlugInImageElement::isImageType()
if (Frame* frame = document()->frame()) {
KURL completedURL = document()->completeURL(m_url);
return frame->loader().client()->objectContentType(completedURL, m_serviceType, shouldPreferPlugInsForImages()) == ObjectContentImage;
return frame->loader().client().objectContentType(completedURL, m_serviceType, shouldPreferPlugInsForImages()) == ObjectContentImage;
}
return Image::supportsType(m_serviceType);
......@@ -188,7 +188,7 @@ bool HTMLPlugInImageElement::wouldLoadAsNetscapePlugin(const String& url, const
completedURL = document()->completeURL(url);
FrameLoader& frameLoader = document()->frame()->loader();
if (frameLoader.client()->objectContentType(completedURL, serviceType, shouldPreferPlugInsForImages()) == ObjectContentNetscapePlugin)
if (frameLoader.client().objectContentType(completedURL, serviceType, shouldPreferPlugInsForImages()) == ObjectContentNetscapePlugin)
return true;
return false;
}
......
......@@ -130,7 +130,7 @@ static float pageZoomFactor(const Document* document)
void ImageDocumentParser::appendBytes(DocumentWriter*, const char*, size_t)
{
Frame* frame = document()->frame();
if (!frame->loader().client()->allowImage(frame->settings().areImagesEnabled(), document()->url()))
if (!frame->loader().client().allowImage(frame->settings().areImagesEnabled(), document()->url()))
return;
CachedImage* cachedImage = document()->cachedImage();
......
......@@ -122,7 +122,7 @@ void PluginDocumentParser::appendBytes(DocumentWriter*, const char*, size_t)
if (RenderPart* renderer = m_embedElement->renderPart()) {
if (Widget* widget = renderer->widget()) {
frame->loader().client()->redirectDataToPlugin(widget);
frame->loader().client().redirectDataToPlugin(widget);
// In a plugin document, the main resource is the plugin. If we have a null widget, that means
// the loading of the plugin was cancelled, which gives us a null mainResourceLoader(), so we
// need to have this call in a null check of the widget or of mainResourceLoader().
......@@ -162,7 +162,7 @@ void PluginDocument::detach()
{
// Release the plugin Element so that we don't have a circular reference.
m_pluginElement = 0;
frame()->loader().client()->redirectDataToPlugin(0);
frame()->loader().client().redirectDataToPlugin(0);
Document::detach();
}
......
......@@ -414,7 +414,7 @@ PassOwnPtr<WebGLRenderingContext> WebGLRenderingContext::create(HTMLCanvasElemen
// The FrameLoaderClient might creation of a new WebGL context despite the page settings; in
// particular, if WebGL contexts were lost one or more times via the GL_ARB_robustness extension.
if (!frame->loader().client()->allowWebGL(frame->settings().webGLEnabled())) {
if (!frame->loader().client().allowWebGL(frame->settings().webGLEnabled())) {
canvas->dispatchEvent(WebGLContextEvent::create(eventNames().webglcontextcreationerrorEvent, false, true, "Web page was not allowed to create a WebGL context."));
return nullptr;
}
......@@ -4600,7 +4600,7 @@ void WebGLRenderingContext::loseContextImpl(WebGLRenderingContext::LostContextMo
// decide to take action such as asking the user for permission to use WebGL again.
if (Document* document = canvas()->document()) {
if (Frame* frame = document->frame())
frame->loader().client()->didLoseWebGLContext(m_context->getExtensions()->getGraphicsResetStatusARB());
frame->loader().client().didLoseWebGLContext(m_context->getExtensions()->getGraphicsResetStatusARB());
}
}
......@@ -5819,7 +5819,7 @@ void WebGLRenderingContext::maybeRestoreContext(Timer<WebGLRenderingContext>*)
if (!frame)
return;
if (!frame->loader().client()->allowWebGL(frame->settings().webGLEnabled()))
if (!frame->loader().client().allowWebGL(frame->settings().webGLEnabled()))
return;
FrameView* view = frame->view();
......
......@@ -411,7 +411,7 @@ void HTMLConstructionSite::insertHTMLBodyElement(AtomicHTMLToken* token)
attachLater(currentNode(), body);
m_openElements.pushHTMLBodyElement(HTMLStackItem::create(body.release(), token));
if (Frame* frame = m_document->frame())
frame->loader().client()->dispatchWillInsertBody();
frame->loader().client().dispatchWillInsertBody();
}
void HTMLConstructionSite::insertHTMLFormElement(AtomicHTMLToken* token, bool isDemoted)
......
......@@ -106,7 +106,7 @@ void XSSAuditorDelegate::didBlockScript(const XSSInfo& xssInfo)
if (!m_didSendNotifications) {
m_didSendNotifications = true;
frameLoader.client()->didDetectXSS(m_document->url(), xssInfo.m_didBlockEntirePage);
frameLoader.client().didDetectXSS(m_document->url(), xssInfo.m_didBlockEntirePage);
if (!m_reportURL.isEmpty())
PingLoader::sendViolationReport(m_document->frame(), m_reportURL, generateViolationReport());
......
......@@ -215,7 +215,7 @@ void DocumentLoader::setRequest(const ResourceRequest& req)
void DocumentLoader::setMainDocumentError(const ResourceError& error)
{
m_mainDocumentError = error;
frameLoader()->client()->setMainDocumentError(this, error);
frameLoader()->client().setMainDocumentError(this, error);
}
void DocumentLoader::mainReceivedError(const ResourceError& error)
......@@ -224,7 +224,7 @@ void DocumentLoader::mainReceivedError(const ResourceError& error)
if (m_identifierForLoadWithoutResourceLoader) {
ASSERT(!mainResourceLoader());
frameLoader()->client()->dispatchDidFailLoading(this, m_identifierForLoadWithoutResourceLoader, error);
frameLoader()->client().dispatchDidFailLoading(this, m_identifierForLoadWithoutResourceLoader, error);
}
// There is a bug in CFNetwork where callbacks can be dispatched even when loads are deferred.
......@@ -401,7 +401,7 @@ void DocumentLoader::finishedLoading(double finishTime)
// DocumentWriter::begin() gets called and creates the Document.
if (!m_gotFirstByte)
commitData(0, 0);
frameLoader()->client()->finishedLoading(this);
frameLoader()->client().finishedLoading(this);
}
m_writer.end();
......@@ -665,7 +665,7 @@ void DocumentLoader::continueAfterContentPolicy(PolicyAction policy)
#endif
|| equalIgnoringCase("multipart/related", mimeType))
&& !m_substituteData.isValid() && !SchemeRegistry::shouldTreatURLSchemeAsLocal(url.protocol());
if (!frameLoader()->client()->canShowMIMEType(mimeType) || isRemoteWebArchive) {
if (!frameLoader()->client().canShowMIMEType(mimeType) || isRemoteWebArchive) {
frameLoader()->policyChecker()->cannotShowMIMEType(m_response);
// Check reachedTerminalState since the load may have already been canceled inside of _handleUnimplementablePolicyWithErrorCode::.
stopLoadingForPolicyChange();
......@@ -677,7 +677,7 @@ void DocumentLoader::continueAfterContentPolicy(PolicyAction policy)
case PolicyDownload: {
// m_mainResource can be null, e.g. when loading a substitute resource from application cache.
if (!m_mainResource) {
mainReceivedError(frameLoader()->client()->cannotShowURLError(m_request));
mainReceivedError(frameLoader()->client().cannotShowURLError(m_request));
return;
}
......@@ -687,7 +687,7 @@ void DocumentLoader::continueAfterContentPolicy(PolicyAction policy)
// When starting the request, we didn't know that it would result in download and not navigation. Now we know that main document URL didn't change.
// Download may use this knowledge for purposes unrelated to cookies, notably for setting file quarantine data.
frameLoader()->setOriginalURLForDownloadRequest(m_request);
frameLoader()->client()->convertMainResourceLoadToDownload(this, m_request, m_response);
frameLoader()->client().convertMainResourceLoadToDownload(this, m_request, m_response);
// It might have gone missing
if (mainResourceLoader())
......@@ -741,12 +741,12 @@ void DocumentLoader::commitLoad(const char* data, int length)
if (ArchiveFactory::isArchiveMimeType(response().mimeType()))
return;
#endif
frameLoader->client()->committedLoad(this, data, length);
frameLoader->client().committedLoad(this, data, length);
}
ResourceError DocumentLoader::interruptedForPolicyChangeError() const
{
return frameLoader()->client()->interruptedForPolicyChangeError(request());
return frameLoader()->client().interruptedForPolicyChangeError(request());
}
void DocumentLoader::stopLoadingForPolicyChange()
......@@ -1338,12 +1338,12 @@ bool DocumentLoader::isMultipartReplacingLoad() const
bool DocumentLoader::maybeLoadEmpty()
{
bool shouldLoadEmpty = !m_substituteData.isValid() && (m_request.url().isEmpty() || SchemeRegistry::shouldLoadURLSchemeAsEmptyDocument(m_request.url().protocol()));
if (!shouldLoadEmpty && !frameLoader()->client()->representationExistsForURLScheme(m_request.url().protocol()))
if (!shouldLoadEmpty && !frameLoader()->client().representationExistsForURLScheme(m_request.url().protocol()))
return false;
if (m_request.url().isEmpty() && !frameLoader()->stateMachine()->creatingInitialEmptyDocument())
m_request.setURL(blankURL());
String mimeType = shouldLoadEmpty ? "text/html" : frameLoader()->client()->generatedMIMETypeForURLScheme(m_request.url().protocol());
String mimeType = shouldLoadEmpty ? "text/html" : frameLoader()->client().generatedMIMETypeForURLScheme(m_request.url().protocol());
m_response = ResourceResponse(m_request.url(), mimeType, 0, String(), String());
finishedLoading(monotonicallyIncreasingTime());
return true;
......
......@@ -104,9 +104,9 @@ void DocumentWriter::begin()
PassRefPtr<Document> DocumentWriter::createDocument(const KURL& url)
{
if (!m_frame->loader().stateMachine()->isDisplayingInitialEmptyDocument() && m_frame->loader().client()->shouldAlwaysUsePluginDocument(m_mimeType))
if (!m_frame->loader().stateMachine()->isDisplayingInitialEmptyDocument() && m_frame->loader().client().shouldAlwaysUsePluginDocument(m_mimeType))
return PluginDocument::create(m_frame, url);
if (!m_frame->loader().client()->hasHTMLView())
if (!m_frame->loader().client().hasHTMLView())
return PlaceholderDocument::create(m_frame, url);
return DOMImplementation::createDocument(m_mimeType, m_frame, url, m_frame->inViewSourceMode());
}
......@@ -160,7 +160,7 @@ void DocumentWriter::begin(const KURL& urlReference, bool dispatch, Document* ow
// document.open).
m_parser = document->parser();
if (m_frame->view() && m_frame->loader().client()->hasHTMLView())
if (m_frame->view() && m_frame->loader().client().hasHTMLView())
m_frame->view()->setContentsSize(IntSize());
m_state = StartedWritingState;
......
This diff is collapsed.
......@@ -84,12 +84,12 @@ bool isBackForwardLoadType(FrameLoadType);
class FrameLoader {
WTF_MAKE_NONCOPYABLE(FrameLoader);
public:
FrameLoader(Frame*, FrameLoaderClient*);
FrameLoader(Frame&, FrameLoaderClient&);
~FrameLoader();
void init();
Frame* frame() const { return m_frame; }
Frame& frame() const { return m_frame; }
PolicyChecker* policyChecker() const { return m_policyChecker.get(); }
HistoryController* history() const { return m_history.get(); }
......@@ -195,7 +195,7 @@ public:
static void addHTTPOriginIfNeeded(ResourceRequest&, const String& origin);
FrameLoaderClient* client() const { return m_client; }
FrameLoaderClient& client() const { return m_client; }
void setDefersLoading(bool);
......@@ -379,8 +379,8 @@ private:
void dispatchGlobalObjectAvailableInAllWorlds();
Frame* m_frame;
FrameLoaderClient* m_client;
Frame& m_frame;
FrameLoaderClient& m_client;
// FIXME: These should be OwnPtr<T> to reduce build times and simplify
// header dependencies unless performance testing proves otherwise.
......
......@@ -85,7 +85,7 @@ void HistoryController::saveScrollPositionAndViewStateToItem(HistoryItem* item)
item->setPageScaleFactor(page->pageScaleFactor());
// FIXME: It would be great to work out a way to put this code in WebCore instead of calling through to the client.
m_frame->loader().client()->saveViewStateToItem(item);
m_frame->loader().client().saveViewStateToItem(item);
}
void HistoryController::clearScrollPositionAndViewState()
......@@ -125,7 +125,7 @@ void HistoryController::restoreScrollPositionAndViewState()
// FIXME: It would be great to work out a way to put this code in WebCore instead of calling
// through to the client. It's currently used only for the PDF view on Mac.
m_frame->loader().client()->restoreViewState();
m_frame->loader().client().restoreViewState();
// FIXME: There is some scrolling related work that needs to happen whenever a page goes into the
// page cache and similar work that needs to occur when it comes out. This is where we do the work
......@@ -250,7 +250,7 @@ bool HistoryController::shouldStopLoadingForHistoryItem(HistoryItem* targetItem)
if (m_currentItem->shouldDoSameDocumentNavigationTo(targetItem))
return false;
return m_frame->loader().client()->shouldStopLoadingForHistoryItem(targetItem);
return m_frame->loader().client().shouldStopLoadingForHistoryItem(targetItem);
}
// Main funnel for navigating to a previous location (back/forward, non-search snap-back)
......@@ -266,7 +266,7 @@ void HistoryController::goToItem(HistoryItem* targetItem, FrameLoadType type)
Page* page = m_frame->page();
if (!page)
return;
if (!m_frame->loader().client()->shouldGoToHistoryItem(targetItem))
if (!m_frame->loader().client().shouldGoToHistoryItem(targetItem))
return;
if (m_defersLoading) {
m_deferredItem = targetItem;
......@@ -279,7 +279,7 @@ void HistoryController::goToItem(HistoryItem* targetItem, FrameLoadType type)
// as opposed to happening for some/one of the page commits that might happen soon
RefPtr<HistoryItem> currentItem = page->backForward()->currentItem();
page->backForward()->setCurrentItem(targetItem);
m_frame->loader().client()->updateGlobalHistoryItemForPage();
m_frame->loader().client().updateGlobalHistoryItemForPage();
// First set the provisional item of any frames that are not actually navigating.
// This must be done before trying to navigate the desired frame, because some
......@@ -354,13 +354,13 @@ void HistoryController::updateForStandardLoad(HistoryUpdateType updateType)
if (updateType != UpdateAllExceptBackForwardList)
updateBackForwardListClippedAtTarget(true);
if (!needPrivacy) {
frameLoader.client()->updateGlobalHistory();
frameLoader.client().updateGlobalHistory();
frameLoader.documentLoader()->setDidCreateGlobalHistoryEntry(true);
if (frameLoader.documentLoader()->unreachableURL().isEmpty())
frameLoader.client()->updateGlobalHistoryRedirectLinks();
frameLoader.client().updateGlobalHistoryRedirectLinks();
}
m_frame->loader().client()->updateGlobalHistoryItemForPage();
m_frame->loader().client().updateGlobalHistoryItemForPage();
}
} else {
// The client redirect replaces the current history item.
......@@ -372,7 +372,7 @@ void HistoryController::updateForStandardLoad(HistoryUpdateType updateType)
addVisitedLink(page, historyURL);
if (!frameLoader.documentLoader()->didCreateGlobalHistoryEntry() && frameLoader.documentLoader()->unreachableURL().isEmpty() && !m_frame->document()->url().isEmpty())
frameLoader.client()->updateGlobalHistoryRedirectLinks();
frameLoader.client().updateGlobalHistoryRedirectLinks();
}
}
......@@ -391,13 +391,13 @@ void HistoryController::updateForRedirectWithLockedBackForwardList()
if (!historyURL.isEmpty()) {
updateBackForwardListClippedAtTarget(true);
if (!needPrivacy) {
m_frame->loader().client()->updateGlobalHistory();
m_frame->loader().client().updateGlobalHistory();
m_frame->loader().documentLoader()->setDidCreateGlobalHistoryEntry(true);
if (m_frame->loader().documentLoader()->unreachableURL().isEmpty())
m_frame->loader().client()->updateGlobalHistoryRedirectLinks();
m_frame->loader().client().updateGlobalHistoryRedirectLinks();
}
m_frame->loader().client()->updateGlobalHistoryItemForPage();
m_frame->loader().client().updateGlobalHistoryItemForPage();
}
}
// The client redirect replaces the current history item.
......@@ -413,7 +413,7 @@ void HistoryController::updateForRedirectWithLockedBackForwardList()
addVisitedLink(page, historyURL);
if (!m_frame->loader().documentLoader()->didCreateGlobalHistoryEntry() && m_frame->loader().documentLoader()->unreachableURL().isEmpty() && !m_frame->document()->url().isEmpty())
m_frame->loader().client()->updateGlobalHistoryRedirectLinks();
m_frame->loader().client().updateGlobalHistoryRedirectLinks();
}
}
......@@ -535,7 +535,7 @@ void HistoryController::updateForSameDocumentNavigation()
if (m_currentItem) {
m_currentItem->setURL(m_frame->document()->url());
m_frame->loader().client()->updateGlobalHistory();
m_frame->loader().client().updateGlobalHistory();
}
}
......@@ -855,7 +855,7 @@ void HistoryController::pushState(PassRefPtr<SerializedScriptValue> stateObject,
return;
addVisitedLink(page, KURL(ParsedURLString, urlString));
m_frame->loader().client()->updateGlobalHistory();
m_frame->loader().client().updateGlobalHistory();
}
......@@ -876,7 +876,7 @@ void HistoryController::replaceState(PassRefPtr<SerializedScriptValue> stateObje
ASSERT(m_frame->page());
addVisitedLink(m_frame->page(), KURL(ParsedURLString, urlString));
m_frame->loader().client()->updateGlobalHistory();
m_frame->loader().client().updateGlobalHistory();
}
} // namespace WebCore
......@@ -48,7 +48,7 @@ MixedContentChecker::MixedContentChecker(Frame* frame)
{
}
FrameLoaderClient* MixedContentChecker::client() const
FrameLoaderClient& MixedContentChecker::client() const
{
return m_frame->loader().client();
}
......@@ -68,11 +68,11 @@ bool MixedContentChecker::canDisplayInsecureContent(SecurityOrigin* securityOrig
if (!isMixedContent(securityOrigin, url))
return true;
bool allowed = client()->allowDisplayingInsecureContent(m_frame->settings().allowDisplayOfInsecureContent(), securityOrigin, url);
bool allowed = client().allowDisplayingInsecureContent(m_frame->settings().allowDisplayOfInsecureContent(), securityOrigin, url);
logWarning(allowed, "displayed", url);
if (allowed)
client()->didDisplayInsecureContent();
client().didDisplayInsecureContent();
return allowed;
}
......@@ -82,11 +82,11 @@ bool MixedContentChecker::canRunInsecureContent(SecurityOrigin* securityOrigin,
if (!isMixedContent(securityOrigin, url))
return true;
bool allowed = client()->allowRunningInsecureContent(m_frame->settings().allowRunningOfInsecureContent(), securityOrigin, url);
bool allowed = client().allowRunningInsecureContent(m_frame->settings().allowRunningOfInsecureContent(), securityOrigin, url);
logWarning(allowed, "ran", url);
if (allowed)
client()->didRunInsecureContent(securityOrigin, url);
client().didRunInsecureContent(securityOrigin, url);
return allowed;
}
......
......@@ -52,7 +52,7 @@ public:
private:
// FIXME: This should probably have a separate client from FrameLoader.
FrameLoaderClient* client() const;
FrameLoaderClient& client() const;
void logWarning(bool allowed, const String& action, const KURL&) const;
......
......@@ -90,7 +90,7 @@ void NetscapePlugInStreamLoader::didReceiveResponse(const ResourceResponse& resp
// Status code can be null when serving from a Web archive.
if (response.httpStatusCode() && (response.httpStatusCode() < 100 || response.httpStatusCode() >= 400))
cancel(frameLoader()->client()->fileDoesNotExistError(response));
cancel(frameLoader()->client().fileDoesNotExistError(response));
}
void NetscapePlugInStreamLoader::didReceiveData(const char* data, int length, long long encodedDataLength, DataPayloadType dataPayloadType)
......
......@@ -135,7 +135,7 @@ PingLoader::PingLoader(Frame* frame, ResourceRequest& request)
// Document in the Frame, but the activeDocumentLoader will be associated
// with the provisional DocumentLoader if there is a provisional
// DocumentLoader.
m_shouldUseCredentialStorage = frame->loader().client()->shouldUseCredentialStorage(frame->loader().activeDocumentLoader(), identifier);
m_shouldUseCredentialStorage = frame->loader().client().shouldUseCredentialStorage(frame->loader().activeDocumentLoader(), identifier);
m_handle = ResourceHandle::create(frame->loader().networkingContext(), request, this, false, false);
InspectorInstrumentation::continueAfterPingLoader(frame, identifier, frame->loader().activeDocumentLoader(), request, ResourceResponse());
......
......@@ -95,7 +95,7 @@ void PolicyChecker::checkNavigationPolicy(const ResourceRequest& request, Docume
m_callback.set(request, formState.get(), function, argument);
m_delegateIsDecidingNavigationPolicy = true;
m_frame->loader().client()->dispatchDecidePolicyForNavigationAction(&PolicyChecker::continueAfterNavigationPolicy,
m_frame->loader().client().dispatchDecidePolicyForNavigationAction(&PolicyChecker::continueAfterNavigationPolicy,
action, request, formState);
m_delegateIsDecidingNavigationPolicy = false;
}
......@@ -110,26 +110,26 @@ void PolicyChecker::checkNewWindowPolicy(const NavigationAction& action, NewWind
return continueAfterNavigationPolicy(PolicyIgnore);
m_callback.set(request, formState, frameName, action, function, argument);
m_frame->loader().client()->dispatchDecidePolicyForNewWindowAction(&PolicyChecker::continueAfterNewWindowPolicy,
m_frame->loader().client().dispatchDecidePolicyForNewWindowAction(&PolicyChecker::continueAfterNewWindowPolicy,
action, request, formState, frameName);
}
void PolicyChecker::checkContentPolicy(const ResourceResponse& response, ContentPolicyDecisionFunction function, void* argument)
{
m_callback.set(function, argument);
m_frame->loader().client()->dispatchDecidePolicyForResponse(&PolicyChecker::continueAfterContentPolicy,
m_frame->loader().client().dispatchDecidePolicyForResponse(&PolicyChecker::continueAfterContentPolicy,