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 if (channel_->Send(msg)) | 222 // We need hold the Pepper proxy lock for sync IPC, because GPU command buffer |
| 223 // may use a sync IPC with another lock held. It may cause deadlock. |
| 224 // http://crbug.com/418651 |
| 225 if (channel_->SendAndStayLocked(msg)) |
223 return true; | 226 return true; |
224 | 227 |
225 last_state_.error = gpu::error::kLostContext; | 228 last_state_.error = gpu::error::kLostContext; |
226 return false; | 229 return false; |
227 } | 230 } |
228 | 231 |
229 void PpapiCommandBufferProxy::UpdateState( | 232 void PpapiCommandBufferProxy::UpdateState( |
230 const gpu::CommandBuffer::State& state, | 233 const gpu::CommandBuffer::State& state, |
231 bool success) { | 234 bool success) { |
232 // Handle wraparound. It works as long as we don't have more than 2B state | 235 // Handle wraparound. It works as long as we don't have more than 2B state |
(...skipping 13 matching lines...) Expand all Loading... |
246 shared_state()->Read(&last_state_); | 249 shared_state()->Read(&last_state_); |
247 } | 250 } |
248 | 251 |
249 gpu::CommandBufferSharedState* PpapiCommandBufferProxy::shared_state() const { | 252 gpu::CommandBufferSharedState* PpapiCommandBufferProxy::shared_state() const { |
250 return reinterpret_cast<gpu::CommandBufferSharedState*>( | 253 return reinterpret_cast<gpu::CommandBufferSharedState*>( |
251 shared_state_shm_->memory()); | 254 shared_state_shm_->memory()); |
252 } | 255 } |
253 | 256 |
254 } // namespace proxy | 257 } // namespace proxy |
255 } // namespace ppapi | 258 } // namespace ppapi |
OLD | NEW |