Title: [90857] branches/chromium/782

Diff

Copied: branches/chromium/782/LayoutTests/fast/dom/HTMLLinkElement/link-and-subresource-test-nonexistent.html (from rev 90595, trunk/LayoutTests/fast/dom/HTMLLinkElement/link-and-subresource-test-nonexistent.html) (0 => 90857)


--- branches/chromium/782/LayoutTests/fast/dom/HTMLLinkElement/link-and-subresource-test-nonexistent.html	                        (rev 0)
+++ branches/chromium/782/LayoutTests/fast/dom/HTMLLinkElement/link-and-subresource-test-nonexistent.html	2011-07-12 22:07:21 UTC (rev 90857)
@@ -0,0 +1,39 @@
+<html>
+<body>
+<script>
+function log(message)
+{
+    var item = document.createElement("li");
+    item.appendChild(document.createTextNode(message));
+    document.getElementById("console").appendChild(item);
+}
+
+dne_error_count = 0
+
+function dne_onerror()
+{
+    log("DNE_ONERROR called");
+    ++dne_error_count;
+    if (dne_error_count == 2) {
+        log("SUCCESS.  Two errors.");
+        layoutTestController.notifyDone();
+    }
+}
+
+if (window.layoutTestController) {
+    layoutTestController.waitUntilDone();
+    layoutTestController.dumpAsText();
+    layoutTestController.dumpResourceResponseMIMETypes();
+}
+</script>
+<p>This test verifies that an image which is prefetched, and which is also contained as a
+subresource of the current document can be loaded correctly as a subresource, even if the URI
+doesn't exist.
+
+<p>When this test succeeds, you will see nothing.  When this test fails, you will crash or have another error.
+<link rel="prefetch" href="" _onerror_="dne_onerror()" />
+<img src="" _onerror_="dne_onerror()" />
+<hr>
+<p><ol id="console"></ol></p>
+</body></html>
+

Copied: branches/chromium/782/LayoutTests/platform/chromium-linux/fast/dom/HTMLLinkElement/link-and-subresource-test-nonexistent-expected.txt (from rev 90595, trunk/LayoutTests/platform/chromium-linux/fast/dom/HTMLLinkElement/link-and-subresource-test-nonexistent-expected.txt) (0 => 90857)


--- branches/chromium/782/LayoutTests/platform/chromium-linux/fast/dom/HTMLLinkElement/link-and-subresource-test-nonexistent-expected.txt	                        (rev 0)
+++ branches/chromium/782/LayoutTests/platform/chromium-linux/fast/dom/HTMLLinkElement/link-and-subresource-test-nonexistent-expected.txt	2011-07-12 22:07:21 UTC (rev 90857)
@@ -0,0 +1,8 @@
+This test verifies that an image which is prefetched, and which is also contained as a subresource of the current document can be loaded correctly as a subresource, even if the URI doesn't exist.
+
+When this test succeeds, you will see nothing. When this test fails, you will crash or have another error.  
+
+DNE_ONERROR called
+DNE_ONERROR called
+SUCCESS. Two errors.
+

Modified: branches/chromium/782/Source/WebCore/loader/cache/CachedResource.cpp (90856 => 90857)


--- branches/chromium/782/Source/WebCore/loader/cache/CachedResource.cpp	2011-07-12 22:00:45 UTC (rev 90856)
+++ branches/chromium/782/Source/WebCore/loader/cache/CachedResource.cpp	2011-07-12 22:07:21 UTC (rev 90857)
@@ -263,6 +263,8 @@
         m_status = Pending;
     m_request = request;
 
+    CachedResourceHandle<CachedResource> protect(this);
+
     // All loads finish with data(allDataReceived = true) or error(), except for
     // canceled loads, which silently set our request to 0. Be sure to notify our
     // client in that case, so we don't seem to continue loading forever.
@@ -271,9 +273,6 @@
         setStatus(Canceled);
         checkNotify();
     }
-
-    if (canDelete() && !inCache())
-        delete this;
 }
 
 void CachedResource::addClient(CachedResourceClient* client)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to