Index: chrome/renderer/command_buffer_proxy.cc |
diff --git a/chrome/renderer/command_buffer_proxy.cc b/chrome/renderer/command_buffer_proxy.cc |
index b78fa84e83bfaff3ff276e9f03d87367ce7f23b5..3b68cc216dd7ffcc16aa6c30f2ed7ae41ac996ef 100644 |
--- a/chrome/renderer/command_buffer_proxy.cc |
+++ b/chrome/renderer/command_buffer_proxy.cc |
@@ -153,12 +153,20 @@ Buffer CommandBufferProxy::GetTransferBuffer(int32 id) { |
} |
// Cache the transfer buffer shared memory object client side. |
+#if defined(OS_WIN) |
+ // TODO(piman): Does Windows needs this version of the constructor ? It |
+ // duplicates the handle, but I'm not sure why it is necessary - it was |
+ // already duped by the CommandBufferStub. |
base::SharedMemory* shared_memory = |
new base::SharedMemory(handle, false, base::GetCurrentProcessHandle()); |
+#else |
+ base::SharedMemory* shared_memory = |
+ new base::SharedMemory(handle, false); |
+#endif |
// Map the shared memory on demand. |
if (!shared_memory->memory()) { |
- if (!shared_memory->Map(shared_memory->max_size())) { |
+ if (!shared_memory->Map(size)) { |
delete shared_memory; |
return Buffer(); |
} |