| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ppapi/proxy/ppapi_command_buffer_proxy.h" | 5 #include "ppapi/proxy/ppapi_command_buffer_proxy.h" |
| 6 | 6 |
| 7 #include "ppapi/proxy/ppapi_messages.h" | 7 #include "ppapi/proxy/ppapi_messages.h" |
| 8 #include "ppapi/proxy/proxy_channel.h" | 8 #include "ppapi/proxy/proxy_channel.h" |
| 9 #include "ppapi/shared_impl/api_id.h" | 9 #include "ppapi/shared_impl/api_id.h" |
| 10 #include "ppapi/shared_impl/host_resource.h" | 10 #include "ppapi/shared_impl/host_resource.h" |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 size_t height, | 212 size_t height, |
| 213 unsigned internalformat, | 213 unsigned internalformat, |
| 214 unsigned usage) { | 214 unsigned usage) { |
| 215 NOTREACHED(); | 215 NOTREACHED(); |
| 216 return -1; | 216 return -1; |
| 217 } | 217 } |
| 218 | 218 |
| 219 bool PpapiCommandBufferProxy::Send(IPC::Message* msg) { | 219 bool PpapiCommandBufferProxy::Send(IPC::Message* msg) { |
| 220 DCHECK(last_state_.error == gpu::error::kNoError); | 220 DCHECK(last_state_.error == gpu::error::kNoError); |
| 221 | 221 |
| 222 // We need hold the Pepper proxy lock for sync IPC, because GPU command buffer | 222 if (channel_->Send(msg)) |
| 223 // may use a sync IPC with another lock held. It may cause deadlock. | |
| 224 // http://crbug.com/418651 | |
| 225 if (channel_->SendAndStayLocked(msg)) | |
| 226 return true; | 223 return true; |
| 227 | 224 |
| 228 last_state_.error = gpu::error::kLostContext; | 225 last_state_.error = gpu::error::kLostContext; |
| 229 return false; | 226 return false; |
| 230 } | 227 } |
| 231 | 228 |
| 232 void PpapiCommandBufferProxy::UpdateState( | 229 void PpapiCommandBufferProxy::UpdateState( |
| 233 const gpu::CommandBuffer::State& state, | 230 const gpu::CommandBuffer::State& state, |
| 234 bool success) { | 231 bool success) { |
| 235 // Handle wraparound. It works as long as we don't have more than 2B state | 232 // Handle wraparound. It works as long as we don't have more than 2B state |
| (...skipping 13 matching lines...) Expand all Loading... |
| 249 shared_state()->Read(&last_state_); | 246 shared_state()->Read(&last_state_); |
| 250 } | 247 } |
| 251 | 248 |
| 252 gpu::CommandBufferSharedState* PpapiCommandBufferProxy::shared_state() const { | 249 gpu::CommandBufferSharedState* PpapiCommandBufferProxy::shared_state() const { |
| 253 return reinterpret_cast<gpu::CommandBufferSharedState*>( | 250 return reinterpret_cast<gpu::CommandBufferSharedState*>( |
| 254 shared_state_shm_->memory()); | 251 shared_state_shm_->memory()); |
| 255 } | 252 } |
| 256 | 253 |
| 257 } // namespace proxy | 254 } // namespace proxy |
| 258 } // namespace ppapi | 255 } // namespace ppapi |
| OLD | NEW |