2011-02-22 Charlie Reis <creis@chromium.org>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Feb 2011 06:58:46 +0000 (06:58 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Feb 2011 06:58:46 +0000 (06:58 +0000)
        Reviewed by Darin Fisher.

        Remove DatabasePolicy from FrameLoaderTypes
        https://bugs.webkit.org/show_bug.cgi?id=54968

        The DatabasePolicy enum is no longer needed now that we avoid stopping
        loaders on same-document navigations.

        Existing test: storage/hash-change-with-xhr.html

        * WebCore.exp.in:
        * loader/DocumentLoader.cpp:
        * loader/DocumentLoader.h:
        * loader/FrameLoader.cpp:
        * loader/FrameLoader.h:
        * loader/FrameLoaderTypes.h:
        * workers/WorkerThread.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@79410 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/loader/DocumentLoader.cpp
Source/WebCore/loader/DocumentLoader.h
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/loader/FrameLoader.h
Source/WebCore/loader/FrameLoaderTypes.h
Source/WebCore/workers/WorkerThread.cpp

index 54923e7..4d69216 100644 (file)
@@ -1,3 +1,23 @@
+2011-02-22  Charlie Reis  <creis@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Remove DatabasePolicy from FrameLoaderTypes
+        https://bugs.webkit.org/show_bug.cgi?id=54968
+
+        The DatabasePolicy enum is no longer needed now that we avoid stopping
+        loaders on same-document navigations.
+
+        Existing test: storage/hash-change-with-xhr.html
+
+        * WebCore.exp.in:
+        * loader/DocumentLoader.cpp:
+        * loader/DocumentLoader.h:
+        * loader/FrameLoader.cpp:
+        * loader/FrameLoader.h:
+        * loader/FrameLoaderTypes.h:
+        * workers/WorkerThread.cpp:
+
 2011-02-22  Alexis Menard  <alexis.menard@openbossa.org>
 
         Reviewed by Andreas Kling.
index c6a9c80..0371e1f 100644 (file)
@@ -164,7 +164,7 @@ __ZN7WebCore11FrameLoader11shouldCloseEv
 __ZN7WebCore11FrameLoader11urlSelectedERKNS_4KURLERKN3WTF6StringENS4_10PassRefPtrINS_5EventEEEbbNS_14ReferrerPolicyE
 __ZN7WebCore11FrameLoader12shouldReloadERKNS_4KURLES3_
 __ZN7WebCore11FrameLoader14detachChildrenEv
-__ZN7WebCore11FrameLoader14stopAllLoadersENS_14DatabasePolicyENS_26ClearProvisionalItemPolicyE
+__ZN7WebCore11FrameLoader14stopAllLoadersENS_26ClearProvisionalItemPolicyE
 __ZN7WebCore11FrameLoader16detachFromParentEv
 __ZN7WebCore11FrameLoader16loadFrameRequestERKNS_16FrameLoadRequestEbbN3WTF10PassRefPtrINS_5EventEEENS5_INS_9FormStateEEENS_14ReferrerPolicyE
 __ZN7WebCore11FrameLoader17stopForUserCancelEb
index e8a7c41..9ff10ad 100644 (file)
@@ -209,7 +209,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(DatabasePolicy databasePolicy)
+void DocumentLoader::stopLoading()
 {
     // 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
@@ -222,7 +222,7 @@ void DocumentLoader::stopLoading(DatabasePolicy databasePolicy)
         Document* doc = m_frame->document();
         
         if (loading || doc->parsing())
-            m_frame->loader()->stopLoading(UnloadEventPolicyNone, databasePolicy);
+            m_frame->loader()->stopLoading(UnloadEventPolicyNone);
     }
 
     // Always cancel multipart loaders
index b92b384..8e9ab8f 100644 (file)
@@ -100,7 +100,7 @@ namespace WebCore {
         
         void replaceRequestURLForSameDocumentNavigation(const KURL&);
         bool isStopping() const { return m_isStopping; }
-        void stopLoading(DatabasePolicy = DatabasePolicyStop);
+        void stopLoading();
         void setCommitted(bool committed) { m_committed = committed; }
         bool isCommitted() const { return m_committed; }
         bool isLoading() const { return m_loading; }
index c9fca8d..2065675 100644 (file)
@@ -362,7 +362,7 @@ void FrameLoader::submitForm(PassRefPtr<FormSubmission> submission)
     targetFrame->navigationScheduler()->scheduleFormSubmission(submission);
 }
 
-void FrameLoader::stopLoading(UnloadEventPolicy unloadEventPolicy, DatabasePolicy databasePolicy)
+void FrameLoader::stopLoading(UnloadEventPolicy unloadEventPolicy)
 {
     if (m_frame->document() && m_frame->document()->parser())
         m_frame->document()->parser()->stopParsing();
@@ -429,10 +429,7 @@ void FrameLoader::stopLoading(UnloadEventPolicy unloadEventPolicy, DatabasePolic
             cachedResourceLoader->cancelRequests();
 
 #if ENABLE(DATABASE)
-        if (databasePolicy == DatabasePolicyStop)
-            doc->stopDatabases(0);
-#else
-    UNUSED_PARAM(databasePolicy);
+        doc->stopDatabases(0);
 #endif
     }
 
@@ -1688,13 +1685,13 @@ bool FrameLoader::shouldAllowNavigation(Frame* targetFrame) const
     return false;
 }
 
-void FrameLoader::stopLoadingSubframes(DatabasePolicy databasePolicy, ClearProvisionalItemPolicy clearProvisionalItemPolicy)
+void FrameLoader::stopLoadingSubframes(ClearProvisionalItemPolicy clearProvisionalItemPolicy)
 {
     for (RefPtr<Frame> child = m_frame->tree()->firstChild(); child; child = child->tree()->nextSibling())
-        child->loader()->stopAllLoaders(databasePolicy, clearProvisionalItemPolicy);
+        child->loader()->stopAllLoaders(clearProvisionalItemPolicy);
 }
 
-void FrameLoader::stopAllLoaders(DatabasePolicy databasePolicy, ClearProvisionalItemPolicy clearProvisionalItemPolicy)
+void FrameLoader::stopAllLoaders(ClearProvisionalItemPolicy clearProvisionalItemPolicy)
 {
     ASSERT(!m_frame->document() || !m_frame->document()->inPageCache());
     if (m_pageDismissalEventBeingDispatched)
@@ -1713,11 +1710,11 @@ void FrameLoader::stopAllLoaders(DatabasePolicy databasePolicy, ClearProvisional
     if (clearProvisionalItemPolicy == ShouldClearProvisionalItem)
         history()->setProvisionalItem(0);
 
-    stopLoadingSubframes(databasePolicy, clearProvisionalItemPolicy);
+    stopLoadingSubframes(clearProvisionalItemPolicy);
     if (m_provisionalDocumentLoader)
-        m_provisionalDocumentLoader->stopLoading(databasePolicy);
+        m_provisionalDocumentLoader->stopLoading();
     if (m_documentLoader)
-        m_documentLoader->stopLoading(databasePolicy);
+        m_documentLoader->stopLoading();
 
     setProvisionalDocumentLoader(0);
     
@@ -2379,7 +2376,7 @@ void FrameLoader::checkLoadCompleteForThisFrame()
                 // FIXME: can stopping loading here possibly have any effect, if isLoading is false,
                 // which it must be to be in this branch of the if? And is it OK to just do a full-on
                 // stopAllLoaders instead of stopLoadingSubframes?
-                stopLoadingSubframes(DatabasePolicyStop, ShouldNotClearProvisionalItem);
+                stopLoadingSubframes(ShouldNotClearProvisionalItem);
                 pdl->stopLoading();
 
                 // If we're in the middle of loading multipart data, we need to restore the document loader.
@@ -2984,7 +2981,7 @@ void FrameLoader::continueLoadAfterNavigationPolicy(const ResourceRequest&, Pass
 
     FrameLoadType type = policyChecker()->loadType();
     // A new navigation is in progress, so don't clear the history's provisional item.
-    stopAllLoaders(DatabasePolicyStop, ShouldNotClearProvisionalItem);
+    stopAllLoaders(ShouldNotClearProvisionalItem);
     
     // <rdar://problem/6250856> - In certain circumstances on pages with multiple frames, stopAllLoaders()
     // might detach the current FrameLoader, in which case we should bail on this newly defunct load. 
index a9e24c4..d59eb16 100644 (file)
@@ -128,8 +128,7 @@ public:
     bool canHandleRequest(const ResourceRequest&);
 
     // Also not cool.
-    // FIXME: We no longer need DatabasePolicy, since we always stop databases now.
-    void stopAllLoaders(DatabasePolicy = DatabasePolicyStop, ClearProvisionalItemPolicy = ShouldClearProvisionalItem);
+    void stopAllLoaders(ClearProvisionalItemPolicy = ShouldClearProvisionalItem);
     void stopForUserCancel(bool deferCheckLoadComplete = false);
 
     bool isLoadingMainResource() const { return m_isLoadingMainResource; }
@@ -222,7 +221,7 @@ public:
     void submitForm(PassRefPtr<FormSubmission>);
 
     void stop();
-    void stopLoading(UnloadEventPolicy, DatabasePolicy = DatabasePolicyStop);
+    void stopLoading(UnloadEventPolicy);
     bool closeURL();
 
     void didExplicitOpen();
@@ -353,7 +352,7 @@ private:
     void addExtraFieldsToRequest(ResourceRequest&, FrameLoadType loadType, bool isMainResource, bool cookiePolicyURLFromRequest);
 
     // Also not cool.
-    void stopLoadingSubframes(DatabasePolicy, ClearProvisionalItemPolicy);
+    void stopLoadingSubframes(ClearProvisionalItemPolicy);
 
     void clearProvisionalLoad();
     void markLoadComplete();
index 9f63c44..79c05dc 100644 (file)
@@ -69,11 +69,6 @@ namespace WebCore {
         NavigationTypeOther
     };
 
-    enum DatabasePolicy {
-        DatabasePolicyStop,    // The database thread should be stopped and database connections closed.
-        DatabasePolicyContinue
-    };
-    
     enum ClearProvisionalItemPolicy {
         ShouldClearProvisionalItem,
         ShouldNotClearProvisionalItem
index e1f1a66..deafb0b 100644 (file)
@@ -195,8 +195,6 @@ public:
         WorkerContext* workerContext = static_cast<WorkerContext*>(context);
 
 #if ENABLE(DATABASE)
-        // We currently ignore any DatabasePolicy used for the document's
-        // databases; if it's actually used anywhere, this should be revisited.
         DatabaseTaskSynchronizer cleanupSync;
         workerContext->stopDatabases(&cleanupSync);
 #endif