[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

ap at apple.com ap at apple.com
Thu Oct 29 20:50:17 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit 12320f579f80f4250dfdaca3efd02e22ddad560c
Author: ap at apple.com <ap at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Oct 23 00:00:50 2009 +0000

            Reviewed by Tim Hatcher.
    
            https://bugs.webkit.org/show_bug.cgi?id=30506
            <rdar://problem/7319845> Resources that the server sent as 304 not modified are not shown
            in the inspectors resource pane
    
            I don't know how to make a test for this.
    
            The issue here was that preloaded resources weren't added to DocLoader document resource set,
            but Web Inspector asked DocLoader to fetch data from CachedResource. Even when (if) document
            parser eventually requested the same resource for real and it got added to resource set, it
            was too late - the Inspector wasn't updated.
    
            * inspector/InspectorResource.cpp:
            (WebCore::InspectorResource::cachedResource):
            (WebCore::InspectorResource::type):
            (WebCore::InspectorResource::resourceData):
            * inspector/InspectorResource.h:
            Fix the issue by trying to fetch corresponding CachedResource harder - also look in global
            cache. This seems safe, and easier than updating the Inspector on transitions between
            resource states (revalidate vs. revalidate done and preload vs. non-preload).
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49960 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 48ebcb1..9bf91b6 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,27 @@
+2009-10-22  Alexey Proskuryakov  <ap at apple.com>
+
+        Reviewed by Tim Hatcher.
+
+        https://bugs.webkit.org/show_bug.cgi?id=30506
+        <rdar://problem/7319845> Resources that the server sent as 304 not modified are not shown
+        in the inspectors resource pane
+
+        I don't know how to make a test for this.
+
+        The issue here was that preloaded resources weren't added to DocLoader document resource set,
+        but Web Inspector asked DocLoader to fetch data from CachedResource. Even when (if) document
+        parser eventually requested the same resource for real and it got added to resource set, it
+        was too late - the Inspector wasn't updated.
+
+        * inspector/InspectorResource.cpp:
+        (WebCore::InspectorResource::cachedResource):
+        (WebCore::InspectorResource::type):
+        (WebCore::InspectorResource::resourceData):
+        * inspector/InspectorResource.h:
+        Fix the issue by trying to fetch corresponding CachedResource harder - also look in global
+        cache. This seems safe, and easier than updating the Inspector on transitions between
+        resource states (revalidate vs. revalidate done and preload vs. non-preload).
+
 2009-10-22  Beth Dakin  <bdakin at apple.com>
 
         Reviewed by Dan Bernstein.
diff --git a/WebCore/inspector/InspectorResource.cpp b/WebCore/inspector/InspectorResource.cpp
index 69ab39b..b8bb22b 100644
--- a/WebCore/inspector/InspectorResource.cpp
+++ b/WebCore/inspector/InspectorResource.cpp
@@ -33,6 +33,7 @@
 
 #if ENABLE(INSPECTOR)
 
+#include "Cache.h"
 #include "CachedResource.h"
 #include "DocLoader.h"
 #include "DocumentLoader.h"
@@ -227,6 +228,18 @@ void InspectorResource::releaseScriptObject(InspectorFrontend* frontend, bool ca
     frontend->removeResource(m_identifier);
 }
 
+CachedResource* InspectorResource::cachedResource() const
+{
+    // Try hard to find a corresponding CachedResource. During preloading, DocLoader may not have the resource in document resources set yet,
+    // but Inspector will already try to fetch data that is only available via CachedResource (and it won't update once the resource is added,
+    // because m_changes will not have the appropriate bits set).
+    const String& url = requestURL();
+    CachedResource* cachedResource = m_frame->document()->docLoader()->cachedResource(url);
+    if (!cachedResource)
+        cachedResource = cache()->resourceForURL(url);
+    return cachedResource;
+}
+
 InspectorResource::Type InspectorResource::type() const
 {
     if (!m_xmlHttpResponseText.isNull())
@@ -238,7 +251,7 @@ InspectorResource::Type InspectorResource::type() const
     if (m_loader->frameLoader() && m_requestURL == m_loader->frameLoader()->iconURL())
         return Image;
 
-    CachedResource* cachedResource = m_frame->document()->docLoader()->cachedResource(requestURL());
+    CachedResource* cachedResource = this->cachedResource();
     if (!cachedResource)
         return Other;
 
@@ -281,13 +294,14 @@ String InspectorResource::sourceString() const
     return encoding.decode(buffer->data(), buffer->size());
 }
 
-PassRefPtr<SharedBuffer> InspectorResource::resourceData(String* textEncodingName) const {
+PassRefPtr<SharedBuffer> InspectorResource::resourceData(String* textEncodingName) const
+{
     if (m_requestURL == m_loader->requestURL()) {
         *textEncodingName = m_frame->document()->inputEncoding();
         return m_loader->mainResourceData();
     }
 
-    CachedResource* cachedResource = m_frame->document()->docLoader()->cachedResource(requestURL());
+    CachedResource* cachedResource = this->cachedResource();
     if (!cachedResource)
         return 0;
 
diff --git a/WebCore/inspector/InspectorResource.h b/WebCore/inspector/InspectorResource.h
index 880eab7..0335586 100644
--- a/WebCore/inspector/InspectorResource.h
+++ b/WebCore/inspector/InspectorResource.h
@@ -145,6 +145,8 @@ namespace WebCore {
         InspectorResource(long long identifier, DocumentLoader*);
         Type type() const;
 
+        CachedResource* cachedResource() const;
+
         long long m_identifier;
         RefPtr<DocumentLoader> m_loader;
         RefPtr<Frame> m_frame;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list