Commit 88b4e6bf authored by abarth@webkit.org's avatar abarth@webkit.org

2010-10-04 Adam Barth <abarth@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@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@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
parent 4be23e3d
......@@ -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 \
......
......@@ -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
......
2010-10-04 Adam Barth <abarth@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@webkit.org>
Reviewed by Sam Weinig.
......@@ -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 \
......
......@@ -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',
......
......@@ -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 \
......
......@@ -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
......@@ -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 */,
......@@ -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();
}
......
......@@ -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
......
......@@ -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());
}
......
......@@ -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)
......
......@@ -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();
}
......
......@@ -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();
}
......
......@@ -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());
......
......@@ -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
......
......@@ -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();
......
......@@ -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"
......
......@@ -30,7 +30,7 @@
*/
#include "config.h"
#include "RedirectScheduler.h"
#include "NavigationScheduler.h"
#include "BackForwardList.h"
#include "DOMWindow.h"
......@@ -67,7 +67,7 @@ public:
virtual void fire(Frame*) = 0;
virtual bool shouldStartTimer(Frame*) { return true; }
virtual void didStartTimer(Frame*, Timer<RedirectScheduler>*) { }
virtual void didStartTimer(Frame*, Timer<NavigationScheduler>*) { }
virtual void didStopTimer(Frame*, bool /* newLoadInProgress */) { }
double delay() const { return m_delay; }
......@@ -101,7 +101,7 @@ public:
frame->loader()->changeLocation(KURL(ParsedURLString, m_url), m_referrer, lockHistory(), lockBackForwardList(), wasUserGesture(), false);
}
virtual void didStartTimer(Frame* frame, Timer<RedirectScheduler>* timer)
virtual void didStartTimer(Frame* frame, Timer<NavigationScheduler>* timer)
{
if (m_haveToldClient)
return;
......@@ -199,7 +199,7 @@ public:
frame->loader()->loadFrameRequest(frameRequest, lockHistory(), lockBackForwardList(), m_submission->event(), m_submission->state(), SendReferrer);
}
virtual void didStartTimer(Frame* frame, Timer<RedirectScheduler>* timer)
virtual void didStartTimer(Frame* frame, Timer<NavigationScheduler>* timer)
{
if (m_haveToldClient)
return;
......@@ -219,33 +219,33 @@ private:
bool m_haveToldClient;
};
RedirectScheduler::RedirectScheduler(Frame* frame)
NavigationScheduler::NavigationScheduler(Frame* frame)
: m_frame(frame)
, m_timer(this, &RedirectScheduler::timerFired)
, m_timer(this, &NavigationScheduler::timerFired)
{
}
RedirectScheduler::~RedirectScheduler()
NavigationScheduler::~NavigationScheduler()
{
}
bool RedirectScheduler::redirectScheduledDuringLoad()
bool NavigationScheduler::redirectScheduledDuringLoad()
{
return m_redirect && m_redirect->wasDuringLoad();
}
bool RedirectScheduler::locationChangePending()
bool NavigationScheduler::locationChangePending()
{
return m_redirect && m_redirect->isLocationChange();
}
void RedirectScheduler::clear()
void NavigationScheduler::clear()
{
m_timer.stop();
m_redirect.clear();
}
void RedirectScheduler::scheduleRedirect(double delay, const String& url)
void NavigationScheduler::scheduleRedirect(double delay, const String& url)
{
if (!m_frame->page())
return;
......@@ -259,7 +259,7 @@ void RedirectScheduler::scheduleRedirect(double delay, const String& url)
schedule(adoptPtr(new ScheduledRedirect(delay, url, true, delay <= 1, false)));
}
bool RedirectScheduler::mustLockBackForwardList(Frame* targetFrame, bool wasUserGesture)
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.
......@@ -277,7 +277,7 @@ bool RedirectScheduler::mustLockBackForwardList(Frame* targetFrame, bool wasUser
return false;
}
void RedirectScheduler::scheduleLocationChange(const String& url, const String& referrer, bool lockHistory, bool lockBackForwardList, bool wasUserGesture)
void NavigationScheduler::scheduleLocationChange(const String& url, const String& referrer, bool lockHistory, bool lockBackForwardList, bool wasUserGesture)
{
if (!m_frame->page())
return;
......@@ -303,7 +303,7 @@ void RedirectScheduler::scheduleLocationChange(const String& url, const String&
schedule(adoptPtr(new ScheduledLocationChange(url, referrer, lockHistory, lockBackForwardList, wasUserGesture, duringLoad)));
}
void RedirectScheduler::scheduleFormSubmission(PassRefPtr<FormSubmission> submission)
void NavigationScheduler::scheduleFormSubmission(PassRefPtr<FormSubmission> submission)
{
ASSERT(m_frame->page());
......@@ -323,7 +323,7 @@ void RedirectScheduler::scheduleFormSubmission(PassRefPtr<FormSubmission> submis
schedule(adoptPtr(new ScheduledFormSubmission(submission, lockBackForwardList, duringLoad, isUserGesture)));
}
void RedirectScheduler::scheduleRefresh(bool wasUserGesture)
void NavigationScheduler::scheduleRefresh(bool wasUserGesture)
{
if (!m_frame->page())
return;
......@@ -334,7 +334,7 @@ void RedirectScheduler::scheduleRefresh(bool wasUserGesture)
schedule(adoptPtr(new ScheduledRefresh(url.string(), m_frame->loader()->outgoingReferrer(), wasUserGesture)));
}
void RedirectScheduler::scheduleHistoryNavigation(int steps)
void NavigationScheduler::scheduleHistoryNavigation(int steps)
{
if (!m_frame->page())
return;
......@@ -351,7 +351,7 @@ void RedirectScheduler::scheduleHistoryNavigation(int steps)
schedule(adoptPtr(new ScheduledHistoryNavigation(steps, m_frame->loader()->isProcessingUserGesture())));
}
void RedirectScheduler::timerFired(Timer<RedirectScheduler>*)
void NavigationScheduler::timerFired(Timer<NavigationScheduler>*)
{
if (!m_frame->page())
return;
......@@ -362,7 +362,7 @@ void RedirectScheduler::timerFired(Timer<RedirectScheduler>*)
redirect->fire(m_frame);
}
void RedirectScheduler::schedule(PassOwnPtr<ScheduledNavigation> redirect)
void NavigationScheduler::schedule(PassOwnPtr<ScheduledNavigation> redirect)
{
ASSERT(m_frame->page());
......@@ -384,7 +384,7 @@ void RedirectScheduler::schedule(PassOwnPtr<ScheduledNavigation> redirect)
startTimer();
}
void RedirectScheduler::startTimer()
void NavigationScheduler::startTimer()
{
if (!m_redirect)
return;
......@@ -399,7 +399,7 @@ void RedirectScheduler::startTimer()
m_redirect->didStartTimer(m_frame, &m_timer);
}
void RedirectScheduler::cancel(bool newLoadInProgress)
void NavigationScheduler::cancel(bool newLoadInProgress)
{
m_timer.stop();
......
......@@ -47,10 +47,10 @@ class Frame;
struct FrameLoadRequest;
class ScheduledNavigation;
class RedirectScheduler : public Noncopyable {
class NavigationScheduler : public Noncopyable {
public:
RedirectScheduler(Frame*);
~RedirectScheduler();
NavigationScheduler(Frame*);
~NavigationScheduler();
bool redirectScheduledDuringLoad();
bool locationChangePending();
......@@ -67,13 +67,13 @@ public:
void clear();
private:
void timerFired(Timer<RedirectScheduler>*);
void timerFired(Timer<NavigationScheduler>*);
void schedule(PassOwnPtr<ScheduledNavigation>);
static bool mustLockBackForwardList(Frame* targetFrame, bool mustLockIfDuringLoad);
Frame* m_frame;