summaryrefslogtreecommitdiffstats
path: root/WebCore/loader/RedirectScheduler.cpp
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2009-11-05 09:23:40 +0000
committerSteve Block <steveblock@google.com>2009-11-10 22:41:12 +0000
commitcac0f67c402d107cdb10971b95719e2ff9c7c76b (patch)
treed182c7f87211c6f201a5f038e332336493ebdbe7 /WebCore/loader/RedirectScheduler.cpp
parent4b2ef0f288e7c6c4602f621b7a0e9feed304b70e (diff)
downloadexternal_webkit-cac0f67c402d107cdb10971b95719e2ff9c7c76b.zip
external_webkit-cac0f67c402d107cdb10971b95719e2ff9c7c76b.tar.gz
external_webkit-cac0f67c402d107cdb10971b95719e2ff9c7c76b.tar.bz2
Merge webkit.org at r50258 : Initial merge by git.
Change-Id: I1a9e1dc4ed654b69174ad52a4f031a07240f37b0
Diffstat (limited to 'WebCore/loader/RedirectScheduler.cpp')
-rw-r--r--WebCore/loader/RedirectScheduler.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/WebCore/loader/RedirectScheduler.cpp b/WebCore/loader/RedirectScheduler.cpp
index 819cbdd..c0d78ae 100644
--- a/WebCore/loader/RedirectScheduler.cpp
+++ b/WebCore/loader/RedirectScheduler.cpp
@@ -255,12 +255,20 @@ void RedirectScheduler::scheduleHistoryNavigation(int steps)
if (!m_frame->page())
return;
+ // Invalid history navigations (such as history.forward() during a new load) have the side effect of cancelling any scheduled
+ // redirects. We also avoid the possibility of cancelling the current load by avoiding the scheduled redirection altogether.
+ if (!m_frame->page()->canGoBackOrForward(steps)) {
+ cancel();
+ return;
+ }
+
schedule(new ScheduledRedirection(steps));
}
void RedirectScheduler::timerFired(Timer<RedirectScheduler>*)
{
- ASSERT(m_frame->page());
+ if (!m_frame->page())
+ return;
if (m_frame->page()->defersLoading())
return;
@@ -277,13 +285,12 @@ void RedirectScheduler::timerFired(Timer<RedirectScheduler>*)
case ScheduledRedirection::historyNavigation:
if (redirection->historySteps == 0) {
// Special case for go(0) from a frame -> reload only the frame
- loader->urlSelected(loader->url(), "", 0, redirection->lockHistory, redirection->lockBackForwardList, redirection->wasUserGesture);
+ loader->urlSelected(loader->url(), "", 0, redirection->lockHistory, redirection->lockBackForwardList, redirection->wasUserGesture, SendReferrer);
return;
}
// go(i!=0) from a frame navigates into the history of the frame only,
// in both IE and NS (but not in Mozilla). We can't easily do that.
- if (m_frame->page()->canGoBackOrForward(redirection->historySteps))
- m_frame->page()->goBackOrForward(redirection->historySteps);
+ m_frame->page()->goBackOrForward(redirection->historySteps);
return;
case ScheduledRedirection::formSubmission:
// The submitForm function will find a target frame before using the redirection timer.
@@ -293,7 +300,7 @@ void RedirectScheduler::timerFired(Timer<RedirectScheduler>*)
if (!redirection->formState->sourceFrame()->loader()->shouldAllowNavigation(m_frame))
return;
loader->loadFrameRequest(redirection->frameRequest, redirection->lockHistory, redirection->lockBackForwardList,
- redirection->event, redirection->formState);
+ redirection->event, redirection->formState, SendReferrer);
return;
}