Commit 9ce995f2 authored by akling@apple.com's avatar akling@apple.com

<https://webkit.org/b/120132> Frame::navigationScheduler() should return a reference.

Reviewed by Anders Carlzon.

Frame::m_navigationScheduler is an inline member, not a pointer.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154409 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent cd07b473
2013-08-21 Andreas Kling <akling@apple.com>
<https://webkit.org/b/120132> Frame::navigationScheduler() should return a reference.
Reviewed by Anders Carlzon.
Frame::m_navigationScheduler is an inline member, not a pointer.
2013-08-21 Tim Horton <timothy_horton@apple.com>
REGRESSION(r154399): broke Mac ML debug WK1 tests > 50 crashes (Requested by thorton on #webkit).
......@@ -2325,7 +2325,7 @@ void Document::implicitClose()
return;
}
bool wasLocationChangePending = frame() && frame()->navigationScheduler()->locationChangePending();
bool wasLocationChangePending = frame() && frame()->navigationScheduler().locationChangePending();
bool doload = !parsing() && m_parser && !m_processingLoadEvent && !wasLocationChangePending;
if (!doload)
......@@ -2391,7 +2391,7 @@ void Document::implicitClose()
// fires. This will improve onload scores, and other browsers do it.
// If they wanna cheat, we can too. -dwh
if (frame()->navigationScheduler()->locationChangePending() && elapsedTime() < cLayoutScheduleThreshold) {
if (frame()->navigationScheduler().locationChangePending() && elapsedTime() < cLayoutScheduleThreshold) {
// Just bail out. Before or during the onload we were shifted to another page.
// The old i-Bench suite does this. When this happens don't bother painting or laying out.
m_processingLoadEvent = false;
......@@ -2801,7 +2801,7 @@ void Document::processHttpEquiv(const String& equiv, const String& content)
url = m_url.string();
else
url = completeURL(url).string();
frame->navigationScheduler()->scheduleRedirect(delay, url);
frame->navigationScheduler().scheduleRedirect(delay, url);
}
} else if (equalIgnoringCase(equiv, "set-cookie")) {
// FIXME: make setCookie work on XML documents too; e.g. in case of <html:meta .....>
......@@ -2825,7 +2825,7 @@ void Document::processHttpEquiv(const String& equiv, const String& content)
// 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.
frame->navigationScheduler()->scheduleLocationChange(securityOrigin(), SecurityOrigin::urlWithUniqueSecurityOrigin(), String());
frame->navigationScheduler().scheduleLocationChange(securityOrigin(), SecurityOrigin::urlWithUniqueSecurityOrigin(), String());
addConsoleMessage(SecurityMessageSource, ErrorMessageLevel, message, requestIdentifier);
}
}
......
......@@ -299,7 +299,7 @@ bool HTMLDocumentParser::canTakeNextToken(SynchronousMode mode, PumpSession& ses
// parser to stop parsing cleanly. The problem is we're not
// perpared to do that at every point where we run JavaScript.
if (!isParsingFragment()
&& document()->frame() && document()->frame()->navigationScheduler()->locationChangePending())
&& document()->frame() && document()->frame()->navigationScheduler().locationChangePending())
return false;
if (mode == AllowYield)
......@@ -415,7 +415,7 @@ void HTMLDocumentParser::processParsedChunkFromBackgroundParser(PassOwnPtr<Parse
ASSERT(!isWaitingForScripts());
if (!isParsingFragment()
&& document()->frame() && document()->frame()->navigationScheduler()->locationChangePending()) {
&& document()->frame() && document()->frame()->navigationScheduler().locationChangePending()) {
// To match main-thread parser behavior (which never checks locationChangePending on the EOF path)
// we peek to see if this chunk has an EOF and process it anyway.
......
......@@ -113,7 +113,7 @@ void XSSAuditorDelegate::didBlockScript(const XSSInfo& xssInfo)
}
if (xssInfo.m_didBlockEntirePage)
m_document->frame()->navigationScheduler()->scheduleLocationChange(m_document->securityOrigin(), SecurityOrigin::urlWithUniqueSecurityOrigin(), String());
m_document->frame()->navigationScheduler().scheduleLocationChange(m_document->securityOrigin(), SecurityOrigin::urlWithUniqueSecurityOrigin(), String());
}
} // namespace WebCore
......@@ -280,7 +280,7 @@ void FrameLoader::setDefersLoading(bool defers)
history()->setDefersLoading(defers);
if (!defers) {
m_frame->navigationScheduler()->startTimer();
m_frame->navigationScheduler().startTimer();
startCheckCompleteTimer();
}
}
......@@ -391,7 +391,7 @@ void FrameLoader::submitForm(PassRefPtr<FormSubmission> submission)
submission->setReferrer(outgoingReferrer());
submission->setOrigin(outgoingOrigin());
targetFrame->navigationScheduler()->scheduleFormSubmission(submission);
targetFrame->navigationScheduler().scheduleFormSubmission(submission);
}
void FrameLoader::stopLoading(UnloadEventPolicy unloadEventPolicy)
......@@ -469,7 +469,7 @@ void FrameLoader::stopLoading(UnloadEventPolicy unloadEventPolicy)
}
// FIXME: This will cancel redirection timer, which really needs to be restarted when restoring the frame from b/f cache.
m_frame->navigationScheduler()->cancel();
m_frame->navigationScheduler().cancel();
}
void FrameLoader::stop()
......@@ -512,13 +512,13 @@ bool FrameLoader::closeURL()
bool FrameLoader::didOpenURL()
{
if (m_frame->navigationScheduler()->redirectScheduledDuringLoad()) {
if (m_frame->navigationScheduler().redirectScheduledDuringLoad()) {
// A redirect was scheduled before the document was created.
// This can happen when one frame changes another frame's location.
return false;
}
m_frame->navigationScheduler()->cancel();
m_frame->navigationScheduler().cancel();
m_frame->editor().clearLastEditCommand();
m_isComplete = false;
......@@ -551,13 +551,13 @@ void FrameLoader::didExplicitOpen()
// from a subsequent window.document.open / window.document.write call.
// Canceling redirection here works for all cases because document.open
// implicitly precedes document.write.
m_frame->navigationScheduler()->cancel();
m_frame->navigationScheduler().cancel();
}
void FrameLoader::cancelAndClear()
{
m_frame->navigationScheduler()->cancel();
m_frame->navigationScheduler().cancel();
if (!m_isComplete)
closeURL();
......@@ -606,7 +606,7 @@ void FrameLoader::clear(Document* newDocument, bool clearWindowProperties, bool
m_frame->script().enableEval();
m_frame->navigationScheduler()->clear();
m_frame->navigationScheduler().clear();
m_checkTimer.stop();
m_shouldCallCheckCompleted = false;
......@@ -643,7 +643,7 @@ void FrameLoader::receivedFirstData()
else
url = m_frame->document()->completeURL(url).string();
m_frame->navigationScheduler()->scheduleRedirect(delay, url);
m_frame->navigationScheduler().scheduleRedirect(delay, url);
}
void FrameLoader::setOutgoingReferrer(const KURL& url)
......@@ -792,7 +792,7 @@ void FrameLoader::checkCompleted()
checkCallImplicitClose(); // if we didn't do it before
m_frame->navigationScheduler()->startTimer();
m_frame->navigationScheduler().startTimer();
completed();
if (m_frame->page())
......@@ -994,7 +994,7 @@ void FrameLoader::provisionalLoadStarted()
{
if (m_stateMachine.firstLayoutDone())
m_stateMachine.advanceTo(FrameLoaderStateMachine::CommittedFirstRealLoad);
m_frame->navigationScheduler()->cancel(true);
m_frame->navigationScheduler().cancel(true);
m_client->provisionalLoadStarted();
}
......@@ -1094,7 +1094,7 @@ void FrameLoader::completed()
RefPtr<Frame> protect(m_frame);
for (Frame* descendant = m_frame->tree()->traverseNext(m_frame); descendant; descendant = descendant->tree()->traverseNext(m_frame))
descendant->navigationScheduler()->startTimer();
descendant->navigationScheduler().startTimer();
if (Frame* parent = m_frame->tree()->parent())
parent->loader().checkCompleted();
......@@ -1964,7 +1964,7 @@ void FrameLoader::prepareForCachedPageRestore()
ASSERT(m_frame->page());
ASSERT(m_frame->page()->mainFrame() == m_frame);
m_frame->navigationScheduler()->cancel();
m_frame->navigationScheduler().cancel();
// We still have to close the previous part page.
closeURL();
......
......@@ -333,7 +333,7 @@ Frame* SubframeLoader::loadOrRedirectSubframe(HTMLFrameOwnerElement* ownerElemen
{
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());
......
......@@ -179,7 +179,7 @@ void ApplicationCacheGroup::selectCache(Frame* frame, const KURL& passedManifest
// Restart the current navigation from the top of the navigation algorithm, undoing any changes that were made
// as part of the initial load.
// The navigation will not result in the same resource being loaded, because "foreign" entries are never picked during navigation.
frame->navigationScheduler()->scheduleLocationChange(frame->document()->securityOrigin(), documentLoader->url(), frame->loader().referrer());
frame->navigationScheduler().scheduleLocationChange(frame->document()->securityOrigin(), documentLoader->url(), frame->loader().referrer());
}
return;
......
......@@ -1810,7 +1810,7 @@ void DOMWindow::setLocation(const String& urlString, DOMWindow* activeWindow, DO
return;
// We want a new history item if we are processing a user gesture.
m_frame->navigationScheduler()->scheduleLocationChange(activeDocument->securityOrigin(),
m_frame->navigationScheduler().scheduleLocationChange(activeDocument->securityOrigin(),
// FIXME: What if activeDocument()->frame() is 0?
completedURL, activeDocument->frame()->loader().outgoingReferrer(),
locking != LockHistoryBasedOnGestureState || !ScriptController::processingUserGesture(),
......@@ -1929,7 +1929,7 @@ PassRefPtr<Frame> DOMWindow::createWindow(const String& urlString, const AtomicS
newFrame->loader().changeLocation(activeWindow->document()->securityOrigin(), completedURL, referrer, false, false);
else if (!urlString.isEmpty()) {
bool lockHistory = !ScriptController::processingUserGesture();
newFrame->navigationScheduler()->scheduleLocationChange(activeWindow->document()->securityOrigin(), completedURL.string(), referrer, lockHistory, false);
newFrame->navigationScheduler().scheduleLocationChange(activeWindow->document()->securityOrigin(), completedURL.string(), referrer, lockHistory, false);
}
// Navigating the new frame could result in it being detached from its page by a navigation policy delegate.
......@@ -1984,7 +1984,7 @@ PassRefPtr<DOMWindow> DOMWindow::open(const String& urlString, const AtomicStrin
// For whatever reason, Firefox uses the first window rather than the active window to
// determine the outgoing referrer. We replicate that behavior here.
bool lockHistory = !ScriptController::processingUserGesture();
targetFrame->navigationScheduler()->scheduleLocationChange(
targetFrame->navigationScheduler().scheduleLocationChange(
activeDocument->securityOrigin(),
completedURL,
firstFrame->loader().outgoingReferrer(),
......
......@@ -117,7 +117,7 @@ namespace WebCore {
Editor& editor() const;
EventHandler& eventHandler() const;
FrameLoader& loader() const;
NavigationScheduler* navigationScheduler() const;
NavigationScheduler& navigationScheduler() const;
FrameSelection& selection() const;
FrameTree* tree() const;
AnimationController& animation() const;
......@@ -266,9 +266,9 @@ namespace WebCore {
return m_loader;
}
inline NavigationScheduler* Frame::navigationScheduler() const
inline NavigationScheduler& Frame::navigationScheduler() const
{
return &m_navigationScheduler;
return m_navigationScheduler;
}
inline FrameView* Frame::view() const
......
......@@ -108,7 +108,7 @@ void History::go(int distance)
if (!m_frame)
return;
m_frame->navigationScheduler()->scheduleHistoryNavigation(distance);
m_frame->navigationScheduler().scheduleHistoryNavigation(distance);
}
void History::go(ScriptExecutionContext* context, int distance)
......@@ -124,7 +124,7 @@ void History::go(ScriptExecutionContext* context, int distance)
if (!activeDocument->canNavigate(m_frame))
return;
m_frame->navigationScheduler()->scheduleHistoryNavigation(distance);
m_frame->navigationScheduler().scheduleHistoryNavigation(distance);
}
KURL History::urlForState(const String& urlString)
......
......@@ -258,7 +258,7 @@ void Location::reload(DOMWindow* activeWindow)
}
if (protocolIsJavaScript(m_frame->document()->url()))
return;
m_frame->navigationScheduler()->scheduleRefresh();
m_frame->navigationScheduler().scheduleRefresh();
}
void Location::setLocation(const String& url, DOMWindow* activeWindow, DOMWindow* firstWindow)
......
......@@ -808,7 +808,7 @@ void QWebFrameAdapter::updateBackgroundRecursively(const QColor& backgroundColor
void QWebFrameAdapter::cancelLoad()
{
frame->navigationScheduler()->cancel();
frame->navigationScheduler().cancel();
}
// ========== QWebHitTestResultPrivate implementation ===========
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment