[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

abarth at webkit.org abarth at webkit.org
Wed Dec 22 14:07:08 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 88b4e6bf7a8e88456eb90ac02502dc32953cd2a8
Author: abarth at webkit.org <abarth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Oct 4 22:09:57 2010 +0000

    2010-10-04  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Darin Adler.
    
            Rename RedirectScheduler to NavigationScheduler
            https://bugs.webkit.org/show_bug.cgi?id=47037
    
            Update for name change.
    
            * src/ApplicationCacheHost.cpp:
            (WebCore::ApplicationCacheHost::selectCacheWithManifest):
            * src/WebFrameImpl.cpp:
            (WebKit::WebFrameImpl::loadJavaScriptURL):
    2010-10-04  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Darin Adler.
    
            Rename RedirectScheduler to NavigationScheduler
            https://bugs.webkit.org/show_bug.cgi?id=47037
    
            Update for name change.
    
            * Api/qwebpage.cpp:
            (QWebPage::triggerAction):
    2010-10-04  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Darin Adler.
    
            Rename RedirectScheduler to NavigationScheduler
            https://bugs.webkit.org/show_bug.cgi?id=47037
    
            This class schedules more than just redirects.  In fact, it schedules
            most kinds of navigations.
    
            * Android.mk:
            * CMakeLists.txt:
            * GNUmakefile.am:
            * WebCore.gypi:
            * WebCore.pro:
            * WebCore.vcproj/WebCore.vcproj:
            * WebCore.xcodeproj/project.pbxproj:
            * bindings/generic/BindingDOMWindow.h:
            (WebCore::::createWindow):
            (WebCore::::open):
            * bindings/generic/BindingFrame.h:
            (WebCore::::navigateIfAllowed):
            * bindings/js/JSDOMWindowCustom.cpp:
            (WebCore::JSDOMWindow::setLocation):
            (WebCore::createWindow):
            (WebCore::JSDOMWindow::open):
            * bindings/js/JSDocumentCustom.cpp:
            (WebCore::JSDocument::setLocation):
            * bindings/js/JSLocationCustom.cpp:
            (WebCore::JSLocation::reload):
            * bindings/v8/custom/V8LocationCustom.cpp:
            (WebCore::V8Location::reloadCallback):
            * dom/Document.cpp:
            (WebCore::Document::implicitClose):
            (WebCore::Document::processHttpEquiv):
            * inspector/InspectorController.cpp:
            (WebCore::InspectorController::setResourceTrackingEnabled):
            (WebCore::InspectorController::reloadPage):
            * loader/FrameLoader.cpp:
            (WebCore::FrameLoader::setDefersLoading):
            (WebCore::FrameLoader::submitForm):
            (WebCore::FrameLoader::stopLoading):
            (WebCore::FrameLoader::didOpenURL):
            (WebCore::FrameLoader::didExplicitOpen):
            (WebCore::FrameLoader::cancelAndClear):
            (WebCore::FrameLoader::clear):
            (WebCore::FrameLoader::receivedFirstData):
            (WebCore::FrameLoader::checkCompleted):
            (WebCore::FrameLoader::provisionalLoadStarted):
            (WebCore::FrameLoader::completed):
            (WebCore::FrameLoader::prepareForCachedPageRestore):
            * loader/FrameLoader.h:
            * loader/NavigationScheduler.cpp: Added.
            (WebCore::ScheduledNavigation::ScheduledNavigation):
            (WebCore::ScheduledNavigation::~ScheduledNavigation):
            (WebCore::ScheduledNavigation::shouldStartTimer):
            (WebCore::ScheduledNavigation::didStartTimer):
            (WebCore::ScheduledNavigation::didStopTimer):
            (WebCore::ScheduledNavigation::delay):
            (WebCore::ScheduledNavigation::lockHistory):
            (WebCore::ScheduledNavigation::lockBackForwardList):
            (WebCore::ScheduledNavigation::wasDuringLoad):
            (WebCore::ScheduledNavigation::isLocationChange):
            (WebCore::ScheduledNavigation::wasUserGesture):
            (WebCore::ScheduledURLNavigation::ScheduledURLNavigation):
            (WebCore::ScheduledURLNavigation::fire):
            (WebCore::ScheduledURLNavigation::didStartTimer):
            (WebCore::ScheduledURLNavigation::didStopTimer):
            (WebCore::ScheduledURLNavigation::url):
            (WebCore::ScheduledURLNavigation::referrer):
            (WebCore::ScheduledRedirect::ScheduledRedirect):
            (WebCore::ScheduledRedirect::shouldStartTimer):
            (WebCore::ScheduledLocationChange::ScheduledLocationChange):
            (WebCore::ScheduledRefresh::ScheduledRefresh):
            (WebCore::ScheduledRefresh::fire):
            (WebCore::ScheduledHistoryNavigation::ScheduledHistoryNavigation):
            (WebCore::ScheduledHistoryNavigation::fire):
            (WebCore::ScheduledFormSubmission::ScheduledFormSubmission):
            (WebCore::ScheduledFormSubmission::fire):
            (WebCore::ScheduledFormSubmission::didStartTimer):
            (WebCore::ScheduledFormSubmission::didStopTimer):
            (WebCore::NavigationScheduler::NavigationScheduler):
            (WebCore::NavigationScheduler::~NavigationScheduler):
            (WebCore::NavigationScheduler::redirectScheduledDuringLoad):
            (WebCore::NavigationScheduler::locationChangePending):
            (WebCore::NavigationScheduler::clear):
            (WebCore::NavigationScheduler::scheduleRedirect):
            (WebCore::NavigationScheduler::mustLockBackForwardList):
            (WebCore::NavigationScheduler::scheduleLocationChange):
            (WebCore::NavigationScheduler::scheduleFormSubmission):
            (WebCore::NavigationScheduler::scheduleRefresh):
            (WebCore::NavigationScheduler::scheduleHistoryNavigation):
            (WebCore::NavigationScheduler::timerFired):
            (WebCore::NavigationScheduler::schedule):
            (WebCore::NavigationScheduler::startTimer):
            (WebCore::NavigationScheduler::cancel):
            * loader/NavigationScheduler.h: Added.
            * loader/RedirectScheduler.cpp: Removed.
            * loader/RedirectScheduler.h: Removed.
            * loader/SubframeLoader.cpp:
            (WebCore::SubframeLoader::loadOrRedirectSubframe):
            * loader/appcache/ApplicationCacheGroup.cpp:
            (WebCore::ApplicationCacheGroup::selectCache):
            * page/Frame.cpp:
            (WebCore::Frame::Frame):
            * page/Frame.h:
            (WebCore::Frame::navigationScheduler):
            * page/History.cpp:
            (WebCore::History::back):
            (WebCore::History::forward):
            (WebCore::History::go):
            * page/XSSAuditor.cpp:
            (WebCore::XSSAuditor::findInRequest):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69039 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/Android.mk b/WebCore/Android.mk
index d151b27..4246787 100644
--- a/WebCore/Android.mk
+++ b/WebCore/Android.mk
@@ -365,7 +365,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
 	loader/PolicyCallback.cpp \
 	loader/PolicyChecker.cpp \
 	loader/ProgressTracker.cpp \
-	loader/RedirectScheduler.cpp \
+	loader/NavigationScheduler.cpp \
 	loader/Request.cpp \
 	loader/ResourceLoadNotifier.cpp \
 	loader/ResourceLoader.cpp \
diff --git a/WebCore/CMakeLists.txt b/WebCore/CMakeLists.txt
index 217252e..b14486d 100644
--- a/WebCore/CMakeLists.txt
+++ b/WebCore/CMakeLists.txt
@@ -1146,7 +1146,7 @@ SET(WebCore_SOURCES
     loader/PolicyCallback.cpp
     loader/PolicyChecker.cpp
     loader/ProgressTracker.cpp
-    loader/RedirectScheduler.cpp
+    loader/NavigationScheduler.cpp
     loader/Request.cpp
     loader/ResourceLoadNotifier.cpp
     loader/ResourceLoader.cpp
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 05da6dd..d7895fa 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,5 +1,119 @@
 2010-10-04  Adam Barth  <abarth at webkit.org>
 
+        Reviewed by Darin Adler.
+
+        Rename RedirectScheduler to NavigationScheduler
+        https://bugs.webkit.org/show_bug.cgi?id=47037
+
+        This class schedules more than just redirects.  In fact, it schedules
+        most kinds of navigations.
+
+        * Android.mk:
+        * CMakeLists.txt:
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/generic/BindingDOMWindow.h:
+        (WebCore::::createWindow):
+        (WebCore::::open):
+        * bindings/generic/BindingFrame.h:
+        (WebCore::::navigateIfAllowed):
+        * bindings/js/JSDOMWindowCustom.cpp:
+        (WebCore::JSDOMWindow::setLocation):
+        (WebCore::createWindow):
+        (WebCore::JSDOMWindow::open):
+        * bindings/js/JSDocumentCustom.cpp:
+        (WebCore::JSDocument::setLocation):
+        * bindings/js/JSLocationCustom.cpp:
+        (WebCore::JSLocation::reload):
+        * bindings/v8/custom/V8LocationCustom.cpp:
+        (WebCore::V8Location::reloadCallback):
+        * dom/Document.cpp:
+        (WebCore::Document::implicitClose):
+        (WebCore::Document::processHttpEquiv):
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::setResourceTrackingEnabled):
+        (WebCore::InspectorController::reloadPage):
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::setDefersLoading):
+        (WebCore::FrameLoader::submitForm):
+        (WebCore::FrameLoader::stopLoading):
+        (WebCore::FrameLoader::didOpenURL):
+        (WebCore::FrameLoader::didExplicitOpen):
+        (WebCore::FrameLoader::cancelAndClear):
+        (WebCore::FrameLoader::clear):
+        (WebCore::FrameLoader::receivedFirstData):
+        (WebCore::FrameLoader::checkCompleted):
+        (WebCore::FrameLoader::provisionalLoadStarted):
+        (WebCore::FrameLoader::completed):
+        (WebCore::FrameLoader::prepareForCachedPageRestore):
+        * loader/FrameLoader.h:
+        * loader/NavigationScheduler.cpp: Added.
+        (WebCore::ScheduledNavigation::ScheduledNavigation):
+        (WebCore::ScheduledNavigation::~ScheduledNavigation):
+        (WebCore::ScheduledNavigation::shouldStartTimer):
+        (WebCore::ScheduledNavigation::didStartTimer):
+        (WebCore::ScheduledNavigation::didStopTimer):
+        (WebCore::ScheduledNavigation::delay):
+        (WebCore::ScheduledNavigation::lockHistory):
+        (WebCore::ScheduledNavigation::lockBackForwardList):
+        (WebCore::ScheduledNavigation::wasDuringLoad):
+        (WebCore::ScheduledNavigation::isLocationChange):
+        (WebCore::ScheduledNavigation::wasUserGesture):
+        (WebCore::ScheduledURLNavigation::ScheduledURLNavigation):
+        (WebCore::ScheduledURLNavigation::fire):
+        (WebCore::ScheduledURLNavigation::didStartTimer):
+        (WebCore::ScheduledURLNavigation::didStopTimer):
+        (WebCore::ScheduledURLNavigation::url):
+        (WebCore::ScheduledURLNavigation::referrer):
+        (WebCore::ScheduledRedirect::ScheduledRedirect):
+        (WebCore::ScheduledRedirect::shouldStartTimer):
+        (WebCore::ScheduledLocationChange::ScheduledLocationChange):
+        (WebCore::ScheduledRefresh::ScheduledRefresh):
+        (WebCore::ScheduledRefresh::fire):
+        (WebCore::ScheduledHistoryNavigation::ScheduledHistoryNavigation):
+        (WebCore::ScheduledHistoryNavigation::fire):
+        (WebCore::ScheduledFormSubmission::ScheduledFormSubmission):
+        (WebCore::ScheduledFormSubmission::fire):
+        (WebCore::ScheduledFormSubmission::didStartTimer):
+        (WebCore::ScheduledFormSubmission::didStopTimer):
+        (WebCore::NavigationScheduler::NavigationScheduler):
+        (WebCore::NavigationScheduler::~NavigationScheduler):
+        (WebCore::NavigationScheduler::redirectScheduledDuringLoad):
+        (WebCore::NavigationScheduler::locationChangePending):
+        (WebCore::NavigationScheduler::clear):
+        (WebCore::NavigationScheduler::scheduleRedirect):
+        (WebCore::NavigationScheduler::mustLockBackForwardList):
+        (WebCore::NavigationScheduler::scheduleLocationChange):
+        (WebCore::NavigationScheduler::scheduleFormSubmission):
+        (WebCore::NavigationScheduler::scheduleRefresh):
+        (WebCore::NavigationScheduler::scheduleHistoryNavigation):
+        (WebCore::NavigationScheduler::timerFired):
+        (WebCore::NavigationScheduler::schedule):
+        (WebCore::NavigationScheduler::startTimer):
+        (WebCore::NavigationScheduler::cancel):
+        * loader/NavigationScheduler.h: Added.
+        * loader/RedirectScheduler.cpp: Removed.
+        * loader/RedirectScheduler.h: Removed.
+        * loader/SubframeLoader.cpp:
+        (WebCore::SubframeLoader::loadOrRedirectSubframe):
+        * loader/appcache/ApplicationCacheGroup.cpp:
+        (WebCore::ApplicationCacheGroup::selectCache):
+        * page/Frame.cpp:
+        (WebCore::Frame::Frame):
+        * page/Frame.h:
+        (WebCore::Frame::navigationScheduler):
+        * page/History.cpp:
+        (WebCore::History::back):
+        (WebCore::History::forward):
+        (WebCore::History::go):
+        * page/XSSAuditor.cpp:
+        (WebCore::XSSAuditor::findInRequest):
+
+2010-10-04  Adam Barth  <abarth at webkit.org>
+
         Reviewed by Sam Weinig.
 
         Remove ENABLE_SANDBOX
diff --git a/WebCore/GNUmakefile.am b/WebCore/GNUmakefile.am
index 95ba481..b9c5b5a 100644
--- a/WebCore/GNUmakefile.am
+++ b/WebCore/GNUmakefile.am
@@ -1925,8 +1925,8 @@ webcore_sources += \
 	WebCore/loader/PolicyChecker.h \
 	WebCore/loader/ProgressTracker.cpp \
 	WebCore/loader/ProgressTracker.h \
-	WebCore/loader/RedirectScheduler.cpp \
-	WebCore/loader/RedirectScheduler.h \
+	WebCore/loader/NavigationScheduler.cpp \
+	WebCore/loader/NavigationScheduler.h \
 	WebCore/loader/Request.cpp \
 	WebCore/loader/Request.h \
 	WebCore/loader/ResourceLoader.cpp \
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index a17f61c..9b4779e 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -2029,8 +2029,8 @@
             'loader/PolicyChecker.h',
             'loader/ProgressTracker.cpp',
             'loader/ProgressTracker.h',
-            'loader/RedirectScheduler.cpp',
-            'loader/RedirectScheduler.h',
+            'loader/NavigationScheduler.cpp',
+            'loader/NavigationScheduler.h',
             'loader/Request.cpp',
             'loader/Request.h',
             'loader/ResourceLoader.cpp',
diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro
index 26dd70a..f774c95 100644
--- a/WebCore/WebCore.pro
+++ b/WebCore/WebCore.pro
@@ -1041,7 +1041,7 @@ SOURCES += \
     loader/PolicyCallback.cpp \
     loader/PolicyChecker.cpp \
     loader/ProgressTracker.cpp \
-    loader/RedirectScheduler.cpp \
+    loader/NavigationScheduler.cpp \
     loader/Request.cpp \
     loader/ResourceLoader.cpp \
     loader/ResourceLoadNotifier.cpp \
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index 61d8ccb..fed5913 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -23767,11 +23767,11 @@
 				>
 			</File>
 			<File
-				RelativePath="..\loader\RedirectScheduler.cpp"
+				RelativePath="..\loader\NavigationScheduler.cpp"
 				>
 			</File>
 			<File
-				RelativePath="..\loader\RedirectScheduler.h"
+				RelativePath="..\loader\NavigationScheduler.h"
 				>
 			</File>
 			<File
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index b868408..f6e5e7c 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -2884,8 +2884,8 @@
 		977B3878122883E900B81FF8 /* HTMLTokenizer.h in Headers */ = {isa = PBXBuildFile; fileRef = 977B385F122883E900B81FF8 /* HTMLTokenizer.h */; };
 		977B3879122883E900B81FF8 /* HTMLViewSourceParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 977B3860122883E900B81FF8 /* HTMLViewSourceParser.cpp */; };
 		977B387A122883E900B81FF8 /* HTMLViewSourceParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 977B3861122883E900B81FF8 /* HTMLViewSourceParser.h */; };
-		979F43D31075E44A0000F83B /* RedirectScheduler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 979F43D11075E44A0000F83B /* RedirectScheduler.cpp */; };
-		979F43D41075E44A0000F83B /* RedirectScheduler.h in Headers */ = {isa = PBXBuildFile; fileRef = 979F43D21075E44A0000F83B /* RedirectScheduler.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		979F43D31075E44A0000F83B /* NavigationScheduler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 979F43D11075E44A0000F83B /* NavigationScheduler.cpp */; };
+		979F43D41075E44A0000F83B /* NavigationScheduler.h in Headers */ = {isa = PBXBuildFile; fileRef = 979F43D21075E44A0000F83B /* NavigationScheduler.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		97BC84831236FD93000C6161 /* TextDocumentParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97BC84811236FD93000C6161 /* TextDocumentParser.cpp */; };
 		97BC84841236FD93000C6161 /* TextDocumentParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 97BC84821236FD93000C6161 /* TextDocumentParser.h */; };
 		97BC849B12370A4B000C6161 /* HTMLInputStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 97BC849A12370A4B000C6161 /* HTMLInputStream.h */; };
@@ -8887,8 +8887,8 @@
 		977B385F122883E900B81FF8 /* HTMLTokenizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLTokenizer.h; path = parser/HTMLTokenizer.h; sourceTree = "<group>"; };
 		977B3860122883E900B81FF8 /* HTMLViewSourceParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HTMLViewSourceParser.cpp; path = parser/HTMLViewSourceParser.cpp; sourceTree = "<group>"; };
 		977B3861122883E900B81FF8 /* HTMLViewSourceParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLViewSourceParser.h; path = parser/HTMLViewSourceParser.h; sourceTree = "<group>"; };
-		979F43D11075E44A0000F83B /* RedirectScheduler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RedirectScheduler.cpp; sourceTree = "<group>"; };
-		979F43D21075E44A0000F83B /* RedirectScheduler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RedirectScheduler.h; sourceTree = "<group>"; };
+		979F43D11075E44A0000F83B /* NavigationScheduler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NavigationScheduler.cpp; sourceTree = "<group>"; };
+		979F43D21075E44A0000F83B /* NavigationScheduler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NavigationScheduler.h; sourceTree = "<group>"; };
 		97BC84811236FD93000C6161 /* TextDocumentParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TextDocumentParser.cpp; path = parser/TextDocumentParser.cpp; sourceTree = "<group>"; };
 		97BC84821236FD93000C6161 /* TextDocumentParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TextDocumentParser.h; path = parser/TextDocumentParser.h; sourceTree = "<group>"; };
 		97BC849A12370A4B000C6161 /* HTMLInputStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLInputStream.h; path = parser/HTMLInputStream.h; sourceTree = "<group>"; };
@@ -17021,8 +17021,8 @@
 				97059976107D975200A50A7C /* PolicyChecker.h */,
 				1A2A68210B5BEDE70002A480 /* ProgressTracker.cpp */,
 				1A2A68220B5BEDE70002A480 /* ProgressTracker.h */,
-				979F43D11075E44A0000F83B /* RedirectScheduler.cpp */,
-				979F43D21075E44A0000F83B /* RedirectScheduler.h */,
+				979F43D11075E44A0000F83B /* NavigationScheduler.cpp */,
+				979F43D21075E44A0000F83B /* NavigationScheduler.h */,
 				BCB16C150979C3BD00467741 /* Request.cpp */,
 				BCB16C160979C3BD00467741 /* Request.h */,
 				93E227DE0AF589AD00D48324 /* ResourceLoader.cpp */,
@@ -20227,7 +20227,7 @@
 				F55B3DCE1251F12D003EF269 /* RangeInputType.h in Headers */,
 				A84D827C11D333ED00972990 /* RawDataDocumentParser.h in Headers */,
 				BC4368E80C226E32005EFB5F /* Rect.h in Headers */,
-				979F43D41075E44A0000F83B /* RedirectScheduler.h in Headers */,
+				979F43D41075E44A0000F83B /* NavigationScheduler.h in Headers */,
 				85031B4C0A44EFC700F992E0 /* RegisteredEventListener.h in Headers */,
 				B2C3DA2D0D006C1D00EF6F26 /* RegularExpression.h in Headers */,
 				93309E01099E64920056E581 /* RemoveCSSPropertyCommand.h in Headers */,
@@ -22832,7 +22832,7 @@
 				F55B3DCB1251F12D003EF269 /* RadioInputType.cpp in Sources */,
 				93F19AB908245E59001E9ABC /* Range.cpp in Sources */,
 				F55B3DCD1251F12D003EF269 /* RangeInputType.cpp in Sources */,
-				979F43D31075E44A0000F83B /* RedirectScheduler.cpp in Sources */,
+				979F43D31075E44A0000F83B /* NavigationScheduler.cpp in Sources */,
 				85031B4B0A44EFC700F992E0 /* RegisteredEventListener.cpp in Sources */,
 				B2C3DA2C0D006C1D00EF6F26 /* RegularExpression.cpp in Sources */,
 				93309E00099E64920056E581 /* RemoveCSSPropertyCommand.cpp in Sources */,
diff --git a/WebCore/bindings/generic/BindingDOMWindow.h b/WebCore/bindings/generic/BindingDOMWindow.h
index 96b8b9d..3b2adb5 100644
--- a/WebCore/bindings/generic/BindingDOMWindow.h
+++ b/WebCore/bindings/generic/BindingDOMWindow.h
@@ -124,7 +124,7 @@ Frame* BindingDOMWindow<Binding>::createWindow(State<Binding>* state,
         if (created)
             newFrame->loader()->changeLocation(completedUrl, referrer, false, false, userGesture);
         else if (!url.isEmpty())
-            newFrame->redirectScheduler()->scheduleLocationChange(completedUrl.string(), referrer, false, false, userGesture);
+            newFrame->navigationScheduler()->scheduleLocationChange(completedUrl.string(), referrer, false, false, userGesture);
     }
 
     return newFrame;
@@ -193,7 +193,7 @@ WebCore::DOMWindow* BindingDOMWindow<Binding>::open(State<Binding>* state,
             // the outgoingReferrer.  We replicate that behavior here.
             String referrer = firstFrame->loader()->outgoingReferrer();
 
-            frame->redirectScheduler()->scheduleLocationChange(completedUrl, referrer, false, false, userGesture);
+            frame->navigationScheduler()->scheduleLocationChange(completedUrl, referrer, false, false, userGesture);
         }
         return frame->domWindow();
     }
diff --git a/WebCore/bindings/generic/BindingFrame.h b/WebCore/bindings/generic/BindingFrame.h
index f1fdc79..8c7285e 100644
--- a/WebCore/bindings/generic/BindingFrame.h
+++ b/WebCore/bindings/generic/BindingFrame.h
@@ -49,7 +49,7 @@ void BindingFrame<Binding>::navigateIfAllowed(State<Binding>* state, Frame* fram
     if (!activeFrame)
         return;
     if (!protocolIsJavaScript(url) || state->allowsAccessFromFrame(frame))
-        frame->redirectScheduler()->scheduleLocationChange(url.string(), activeFrame->loader()->outgoingReferrer(), lockHistory, lockBackForwardList, state->processingUserGesture());
+        frame->navigationScheduler()->scheduleLocationChange(url.string(), activeFrame->loader()->outgoingReferrer(), lockHistory, lockBackForwardList, state->processingUserGesture());
 }
 
 } // namespace WebCore
diff --git a/WebCore/bindings/js/JSDOMWindowCustom.cpp b/WebCore/bindings/js/JSDOMWindowCustom.cpp
index 2ad71f0..9642cb2 100644
--- a/WebCore/bindings/js/JSDOMWindowCustom.cpp
+++ b/WebCore/bindings/js/JSDOMWindowCustom.cpp
@@ -512,7 +512,7 @@ void JSDOMWindow::setLocation(ExecState* exec, JSValue value)
 
     if (!protocolIsJavaScript(url) || allowsAccessFrom(exec)) {
         // We want a new history item if this JS was called via a user gesture
-        frame->redirectScheduler()->scheduleLocationChange(url, lexicalFrame->loader()->outgoingReferrer(), !lexicalFrame->script()->anyPageIsProcessingUserGesture(), false, processingUserGesture());
+        frame->navigationScheduler()->scheduleLocationChange(url, lexicalFrame->loader()->outgoingReferrer(), !lexicalFrame->script()->anyPageIsProcessingUserGesture(), false, processingUserGesture());
     }
 }
 
@@ -705,7 +705,7 @@ static Frame* createWindow(ExecState* exec, Frame* lexicalFrame, Frame* dynamicF
         if (created)
             newFrame->loader()->changeLocation(completedURL, referrer, false, false, userGesture);
         else if (!url.isEmpty())
-            newFrame->redirectScheduler()->scheduleLocationChange(completedURL.string(), referrer, !lexicalFrame->script()->anyPageIsProcessingUserGesture(), false, userGesture);
+            newFrame->navigationScheduler()->scheduleLocationChange(completedURL.string(), referrer, !lexicalFrame->script()->anyPageIsProcessingUserGesture(), false, userGesture);
     }
 
     return newFrame;
@@ -770,7 +770,7 @@ JSValue JSDOMWindow::open(ExecState* exec)
             // here.
             String referrer = dynamicFrame->loader()->outgoingReferrer();
 
-            frame->redirectScheduler()->scheduleLocationChange(completedURL, referrer, !lexicalFrame->script()->anyPageIsProcessingUserGesture(), false, userGesture);
+            frame->navigationScheduler()->scheduleLocationChange(completedURL, referrer, !lexicalFrame->script()->anyPageIsProcessingUserGesture(), false, userGesture);
         }
         return toJS(exec, frame->domWindow());
     }
diff --git a/WebCore/bindings/js/JSDocumentCustom.cpp b/WebCore/bindings/js/JSDocumentCustom.cpp
index ec66cbd..2530892 100644
--- a/WebCore/bindings/js/JSDocumentCustom.cpp
+++ b/WebCore/bindings/js/JSDocumentCustom.cpp
@@ -89,7 +89,7 @@ void JSDocument::setLocation(ExecState* exec, JSValue value)
         str = activeFrame->document()->completeURL(str).string();
 
     bool userGesture = ScriptController::processingUserGesture();
-    frame->redirectScheduler()->scheduleLocationChange(str, activeFrame->loader()->outgoingReferrer(), !activeFrame->script()->anyPageIsProcessingUserGesture(), false, userGesture);
+    frame->navigationScheduler()->scheduleLocationChange(str, activeFrame->loader()->outgoingReferrer(), !activeFrame->script()->anyPageIsProcessingUserGesture(), false, userGesture);
 }
 
 JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, Document* document)
diff --git a/WebCore/bindings/js/JSLocationCustom.cpp b/WebCore/bindings/js/JSLocationCustom.cpp
index 09e7294..b255029 100644
--- a/WebCore/bindings/js/JSLocationCustom.cpp
+++ b/WebCore/bindings/js/JSLocationCustom.cpp
@@ -313,7 +313,7 @@ JSValue JSLocation::reload(ExecState* exec)
         return jsUndefined();
 
     if (!protocolIsJavaScript(frame->loader()->url()))
-        frame->redirectScheduler()->scheduleRefresh(processingUserGesture());
+        frame->navigationScheduler()->scheduleRefresh(processingUserGesture());
     return jsUndefined();
 }
 
diff --git a/WebCore/bindings/v8/custom/V8LocationCustom.cpp b/WebCore/bindings/v8/custom/V8LocationCustom.cpp
index 7103eaa..225dcdd 100644
--- a/WebCore/bindings/v8/custom/V8LocationCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8LocationCustom.cpp
@@ -282,7 +282,7 @@ v8::Handle<v8::Value> V8Location::reloadCallback(const v8::Arguments& args)
         return v8::Undefined();
 
     if (!protocolIsJavaScript(frame->loader()->url()))
-        frame->redirectScheduler()->scheduleRefresh(processingUserGesture());
+        frame->navigationScheduler()->scheduleRefresh(processingUserGesture());
     return v8::Undefined();
 }
 
diff --git a/WebCore/dom/Document.cpp b/WebCore/dom/Document.cpp
index 009db6d..84a8038 100644
--- a/WebCore/dom/Document.cpp
+++ b/WebCore/dom/Document.cpp
@@ -1986,7 +1986,7 @@ void Document::implicitClose()
         return;
     }
 
-    bool wasLocationChangePending = frame() && frame()->redirectScheduler()->locationChangePending();
+    bool wasLocationChangePending = frame() && frame()->navigationScheduler()->locationChangePending();
     bool doload = !parsing() && m_parser && !m_processingLoadEvent && !wasLocationChangePending;
     
     if (!doload)
@@ -2041,7 +2041,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()->redirectScheduler()->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.        
         view()->unscheduleRelayout();
@@ -2513,7 +2513,7 @@ void Document::processHttpEquiv(const String& equiv, const String& content)
                 url = frame->loader()->url().string();
             else
                 url = completeURL(url).string();
-            frame->redirectScheduler()->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 .....>
@@ -2530,7 +2530,7 @@ void Document::processHttpEquiv(const String& equiv, const String& content)
             FrameLoader* frameLoader = frame->loader();
             if (frameLoader->shouldInterruptLoadForXFrameOptions(content, url())) {
                 frameLoader->stopAllLoaders();
-                frame->redirectScheduler()->scheduleLocationChange(blankURL(), String());
+                frame->navigationScheduler()->scheduleLocationChange(blankURL(), String());
 
                 DEFINE_STATIC_LOCAL(String, consoleMessage, ("Refused to display document because display forbidden by X-Frame-Options.\n"));
                 frame->domWindow()->console()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, consoleMessage, 1, String());
diff --git a/WebCore/inspector/InspectorController.cpp b/WebCore/inspector/InspectorController.cpp
index f29c0de..6c6f9c0 100644
--- a/WebCore/inspector/InspectorController.cpp
+++ b/WebCore/inspector/InspectorController.cpp
@@ -1192,7 +1192,7 @@ void InspectorController::setResourceTrackingEnabled(bool enable, bool always, b
     m_resourceTrackingEnabled = enable;
 
     if (enable)
-        m_inspectedPage->mainFrame()->redirectScheduler()->scheduleRefresh(true);
+        m_inspectedPage->mainFrame()->navigationScheduler()->scheduleRefresh(true);
 
     updateInspectorStateCookie();
 }
@@ -2143,7 +2143,7 @@ bool InspectorController::resourceContentForURL(const KURL& url, Document* frame
 
 void InspectorController::reloadPage()
 {
-    m_inspectedPage->mainFrame()->redirectScheduler()->scheduleRefresh(true);
+    m_inspectedPage->mainFrame()->navigationScheduler()->scheduleRefresh(true);
 }
 
 } // namespace WebCore
diff --git a/WebCore/loader/FrameLoader.cpp b/WebCore/loader/FrameLoader.cpp
index 32cf2d1..e2bd427 100644
--- a/WebCore/loader/FrameLoader.cpp
+++ b/WebCore/loader/FrameLoader.cpp
@@ -254,7 +254,7 @@ void FrameLoader::setDefersLoading(bool defers)
         m_policyDocumentLoader->setDefersLoading(defers);
 
     if (!defers) {
-        m_frame->redirectScheduler()->startTimer();
+        m_frame->navigationScheduler()->startTimer();
         startCheckCompleteTimer();
     }
 }
@@ -365,7 +365,7 @@ void FrameLoader::submitForm(PassRefPtr<FormSubmission> submission)
     submission->setReferrer(m_outgoingReferrer);
     submission->setOrigin(outgoingOrigin());
 
-    targetFrame->redirectScheduler()->scheduleFormSubmission(submission);
+    targetFrame->navigationScheduler()->scheduleFormSubmission(submission);
 }
 
 void FrameLoader::stopLoading(UnloadEventPolicy unloadEventPolicy, DatabasePolicy databasePolicy)
@@ -441,7 +441,7 @@ void FrameLoader::stopLoading(UnloadEventPolicy unloadEventPolicy, DatabasePolic
     }
 
     // FIXME: This will cancel redirection timer, which really needs to be restarted when restoring the frame from b/f cache.
-    m_frame->redirectScheduler()->cancel();
+    m_frame->navigationScheduler()->cancel();
 }
 
 void FrameLoader::stop()
@@ -496,13 +496,13 @@ KURL FrameLoader::iconURL()
 
 bool FrameLoader::didOpenURL(const KURL& url)
 {
-    if (m_frame->redirectScheduler()->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->redirectScheduler()->cancel();
+    m_frame->navigationScheduler()->cancel();
     m_frame->editor()->clearLastEditCommand();
 
     m_isComplete = false;
@@ -541,7 +541,7 @@ 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->redirectScheduler()->cancel(); 
+    m_frame->navigationScheduler()->cancel(); 
     if (m_frame->document()->url() != blankURL())
         m_URL = m_frame->document()->url();
 }
@@ -549,7 +549,7 @@ void FrameLoader::didExplicitOpen()
 
 void FrameLoader::cancelAndClear()
 {
-    m_frame->redirectScheduler()->cancel();
+    m_frame->navigationScheduler()->cancel();
 
     if (!m_isComplete)
         closeURL();
@@ -598,7 +598,7 @@ void FrameLoader::clear(bool clearWindowProperties, bool clearScriptObjects, boo
     if (clearScriptObjects)
         m_frame->script()->clearScriptObjects();
 
-    m_frame->redirectScheduler()->clear();
+    m_frame->navigationScheduler()->clear();
 
     m_checkTimer.stop();
     m_shouldCallCheckCompleted = false;
@@ -639,7 +639,7 @@ void FrameLoader::receivedFirstData()
     else
         url = m_frame->document()->completeURL(url).string();
 
-    m_frame->redirectScheduler()->scheduleRedirect(delay, url);
+    m_frame->navigationScheduler()->scheduleRedirect(delay, url);
 }
 
 void FrameLoader::setURL(const KURL& url)
@@ -848,7 +848,7 @@ void FrameLoader::checkCompleted()
     RefPtr<Frame> protect(m_frame);
     checkCallImplicitClose(); // if we didn't do it before
 
-    m_frame->redirectScheduler()->startTimer();
+    m_frame->navigationScheduler()->startTimer();
 
     completed();
     if (m_frame->page())
@@ -1067,7 +1067,7 @@ void FrameLoader::provisionalLoadStarted()
 {
     if (m_stateMachine.firstLayoutDone())
         m_stateMachine.advanceTo(FrameLoaderStateMachine::CommittedFirstRealLoad);
-    m_frame->redirectScheduler()->cancel(true);
+    m_frame->navigationScheduler()->cancel(true);
     m_client->provisionalLoadStarted();
 }
 
@@ -1195,7 +1195,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->redirectScheduler()->startTimer();
+        descendant->navigationScheduler()->startTimer();
     
     if (Frame* parent = m_frame->tree()->parent())
         parent->loader()->checkCompleted();
@@ -2079,7 +2079,7 @@ void FrameLoader::prepareForCachedPageRestore()
     ASSERT(m_frame->page());
     ASSERT(m_frame->page()->mainFrame() == m_frame);
 
-    m_frame->redirectScheduler()->cancel();
+    m_frame->navigationScheduler()->cancel();
 
     // We still have to close the previous part page.
     closeURL();
diff --git a/WebCore/loader/FrameLoader.h b/WebCore/loader/FrameLoader.h
index 40f35bd..2af6b6f 100644
--- a/WebCore/loader/FrameLoader.h
+++ b/WebCore/loader/FrameLoader.h
@@ -36,9 +36,9 @@
 #include "FrameLoaderStateMachine.h"
 #include "FrameLoaderTypes.h"
 #include "HistoryController.h"
+#include "NavigationScheduler.h"
 #include "PolicyCallback.h"
 #include "PolicyChecker.h"
-#include "RedirectScheduler.h"
 #include "ResourceLoadNotifier.h"
 #include "ResourceRequest.h"
 #include "SubframeLoader.h"
diff --git a/WebCore/loader/NavigationScheduler.cpp b/WebCore/loader/NavigationScheduler.cpp
new file mode 100644
index 0000000..1c3da42
--- /dev/null
+++ b/WebCore/loader/NavigationScheduler.cpp
@@ -0,0 +1,411 @@
+/*
+ * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
+ * Copyright (C) 2009 Adam Barth. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer. 
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution. 
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission. 
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "NavigationScheduler.h"
+
+#include "BackForwardList.h"
+#include "DOMWindow.h"
+#include "DocumentLoader.h"
+#include "Event.h"
+#include "FormState.h"
+#include "FormSubmission.h"
+#include "Frame.h"
+#include "FrameLoadRequest.h"
+#include "FrameLoader.h"
+#include "FrameLoaderStateMachine.h"
+#include "HTMLFormElement.h"
+#include "HTMLFrameOwnerElement.h"
+#include "HistoryItem.h"
+#include "Page.h"
+#include "UserGestureIndicator.h"
+#include <wtf/CurrentTime.h>
+
+namespace WebCore {
+
+class ScheduledNavigation : public Noncopyable {
+public:
+    ScheduledNavigation(double delay, bool lockHistory, bool lockBackForwardList, bool wasDuringLoad, bool isLocationChange, bool wasUserGesture)
+        : m_delay(delay)
+        , m_lockHistory(lockHistory)
+        , m_lockBackForwardList(lockBackForwardList)
+        , m_wasDuringLoad(wasDuringLoad)
+        , m_isLocationChange(isLocationChange)
+        , m_wasUserGesture(wasUserGesture)
+    {
+    }
+    virtual ~ScheduledNavigation() { }
+
+    virtual void fire(Frame*) = 0;
+
+    virtual bool shouldStartTimer(Frame*) { return true; }
+    virtual void didStartTimer(Frame*, Timer<NavigationScheduler>*) { }
+    virtual void didStopTimer(Frame*, bool /* newLoadInProgress */) { }
+
+    double delay() const { return m_delay; }
+    bool lockHistory() const { return m_lockHistory; }
+    bool lockBackForwardList() const { return m_lockBackForwardList; }
+    bool wasDuringLoad() const { return m_wasDuringLoad; }
+    bool isLocationChange() const { return m_isLocationChange; }
+    bool wasUserGesture() const { return m_wasUserGesture; }
+
+private:
+    double m_delay;
+    bool m_lockHistory;
+    bool m_lockBackForwardList;
+    bool m_wasDuringLoad;
+    bool m_isLocationChange;
+    bool m_wasUserGesture;
+};
+
+class ScheduledURLNavigation : public ScheduledNavigation {
+public:
+    ScheduledURLNavigation(double delay, const String& url, const String& referrer, bool lockHistory, bool lockBackForwardList, bool wasUserGesture, bool duringLoad, bool isLocationChange)
+        : ScheduledNavigation(delay, lockHistory, lockBackForwardList, duringLoad, isLocationChange, wasUserGesture)
+        , m_url(url)
+        , m_referrer(referrer)
+        , m_haveToldClient(false)
+    {
+    }
+
+    virtual void fire(Frame* frame)
+    {
+        frame->loader()->changeLocation(KURL(ParsedURLString, m_url), m_referrer, lockHistory(), lockBackForwardList(), wasUserGesture(), false);
+    }
+
+    virtual void didStartTimer(Frame* frame, Timer<NavigationScheduler>* timer)
+    {
+        if (m_haveToldClient)
+            return;
+        m_haveToldClient = true;
+        frame->loader()->clientRedirected(KURL(ParsedURLString, m_url), delay(), currentTime() + timer->nextFireInterval(), lockBackForwardList());
+    }
+
+    virtual void didStopTimer(Frame* frame, bool newLoadInProgress)
+    {
+        if (!m_haveToldClient)
+            return;
+        frame->loader()->clientRedirectCancelledOrFinished(newLoadInProgress);
+    }
+
+    String url() const { return m_url; }
+    String referrer() const { return m_referrer; }
+
+private:
+    String m_url;
+    String m_referrer;
+    bool m_haveToldClient;
+};
+
+class ScheduledRedirect : public ScheduledURLNavigation {
+public:
+    ScheduledRedirect(double delay, const String& url, bool lockHistory, bool lockBackForwardList, bool wasUserGesture)
+        : ScheduledURLNavigation(delay, url, String(), lockHistory, lockBackForwardList, wasUserGesture, false, false) { }
+
+    virtual bool shouldStartTimer(Frame* frame) { return frame->loader()->allAncestorsAreComplete(); }
+};
+
+class ScheduledLocationChange : public ScheduledURLNavigation {
+public:
+    ScheduledLocationChange(const String& url, const String& referrer, bool lockHistory, bool lockBackForwardList, bool wasUserGesture, bool duringLoad)
+        : ScheduledURLNavigation(0.0, url, referrer, lockHistory, lockBackForwardList, wasUserGesture, duringLoad, true) { }
+};
+
+class ScheduledRefresh : public ScheduledURLNavigation {
+public:
+    ScheduledRefresh(const String& url, const String& referrer, bool wasUserGesture)
+        : ScheduledURLNavigation(0.0, url, referrer, true, true, wasUserGesture, false, true) { }
+
+    virtual void fire(Frame* frame)
+    {
+        frame->loader()->changeLocation(KURL(ParsedURLString, url()), referrer(), lockHistory(), lockBackForwardList(), wasUserGesture(), true);
+    }
+};
+
+class ScheduledHistoryNavigation : public ScheduledNavigation {
+public:
+    explicit ScheduledHistoryNavigation(int historySteps, bool wasUserGesture) : ScheduledNavigation(0, false, false, false, true, wasUserGesture), m_historySteps(historySteps) { }
+
+    virtual void fire(Frame* frame)
+    {
+        UserGestureIndicator gestureIndicator(wasUserGesture() ? DefinitelyProcessingUserGesture : DefinitelyNotProcessingUserGesture);
+
+        FrameLoader* loader = frame->loader();
+        if (!m_historySteps) {
+            // Special case for go(0) from a frame -> reload only the frame
+            // To follow Firefox and IE's behavior, history reload can only navigate the self frame.
+            loader->urlSelected(loader->url(), "_self", 0, lockHistory(), lockBackForwardList(), 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.
+        frame->page()->goBackOrForward(m_historySteps);
+    }
+
+private:
+    int m_historySteps;
+};
+
+class ScheduledFormSubmission : public ScheduledNavigation {
+public:
+    ScheduledFormSubmission(PassRefPtr<FormSubmission> submission, bool lockBackForwardList, bool duringLoad, bool wasUserGesture)
+        : ScheduledNavigation(0, submission->lockHistory(), lockBackForwardList, duringLoad, true, wasUserGesture)
+        , m_submission(submission)
+        , m_haveToldClient(false)
+    {
+        ASSERT(m_submission->state());
+    }
+
+    virtual void fire(Frame* frame)
+    {
+        UserGestureIndicator gestureIndicator(wasUserGesture() ? DefinitelyProcessingUserGesture : DefinitelyNotProcessingUserGesture);
+
+        // The submitForm function will find a target frame before using the redirection timer.
+        // Now that the timer has fired, we need to repeat the security check which normally is done when
+        // selecting a target, in case conditions have changed. Other code paths avoid this by targeting
+        // without leaving a time window. If we fail the check just silently drop the form submission.
+        if (!m_submission->state()->sourceFrame()->loader()->shouldAllowNavigation(frame))
+            return;
+        FrameLoadRequest frameRequest;
+        m_submission->populateFrameLoadRequest(frameRequest);
+        frame->loader()->loadFrameRequest(frameRequest, lockHistory(), lockBackForwardList(), m_submission->event(), m_submission->state(), SendReferrer);
+    }
+    
+    virtual void didStartTimer(Frame* frame, Timer<NavigationScheduler>* timer)
+    {
+        if (m_haveToldClient)
+            return;
+        m_haveToldClient = true;
+        frame->loader()->clientRedirected(m_submission->requestURL(), delay(), currentTime() + timer->nextFireInterval(), lockBackForwardList());
+    }
+
+    virtual void didStopTimer(Frame* frame, bool newLoadInProgress)
+    {
+        if (!m_haveToldClient)
+            return;
+        frame->loader()->clientRedirectCancelledOrFinished(newLoadInProgress);
+    }
+
+private:
+    RefPtr<FormSubmission> m_submission;
+    bool m_haveToldClient;
+};
+
+NavigationScheduler::NavigationScheduler(Frame* frame)
+    : m_frame(frame)
+    , m_timer(this, &NavigationScheduler::timerFired)
+{
+}
+
+NavigationScheduler::~NavigationScheduler()
+{
+}
+
+bool NavigationScheduler::redirectScheduledDuringLoad()
+{
+    return m_redirect && m_redirect->wasDuringLoad();
+}
+
+bool NavigationScheduler::locationChangePending()
+{
+    return m_redirect && m_redirect->isLocationChange();
+}
+
+void NavigationScheduler::clear()
+{
+    m_timer.stop();
+    m_redirect.clear();
+}
+
+void NavigationScheduler::scheduleRedirect(double delay, const String& url)
+{
+    if (!m_frame->page())
+        return;
+    if (delay < 0 || delay > INT_MAX / 1000)
+        return;
+    if (url.isEmpty())
+        return;
+
+    // We want a new back/forward list item if the refresh timeout is > 1 second.
+    if (!m_redirect || delay <= m_redirect->delay())
+        schedule(adoptPtr(new ScheduledRedirect(delay, url, true, delay <= 1, false)));
+}
+
+bool NavigationScheduler::mustLockBackForwardList(Frame* targetFrame, bool wasUserGesture)
+{
+    // Non-user navigation before the page has finished firing onload should not create a new back/forward item.
+    // See https://webkit.org/b/42861 for the original motivation for this.    
+    if (!wasUserGesture && targetFrame->loader()->documentLoader() && !targetFrame->loader()->documentLoader()->wasOnloadHandled())
+        return true;
+    
+    // Navigation of a subframe during loading of an ancestor frame does not create a new back/forward item.
+    // The definition of "during load" is any time before all handlers for the load event have been run.
+    // See https://bugs.webkit.org/show_bug.cgi?id=14957 for the original motivation for this.
+    for (Frame* ancestor = targetFrame->tree()->parent(); ancestor; ancestor = ancestor->tree()->parent()) {
+        Document* document = ancestor->document();
+        if (!ancestor->loader()->isComplete() || (document && document->processingLoadEvent()))
+            return true;
+    }
+    return false;
+}
+
+void NavigationScheduler::scheduleLocationChange(const String& url, const String& referrer, bool lockHistory, bool lockBackForwardList, bool wasUserGesture)
+{
+    if (!m_frame->page())
+        return;
+    if (url.isEmpty())
+        return;
+
+    lockBackForwardList = lockBackForwardList || mustLockBackForwardList(m_frame, wasUserGesture);
+
+    FrameLoader* loader = m_frame->loader();
+    
+    // If the URL we're going to navigate to is the same as the current one, except for the
+    // fragment part, we don't need to schedule the location change.
+    KURL parsedURL(ParsedURLString, url);
+    if (parsedURL.hasFragmentIdentifier() && equalIgnoringFragmentIdentifier(loader->url(), parsedURL)) {
+        loader->changeLocation(loader->completeURL(url), referrer, lockHistory, lockBackForwardList, wasUserGesture);
+        return;
+    }
+
+    // Handle a location change of a page with no document as a special case.
+    // This may happen when a frame changes the location of another frame.
+    bool duringLoad = !loader->stateMachine()->committedFirstRealDocumentLoad();
+
+    schedule(adoptPtr(new ScheduledLocationChange(url, referrer, lockHistory, lockBackForwardList, wasUserGesture, duringLoad)));
+}
+
+void NavigationScheduler::scheduleFormSubmission(PassRefPtr<FormSubmission> submission)
+{
+    ASSERT(m_frame->page());
+
+    // FIXME: Do we need special handling for form submissions where the URL is the same
+    // as the current one except for the fragment part? See scheduleLocationChange above.
+
+    // Handle a location change of a page with no document as a special case.
+    // This may happen when a frame changes the location of another frame.
+    bool duringLoad = !m_frame->loader()->stateMachine()->committedFirstRealDocumentLoad();
+
+    // If this is a child frame and the form submission was triggered by a script, lock the back/forward list
+    // to match IE and Opera.
+    // See https://bugs.webkit.org/show_bug.cgi?id=32383 for the original motivation for this.
+    bool isUserGesture = m_frame->loader()->isProcessingUserGesture();
+    bool lockBackForwardList = mustLockBackForwardList(m_frame, isUserGesture) || (submission->state()->formSubmissionTrigger() == SubmittedByJavaScript && m_frame->tree()->parent() && !isUserGesture);
+
+    schedule(adoptPtr(new ScheduledFormSubmission(submission, lockBackForwardList, duringLoad, isUserGesture)));
+}
+
+void NavigationScheduler::scheduleRefresh(bool wasUserGesture)
+{
+    if (!m_frame->page())
+        return;
+    const KURL& url = m_frame->loader()->url();
+    if (url.isEmpty())
+        return;
+
+    schedule(adoptPtr(new ScheduledRefresh(url.string(), m_frame->loader()->outgoingReferrer(), wasUserGesture)));
+}
+
+void NavigationScheduler::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.
+    HistoryItem* specifiedEntry = m_frame->page()->backForwardList()->itemAtIndex(steps);
+    if (!specifiedEntry) {
+        cancel();
+        return;
+    }
+
+    // In all other cases, schedule the history traversal to occur asynchronously.
+    schedule(adoptPtr(new ScheduledHistoryNavigation(steps, m_frame->loader()->isProcessingUserGesture())));
+}
+
+void NavigationScheduler::timerFired(Timer<NavigationScheduler>*)
+{
+    if (!m_frame->page())
+        return;
+    if (m_frame->page()->defersLoading())
+        return;
+
+    OwnPtr<ScheduledNavigation> redirect(m_redirect.release());
+    redirect->fire(m_frame);
+}
+
+void NavigationScheduler::schedule(PassOwnPtr<ScheduledNavigation> redirect)
+{
+    ASSERT(m_frame->page());
+
+    // If a redirect was scheduled during a load, then stop the current load.
+    // Otherwise when the current load transitions from a provisional to a 
+    // committed state, pending redirects may be cancelled. 
+    if (redirect->wasDuringLoad()) {
+        if (DocumentLoader* provisionalDocumentLoader = m_frame->loader()->provisionalDocumentLoader())
+            provisionalDocumentLoader->stopLoading();
+        m_frame->loader()->stopLoading(UnloadEventPolicyUnloadAndPageHide);   
+    }
+
+    cancel();
+    m_redirect = redirect;
+
+    if (!m_frame->loader()->isComplete() && m_redirect->isLocationChange())
+        m_frame->loader()->completed();
+
+    startTimer();
+}
+
+void NavigationScheduler::startTimer()
+{
+    if (!m_redirect)
+        return;
+
+    ASSERT(m_frame->page());
+    if (m_timer.isActive())
+        return;
+    if (!m_redirect->shouldStartTimer(m_frame))
+        return;
+
+    m_timer.startOneShot(m_redirect->delay());
+    m_redirect->didStartTimer(m_frame, &m_timer);
+}
+
+void NavigationScheduler::cancel(bool newLoadInProgress)
+{
+    m_timer.stop();
+
+    OwnPtr<ScheduledNavigation> redirect(m_redirect.release());
+    if (redirect)
+        redirect->didStopTimer(m_frame, newLoadInProgress);
+}
+
+} // namespace WebCore
diff --git a/WebCore/loader/NavigationScheduler.h b/WebCore/loader/NavigationScheduler.h
new file mode 100644
index 0000000..f96f9cb
--- /dev/null
+++ b/WebCore/loader/NavigationScheduler.h
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
+ * Copyright (C) 2009 Adam Barth. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer. 
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution. 
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission. 
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef RedirectScheduler_h
+#define RedirectScheduler_h
+
+#include "Event.h"
+#include "Timer.h"
+#include <wtf/Forward.h>
+#include <wtf/OwnPtr.h>
+#include <wtf/PassOwnPtr.h>
+#include <wtf/PassRefPtr.h>
+
+namespace WebCore {
+
+class FormState;
+class FormSubmission;
+class Frame;
+
+struct FrameLoadRequest;
+class ScheduledNavigation;
+
+class NavigationScheduler : public Noncopyable {
+public:
+    NavigationScheduler(Frame*);
+    ~NavigationScheduler();
+
+    bool redirectScheduledDuringLoad();
+    bool locationChangePending();
+
+    void scheduleRedirect(double delay, const String& url);
+    void scheduleLocationChange(const String& url, const String& referrer, bool lockHistory = true, bool lockBackForwardList = true, bool userGesture = false);
+    void scheduleFormSubmission(PassRefPtr<FormSubmission>);
+    void scheduleRefresh(bool userGesture = false);
+    void scheduleHistoryNavigation(int steps);
+
+    void startTimer();
+
+    void cancel(bool newLoadInProgress = false);
+    void clear();
+
+private:
+    void timerFired(Timer<NavigationScheduler>*);
+    void schedule(PassOwnPtr<ScheduledNavigation>);
+
+    static bool mustLockBackForwardList(Frame* targetFrame, bool mustLockIfDuringLoad);
+
+    Frame* m_frame;
+    Timer<NavigationScheduler> m_timer;
+    OwnPtr<ScheduledNavigation> m_redirect;
+};
+
+} // namespace WebCore
+
+#endif // RedirectScheduler_h
diff --git a/WebCore/loader/RedirectScheduler.cpp b/WebCore/loader/RedirectScheduler.cpp
deleted file mode 100644
index ce41cde..0000000
--- a/WebCore/loader/RedirectScheduler.cpp
+++ /dev/null
@@ -1,411 +0,0 @@
-/*
- * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
- * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
- * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
- * Copyright (C) 2009 Adam Barth. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer. 
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution. 
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission. 
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "RedirectScheduler.h"
-
-#include "BackForwardList.h"
-#include "DOMWindow.h"
-#include "DocumentLoader.h"
-#include "Event.h"
-#include "FormState.h"
-#include "FormSubmission.h"
-#include "Frame.h"
-#include "FrameLoadRequest.h"
-#include "FrameLoader.h"
-#include "FrameLoaderStateMachine.h"
-#include "HTMLFormElement.h"
-#include "HTMLFrameOwnerElement.h"
-#include "HistoryItem.h"
-#include "Page.h"
-#include "UserGestureIndicator.h"
-#include <wtf/CurrentTime.h>
-
-namespace WebCore {
-
-class ScheduledNavigation : public Noncopyable {
-public:
-    ScheduledNavigation(double delay, bool lockHistory, bool lockBackForwardList, bool wasDuringLoad, bool isLocationChange, bool wasUserGesture)
-        : m_delay(delay)
-        , m_lockHistory(lockHistory)
-        , m_lockBackForwardList(lockBackForwardList)
-        , m_wasDuringLoad(wasDuringLoad)
-        , m_isLocationChange(isLocationChange)
-        , m_wasUserGesture(wasUserGesture)
-    {
-    }
-    virtual ~ScheduledNavigation() { }
-
-    virtual void fire(Frame*) = 0;
-
-    virtual bool shouldStartTimer(Frame*) { return true; }
-    virtual void didStartTimer(Frame*, Timer<RedirectScheduler>*) { }
-    virtual void didStopTimer(Frame*, bool /* newLoadInProgress */) { }
-
-    double delay() const { return m_delay; }
-    bool lockHistory() const { return m_lockHistory; }
-    bool lockBackForwardList() const { return m_lockBackForwardList; }
-    bool wasDuringLoad() const { return m_wasDuringLoad; }
-    bool isLocationChange() const { return m_isLocationChange; }
-    bool wasUserGesture() const { return m_wasUserGesture; }
-
-private:
-    double m_delay;
-    bool m_lockHistory;
-    bool m_lockBackForwardList;
-    bool m_wasDuringLoad;
-    bool m_isLocationChange;
-    bool m_wasUserGesture;
-};
-
-class ScheduledURLNavigation : public ScheduledNavigation {
-public:
-    ScheduledURLNavigation(double delay, const String& url, const String& referrer, bool lockHistory, bool lockBackForwardList, bool wasUserGesture, bool duringLoad, bool isLocationChange)
-        : ScheduledNavigation(delay, lockHistory, lockBackForwardList, duringLoad, isLocationChange, wasUserGesture)
-        , m_url(url)
-        , m_referrer(referrer)
-        , m_haveToldClient(false)
-    {
-    }
-
-    virtual void fire(Frame* frame)
-    {
-        frame->loader()->changeLocation(KURL(ParsedURLString, m_url), m_referrer, lockHistory(), lockBackForwardList(), wasUserGesture(), false);
-    }
-
-    virtual void didStartTimer(Frame* frame, Timer<RedirectScheduler>* timer)
-    {
-        if (m_haveToldClient)
-            return;
-        m_haveToldClient = true;
-        frame->loader()->clientRedirected(KURL(ParsedURLString, m_url), delay(), currentTime() + timer->nextFireInterval(), lockBackForwardList());
-    }
-
-    virtual void didStopTimer(Frame* frame, bool newLoadInProgress)
-    {
-        if (!m_haveToldClient)
-            return;
-        frame->loader()->clientRedirectCancelledOrFinished(newLoadInProgress);
-    }
-
-    String url() const { return m_url; }
-    String referrer() const { return m_referrer; }
-
-private:
-    String m_url;
-    String m_referrer;
-    bool m_haveToldClient;
-};
-
-class ScheduledRedirect : public ScheduledURLNavigation {
-public:
-    ScheduledRedirect(double delay, const String& url, bool lockHistory, bool lockBackForwardList, bool wasUserGesture)
-        : ScheduledURLNavigation(delay, url, String(), lockHistory, lockBackForwardList, wasUserGesture, false, false) { }
-
-    virtual bool shouldStartTimer(Frame* frame) { return frame->loader()->allAncestorsAreComplete(); }
-};
-
-class ScheduledLocationChange : public ScheduledURLNavigation {
-public:
-    ScheduledLocationChange(const String& url, const String& referrer, bool lockHistory, bool lockBackForwardList, bool wasUserGesture, bool duringLoad)
-        : ScheduledURLNavigation(0.0, url, referrer, lockHistory, lockBackForwardList, wasUserGesture, duringLoad, true) { }
-};
-
-class ScheduledRefresh : public ScheduledURLNavigation {
-public:
-    ScheduledRefresh(const String& url, const String& referrer, bool wasUserGesture)
-        : ScheduledURLNavigation(0.0, url, referrer, true, true, wasUserGesture, false, true) { }
-
-    virtual void fire(Frame* frame)
-    {
-        frame->loader()->changeLocation(KURL(ParsedURLString, url()), referrer(), lockHistory(), lockBackForwardList(), wasUserGesture(), true);
-    }
-};
-
-class ScheduledHistoryNavigation : public ScheduledNavigation {
-public:
-    explicit ScheduledHistoryNavigation(int historySteps, bool wasUserGesture) : ScheduledNavigation(0, false, false, false, true, wasUserGesture), m_historySteps(historySteps) { }
-
-    virtual void fire(Frame* frame)
-    {
-        UserGestureIndicator gestureIndicator(wasUserGesture() ? DefinitelyProcessingUserGesture : DefinitelyNotProcessingUserGesture);
-
-        FrameLoader* loader = frame->loader();
-        if (!m_historySteps) {
-            // Special case for go(0) from a frame -> reload only the frame
-            // To follow Firefox and IE's behavior, history reload can only navigate the self frame.
-            loader->urlSelected(loader->url(), "_self", 0, lockHistory(), lockBackForwardList(), 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.
-        frame->page()->goBackOrForward(m_historySteps);
-    }
-
-private:
-    int m_historySteps;
-};
-
-class ScheduledFormSubmission : public ScheduledNavigation {
-public:
-    ScheduledFormSubmission(PassRefPtr<FormSubmission> submission, bool lockBackForwardList, bool duringLoad, bool wasUserGesture)
-        : ScheduledNavigation(0, submission->lockHistory(), lockBackForwardList, duringLoad, true, wasUserGesture)
-        , m_submission(submission)
-        , m_haveToldClient(false)
-    {
-        ASSERT(m_submission->state());
-    }
-
-    virtual void fire(Frame* frame)
-    {
-        UserGestureIndicator gestureIndicator(wasUserGesture() ? DefinitelyProcessingUserGesture : DefinitelyNotProcessingUserGesture);
-
-        // The submitForm function will find a target frame before using the redirection timer.
-        // Now that the timer has fired, we need to repeat the security check which normally is done when
-        // selecting a target, in case conditions have changed. Other code paths avoid this by targeting
-        // without leaving a time window. If we fail the check just silently drop the form submission.
-        if (!m_submission->state()->sourceFrame()->loader()->shouldAllowNavigation(frame))
-            return;
-        FrameLoadRequest frameRequest;
-        m_submission->populateFrameLoadRequest(frameRequest);
-        frame->loader()->loadFrameRequest(frameRequest, lockHistory(), lockBackForwardList(), m_submission->event(), m_submission->state(), SendReferrer);
-    }
-    
-    virtual void didStartTimer(Frame* frame, Timer<RedirectScheduler>* timer)
-    {
-        if (m_haveToldClient)
-            return;
-        m_haveToldClient = true;
-        frame->loader()->clientRedirected(m_submission->requestURL(), delay(), currentTime() + timer->nextFireInterval(), lockBackForwardList());
-    }
-
-    virtual void didStopTimer(Frame* frame, bool newLoadInProgress)
-    {
-        if (!m_haveToldClient)
-            return;
-        frame->loader()->clientRedirectCancelledOrFinished(newLoadInProgress);
-    }
-
-private:
-    RefPtr<FormSubmission> m_submission;
-    bool m_haveToldClient;
-};
-
-RedirectScheduler::RedirectScheduler(Frame* frame)
-    : m_frame(frame)
-    , m_timer(this, &RedirectScheduler::timerFired)
-{
-}
-
-RedirectScheduler::~RedirectScheduler()
-{
-}
-
-bool RedirectScheduler::redirectScheduledDuringLoad()
-{
-    return m_redirect && m_redirect->wasDuringLoad();
-}
-
-bool RedirectScheduler::locationChangePending()
-{
-    return m_redirect && m_redirect->isLocationChange();
-}
-
-void RedirectScheduler::clear()
-{
-    m_timer.stop();
-    m_redirect.clear();
-}
-
-void RedirectScheduler::scheduleRedirect(double delay, const String& url)
-{
-    if (!m_frame->page())
-        return;
-    if (delay < 0 || delay > INT_MAX / 1000)
-        return;
-    if (url.isEmpty())
-        return;
-
-    // We want a new back/forward list item if the refresh timeout is > 1 second.
-    if (!m_redirect || delay <= m_redirect->delay())
-        schedule(adoptPtr(new ScheduledRedirect(delay, url, true, delay <= 1, false)));
-}
-
-bool RedirectScheduler::mustLockBackForwardList(Frame* targetFrame, bool wasUserGesture)
-{
-    // Non-user navigation before the page has finished firing onload should not create a new back/forward item.
-    // See https://webkit.org/b/42861 for the original motivation for this.    
-    if (!wasUserGesture && targetFrame->loader()->documentLoader() && !targetFrame->loader()->documentLoader()->wasOnloadHandled())
-        return true;
-    
-    // Navigation of a subframe during loading of an ancestor frame does not create a new back/forward item.
-    // The definition of "during load" is any time before all handlers for the load event have been run.
-    // See https://bugs.webkit.org/show_bug.cgi?id=14957 for the original motivation for this.
-    for (Frame* ancestor = targetFrame->tree()->parent(); ancestor; ancestor = ancestor->tree()->parent()) {
-        Document* document = ancestor->document();
-        if (!ancestor->loader()->isComplete() || (document && document->processingLoadEvent()))
-            return true;
-    }
-    return false;
-}
-
-void RedirectScheduler::scheduleLocationChange(const String& url, const String& referrer, bool lockHistory, bool lockBackForwardList, bool wasUserGesture)
-{
-    if (!m_frame->page())
-        return;
-    if (url.isEmpty())
-        return;
-
-    lockBackForwardList = lockBackForwardList || mustLockBackForwardList(m_frame, wasUserGesture);
-
-    FrameLoader* loader = m_frame->loader();
-    
-    // If the URL we're going to navigate to is the same as the current one, except for the
-    // fragment part, we don't need to schedule the location change.
-    KURL parsedURL(ParsedURLString, url);
-    if (parsedURL.hasFragmentIdentifier() && equalIgnoringFragmentIdentifier(loader->url(), parsedURL)) {
-        loader->changeLocation(loader->completeURL(url), referrer, lockHistory, lockBackForwardList, wasUserGesture);
-        return;
-    }
-
-    // Handle a location change of a page with no document as a special case.
-    // This may happen when a frame changes the location of another frame.
-    bool duringLoad = !loader->stateMachine()->committedFirstRealDocumentLoad();
-
-    schedule(adoptPtr(new ScheduledLocationChange(url, referrer, lockHistory, lockBackForwardList, wasUserGesture, duringLoad)));
-}
-
-void RedirectScheduler::scheduleFormSubmission(PassRefPtr<FormSubmission> submission)
-{
-    ASSERT(m_frame->page());
-
-    // FIXME: Do we need special handling for form submissions where the URL is the same
-    // as the current one except for the fragment part? See scheduleLocationChange above.
-
-    // Handle a location change of a page with no document as a special case.
-    // This may happen when a frame changes the location of another frame.
-    bool duringLoad = !m_frame->loader()->stateMachine()->committedFirstRealDocumentLoad();
-
-    // If this is a child frame and the form submission was triggered by a script, lock the back/forward list
-    // to match IE and Opera.
-    // See https://bugs.webkit.org/show_bug.cgi?id=32383 for the original motivation for this.
-    bool isUserGesture = m_frame->loader()->isProcessingUserGesture();
-    bool lockBackForwardList = mustLockBackForwardList(m_frame, isUserGesture) || (submission->state()->formSubmissionTrigger() == SubmittedByJavaScript && m_frame->tree()->parent() && !isUserGesture);
-
-    schedule(adoptPtr(new ScheduledFormSubmission(submission, lockBackForwardList, duringLoad, isUserGesture)));
-}
-
-void RedirectScheduler::scheduleRefresh(bool wasUserGesture)
-{
-    if (!m_frame->page())
-        return;
-    const KURL& url = m_frame->loader()->url();
-    if (url.isEmpty())
-        return;
-
-    schedule(adoptPtr(new ScheduledRefresh(url.string(), m_frame->loader()->outgoingReferrer(), wasUserGesture)));
-}
-
-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.
-    HistoryItem* specifiedEntry = m_frame->page()->backForwardList()->itemAtIndex(steps);
-    if (!specifiedEntry) {
-        cancel();
-        return;
-    }
-
-    // In all other cases, schedule the history traversal to occur asynchronously.
-    schedule(adoptPtr(new ScheduledHistoryNavigation(steps, m_frame->loader()->isProcessingUserGesture())));
-}
-
-void RedirectScheduler::timerFired(Timer<RedirectScheduler>*)
-{
-    if (!m_frame->page())
-        return;
-    if (m_frame->page()->defersLoading())
-        return;
-
-    OwnPtr<ScheduledNavigation> redirect(m_redirect.release());
-    redirect->fire(m_frame);
-}
-
-void RedirectScheduler::schedule(PassOwnPtr<ScheduledNavigation> redirect)
-{
-    ASSERT(m_frame->page());
-
-    // If a redirect was scheduled during a load, then stop the current load.
-    // Otherwise when the current load transitions from a provisional to a 
-    // committed state, pending redirects may be cancelled. 
-    if (redirect->wasDuringLoad()) {
-        if (DocumentLoader* provisionalDocumentLoader = m_frame->loader()->provisionalDocumentLoader())
-            provisionalDocumentLoader->stopLoading();
-        m_frame->loader()->stopLoading(UnloadEventPolicyUnloadAndPageHide);   
-    }
-
-    cancel();
-    m_redirect = redirect;
-
-    if (!m_frame->loader()->isComplete() && m_redirect->isLocationChange())
-        m_frame->loader()->completed();
-
-    startTimer();
-}
-
-void RedirectScheduler::startTimer()
-{
-    if (!m_redirect)
-        return;
-
-    ASSERT(m_frame->page());
-    if (m_timer.isActive())
-        return;
-    if (!m_redirect->shouldStartTimer(m_frame))
-        return;
-
-    m_timer.startOneShot(m_redirect->delay());
-    m_redirect->didStartTimer(m_frame, &m_timer);
-}
-
-void RedirectScheduler::cancel(bool newLoadInProgress)
-{
-    m_timer.stop();
-
-    OwnPtr<ScheduledNavigation> redirect(m_redirect.release());
-    if (redirect)
-        redirect->didStopTimer(m_frame, newLoadInProgress);
-}
-
-} // namespace WebCore
diff --git a/WebCore/loader/RedirectScheduler.h b/WebCore/loader/RedirectScheduler.h
deleted file mode 100644
index 70b0202..0000000
--- a/WebCore/loader/RedirectScheduler.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
- * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
- * Copyright (C) 2009 Adam Barth. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer. 
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution. 
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission. 
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef RedirectScheduler_h
-#define RedirectScheduler_h
-
-#include "Event.h"
-#include "Timer.h"
-#include <wtf/Forward.h>
-#include <wtf/OwnPtr.h>
-#include <wtf/PassOwnPtr.h>
-#include <wtf/PassRefPtr.h>
-
-namespace WebCore {
-
-class FormState;
-class FormSubmission;
-class Frame;
-
-struct FrameLoadRequest;
-class ScheduledNavigation;
-
-class RedirectScheduler : public Noncopyable {
-public:
-    RedirectScheduler(Frame*);
-    ~RedirectScheduler();
-
-    bool redirectScheduledDuringLoad();
-    bool locationChangePending();
-
-    void scheduleRedirect(double delay, const String& url);
-    void scheduleLocationChange(const String& url, const String& referrer, bool lockHistory = true, bool lockBackForwardList = true, bool userGesture = false);
-    void scheduleFormSubmission(PassRefPtr<FormSubmission>);
-    void scheduleRefresh(bool userGesture = false);
-    void scheduleHistoryNavigation(int steps);
-
-    void startTimer();
-
-    void cancel(bool newLoadInProgress = false);
-    void clear();
-
-private:
-    void timerFired(Timer<RedirectScheduler>*);
-    void schedule(PassOwnPtr<ScheduledNavigation>);
-
-    static bool mustLockBackForwardList(Frame* targetFrame, bool mustLockIfDuringLoad);
-
-    Frame* m_frame;
-    Timer<RedirectScheduler> m_timer;
-    OwnPtr<ScheduledNavigation> m_redirect;
-};
-
-} // namespace WebCore
-
-#endif // RedirectScheduler_h
diff --git a/WebCore/loader/SubframeLoader.cpp b/WebCore/loader/SubframeLoader.cpp
index 6c59ab4..d5d0e46 100644
--- a/WebCore/loader/SubframeLoader.cpp
+++ b/WebCore/loader/SubframeLoader.cpp
@@ -239,7 +239,7 @@ Frame* SubframeLoader::loadOrRedirectSubframe(HTMLFrameOwnerElement* ownerElemen
 {
     Frame* frame = ownerElement->contentFrame();
     if (frame)
-        frame->redirectScheduler()->scheduleLocationChange(url.string(), m_frame->loader()->outgoingReferrer(), lockHistory, lockBackForwardList, m_frame->loader()->isProcessingUserGesture());
+        frame->navigationScheduler()->scheduleLocationChange(url.string(), m_frame->loader()->outgoingReferrer(), lockHistory, lockBackForwardList, m_frame->loader()->isProcessingUserGesture());
     else
         frame = loadSubframe(ownerElement, url, frameName, m_frame->loader()->outgoingReferrer());
     return frame;
diff --git a/WebCore/loader/appcache/ApplicationCacheGroup.cpp b/WebCore/loader/appcache/ApplicationCacheGroup.cpp
index 82f2a0a..daa6f4a 100644
--- a/WebCore/loader/appcache/ApplicationCacheGroup.cpp
+++ b/WebCore/loader/appcache/ApplicationCacheGroup.cpp
@@ -175,7 +175,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->redirectScheduler()->scheduleLocationChange(documentLoader->url(), frame->loader()->referrer(), true);
+            frame->navigationScheduler()->scheduleLocationChange(documentLoader->url(), frame->loader()->referrer(), true);
         }
         
         return;
diff --git a/WebCore/page/Frame.cpp b/WebCore/page/Frame.cpp
index 2cccd92..5a040f1 100644
--- a/WebCore/page/Frame.cpp
+++ b/WebCore/page/Frame.cpp
@@ -149,7 +149,7 @@ inline Frame::Frame(Page* page, HTMLFrameOwnerElement* ownerElement, FrameLoader
     : m_page(page)
     , m_treeNode(this, parentFromOwnerElement(ownerElement))
     , m_loader(this, frameLoaderClient)
-    , m_redirectScheduler(this)
+    , m_navigationScheduler(this)
     , m_ownerElement(ownerElement)
     , m_script(this)
     , m_editor(this)
diff --git a/WebCore/page/Frame.h b/WebCore/page/Frame.h
index c09c330..b48f5c8 100644
--- a/WebCore/page/Frame.h
+++ b/WebCore/page/Frame.h
@@ -93,7 +93,7 @@ namespace WebCore {
         Editor* editor() const;
         EventHandler* eventHandler() const;
         FrameLoader* loader() const;
-        RedirectScheduler* redirectScheduler() const;
+        NavigationScheduler* navigationScheduler() const;
         SelectionController* selection() const;
         FrameTree* tree() const;
         AnimationController* animation() const;
@@ -194,7 +194,7 @@ namespace WebCore {
         Page* m_page;
         mutable FrameTree m_treeNode;
         mutable FrameLoader m_loader;
-        mutable RedirectScheduler m_redirectScheduler;
+        mutable NavigationScheduler m_navigationScheduler;
 
         mutable RefPtr<DOMWindow> m_domWindow;
         HashSet<DOMWindow*> m_liveFormerWindows;
@@ -252,9 +252,9 @@ namespace WebCore {
         return &m_loader;
     }
 
-    inline RedirectScheduler* Frame::redirectScheduler() const
+    inline NavigationScheduler* Frame::navigationScheduler() const
     {
-        return &m_redirectScheduler;
+        return &m_navigationScheduler;
     }
 
     inline FrameView* Frame::view() const
diff --git a/WebCore/page/History.cpp b/WebCore/page/History.cpp
index 337f5b2..3d463b6 100644
--- a/WebCore/page/History.cpp
+++ b/WebCore/page/History.cpp
@@ -63,21 +63,21 @@ void History::back()
 {
     if (!m_frame)
         return;
-    m_frame->redirectScheduler()->scheduleHistoryNavigation(-1);
+    m_frame->navigationScheduler()->scheduleHistoryNavigation(-1);
 }
 
 void History::forward()
 {
     if (!m_frame)
         return;
-    m_frame->redirectScheduler()->scheduleHistoryNavigation(1);
+    m_frame->navigationScheduler()->scheduleHistoryNavigation(1);
 }
 
 void History::go(int distance)
 {
     if (!m_frame)
         return;
-    m_frame->redirectScheduler()->scheduleHistoryNavigation(distance);
+    m_frame->navigationScheduler()->scheduleHistoryNavigation(distance);
 }
 
 KURL History::urlForState(const String& urlString)
diff --git a/WebCore/page/XSSAuditor.cpp b/WebCore/page/XSSAuditor.cpp
index 0e6cc65..1a6ff02 100644
--- a/WebCore/page/XSSAuditor.cpp
+++ b/WebCore/page/XSSAuditor.cpp
@@ -340,7 +340,7 @@ bool XSSAuditor::findInRequest(const FindTask& task) const
     case XSSProtectionBlockEnabled:
         if (blockFrame) {
             blockFrame->loader()->stopAllLoaders();
-            blockFrame->redirectScheduler()->scheduleLocationChange(blankURL(), String());
+            blockFrame->navigationScheduler()->scheduleLocationChange(blankURL(), String());
         }
         break;
     default:
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 4402293..f1d08a8 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,17 @@
+2010-10-04  Adam Barth  <abarth at webkit.org>
+
+        Reviewed by Darin Adler.
+
+        Rename RedirectScheduler to NavigationScheduler
+        https://bugs.webkit.org/show_bug.cgi?id=47037
+
+        Update for name change.
+
+        * src/ApplicationCacheHost.cpp:
+        (WebCore::ApplicationCacheHost::selectCacheWithManifest):
+        * src/WebFrameImpl.cpp:
+        (WebKit::WebFrameImpl::loadJavaScriptURL):
+
 2010-10-01  Victoria Kirst  <vrk at google.com>
 
         Reviewed by James Robinson.
diff --git a/WebKit/chromium/src/ApplicationCacheHost.cpp b/WebKit/chromium/src/ApplicationCacheHost.cpp
index 3bfcfe2..55d7322 100644
--- a/WebKit/chromium/src/ApplicationCacheHost.cpp
+++ b/WebKit/chromium/src/ApplicationCacheHost.cpp
@@ -108,7 +108,7 @@ void ApplicationCacheHost::selectCacheWithManifest(const KURL& manifestURL)
             // see WebCore::ApplicationCacheGroup::selectCache()
             const KURL& docURL = m_documentLoader->frame()->document()->url();
             String referrer = m_documentLoader->frameLoader()->referrer();
-            m_documentLoader->frame()->redirectScheduler()->scheduleLocationChange(docURL, referrer);
+            m_documentLoader->frame()->navigationScheduler()->scheduleLocationChange(docURL, referrer);
         }
     }
 }
diff --git a/WebKit/chromium/src/WebFrameImpl.cpp b/WebKit/chromium/src/WebFrameImpl.cpp
index b93a792..3cd6480 100644
--- a/WebKit/chromium/src/WebFrameImpl.cpp
+++ b/WebKit/chromium/src/WebFrameImpl.cpp
@@ -2254,7 +2254,7 @@ void WebFrameImpl::loadJavaScriptURL(const KURL& url)
     if (!result.getString(scriptResult))
         return;
 
-    if (!m_frame->redirectScheduler()->locationChangePending())
+    if (!m_frame->navigationScheduler()->locationChangePending())
         m_frame->loader()->writer()->replaceDocument(scriptResult);
 }
 
diff --git a/WebKit/qt/Api/qwebpage.cpp b/WebKit/qt/Api/qwebpage.cpp
index c262908..9ded37b 100644
--- a/WebKit/qt/Api/qwebpage.cpp
+++ b/WebKit/qt/Api/qwebpage.cpp
@@ -2283,12 +2283,12 @@ void QWebPage::triggerAction(WebAction action, bool)
         }
         case StopScheduledPageRefresh: {
             QWebFrame* topFrame = mainFrame();
-            topFrame->d->frame->redirectScheduler()->cancel();
+            topFrame->d->frame->navigationScheduler()->cancel();
             QList<QWebFrame*> childFrames;
             collectChildFrames(topFrame, childFrames);
             QListIterator<QWebFrame*> it(childFrames);
             while (it.hasNext())
-                it.next()->d->frame->redirectScheduler()->cancel();
+                it.next()->d->frame->navigationScheduler()->cancel();
             break;
         }
         default:
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index 96253ed..48c9736 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,15 @@
+2010-10-04  Adam Barth  <abarth at webkit.org>
+
+        Reviewed by Darin Adler.
+
+        Rename RedirectScheduler to NavigationScheduler
+        https://bugs.webkit.org/show_bug.cgi?id=47037
+
+        Update for name change.
+
+        * Api/qwebpage.cpp:
+        (QWebPage::triggerAction):
+
 2010-10-04  Diego Gonzalez  <diegohcg at webkit.org>
 
         Reviewed by Kenneth Rohde Christiansen.

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list