[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-142-g786665c

darin at apple.com darin at apple.com
Mon Dec 27 16:27:56 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit befeff1f829a73f282e58715067fc0efd56f87e6
Author: darin at apple.com <darin at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Dec 21 22:24:45 2010 +0000

    2010-12-21  Darin Adler  <darin at apple.com>
    
            Reviewed by Sam Weinig.
    
            Mac WebKit delivers an extra didCommit when loading web archives
            https://bugs.webkit.org/show_bug.cgi?id=51419
    
            Could not find a simple way to test this in WebKit1, but in WebKit2
            it leads to an immediate failure when loading a web archive. Tested
            that making the Mac share the same code path with other platforms
            works fine in WebKit1.
    
            * loader/FrameLoader.cpp:
            (WebCore::FrameLoader::finishedLoadingDocument): Removed special case for
            the Mac platform. Also removed the call to isArchiveMimeType since we
            get a 0 from ArchiveFactory::create in that case.
    
            * loader/archive/ArchiveFactory.cpp:
            (WebCore::ArchiveFactory::isArchiveMimeType): Hardened slightly by
            adding a special case for null and empty strings, since hash tables can't
            handle null strings.
            (WebCore::ArchiveFactory::create): Ditto.
    2010-12-21  Darin Adler  <darin at apple.com>
    
            Reviewed by Sam Weinig.
    
            Mac WebKit delivers an extra didCommit when loading web archives
            https://bugs.webkit.org/show_bug.cgi?id=51419
    
            * UIProcess/WebFrameProxy.cpp:
            (WebKit::WebFrameProxy::didStartProvisionalLoad): Added assertions so we catch
            inconsistencies here instead of at the application level. Later, we will have
            to decide what to do in cases these assertions fail. The right policy is probably
            to consider it a web process failure and do whatever we do for those.
            (WebKit::WebFrameProxy::didReceiveServerRedirectForProvisionalLoad): Ditto.
            (WebKit::WebFrameProxy::didFailProvisionalLoad): Ditto.
            (WebKit::WebFrameProxy::didCommitLoad): Ditto.
            (WebKit::WebFrameProxy::didFinishLoad): Ditto.
            (WebKit::WebFrameProxy::didFailLoad): Ditto.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74426 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index e2d02cf..44d2978 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,26 @@
+2010-12-21  Darin Adler  <darin at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Mac WebKit delivers an extra didCommit when loading web archives
+        https://bugs.webkit.org/show_bug.cgi?id=51419
+
+        Could not find a simple way to test this in WebKit1, but in WebKit2
+        it leads to an immediate failure when loading a web archive. Tested
+        that making the Mac share the same code path with other platforms
+        works fine in WebKit1.
+
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::finishedLoadingDocument): Removed special case for
+        the Mac platform. Also removed the call to isArchiveMimeType since we
+        get a 0 from ArchiveFactory::create in that case.
+
+        * loader/archive/ArchiveFactory.cpp:
+        (WebCore::ArchiveFactory::isArchiveMimeType): Hardened slightly by
+        adding a special case for null and empty strings, since hash tables can't
+        handle null strings.
+        (WebCore::ArchiveFactory::create): Ditto.
+
 2010-12-21  Yong Li  <yoli at rim.com>
 
         Reviewed by Adam Barth.
diff --git a/WebCore/loader/FrameLoader.cpp b/WebCore/loader/FrameLoader.cpp
index 3c80b29..ef692b6 100644
--- a/WebCore/loader/FrameLoader.cpp
+++ b/WebCore/loader/FrameLoader.cpp
@@ -2201,30 +2201,16 @@ void FrameLoader::finishedLoadingDocument(DocumentLoader* loader)
     if (m_stateMachine.creatingInitialEmptyDocument())
         return;
 #endif
-    
-    // If loading a webarchive, run through webarchive machinery
-    const String& responseMIMEType = loader->responseMIMEType();
 
-    // FIXME: Mac's FrameLoaderClient::finishedLoading() method does work that is required even with Archive loads
-    // so we still need to call it.  Other platforms should only call finishLoading for non-archive loads
-    // That work should be factored out so this #ifdef can be removed
-#if PLATFORM(MAC)
-    m_client->finishedLoading(loader);
-    if (!ArchiveFactory::isArchiveMimeType(responseMIMEType))
-        return;
-#else
-    if (!ArchiveFactory::isArchiveMimeType(responseMIMEType)) {
+    // Give archive machinery a crack at this document. If the MIME type is not an archive type, it will return 0.
+    RefPtr<Archive> archive = ArchiveFactory::create(loader->mainResourceData().get(), loader->responseMIMEType());
+    if (!archive) {
         m_client->finishedLoading(loader);
         return;
     }
-#endif
-        
-    RefPtr<Archive> archive(ArchiveFactory::create(loader->mainResourceData().get(), responseMIMEType));
-    if (!archive)
-        return;
 
-    // FIXME: The remainder of this function should be in DocumentLoader.
-    
+    // FIXME: The remainder of this function should be moved to DocumentLoader.
+
     loader->addAllArchiveResources(archive.get());
 
     ArchiveResource* mainResource = archive->mainResource();
diff --git a/WebCore/loader/archive/ArchiveFactory.cpp b/WebCore/loader/archive/ArchiveFactory.cpp
index d09b064..2e108c5 100644
--- a/WebCore/loader/archive/ArchiveFactory.cpp
+++ b/WebCore/loader/archive/ArchiveFactory.cpp
@@ -70,12 +70,12 @@ static ArchiveMIMETypesMap& archiveMIMETypes()
 
 bool ArchiveFactory::isArchiveMimeType(const String& mimeType)
 {
-    return archiveMIMETypes().contains(mimeType);
+    return !mimeType.isEmpty() && archiveMIMETypes().contains(mimeType);
 }
 
 PassRefPtr<Archive> ArchiveFactory::create(SharedBuffer* data, const String& mimeType)
 {
-    RawDataCreationFunction* function = archiveMIMETypes().get(mimeType);
+    RawDataCreationFunction* function = mimeType.isEmpty() ? 0 : archiveMIMETypes().get(mimeType);
     return function ? function(data) : 0;
 }
 
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 72a26d3..a4e31eb 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,21 @@
+2010-12-21  Darin Adler  <darin at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Mac WebKit delivers an extra didCommit when loading web archives
+        https://bugs.webkit.org/show_bug.cgi?id=51419
+
+        * UIProcess/WebFrameProxy.cpp:
+        (WebKit::WebFrameProxy::didStartProvisionalLoad): Added assertions so we catch
+        inconsistencies here instead of at the application level. Later, we will have
+        to decide what to do in cases these assertions fail. The right policy is probably
+        to consider it a web process failure and do whatever we do for those.
+        (WebKit::WebFrameProxy::didReceiveServerRedirectForProvisionalLoad): Ditto.
+        (WebKit::WebFrameProxy::didFailProvisionalLoad): Ditto.
+        (WebKit::WebFrameProxy::didCommitLoad): Ditto.
+        (WebKit::WebFrameProxy::didFinishLoad): Ditto.
+        (WebKit::WebFrameProxy::didFailLoad): Ditto.
+
 2010-12-21  Anders Carlsson  <andersca at apple.com>
 
         Fix Snow Leopard build.
diff --git a/WebKit2/UIProcess/WebFrameProxy.cpp b/WebKit2/UIProcess/WebFrameProxy.cpp
index 65569d1..04e3b52 100644
--- a/WebKit2/UIProcess/WebFrameProxy.cpp
+++ b/WebKit2/UIProcess/WebFrameProxy.cpp
@@ -109,24 +109,33 @@ bool WebFrameProxy::isDisplayingMarkupDocument() const
 
 void WebFrameProxy::didStartProvisionalLoad(const String& url)
 {
-    // FIXME: Add assertions.
+    ASSERT(!url.isEmpty());
+    ASSERT(m_loadState == LoadStateFinished);
+    ASSERT(m_provisionalURL.isEmpty());
     m_loadState = LoadStateProvisional;
     m_provisionalURL = url;
 }
 
 void WebFrameProxy::didReceiveServerRedirectForProvisionalLoad(const String& url)
 {
+    ASSERT(!url.isEmpty());
+    ASSERT(m_loadState == LoadStateProvisional);
+    ASSERT(!m_provisionalURL.isEmpty());
     m_provisionalURL = url;
 }
 
 void WebFrameProxy::didFailProvisionalLoad()
 {
+    ASSERT(m_loadState == LoadStateProvisional);
+    ASSERT(!m_provisionalURL.isEmpty());
     m_loadState = LoadStateFinished;
     m_provisionalURL = String();
 }
 
 void WebFrameProxy::didCommitLoad()
 {
+    ASSERT(m_loadState == LoadStateProvisional);
+    ASSERT(!m_provisionalURL.isEmpty());
     m_loadState = LoadStateCommitted;
     m_url = m_provisionalURL;
     m_provisionalURL = String();
@@ -135,12 +144,17 @@ void WebFrameProxy::didCommitLoad()
 
 void WebFrameProxy::didFinishLoad()
 {
-    // FIXME: Add assertions
+    ASSERT(m_loadState == LoadStateCommitted);
+    ASSERT(m_provisionalURL.isEmpty());
+    ASSERT(!m_url.isEmpty());
     m_loadState = LoadStateFinished;
 }
 
 void WebFrameProxy::didFailLoad()
 {
+    ASSERT(m_loadState == LoadStateCommitted);
+    ASSERT(m_provisionalURL.isEmpty());
+    ASSERT(!m_url.isEmpty());
     m_loadState = LoadStateFinished;
     m_title = String();
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list