Commit 43d36a30 authored by abarth@webkit.org's avatar abarth@webkit.org

2009-09-30 Adam Barth <abarth@webkit.org>

        Reviewed by Maciej Stachowiak.

        Factor RedirectScheduler out of FrameLoader
        https://bugs.webkit.org/show_bug.cgi?id=29948

        This change introduces a new sub-object of Frame, redirectScheduler.
        The redirectScheduler is responsible for scheduling redirects.

        This change leaves the code for the redirectScheduler in
        FrameLoader.cpp.  A future change will move the class into its own
        file.

        No behavior change (hopefully!).

        * loader/FrameLoader.cpp:
        (WebCore::RedirectScheduler::RedirectScheduler):
        (WebCore::RedirectScheduler::~RedirectScheduler):
        (WebCore::RedirectScheduler::redirectScheduledDuringLoad):
        (WebCore::RedirectScheduler::clear):
        (WebCore::FrameLoader::FrameLoader):
        (WebCore::FrameLoader::setDefersLoading):
        (WebCore::FrameLoader::stopLoading):
        (WebCore::FrameLoader::didOpenURL):
        (WebCore::FrameLoader::didExplicitOpen):
        (WebCore::FrameLoader::cancelAndClear):
        (WebCore::FrameLoader::clear):
        (WebCore::FrameLoader::checkCompleted):
        (WebCore::FrameLoader::isScheduledLocationChangePending):
        (WebCore::FrameLoader::scheduleHTTPRedirection):
        (WebCore::RedirectScheduler::scheduleRedirect):
        (WebCore::RedirectScheduler::mustLockBackForwardList):
        (WebCore::FrameLoader::scheduleLocationChange):
        (WebCore::RedirectScheduler::scheduleLocationChange):
        (WebCore::FrameLoader::scheduleFormSubmission):
        (WebCore::RedirectScheduler::scheduleFormSubmission):
        (WebCore::FrameLoader::scheduleRefresh):
        (WebCore::RedirectScheduler::scheduleRefresh):
        (WebCore::RedirectScheduler::locationChangePending):
        (WebCore::FrameLoader::scheduleHistoryNavigation):
        (WebCore::RedirectScheduler::scheduleHistoryNavigation):
        (WebCore::RedirectScheduler::timerFired):
        (WebCore::FrameLoader::provisionalLoadStarted):
        (WebCore::RedirectScheduler::schedule):
        (WebCore::RedirectScheduler::startTimer):
        (WebCore::RedirectScheduler::cancel):
        (WebCore::FrameLoader::completed):
        (WebCore::FrameLoader::open):
        * loader/FrameLoader.h:
        (WebCore::FrameLoader::committedFirstRealDocumentLoad):
        * page/Frame.cpp:
        (WebCore::Frame::Frame):
        (WebCore::Frame::redirectScheduler):
        * page/Frame.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48958 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent e9f60fe3
2009-09-30 Adam Barth <abarth@webkit.org>
Reviewed by Maciej Stachowiak.
Factor RedirectScheduler out of FrameLoader
https://bugs.webkit.org/show_bug.cgi?id=29948
This change introduces a new sub-object of Frame, redirectScheduler.
The redirectScheduler is responsible for scheduling redirects.
This change leaves the code for the redirectScheduler in
FrameLoader.cpp. A future change will move the class into its own
file.
No behavior change (hopefully!).
* loader/FrameLoader.cpp:
(WebCore::RedirectScheduler::RedirectScheduler):
(WebCore::RedirectScheduler::~RedirectScheduler):
(WebCore::RedirectScheduler::redirectScheduledDuringLoad):
(WebCore::RedirectScheduler::clear):
(WebCore::FrameLoader::FrameLoader):
(WebCore::FrameLoader::setDefersLoading):
(WebCore::FrameLoader::stopLoading):
(WebCore::FrameLoader::didOpenURL):
(WebCore::FrameLoader::didExplicitOpen):
(WebCore::FrameLoader::cancelAndClear):
(WebCore::FrameLoader::clear):
(WebCore::FrameLoader::checkCompleted):
(WebCore::FrameLoader::isScheduledLocationChangePending):
(WebCore::FrameLoader::scheduleHTTPRedirection):
(WebCore::RedirectScheduler::scheduleRedirect):
(WebCore::RedirectScheduler::mustLockBackForwardList):
(WebCore::FrameLoader::scheduleLocationChange):
(WebCore::RedirectScheduler::scheduleLocationChange):
(WebCore::FrameLoader::scheduleFormSubmission):
(WebCore::RedirectScheduler::scheduleFormSubmission):
(WebCore::FrameLoader::scheduleRefresh):
(WebCore::RedirectScheduler::scheduleRefresh):
(WebCore::RedirectScheduler::locationChangePending):
(WebCore::FrameLoader::scheduleHistoryNavigation):
(WebCore::RedirectScheduler::scheduleHistoryNavigation):
(WebCore::RedirectScheduler::timerFired):
(WebCore::FrameLoader::provisionalLoadStarted):
(WebCore::RedirectScheduler::schedule):
(WebCore::RedirectScheduler::startTimer):
(WebCore::RedirectScheduler::cancel):
(WebCore::FrameLoader::completed):
(WebCore::FrameLoader::open):
* loader/FrameLoader.h:
(WebCore::FrameLoader::committedFirstRealDocumentLoad):
* page/Frame.cpp:
(WebCore::Frame::Frame):
(WebCore::Frame::redirectScheduler):
* page/Frame.h:
2009-09-30 Maciej Stachowiak <mjs@apple.com>
Build fix, not reviewed.
......@@ -205,7 +205,28 @@ struct ScheduledRedirection {
ASSERT(this->formState);
}
};
RedirectScheduler::RedirectScheduler(Frame* frame)
: m_frame(frame)
, m_timer(this, &RedirectScheduler::timerFired)
{
}
RedirectScheduler::~RedirectScheduler()
{
}
bool RedirectScheduler::redirectScheduledDuringLoad()
{
return m_scheduledRedirection && m_scheduledRedirection->wasDuringLoad;
}
void RedirectScheduler::clear()
{
m_timer.stop();
m_scheduledRedirection.clear();
}
#if ENABLE(XHTMLMP)
static const char defaultAcceptHeader[] = "application/xml,application/vnd.wap.xhtml+xml,application/xhtml+xml;profile='http://www.wapforum.org/xhtml',text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5";
#else
......@@ -267,12 +288,10 @@ FrameLoader::FrameLoader(Frame* frame, FrameLoaderClient* client)
, m_unloadEventBeingDispatched(false)
, m_isComplete(false)
, m_isLoadingMainResource(false)
, m_cancellingWithLoadInProgress(false)
, m_needsClear(false)
, m_receivedData(false)
, m_encodingWasChosenByUser(false)
, m_containsPlugIns(false)
, m_redirectionTimer(this, &FrameLoader::redirectionTimerFired)
, m_checkTimer(this, &FrameLoader::checkTimerFired)
, m_shouldCallCheckCompleted(false)
, m_shouldCallCheckLoadComplete(false)
......@@ -327,7 +346,7 @@ void FrameLoader::setDefersLoading(bool defers)
m_policyDocumentLoader->setDefersLoading(defers);
if (!defers) {
startRedirectionTimer();
m_frame->redirectScheduler()->startTimer();
startCheckCompleteTimer();
}
}
......@@ -634,7 +653,7 @@ void FrameLoader::stopLoading(UnloadEventPolicy unloadEventPolicy, DatabasePolic
for (Frame* child = m_frame->tree()->firstChild(); child; child = child->tree()->nextSibling())
child->loader()->stopLoading(unloadEventPolicy);
cancelRedirection();
m_frame->redirectScheduler()->cancel();
}
void FrameLoader::stop()
......@@ -663,13 +682,6 @@ bool FrameLoader::closeURL()
return true;
}
void FrameLoader::cancelRedirection(bool cancelWithLoadInProgress)
{
m_cancellingWithLoadInProgress = cancelWithLoadInProgress;
stopRedirectionTimer();
}
KURL FrameLoader::iconURL()
{
// If this isn't a top level frame, return nothing
......@@ -695,13 +707,13 @@ KURL FrameLoader::iconURL()
bool FrameLoader::didOpenURL(const KURL& url)
{
if (m_scheduledRedirection && m_scheduledRedirection->wasDuringLoad) {
if (m_frame->redirectScheduler()->redirectScheduledDuringLoad()) {
// A redirect was scheduled before the document was created.
// This can happen when one frame changes another frame's location.
return false;
}
cancelRedirection();
m_frame->redirectScheduler()->cancel();
m_frame->editor()->clearLastEditCommand();
closeURL();
......@@ -738,7 +750,7 @@ void FrameLoader::didExplicitOpen()
// from a subsequent window.document.open / window.document.write call.
// Cancelling redirection here works for all cases because document.open
// implicitly precedes document.write.
cancelRedirection();
m_frame->redirectScheduler()->cancel();
if (m_frame->document()->url() != blankURL())
m_URL = m_frame->document()->url();
}
......@@ -802,7 +814,7 @@ ScriptValue FrameLoader::executeScript(const ScriptSourceCode& sourceCode)
void FrameLoader::cancelAndClear()
{
cancelRedirection();
m_frame->redirectScheduler()->cancel();
if (!m_isComplete)
closeURL();
......@@ -853,8 +865,7 @@ void FrameLoader::clear(bool clearWindowProperties, bool clearScriptObjects, boo
if (clearScriptObjects)
m_frame->script()->clearScriptObjects();
m_redirectionTimer.stop();
m_scheduledRedirection.clear();
m_frame->redirectScheduler()->clear();
m_checkTimer.stop();
m_shouldCallCheckCompleted = false;
......@@ -1298,7 +1309,7 @@ void FrameLoader::checkCompleted()
RefPtr<Frame> protect(m_frame);
checkCallImplicitClose(); // if we didn't do it before
startRedirectionTimer();
m_frame->redirectScheduler()->startTimer();
completed();
if (m_frame->page())
......@@ -1363,7 +1374,17 @@ KURL FrameLoader::completeURL(const String& url)
return m_frame->document()->completeURL(url);
}
bool FrameLoader::isScheduledLocationChangePending() const
{
return m_frame->redirectScheduler()->locationChangePending();
}
void FrameLoader::scheduleHTTPRedirection(double delay, const String& url)
{
m_frame->redirectScheduler()->scheduleRedirect(delay, url);
}
void RedirectScheduler::scheduleRedirect(double delay, const String& url)
{
if (delay < 0 || delay > INT_MAX / 1000)
return;
......@@ -1376,10 +1397,10 @@ void FrameLoader::scheduleHTTPRedirection(double delay, const String& url)
// We want a new history item if the refresh timeout is > 1 second.
if (!m_scheduledRedirection || delay <= m_scheduledRedirection->delay)
scheduleRedirection(new ScheduledRedirection(delay, url, true, delay <= 1, false, false));
schedule(new ScheduledRedirection(delay, url, true, delay <= 1, false, false));
}
static bool mustLockBackForwardList(Frame* targetFrame)
bool RedirectScheduler::mustLockBackForwardList(Frame* targetFrame)
{
// 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.
......@@ -1391,9 +1412,14 @@ static bool mustLockBackForwardList(Frame* targetFrame)
return true;
}
return false;
}
}
void FrameLoader::scheduleLocationChange(const String& url, const String& referrer, bool lockHistory, bool lockBackForwardList, bool wasUserGesture)
{
m_frame->redirectScheduler()->scheduleLocationChange(url, referrer, lockHistory, lockBackForwardList, wasUserGesture);
}
void RedirectScheduler::scheduleLocationChange(const String& url, const String& referrer, bool lockHistory, bool lockBackForwardList, bool wasUserGesture)
{
if (!m_frame->page())
return;
......@@ -1403,23 +1429,31 @@ void FrameLoader::scheduleLocationChange(const String& url, const String& referr
lockBackForwardList = lockBackForwardList || mustLockBackForwardList(m_frame);
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(m_URL, parsedURL)) {
changeLocation(completeURL(url), referrer, lockHistory, lockBackForwardList, wasUserGesture);
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 = !m_committedFirstRealDocumentLoad;
bool duringLoad = !loader->committedFirstRealDocumentLoad();
scheduleRedirection(new ScheduledRedirection(url, referrer, lockHistory, lockBackForwardList, wasUserGesture, false, duringLoad));
schedule(new ScheduledRedirection(url, referrer, lockHistory, lockBackForwardList, wasUserGesture, false, duringLoad));
}
void FrameLoader::scheduleFormSubmission(const FrameLoadRequest& frameRequest,
bool lockHistory, PassRefPtr<Event> event, PassRefPtr<FormState> formState)
{
m_frame->redirectScheduler()->scheduleFormSubmission(frameRequest, lockHistory, event, formState);
}
void RedirectScheduler::scheduleFormSubmission(const FrameLoadRequest& frameRequest,
bool lockHistory, PassRefPtr<Event> event, PassRefPtr<FormState> formState)
{
ASSERT(m_frame->page());
ASSERT(!frameRequest.isEmpty());
......@@ -1429,25 +1463,35 @@ void FrameLoader::scheduleFormSubmission(const FrameLoadRequest& frameRequest,
// 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_committedFirstRealDocumentLoad;
bool duringLoad = !m_frame->loader()->committedFirstRealDocumentLoad();
scheduleRedirection(new ScheduledRedirection(frameRequest, lockHistory, mustLockBackForwardList(m_frame), event, formState, duringLoad));
schedule(new ScheduledRedirection(frameRequest, lockHistory, mustLockBackForwardList(m_frame), event, formState, duringLoad));
}
void FrameLoader::scheduleRefresh(bool wasUserGesture)
{
m_frame->redirectScheduler()->scheduleRefresh(wasUserGesture);
}
void RedirectScheduler::scheduleRefresh(bool wasUserGesture)
{
if (!m_frame->page())
return;
const KURL& url = m_frame->loader()->url();
if (m_URL.isEmpty())
if (url.isEmpty())
return;
scheduleRedirection(new ScheduledRedirection(m_URL.string(), m_outgoingReferrer, true, true, wasUserGesture, true, false));
schedule(new ScheduledRedirection(url.string(), m_frame->loader()->outgoingReferrer(), true, true, wasUserGesture, true, false));
}
bool FrameLoader::isLocationChange(const ScheduledRedirection& redirection)
bool RedirectScheduler::locationChangePending()
{
switch (redirection.type) {
if (!m_scheduledRedirection)
return false;
switch (m_scheduledRedirection->type) {
case ScheduledRedirection::redirection:
return false;
case ScheduledRedirection::historyNavigation:
......@@ -1460,11 +1504,16 @@ bool FrameLoader::isLocationChange(const ScheduledRedirection& redirection)
}
void FrameLoader::scheduleHistoryNavigation(int steps)
{
m_frame->redirectScheduler()->scheduleHistoryNavigation(steps);
}
void RedirectScheduler::scheduleHistoryNavigation(int steps)
{
if (!m_frame->page())
return;
scheduleRedirection(new ScheduledRedirection(steps));
schedule(new ScheduledRedirection(steps));
}
void FrameLoader::goBackOrForward(int distance)
......@@ -1497,7 +1546,7 @@ void FrameLoader::goBackOrForward(int distance)
page->goToItem(item, FrameLoadTypeIndexedBackForward);
}
void FrameLoader::redirectionTimerFired(Timer<FrameLoader>*)
void RedirectScheduler::timerFired(Timer<RedirectScheduler>*)
{
ASSERT(m_frame->page());
......@@ -1505,23 +1554,24 @@ void FrameLoader::redirectionTimerFired(Timer<FrameLoader>*)
return;
OwnPtr<ScheduledRedirection> redirection(m_scheduledRedirection.release());
FrameLoader* loader = m_frame->loader();
switch (redirection->type) {
case ScheduledRedirection::redirection:
case ScheduledRedirection::locationChange:
changeLocation(KURL(ParsedURLString, redirection->url), redirection->referrer,
loader->changeLocation(KURL(ParsedURLString, redirection->url), redirection->referrer,
redirection->lockHistory, redirection->lockBackForwardList, redirection->wasUserGesture, redirection->wasRefresh);
return;
case ScheduledRedirection::historyNavigation:
if (redirection->historySteps == 0) {
// Special case for go(0) from a frame -> reload only the frame
urlSelected(m_URL, "", 0, redirection->lockHistory, redirection->lockBackForwardList, redirection->wasUserGesture);
loader->urlSelected(loader->url(), "", 0, redirection->lockHistory, redirection->lockBackForwardList, redirection->wasUserGesture);
return;
}
// go(i!=0) from a frame navigates into the history of the frame only,
// in both IE and NS (but not in Mozilla). We can't easily do that.
if (canGoBackOrForward(redirection->historySteps))
goBackOrForward(redirection->historySteps);
if (loader->canGoBackOrForward(redirection->historySteps))
loader->goBackOrForward(redirection->historySteps);
return;
case ScheduledRedirection::formSubmission:
// The submitForm function will find a target frame before using the redirection timer.
......@@ -1530,7 +1580,7 @@ void FrameLoader::redirectionTimerFired(Timer<FrameLoader>*)
// without leaving a time window. If we fail the check just silently drop the form submission.
if (!redirection->formState->sourceFrame()->loader()->shouldAllowNavigation(m_frame))
return;
loadFrameRequest(redirection->frameRequest, redirection->lockHistory, redirection->lockBackForwardList,
loader->loadFrameRequest(redirection->frameRequest, redirection->lockHistory, redirection->lockBackForwardList,
redirection->event, redirection->formState);
return;
}
......@@ -1822,7 +1872,7 @@ void FrameLoader::handleFallbackContent()
void FrameLoader::provisionalLoadStarted()
{
m_firstLayoutDone = false;
cancelRedirection(true);
m_frame->redirectScheduler()->cancel(true);
m_client->provisionalLoadStarted();
}
......@@ -2109,7 +2159,7 @@ private:
RefPtr<Document> m_document;
};
// This does the same kind of work that didOpenURL does, except it relies on the fact
// that a higher level already checked that the URLs match and the scrolling is the right thing to do.
void FrameLoader::scrollToAnchor(const KURL& url)
......@@ -2139,40 +2189,43 @@ bool FrameLoader::isComplete() const
return m_isComplete;
}
void FrameLoader::scheduleRedirection(PassOwnPtr<ScheduledRedirection> redirection)
void RedirectScheduler::schedule(PassOwnPtr<ScheduledRedirection> redirection)
{
ASSERT(m_frame->page());
FrameLoader* loader = m_frame->loader();
// 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 (redirection->wasDuringLoad) {
if (m_provisionalDocumentLoader)
m_provisionalDocumentLoader->stopLoading();
stopLoading(UnloadEventPolicyUnloadAndPageHide);
if (DocumentLoader* provisionalDocumentLoader = loader->provisionalDocumentLoader())
provisionalDocumentLoader->stopLoading();
loader->stopLoading(UnloadEventPolicyUnloadAndPageHide);
}
stopRedirectionTimer();
cancel();
m_scheduledRedirection = redirection;
if (!m_isComplete && m_scheduledRedirection->type != ScheduledRedirection::redirection)
completed();
startRedirectionTimer();
if (!loader->isComplete() && m_scheduledRedirection->type != ScheduledRedirection::redirection)
loader->completed();
startTimer();
}
void FrameLoader::startRedirectionTimer()
void RedirectScheduler::startTimer()
{
if (!m_scheduledRedirection)
return;
ASSERT(m_frame->page());
FrameLoader* loader = m_frame->loader();
if (m_redirectionTimer.isActive())
if (m_timer.isActive())
return;
if (m_scheduledRedirection->type == ScheduledRedirection::redirection && !allAncestorsAreComplete())
if (m_scheduledRedirection->type == ScheduledRedirection::redirection && !loader->allAncestorsAreComplete())
return;
m_redirectionTimer.startOneShot(m_scheduledRedirection->delay);
m_timer.startOneShot(m_scheduledRedirection->delay);
switch (m_scheduledRedirection->type) {
case ScheduledRedirection::locationChange:
......@@ -2180,9 +2233,9 @@ void FrameLoader::startRedirectionTimer()
if (m_scheduledRedirection->toldClient)
return;
m_scheduledRedirection->toldClient = true;
clientRedirected(KURL(ParsedURLString, m_scheduledRedirection->url),
loader->clientRedirected(KURL(ParsedURLString, m_scheduledRedirection->url),
m_scheduledRedirection->delay,
currentTime() + m_redirectionTimer.nextFireInterval(),
currentTime() + m_timer.nextFireInterval(),
m_scheduledRedirection->lockBackForwardList);
return;
case ScheduledRedirection::formSubmission:
......@@ -2197,20 +2250,20 @@ void FrameLoader::startRedirectionTimer()
ASSERT_NOT_REACHED();
}
void FrameLoader::stopRedirectionTimer()
void RedirectScheduler::cancel(bool newLoadInProgress)
{
m_redirectionTimer.stop();
m_timer.stop();
OwnPtr<ScheduledRedirection> redirection(m_scheduledRedirection.release());
if (redirection && redirection->toldClient)
clientRedirectCancelledOrFinished(m_cancellingWithLoadInProgress);
m_frame->loader()->clientRedirectCancelledOrFinished(newLoadInProgress);
}
void FrameLoader::completed()
{
RefPtr<Frame> protect(m_frame);
for (Frame* child = m_frame->tree()->firstChild(); child; child = child->tree()->nextSibling())
child->loader()->startRedirectionTimer();
child->redirectScheduler()->startTimer();
if (Frame* parent = m_frame->tree()->parent())
parent->loader()->checkCompleted();
if (m_frame->view())
......@@ -3130,7 +3183,7 @@ void FrameLoader::open(CachedPage& cachedPage)
ASSERT(m_frame->page());
ASSERT(m_frame->page()->mainFrame() == m_frame);
cancelRedirection();
m_frame->redirectScheduler()->cancel();
// We still have to close the previous part page.
closeURL();
......
......@@ -112,6 +112,36 @@ namespace WebCore {
void* m_argument;
};
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, bool lockBackForwardList, bool wasUserGesture);
void scheduleFormSubmission(const FrameLoadRequest&, bool lockHistory, PassRefPtr<Event>, PassRefPtr<FormState>);
void scheduleRefresh(bool wasUserGesture);
void scheduleHistoryNavigation(int steps);
void startTimer();
void cancel(bool newLoadInProgress = false);
void clear();
private:
void timerFired(Timer<RedirectScheduler>*);
void schedule(PassOwnPtr<ScheduledRedirection> redirection);
static bool mustLockBackForwardList(Frame* targetFrame);
Frame* m_frame;
Timer<RedirectScheduler> m_timer;
OwnPtr<ScheduledRedirection> m_scheduledRedirection;
};
class FrameLoader : public Noncopyable {
public:
FrameLoader(Frame*, FrameLoaderClient*);
......@@ -272,7 +302,7 @@ namespace WebCore {
KURL baseURL() const;
bool isScheduledLocationChangePending() const { return m_scheduledRedirection && isLocationChange(*m_scheduledRedirection); }
bool isScheduledLocationChangePending() const;
void scheduleHTTPRedirection(double delay, const String& url);
void scheduleLocationChange(const String& url, const String& referrer, bool lockHistory = true, bool lockBackForwardList = true, bool userGesture = false);
void scheduleRefresh(bool userGesture = false);
......@@ -370,6 +400,7 @@ namespace WebCore {
static bool allowSubstituteDataAccessToLocal();
bool committingFirstRealLoad() const { return !m_creatingInitialEmptyDocument && !m_committedFirstRealDocumentLoad; }
bool committedFirstRealDocumentLoad() const { return m_committedFirstRealDocumentLoad; }
void iconLoadDecisionAvailable();
......@@ -384,6 +415,13 @@ namespace WebCore {
void open(CachedFrameBase&);
// FIXME: Should these really be public?
void completed();
bool allAncestorsAreComplete() const; // including this
bool allChildrenAreComplete() const; // immediate children, not all descendants
void clientRedirected(const KURL&, double delay, double fireDate, bool lockBackForwardList);
void clientRedirectCancelledOrFinished(bool cancelWithLoadInProgress);
private:
PassRefPtr<HistoryItem> createHistoryItem(bool useOriginal);
PassRefPtr<HistoryItem> createHistoryItemTree(Frame* targetFrame, bool clipAtTarget);
......@@ -410,16 +448,11 @@ namespace WebCore {
void updateHistoryForClientRedirect();
void updateHistoryForCommit();
void updateHistoryForAnchorScroll();
void redirectionTimerFired(Timer<FrameLoader>*);
void checkTimerFired(Timer<FrameLoader>*);
void cancelRedirection(bool newLoadInProgress = false);
void started();
void completed();
bool shouldUsePlugin(const KURL&, const String& mimeType, bool hasFallback, bool& useFallback);
bool loadPlugin(RenderPart*, const KURL&, const String& mimeType,
const Vector<String>& paramNames, const Vector<String>& paramValues, bool useFallback);
......@@ -484,10 +517,6 @@ namespace WebCore {
bool shouldReloadToHandleUnreachableURL(DocumentLoader*);
void handleUnimplementablePolicy(const ResourceError&);
void scheduleRedirection(PassOwnPtr<ScheduledRedirection>);
void startRedirectionTimer();
void stopRedirectionTimer();
void dispatchDidCommitLoad();
void dispatchAssignIdentifierToInitialRequest(unsigned long identifier, DocumentLoader*, const ResourceRequest&);
void dispatchWillSendRequest(DocumentLoader*, unsigned long identifier, ResourceRequest&, const ResourceResponse& redirectResponse);
......@@ -495,7 +524,6 @@ namespace WebCore {
void dispatchDidReceiveContentLength(DocumentLoader*, unsigned long identifier, int length);
void dispatchDidFinishLoading(DocumentLoader*, unsigned long identifier);
static bool isLocationChange(const ScheduledRedirection&);
void scheduleFormSubmission(const FrameLoadRequest&, bool lockHistory, PassRefPtr<Event>, PassRefPtr<FormState>);
void loadWithDocumentLoader(DocumentLoader*, FrameLoadType, PassRefPtr<FormState>); // Calls continueLoadAfterNavigationPolicy
......@@ -509,8 +537,6 @@ namespace WebCore {
void loadURL(const KURL&, const String& referrer, const String& frameName, // Called by loadFrameRequest, calls loadWithNavigationAction or dispatches to navigation policy delegate
bool lockHistory, FrameLoadType, PassRefPtr<Event>, PassRefPtr<FormState>);
void clientRedirectCancelledOrFinished(bool cancelWithLoadInProgress);
void clientRedirected(const KURL&, double delay, double fireDate, bool lockBackForwardList);
bool shouldReload(const KURL& currentURL, const KURL& destinationURL);
void sendRemainingDelegateMessages(unsigned long identifier, const ResourceResponse&, int length, const ResourceError&);
......@@ -545,9 +571,6 @@ namespace WebCore {
void saveScrollPositionAndViewStateToItem(HistoryItem*);
bool allAncestorsAreComplete() const; // including this
bool allChildrenAreComplete() const; // immediate children, not all descendants
Frame* m_frame;
FrameLoaderClient* m_client;
......@@ -598,8 +621,6 @@ namespace WebCore {
bool m_cancellingWithLoadInProgress;
OwnPtr<ScheduledRedirection> m_scheduledRedirection;
bool m_needsClear;
bool m_receivedData;
......@@ -610,8 +631,7 @@ namespace WebCore {
bool m_containsPlugIns;
KURL m_submittedFormURL;
Timer<FrameLoader> m_redirectionTimer;
Timer<FrameLoader> m_checkTimer;
bool m_shouldCallCheckCompleted;
bool m_shouldCallCheckLoadComplete;
......
......@@ -123,6 +123,7 @@ Frame::Frame(Page* page, HTMLFrameOwnerElement* ownerElement, FrameLoaderClient*
: m_page(page)
, m_treeNode(this, parentFromOwnerElement(ownerElement))
, m_loader(this, frameLoaderClient)
, m_redirectScheduler(this)
, m_ownerElement(ownerElement)
, m_script(this)
, m_selectionGranularity(CharacterGranularity)
......@@ -220,6 +221,11 @@ FrameLoader* Frame::loader() const
return &m_loader;
}