diff options
author | Ben Murdoch <benm@google.com> | 2011-05-24 11:24:40 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2011-06-02 09:53:15 +0100 |
commit | 81bc750723a18f21cd17d1b173cd2a4dda9cea6e (patch) | |
tree | 7a9e5ed86ff429fd347a25153107221543909b19 /Source/WebCore/loader/HistoryController.cpp | |
parent | 94088a6d336c1dd80a1e734af51e96abcbb689a7 (diff) | |
download | external_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.zip external_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.tar.gz external_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.tar.bz2 |
Merge WebKit at r80534: Intial merge by Git
Change-Id: Ia7a83357124c9e1cdb1debf55d9661ec0bd09a61
Diffstat (limited to 'Source/WebCore/loader/HistoryController.cpp')
-rw-r--r-- | Source/WebCore/loader/HistoryController.cpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/Source/WebCore/loader/HistoryController.cpp b/Source/WebCore/loader/HistoryController.cpp index 7bfe380..b8bece9 100644 --- a/Source/WebCore/loader/HistoryController.cpp +++ b/Source/WebCore/loader/HistoryController.cpp @@ -217,6 +217,18 @@ void HistoryController::invalidateCurrentItemCachedPage() pageCache()->remove(currentItem()); } +bool HistoryController::shouldStopLoadingForHistoryItem(HistoryItem* targetItem) const +{ + if (!m_currentItem) + return false; + + // Don't abort the current load if we're navigating within the current document. + if (m_currentItem->shouldDoSameDocumentNavigationTo(targetItem)) + return false; + + return m_frame->loader()->client()->shouldStopLoadingForHistoryItem(targetItem); +} + // Main funnel for navigating to a previous location (back/forward, non-search snap-back) // This includes recursion to handle loading into framesets properly void HistoryController::goToItem(HistoryItem* targetItem, FrameLoadType type) @@ -238,8 +250,7 @@ void HistoryController::goToItem(HistoryItem* targetItem, FrameLoadType type) // as opposed to happening for some/one of the page commits that might happen soon RefPtr<HistoryItem> currentItem = page->backForward()->currentItem(); page->backForward()->setCurrentItem(targetItem); - Settings* settings = m_frame->settings(); - page->setGlobalHistoryItem((!settings || settings->privateBrowsingEnabled()) ? 0 : targetItem); + m_frame->loader()->client()->updateGlobalHistoryItemForPage(); // First set the provisional item of any frames that are not actually navigating. // This must be done before trying to navigate the desired frame, because some @@ -311,8 +322,8 @@ void HistoryController::updateForStandardLoad(HistoryUpdateType updateType) if (frameLoader->documentLoader()->unreachableURL().isEmpty()) frameLoader->client()->updateGlobalHistoryRedirectLinks(); } - if (Page* page = m_frame->page()) - page->setGlobalHistoryItem(needPrivacy ? 0 : page->backForward()->currentItem()); + + m_frame->loader()->client()->updateGlobalHistoryItemForPage(); } } else { // The client redirect replaces the current history item. @@ -349,8 +360,8 @@ void HistoryController::updateForRedirectWithLockedBackForwardList() if (m_frame->loader()->documentLoader()->unreachableURL().isEmpty()) m_frame->loader()->client()->updateGlobalHistoryRedirectLinks(); } - if (Page* page = m_frame->page()) - page->setGlobalHistoryItem(needPrivacy ? 0 : page->backForward()->currentItem()); + + m_frame->loader()->client()->updateGlobalHistoryItemForPage(); } } // The client redirect replaces the current history item. |