| Index: blimp/engine/mojo/blob_channel_service.cc
|
| diff --git a/blimp/engine/mojo/blob_channel_service.cc b/blimp/engine/mojo/blob_channel_service.cc
|
| index 0234df60698b3a2c2628537b7e66cfd9ae44bfd9..25a7ee3cdd7d1d0cafa067bd1adefc02122b5817 100644
|
| --- a/blimp/engine/mojo/blob_channel_service.cc
|
| +++ b/blimp/engine/mojo/blob_channel_service.cc
|
| @@ -5,6 +5,7 @@
|
| #include "blimp/engine/mojo/blob_channel_service.h"
|
|
|
| #include "blimp/net/blob_channel/blob_channel_sender.h"
|
| +#include "mojo/public/cpp/system/buffer.h"
|
|
|
| namespace blimp {
|
| namespace engine {
|
| @@ -19,8 +20,18 @@ BlobChannelService::BlobChannelService(BlobChannelSender* blob_channel_sender,
|
| BlobChannelService::~BlobChannelService() {}
|
|
|
| void BlobChannelService::PutBlob(const mojo::String& id,
|
| - const mojo::String& data) {
|
| - blob_channel_sender_->PutBlob(id, new BlobData(data));
|
| + mojo::ScopedSharedBufferHandle data,
|
| + uint32_t size) {
|
| + // Map |data| into the address space and copy out its contents.
|
| + if (!data.is_valid()) {
|
| + LOG(ERROR) << "Invalid data handle received from renderer process.";
|
| + return;
|
| + }
|
| +
|
| + scoped_refptr<BlobData> new_blob(new BlobData);
|
| + auto mapping = data->Map(size);
|
| + new_blob->data.assign(reinterpret_cast<const char*>(mapping.get()), size);
|
| + blob_channel_sender_->PutBlob(id, std::move(new_blob));
|
| }
|
|
|
| void BlobChannelService::DeliverBlob(const mojo::String& id) {
|
|
|