Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1063)

Unified Diff: Source/core/loader/DocumentLoader.cpp

Issue 31063004: Have Frame::loader() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/loader/CookieJar.cpp ('k') | Source/core/loader/DocumentThreadableLoader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/DocumentLoader.cpp
diff --git a/Source/core/loader/DocumentLoader.cpp b/Source/core/loader/DocumentLoader.cpp
index ac276ba89210ad7be9ba52d4678c328631bb208a..b98caeb0d765d7ffa0a67d54d83234eccac275b9 100644
--- a/Source/core/loader/DocumentLoader.cpp
+++ b/Source/core/loader/DocumentLoader.cpp
@@ -96,7 +96,7 @@ FrameLoader* DocumentLoader::frameLoader() const
{
if (!m_frame)
return 0;
- return m_frame->loader();
+ return &m_frame->loader();
}
ResourceLoader* DocumentLoader::mainResourceLoader() const
@@ -128,7 +128,7 @@ unsigned long DocumentLoader::mainResourceIdentifier() const
Document* DocumentLoader::document() const
{
- if (m_frame && m_frame->loader()->documentLoader() == this)
+ if (m_frame && m_frame->loader().documentLoader() == this)
return m_frame->document();
return 0;
}
@@ -226,7 +226,7 @@ void DocumentLoader::stopLoading()
Document* doc = m_frame->document();
if (loading || doc->parsing())
- m_frame->loader()->stopLoading();
+ m_frame->loader().stopLoading();
}
clearArchiveResources();
@@ -442,7 +442,7 @@ void DocumentLoader::willSendRequest(ResourceRequest& newRequest, const Resource
Frame* parent = m_frame->tree().parent();
if (parent) {
- if (!parent->loader()->mixedContentChecker()->canRunInsecureContent(parent->document()->securityOrigin(), newRequest.url())) {
+ if (!parent->loader().mixedContentChecker()->canRunInsecureContent(parent->document()->securityOrigin(), newRequest.url())) {
cancelMainResourceLoad(ResourceError::cancelledError(newRequest.url()));
return;
}
@@ -724,7 +724,7 @@ void DocumentLoader::prepareSubframeArchiveLoadIfNeeded()
if (!m_frame->tree().parent())
return;
- ArchiveResourceCollection* parentCollection = m_frame->tree().parent()->loader()->documentLoader()->m_archiveResourceCollection.get();
+ ArchiveResourceCollection* parentCollection = m_frame->tree().parent()->loader().documentLoader()->m_archiveResourceCollection.get();
if (!parentCollection)
return;
@@ -897,12 +897,12 @@ PassRefPtr<DocumentWriter> DocumentLoader::createWriterFor(Frame* frame, const D
RefPtr<Document> document = DOMImplementation::createDocument(mimeType, frame, url, frame->inViewSourceMode());
if (document->isPluginDocument() && document->isSandboxed(SandboxPlugins))
document = SinkDocument::create(DocumentInit(url, frame));
- bool shouldReuseDefaultView = frame->loader()->stateMachine()->isDisplayingInitialEmptyDocument() && frame->document()->isSecureTransitionTo(url);
+ bool shouldReuseDefaultView = frame->loader().stateMachine()->isDisplayingInitialEmptyDocument() && frame->document()->isSecureTransitionTo(url);
ClearOptions options = 0;
if (!shouldReuseDefaultView)
options = ClearWindowProperties | ClearScriptObjects;
- frame->loader()->clear(options);
+ frame->loader().clear(options);
if (frame->document())
frame->document()->prepareForDestruction();
@@ -910,7 +910,7 @@ PassRefPtr<DocumentWriter> DocumentLoader::createWriterFor(Frame* frame, const D
if (!shouldReuseDefaultView)
frame->setDOMWindow(DOMWindow::create(frame));
- frame->loader()->setOutgoingReferrer(url);
+ frame->loader().setOutgoingReferrer(url);
frame->domWindow()->setDocument(document);
if (ownerDocument) {
@@ -918,7 +918,7 @@ PassRefPtr<DocumentWriter> DocumentLoader::createWriterFor(Frame* frame, const D
document->setSecurityOrigin(ownerDocument->securityOrigin());
}
- frame->loader()->didBeginDocument(dispatch);
+ frame->loader().didBeginDocument(dispatch);
return DocumentWriter::create(document.get(), mimeType, encoding, userChosen);
}
@@ -935,7 +935,7 @@ String DocumentLoader::mimeType() const
// This is the <iframe src="javascript:'html'"> case.
void DocumentLoader::replaceDocument(const String& source, Document* ownerDocument)
{
- m_frame->loader()->stopAllLoaders();
+ m_frame->loader().stopAllLoaders();
m_writer = createWriterFor(m_frame, ownerDocument, m_frame->document()->url(), mimeType(), m_writer ? m_writer->encoding() : "", m_writer ? m_writer->encodingWasChosenByUser() : false, true);
if (!source.isNull())
m_writer->appendReplacingData(source);
« no previous file with comments | « Source/core/loader/CookieJar.cpp ('k') | Source/core/loader/DocumentThreadableLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698