diff options
author | Ben Murdoch <benm@google.com> | 2009-06-05 14:49:32 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2009-06-05 15:24:00 +0100 |
commit | e1503159a6023b8eb39fbecadf6986c8ddd862e2 (patch) | |
tree | 2475b9c31532b452d5449c5372138ffa59675b0c /WebCore | |
parent | bf22f208d6fb755dd4ddebbde1a1a3b23e597990 (diff) | |
download | external_webkit-e1503159a6023b8eb39fbecadf6986c8ddd862e2.zip external_webkit-e1503159a6023b8eb39fbecadf6986c8ddd862e2.tar.gz external_webkit-e1503159a6023b8eb39fbecadf6986c8ddd862e2.tar.bz2 |
Check in patch for webkit bug 25710. History navigation by fragement breaks database transactions.
https://bugs.webkit.org/show_bug.cgi?id=25710, landed to webkit in r44468
Diffstat (limited to 'WebCore')
-rw-r--r-- | WebCore/WebCore.base.exp | 4 | ||||
-rw-r--r-- | WebCore/loader/DocumentLoader.cpp | 4 | ||||
-rw-r--r-- | WebCore/loader/DocumentLoader.h | 2 | ||||
-rw-r--r-- | WebCore/loader/FrameLoader.cpp | 11 | ||||
-rw-r--r-- | WebCore/loader/FrameLoader.h | 4 | ||||
-rw-r--r-- | WebCore/loader/FrameLoaderTypes.h | 5 | ||||
-rw-r--r-- | WebCore/page/Page.cpp | 14 |
7 files changed, 31 insertions, 13 deletions
diff --git a/WebCore/WebCore.base.exp b/WebCore/WebCore.base.exp index f642858..65fffc1 100644 --- a/WebCore/WebCore.base.exp +++ b/WebCore/WebCore.base.exp @@ -145,12 +145,12 @@ __ZN7WebCore11FileChooserD1Ev __ZN7WebCore11FrameLoader11completeURLERKNS_6StringE __ZN7WebCore11FrameLoader11loadArchiveEN3WTF10PassRefPtrINS_7ArchiveEEE __ZN7WebCore11FrameLoader11setEncodingERKNS_6StringEb -__ZN7WebCore11FrameLoader11stopLoadingEb +__ZN7WebCore11FrameLoader11stopLoadingEbNS_14DatabasePolicyE __ZN7WebCore11FrameLoader12shouldReloadERKNS_4KURLES3_ __ZN7WebCore11FrameLoader13executeScriptERKNS_6StringEb __ZN7WebCore11FrameLoader14detachChildrenEv __ZN7WebCore11FrameLoader14scrollToAnchorERKNS_4KURLE -__ZN7WebCore11FrameLoader14stopAllLoadersEv +__ZN7WebCore11FrameLoader14stopAllLoadersENS_14DatabasePolicyE __ZN7WebCore11FrameLoader16detachFromParentEv __ZN7WebCore11FrameLoader17stopForUserCancelEb __ZN7WebCore11FrameLoader18currentHistoryItemEv diff --git a/WebCore/loader/DocumentLoader.cpp b/WebCore/loader/DocumentLoader.cpp index bdf83a8..d0443e8 100644 --- a/WebCore/loader/DocumentLoader.cpp +++ b/WebCore/loader/DocumentLoader.cpp @@ -283,7 +283,7 @@ void DocumentLoader::mainReceivedError(const ResourceError& error, bool isComple // one document at a time, but one document may have many related resources. // stopLoading will stop all loads initiated by the data source, // but not loads initiated by child frames' data sources -- that's the WebFrame's job. -void DocumentLoader::stopLoading() +void DocumentLoader::stopLoading(DatabasePolicy databasePolicy) { // In some rare cases, calling FrameLoader::stopLoading could set m_loading to false. // (This can happen when there's a single XMLHttpRequest currently loading and stopLoading causes it @@ -296,7 +296,7 @@ void DocumentLoader::stopLoading() Document* doc = m_frame->document(); if (loading || doc->parsing()) - m_frame->loader()->stopLoading(false); + m_frame->loader()->stopLoading(false, databasePolicy); } // Always cancel multipart loaders diff --git a/WebCore/loader/DocumentLoader.h b/WebCore/loader/DocumentLoader.h index a861457..4493e22 100644 --- a/WebCore/loader/DocumentLoader.h +++ b/WebCore/loader/DocumentLoader.h @@ -95,7 +95,7 @@ namespace WebCore { void replaceRequestURLForAnchorScroll(const KURL&); bool isStopping() const { return m_isStopping; } - void stopLoading(); + void stopLoading(DatabasePolicy = DatabasePolicyStop); void setCommitted(bool committed) { m_committed = committed; } bool isCommitted() const { return m_committed; } bool isLoading() const { return m_loading; } diff --git a/WebCore/loader/FrameLoader.cpp b/WebCore/loader/FrameLoader.cpp index bfc2686..e5ce94a 100644 --- a/WebCore/loader/FrameLoader.cpp +++ b/WebCore/loader/FrameLoader.cpp @@ -619,7 +619,7 @@ void FrameLoader::submitForm(const char* action, const String& url, PassRefPtr<F submitForm(frameRequest, event, lockHistory, lockBackForwardList); } -void FrameLoader::stopLoading(bool sendUnload) +void FrameLoader::stopLoading(bool sendUnload, DatabasePolicy databasePolicy) { if (m_frame->document() && m_frame->document()->tokenizer()) m_frame->document()->tokenizer()->stopParsing(); @@ -660,7 +660,8 @@ void FrameLoader::stopLoading(bool sendUnload) cache()->loader()->cancelRequests(docLoader); #if ENABLE(DATABASE) - doc->stopDatabases(); + if (databasePolicy == DatabasePolicyStop) + doc->stopDatabases(); #endif } @@ -2713,7 +2714,7 @@ void FrameLoader::stopLoadingSubframes() child->loader()->stopAllLoaders(); } -void FrameLoader::stopAllLoaders() +void FrameLoader::stopAllLoaders(DatabasePolicy databasePolicy) { // If this method is called from within this method, infinite recursion can occur (3442218). Avoid this. if (m_inStopAllLoaders) @@ -2725,9 +2726,9 @@ void FrameLoader::stopAllLoaders() stopLoadingSubframes(); if (m_provisionalDocumentLoader) - m_provisionalDocumentLoader->stopLoading(); + m_provisionalDocumentLoader->stopLoading(databasePolicy); if (m_documentLoader) - m_documentLoader->stopLoading(); + m_documentLoader->stopLoading(databasePolicy); setProvisionalDocumentLoader(0); diff --git a/WebCore/loader/FrameLoader.h b/WebCore/loader/FrameLoader.h index 9b68601..07acff3 100644 --- a/WebCore/loader/FrameLoader.h +++ b/WebCore/loader/FrameLoader.h @@ -176,7 +176,7 @@ namespace WebCore { bool canHandleRequest(const ResourceRequest&); // Also not cool. - void stopAllLoaders(); + void stopAllLoaders(DatabasePolicy = DatabasePolicyStop); void stopForUserCancel(bool deferCheckLoadComplete = false); bool isLoadingMainResource() const { return m_isLoadingMainResource; } @@ -301,7 +301,7 @@ namespace WebCore { void submitForm(const FrameLoadRequest&, Event*, bool lockHistory, bool lockBackForwardList); void stop(); - void stopLoading(bool sendUnload); + void stopLoading(bool sendUnload, DatabasePolicy = DatabasePolicyStop); bool closeURL(); void didExplicitOpen(); diff --git a/WebCore/loader/FrameLoaderTypes.h b/WebCore/loader/FrameLoaderTypes.h index 4fe1176..c264b47 100644 --- a/WebCore/loader/FrameLoaderTypes.h +++ b/WebCore/loader/FrameLoaderTypes.h @@ -66,6 +66,11 @@ namespace WebCore { NavigationTypeOther }; + enum DatabasePolicy { + DatabasePolicyStop, // The database thread should be stopped and database connections closed. + DatabasePolicyContinue + }; + enum ObjectContentType { ObjectContentNone, ObjectContentImage, diff --git a/WebCore/page/Page.cpp b/WebCore/page/Page.cpp index 457bcde..6456bf0 100644 --- a/WebCore/page/Page.cpp +++ b/WebCore/page/Page.cpp @@ -210,7 +210,19 @@ bool Page::goForward() void Page::goToItem(HistoryItem* item, FrameLoadType type) { // Abort any current load if we're going to a history item - m_mainFrame->loader()->stopAllLoaders(); + + // Define what to do with any open database connections. By default we stop them and terminate the database thread. + DatabasePolicy databasePolicy = DatabasePolicyStop; + +#if ENABLE(DATABASE) + // If we're navigating the history via a fragment on the same document, then we do not want to stop databases. + const KURL& currentURL = m_mainFrame->loader()->url(); + const KURL& newURL = item->url(); + + if (newURL.hasRef() && equalIgnoringRef(currentURL, newURL)) + databasePolicy = DatabasePolicyContinue; +#endif + m_mainFrame->loader()->stopAllLoaders(databasePolicy); m_mainFrame->loader()->goToItem(item, type); } |