summaryrefslogtreecommitdiffstats
path: root/WebCore/loader/FrameLoader.cpp
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2009-08-18 15:36:45 +0100
committerBen Murdoch <benm@google.com>2009-08-18 19:20:06 +0100
commitd227fc870c7a697500a3c900c31baf05fb9a8524 (patch)
treea3fa109aa5bf52fef562ac49d97a2f723889cc71 /WebCore/loader/FrameLoader.cpp
parentf2c627513266faa73f7669058d98c60769fb3524 (diff)
downloadexternal_webkit-d227fc870c7a697500a3c900c31baf05fb9a8524.zip
external_webkit-d227fc870c7a697500a3c900c31baf05fb9a8524.tar.gz
external_webkit-d227fc870c7a697500a3c900c31baf05fb9a8524.tar.bz2
Merge WebKit r47420
Diffstat (limited to 'WebCore/loader/FrameLoader.cpp')
-rw-r--r--WebCore/loader/FrameLoader.cpp36
1 files changed, 27 insertions, 9 deletions
diff --git a/WebCore/loader/FrameLoader.cpp b/WebCore/loader/FrameLoader.cpp
index 256c82d..dd584ca 100644
--- a/WebCore/loader/FrameLoader.cpp
+++ b/WebCore/loader/FrameLoader.cpp
@@ -89,6 +89,7 @@
#include "SecurityOrigin.h"
#include "SegmentedString.h"
#include "Settings.h"
+#include "SharedWorkerRepository.h"
#include "TextResourceDecoder.h"
#include "WindowFeatures.h"
#include "XMLHttpRequest.h"
@@ -277,6 +278,7 @@ FrameLoader::FrameLoader(Frame* frame, FrameLoaderClient* client)
, m_isDisplayingInitialEmptyDocument(false)
, m_committedFirstRealDocumentLoad(false)
, m_didPerformFirstNavigation(false)
+ , m_loadingFromCachedPage(false)
#ifndef NDEBUG
, m_didDispatchDidCommitLoad(false)
#endif
@@ -929,9 +931,6 @@ void FrameLoader::begin(const KURL& url, bool dispatch, SecurityOrigin* origin)
m_frame->setDocument(document);
- if (dispatch)
- dispatchWindowObjectAvailable();
-
document->setURL(m_URL);
if (m_decoder)
document->setDecoder(m_decoder.get());
@@ -941,6 +940,9 @@ void FrameLoader::begin(const KURL& url, bool dispatch, SecurityOrigin* origin)
m_frame->domWindow()->setURL(document->url());
m_frame->domWindow()->setSecurityOrigin(document->securityOrigin());
+ if (dispatch)
+ dispatchWindowObjectAvailable();
+
updateFirstPartyForCookies();
Settings* settings = document->settings();
@@ -1843,6 +1845,9 @@ bool FrameLoader::canCachePageContainingThisFrame()
#if ENABLE(DATABASE)
&& !m_frame->document()->hasOpenDatabases()
#endif
+#if ENABLE(SHARED_WORKERS)
+ && !SharedWorkerRepository::hasSharedWorkers(m_frame->document())
+#endif
&& !m_frame->document()->usingGeolocation()
&& m_currentHistoryItem
&& !m_quickRedirectComing
@@ -1989,6 +1994,10 @@ bool FrameLoader::logCanCacheFrameDecision(int indentLevel)
if (m_frame->document()->hasOpenDatabases())
{ PCLOG(" -Frame has open database handles"); cannotCache = true; }
#endif
+#if ENABLE(SHARED_WORKERS)
+ if (SharedWorkerRepository::hasSharedWorkers(m_frame->document()))
+ { PCLOG(" -Frame has associated SharedWorkers"); cannotCache = true; }
+#endif
if (m_frame->document()->usingGeolocation())
{ PCLOG(" -Frame uses Geolocation"); cannotCache = true; }
if (!m_currentHistoryItem)
@@ -2833,7 +2842,8 @@ void FrameLoader::commitProvisionalLoad(PassRefPtr<CachedPage> prpCachedPage)
RefPtr<CachedPage> cachedPage = prpCachedPage;
RefPtr<DocumentLoader> pdl = m_provisionalDocumentLoader;
- LOG(Loading, "WebCoreLoading %s: About to commit provisional load from previous URL %s", m_frame->tree()->name().string().utf8().data(), m_URL.string().utf8().data());
+ LOG(PageCache, "WebCoreLoading %s: About to commit provisional load from previous URL '%s' to new URL '%s'", m_frame->tree()->name().string().utf8().data(), m_URL.string().utf8().data(),
+ pdl ? pdl->url().string().utf8().data() : "<no provisional DocumentLoader>");
// Check to see if we need to cache the page we are navigating away from into the back/forward cache.
// We are doing this here because we know for sure that a new page is about to be loaded.
@@ -2874,7 +2884,7 @@ void FrameLoader::commitProvisionalLoad(PassRefPtr<CachedPage> prpCachedPage)
if (m_loadType == FrameLoadTypeStandard && m_documentLoader->isClientRedirect())
updateHistoryForClientRedirect();
- if (m_documentLoader->isLoadingFromCachedPage()) {
+ if (m_loadingFromCachedPage) {
m_frame->document()->documentDidBecomeActive();
// Force a layout to update view size and thereby update scrollbars.
@@ -3451,7 +3461,7 @@ void FrameLoader::continueLoadAfterWillSubmitForm(PolicyAction)
if (activeDocLoader && activeDocLoader->isLoadingMainResource())
return;
- m_provisionalDocumentLoader->setLoadingFromCachedPage(false);
+ m_loadingFromCachedPage = false;
unsigned long identifier = 0;
@@ -4236,7 +4246,17 @@ bool FrameLoader::loadProvisionalItemFromCachedPage()
RefPtr<CachedPage> cachedPage = pageCache()->get(m_provisionalHistoryItem.get());
if (!cachedPage || !cachedPage->document())
return false;
- provisionalDocumentLoader()->loadFromCachedPage(cachedPage.release());
+
+ DocumentLoader *provisionalLoader = provisionalDocumentLoader();
+ LOG(PageCache, "WebCorePageCache: FrameLoader %p loading provisional DocumentLoader %p with URL '%s' from CachedPage %p", this, provisionalLoader, provisionalLoader->url().string().utf8().data(), cachedPage.get());
+
+ provisionalLoader->prepareForLoadStart();
+
+ m_loadingFromCachedPage = true;
+
+ provisionalLoader->setCommitted(true);
+ commitProvisionalLoad(cachedPage);
+
return true;
}
@@ -5111,8 +5131,6 @@ void FrameLoader::dispatchWindowObjectAvailable()
m_client->windowObjectCleared();
if (Page* page = m_frame->page()) {
- if (InspectorController* inspector = page->inspectorController())
- inspector->inspectedWindowScriptObjectCleared(m_frame);
if (InspectorController* inspector = page->parentInspectorController())
inspector->windowScriptObjectAvailable();
}