Index: gpu/command_buffer/service/command_buffer_service.cc |
diff --git a/gpu/command_buffer/service/command_buffer_service.cc b/gpu/command_buffer/service/command_buffer_service.cc |
index df2bd074273b45c6685bdc15b861bc77d5c462ae..30617c8ffa53754fea204e00d485ec1d2aca3fc5 100644 |
--- a/gpu/command_buffer/service/command_buffer_service.cc |
+++ b/gpu/command_buffer/service/command_buffer_service.cc |
@@ -103,17 +103,15 @@ void CommandBufferService::SetGetBuffer(int32 transfer_buffer_id) { |
UpdateState(); |
} |
-bool CommandBufferService::SetSharedStateBuffer( |
- scoped_ptr<base::SharedMemory> shared_state_shm) { |
- shared_state_shm_.reset(shared_state_shm.release()); |
- if (!shared_state_shm_->Map(sizeof(*shared_state_))) |
- return false; |
+void CommandBufferService::SetSharedStateBuffer( |
+ scoped_ptr<BufferBacking> shared_state_buffer) { |
+ shared_state_buffer_ = shared_state_buffer.Pass(); |
+ DCHECK(shared_state_buffer_->GetSize() >= sizeof(*shared_state_)); |
shared_state_ = |
- static_cast<CommandBufferSharedState*>(shared_state_shm_->memory()); |
+ static_cast<CommandBufferSharedState*>(shared_state_buffer_->GetMemory()); |
UpdateState(); |
- return true; |
} |
void CommandBufferService::SetGetOffset(int32 get_offset) { |
@@ -132,7 +130,8 @@ scoped_refptr<Buffer> CommandBufferService::CreateTransferBuffer(size_t size, |
static int32 next_id = 1; |
*id = next_id++; |
- if (!RegisterTransferBuffer(*id, shared_memory.Pass(), size)) { |
+ if (!RegisterTransferBuffer( |
+ *id, MakeBackingFromSharedMemory(shared_memory.Pass(), size))) { |
*id = -1; |
return NULL; |
} |
@@ -157,10 +156,8 @@ scoped_refptr<Buffer> CommandBufferService::GetTransferBuffer(int32 id) { |
bool CommandBufferService::RegisterTransferBuffer( |
int32 id, |
- scoped_ptr<base::SharedMemory> shared_memory, |
- size_t size) { |
- return transfer_buffer_manager_->RegisterTransferBuffer( |
- id, shared_memory.Pass(), size); |
+ scoped_ptr<BufferBacking> buffer) { |
+ return transfer_buffer_manager_->RegisterTransferBuffer(id, buffer.Pass()); |
} |
void CommandBufferService::SetToken(int32 token) { |