Copy SharedBuffer data into IPC message directly
authorpsolanki@apple.com <psolanki@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Jun 2014 18:33:20 +0000 (18:33 +0000)
committerpsolanki@apple.com <psolanki@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Jun 2014 18:33:20 +0000 (18:33 +0000)
commit95b7f12238c48b3ca6b4beaabbc8d439189839d3
treea9b8e6539a87a6e1be044daf62350c8376360b5c
parenta712a9c3c735e11e00f18cd7bbcc5cf7abed51b5
Copy SharedBuffer data into IPC message directly
https://bugs.webkit.org/show_bug.cgi?id=133920

Reviewed by Anders Carlsson.

When data array callbacks are enabled, we currently merge all the CFDataRefs in SharedBuffer
into one contiguous memory buffer when creating IPC::DataReference. This patch creates a
subclass of DataReference that uses SharedBuffer::getSomeData() to copy the data directly
into the IPC message.

* NetworkProcess/AsynchronousNetworkLoaderClient.cpp:
(WebKit::AsynchronousNetworkLoaderClient::didReceiveBuffer):
* Platform/IPC/ArgumentEncoder.cpp:
(IPC::ArgumentEncoder::reserve): Added.
(IPC::ArgumentEncoder::grow):
* Platform/IPC/ArgumentEncoder.h:
* Platform/IPC/DataReference.cpp:
(IPC::SharedBufferDataReference::encode):
* Platform/IPC/DataReference.h:
(IPC::DataReference::~DataReference):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@170154 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/AsynchronousNetworkLoaderClient.cpp
Source/WebKit2/Platform/IPC/ArgumentEncoder.cpp
Source/WebKit2/Platform/IPC/ArgumentEncoder.h
Source/WebKit2/Platform/IPC/DataReference.cpp
Source/WebKit2/Platform/IPC/DataReference.h