Title: [104407] trunk/Source/WebCore
Revision
104407
Author
[email protected]
Date
2012-01-08 13:31:02 -0800 (Sun, 08 Jan 2012)

Log Message

Assertion failure under SharedBuffer::append() when NETWORK_CFDATA_ARRAY_CALLBACK is enabled
https://bugs.webkit.org/show_bug.cgi?id=75656

Reviewed by Darin Adler.

Update the implementation of SubresourceLoader::didReceiveDataArray() to conform to the
refactoring done as part of bug 71149 in r100311.

* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::didReceiveData):
(WebCore::SubresourceLoader::errorLoadingResource):
* loader/SubresourceLoader.h:
* loader/cf/SubresourceLoaderCF.cpp:
(WebCore::SubresourceLoader::didReceiveDataArray):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (104406 => 104407)


--- trunk/Source/WebCore/ChangeLog	2012-01-08 21:03:00 UTC (rev 104406)
+++ trunk/Source/WebCore/ChangeLog	2012-01-08 21:31:02 UTC (rev 104407)
@@ -1,3 +1,20 @@
+2012-01-08  Pratik Solanki  <[email protected]>
+
+        Assertion failure under SharedBuffer::append() when NETWORK_CFDATA_ARRAY_CALLBACK is enabled
+        https://bugs.webkit.org/show_bug.cgi?id=75656
+
+        Reviewed by Darin Adler.
+
+        Update the implementation of SubresourceLoader::didReceiveDataArray() to conform to the
+        refactoring done as part of bug 71149 in r100311.
+
+        * loader/SubresourceLoader.cpp:
+        (WebCore::SubresourceLoader::didReceiveData):
+        (WebCore::SubresourceLoader::errorLoadingResource):
+        * loader/SubresourceLoader.h:
+        * loader/cf/SubresourceLoaderCF.cpp:
+        (WebCore::SubresourceLoader::didReceiveDataArray):
+
 2012-01-08  Steve Block  <[email protected]>
 
         Remove V8-specific Java Bridge code

Modified: trunk/Source/WebCore/loader/SubresourceLoader.cpp (104406 => 104407)


--- trunk/Source/WebCore/loader/SubresourceLoader.cpp	2012-01-08 21:03:00 UTC (rev 104406)
+++ trunk/Source/WebCore/loader/SubresourceLoader.cpp	2012-01-08 21:31:02 UTC (rev 104407)
@@ -211,17 +211,24 @@
     RefPtr<SubresourceLoader> protect(this);
     ResourceLoader::didReceiveData(data, length, encodedDataLength, allAtOnce);
 
-    if (m_resource->response().httpStatusCode() >= 400 && !m_resource->shouldIgnoreHTTPStatusCodeErrors()) {
-        m_resource->error(CachedResource::LoadError);
-        m_state = Finishing;
-        cancel();
+    if (errorLoadingResource())
         return;
-    }
 
     if (!m_loadingMultipartContent)
         sendDataToResource(data, length);
 }
 
+bool SubresourceLoader::errorLoadingResource()
+{
+    if (m_resource->response().httpStatusCode() < 400 || m_resource->shouldIgnoreHTTPStatusCodeErrors())
+        return false;
+
+    m_resource->error(CachedResource::LoadError);
+    m_state = Finishing;
+    cancel();
+    return true;
+}
+
 void SubresourceLoader::sendDataToResource(const char* data, int length)
 {
     // There are two cases where we might need to create our own SharedBuffer instead of copying the one in ResourceLoader.

Modified: trunk/Source/WebCore/loader/SubresourceLoader.h (104406 => 104407)


--- trunk/Source/WebCore/loader/SubresourceLoader.h	2012-01-08 21:03:00 UTC (rev 104406)
+++ trunk/Source/WebCore/loader/SubresourceLoader.h	2012-01-08 21:31:02 UTC (rev 104407)
@@ -71,6 +71,7 @@
 #endif
     virtual void releaseResources();
 
+    bool errorLoadingResource();
     void sendDataToResource(const char*, int);
 
     enum SubresourceLoaderState {

Modified: trunk/Source/WebCore/loader/cf/SubresourceLoaderCF.cpp (104406 => 104407)


--- trunk/Source/WebCore/loader/cf/SubresourceLoaderCF.cpp	2012-01-08 21:03:00 UTC (rev 104406)
+++ trunk/Source/WebCore/loader/cf/SubresourceLoaderCF.cpp	2012-01-08 21:31:02 UTC (rev 104407)
@@ -36,13 +36,16 @@
 
     ResourceLoader::didReceiveDataArray(dataArray);
 
+    if (errorLoadingResource())
+        return;
+
     // A subresource loader does not load multipart sections progressively.
     // So don't deliver any data to the loader yet.
     if (!m_loadingMultipartContent) {
         CFIndex arrayCount = CFArrayGetCount(dataArray);
         for (CFIndex i = 0; i < arrayCount; ++i)  {
             CFDataRef data = "" i));
-            didReceiveData(reinterpret_cast<const char *>(CFDataGetBytePtr(data)), static_cast<int>(CFDataGetLength(data)), -1, false);
+            sendDataToResource(reinterpret_cast<const char *>(CFDataGetBytePtr(data)), static_cast<int>(CFDataGetLength(data)));
         }
     }
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to