Title: [169868] trunk/Source/WebCore
Revision
169868
Author
psola...@apple.com
Date
2014-06-11 17:46:49 -0700 (Wed, 11 Jun 2014)

Log Message

Keep CFDataRefs in SharedBuffer instead of merging them
https://bugs.webkit.org/show_bug.cgi?id=133775

Reviewed by Alexey Proskuryakov.

Instead of merging the CFDataRefs into one buffer, save them in as CFDataRefs in
SharedBuffer. They will get merged when code calls buffer() later on.

No new tests because no functional changes.

* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::ResourceHandle::handleDataArray):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (169867 => 169868)


--- trunk/Source/WebCore/ChangeLog	2014-06-12 00:32:28 UTC (rev 169867)
+++ trunk/Source/WebCore/ChangeLog	2014-06-12 00:46:49 UTC (rev 169868)
@@ -1,3 +1,18 @@
+2014-06-11  Pratik Solanki  <psola...@apple.com>
+
+        Keep CFDataRefs in SharedBuffer instead of merging them
+        https://bugs.webkit.org/show_bug.cgi?id=133775
+
+        Reviewed by Alexey Proskuryakov.
+
+        Instead of merging the CFDataRefs into one buffer, save them in as CFDataRefs in
+        SharedBuffer. They will get merged when code calls buffer() later on.
+
+        No new tests because no functional changes.
+
+        * platform/network/cf/ResourceHandleCFNet.cpp:
+        (WebCore::ResourceHandle::handleDataArray):
+
 2014-06-11  Alexey Proskuryakov  <a...@apple.com>
 
         editing/selection/selection-in-iframe-removed-crash.html or selection-invalid-offset.html crashes intermittently

Modified: trunk/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp (169867 => 169868)


--- trunk/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp	2014-06-12 00:32:28 UTC (rev 169867)
+++ trunk/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp	2014-06-12 00:46:49 UTC (rev 169868)
@@ -640,18 +640,11 @@
         return;
     }
 
-    CFIndex totalSize = 0;
-    CFIndex index;
-    for (index = 0; index < count; index++)
-        totalSize += CFDataGetLength(static_cast<CFDataRef>(CFArrayGetValueAtIndex(dataArray, index)));
+    RefPtr<SharedBuffer> sharedBuffer = SharedBuffer::create();
+    for (CFIndex index = 0; index < count; index++)
+        sharedBuffer->append(static_cast<CFDataRef>(CFArrayGetValueAtIndex(dataArray, index)));
 
-    RetainPtr<CFMutableDataRef> mergedData = adoptCF(CFDataCreateMutable(kCFAllocatorDefault, totalSize));
-    for (index = 0; index < count; index++) {
-        CFDataRef data = "" index));
-        CFDataAppendBytes(mergedData.get(), CFDataGetBytePtr(data), CFDataGetLength(data));
-    }
-
-    client()->didReceiveBuffer(this, SharedBuffer::wrapCFData(mergedData.get()), -1);
+    client()->didReceiveBuffer(this, sharedBuffer, -1);
 }
 #endif
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to