| Index: content/common/gpu/client/command_buffer_proxy_impl.cc
|
| ===================================================================
|
| --- content/common/gpu/client/command_buffer_proxy_impl.cc (revision 132263)
|
| +++ content/common/gpu/client/command_buffer_proxy_impl.cc (working copy)
|
| @@ -20,6 +20,10 @@
|
| #include "gpu/command_buffer/common/command_buffer_shared.h"
|
| #include "ui/gfx/size.h"
|
|
|
| +#if defined(OS_WIN)
|
| +#include "content/common/sandbox_policy.h"
|
| +#endif
|
| +
|
| using gpu::Buffer;
|
|
|
| CommandBufferProxyImpl::CommandBufferProxyImpl(
|
| @@ -234,7 +238,13 @@
|
| return -1;
|
|
|
| base::SharedMemoryHandle handle = shm->handle();
|
| -#if defined(OS_POSIX)
|
| +#if defined(OS_WIN)
|
| + // Windows needs to explicitly duplicate the handle out to another process.
|
| + if (!sandbox::BrokerDuplicateHandle(handle, channel_->gpu_pid(),
|
| + &handle, FILE_MAP_WRITE, 0)) {
|
| + return -1;
|
| + }
|
| +#elif defined(OS_POSIX)
|
| DCHECK(!handle.auto_close);
|
| #endif
|
|
|
| @@ -257,10 +267,20 @@
|
| if (last_state_.error != gpu::error::kNoError)
|
| return -1;
|
|
|
| + // Returns FileDescriptor with auto_close off.
|
| + base::SharedMemoryHandle handle = shared_memory->handle();
|
| +#if defined(OS_WIN)
|
| + // Windows needs to explicitly duplicate the handle out to another process.
|
| + if (!sandbox::BrokerDuplicateHandle(handle, channel_->gpu_pid(),
|
| + &handle, FILE_MAP_WRITE, 0)) {
|
| + return -1;
|
| + }
|
| +#endif
|
| +
|
| int32 id;
|
| if (!Send(new GpuCommandBufferMsg_RegisterTransferBuffer(
|
| route_id_,
|
| - shared_memory->handle(), // Returns FileDescriptor with auto_close off.
|
| + handle,
|
| size,
|
| id_request,
|
| &id))) {
|
|
|