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/loader | |
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/loader')
-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 |
5 files changed, 16 insertions, 10 deletions
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, |