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

Unified Diff: Source/core/dom/Document.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/dom/DOMImplementation.cpp ('k') | Source/core/dom/DocumentInit.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 351aca1e2be56489022c03087edadba8c005805c..3d9dbef3ca4d4620b0f826da7a35ea9f1a5e45fe 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -473,7 +473,7 @@ Document::Document(const DocumentInit& initializer, DocumentClassFlags documentC
if (m_frame) {
provideContextFeaturesToDocumentFrom(this, m_frame->page());
- m_fetcher = m_frame->loader()->activeDocumentLoader()->fetcher();
+ m_fetcher = m_frame->loader().activeDocumentLoader()->fetcher();
}
if (!m_fetcher)
@@ -1308,7 +1308,7 @@ void Document::updateTitle(const String& title)
if (!m_frame || oldTitle == m_title)
return;
- m_frame->loader()->client()->dispatchDidReceiveTitle(m_title);
+ m_frame->loader().client()->dispatchDidReceiveTitle(m_title);
}
void Document::setTitle(const String& title)
@@ -2173,8 +2173,8 @@ void Document::open(Document* ownerDocument)
}
}
- if (m_frame->loader()->state() == FrameStateProvisional)
- m_frame->loader()->stopAllLoaders();
+ if (m_frame->loader().state() == FrameStateProvisional)
+ m_frame->loader().stopAllLoaders();
}
removeAllEventListeners();
@@ -2183,7 +2183,7 @@ void Document::open(Document* ownerDocument)
parser->setWasCreatedByScript(true);
if (m_frame)
- m_frame->loader()->didExplicitOpen();
+ m_frame->loader().didExplicitOpen();
if (m_loadEventProgress != LoadEventInProgress && m_loadEventProgress != UnloadEventInProgress)
m_loadEventProgress = LoadEventNotRun;
}
@@ -2305,7 +2305,7 @@ void Document::explicitClose()
return;
}
- m_frame->loader()->checkCompleted();
+ m_frame->loader().checkCompleted();
}
void Document::implicitClose()
@@ -2356,7 +2356,7 @@ void Document::implicitClose()
enqueuePopstateEvent(m_pendingStateObject ? m_pendingStateObject.release() : SerializedScriptValue::nullValue());
if (frame()) {
- frame()->loader()->client()->dispatchDidHandleOnloadEvents();
+ frame()->loader().client()->dispatchDidHandleOnloadEvents();
loader()->applicationCacheHost()->stopDeferringEvents();
}
@@ -2466,7 +2466,7 @@ void Document::dispatchUnloadEvents()
// The DocumentLoader (and thus its DocumentLoadTiming) might get destroyed
// while dispatching the event, so protect it to prevent writing the end
// time into freed memory.
- RefPtr<DocumentLoader> documentLoader = m_frame->loader()->provisionalDocumentLoader();
+ RefPtr<DocumentLoader> documentLoader = m_frame->loader().provisionalDocumentLoader();
m_loadEventProgress = UnloadEventInProgress;
RefPtr<Event> unloadEvent(Event::create(EventTypeNames::unload));
if (documentLoader && !documentLoader->timing()->unloadEventStart() && !documentLoader->timing()->unloadEventEnd()) {
@@ -2487,8 +2487,8 @@ void Document::dispatchUnloadEvents()
return;
// Don't remove event listeners from a transitional empty document (see https://bugs.webkit.org/show_bug.cgi?id=28716 for more information).
- bool keepEventListeners = m_frame->loader()->stateMachine()->isDisplayingInitialEmptyDocument() && m_frame->loader()->provisionalDocumentLoader()
- && isSecureTransitionTo(m_frame->loader()->provisionalDocumentLoader()->url());
+ bool keepEventListeners = m_frame->loader().stateMachine()->isDisplayingInitialEmptyDocument() && m_frame->loader().provisionalDocumentLoader()
+ && isSecureTransitionTo(m_frame->loader().provisionalDocumentLoader()->url());
if (!keepEventListeners)
removeAllEventListeners();
}
@@ -2707,7 +2707,7 @@ void Document::processBaseElement()
String Document::userAgent(const KURL& url) const
{
- return frame() ? frame()->loader()->userAgent(url) : String();
+ return frame() ? frame()->loader().userAgent(url) : String();
}
void Document::disableEval(const String& errorMessage)
@@ -2767,10 +2767,10 @@ bool Document::canNavigate(Frame* targetFrame)
// and/or "parent" relation). Requiring some sort of relation prevents a
// document from navigating arbitrary, unrelated top-level frames.
if (!targetFrame->tree().parent()) {
- if (targetFrame == m_frame->loader()->opener())
+ if (targetFrame == m_frame->loader().opener())
return true;
- if (canAccessAncestor(securityOrigin(), targetFrame->loader()->opener()))
+ if (canAccessAncestor(securityOrigin(), targetFrame->loader().opener()))
return true;
}
@@ -2926,11 +2926,11 @@ void Document::processHttpEquivXFrameOptions(const String& content)
if (!frame)
return;
- FrameLoader* frameLoader = frame->loader();
+ FrameLoader& frameLoader = frame->loader();
unsigned long requestIdentifier = loader()->mainResourceIdentifier();
- if (frameLoader->shouldInterruptLoadForXFrameOptions(content, url(), requestIdentifier)) {
+ if (frameLoader.shouldInterruptLoadForXFrameOptions(content, url(), requestIdentifier)) {
String message = "Refused to display '" + url().elidedString() + "' in a frame because it set 'X-Frame-Options' to '" + content + "'.";
- frameLoader->stopAllLoaders();
+ frameLoader.stopAllLoaders();
// Stopping the loader isn't enough, as we're already parsing the document; to honor the header's
// intent, we must navigate away from the possibly partially-rendered document to a location that
// doesn't inherit the parent's SecurityOrigin.
@@ -4124,7 +4124,7 @@ KURL Document::openSearchDescriptionURL()
return KURL();
// FIXME: Why do we need to wait for FrameStateComplete?
- if (frame()->loader()->state() != FrameStateComplete)
+ if (frame()->loader().state() != FrameStateComplete)
return KURL();
if (!head())
@@ -4360,7 +4360,7 @@ void Document::finishedParsing()
// See https://bugs.webkit.org/show_bug.cgi?id=36864 starting around comment 35.
updateStyleIfNeeded();
- f->loader()->finishedParsing();
+ f->loader().finishedParsing();
InspectorInstrumentation::domContentLoadedEventFired(f.get());
}
@@ -4893,7 +4893,7 @@ void Document::decrementLoadEventDelayCount()
void Document::loadEventDelayTimerFired(Timer<Document>*)
{
if (frame())
- frame()->loader()->checkCompleted();
+ frame()->loader().checkCompleted();
}
ScriptedAnimationController& Document::ensureScriptedAnimationController()
@@ -5023,7 +5023,7 @@ DocumentLoader* Document::loader() const
if (!m_frame)
return 0;
- DocumentLoader* loader = m_frame->loader()->documentLoader();
+ DocumentLoader* loader = m_frame->loader().documentLoader();
if (!loader)
return 0;
@@ -5092,7 +5092,7 @@ void Document::decrementActiveParserCount()
// http/tests/security/feed-urls-from-remote.html to timeout on Mac WK1
// see http://webkit.org/b/110554 and http://webkit.org/b/110401
loader()->checkLoadComplete();
- frame()->loader()->checkLoadComplete();
+ frame()->loader().checkLoadComplete();
}
void Document::setContextFeatures(PassRefPtr<ContextFeatures> features)
« no previous file with comments | « Source/core/dom/DOMImplementation.cpp ('k') | Source/core/dom/DocumentInit.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698