Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(246)

Side by Side Diff: ppapi/proxy/ppapi_command_buffer_proxy.cc

Issue 692683003: Hold the Pepper proxy lock for all Pepper GL calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove virtual for override functions Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ppapi/proxy/plugin_dispatcher.cc ('k') | ppapi/proxy/proxy_channel.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ppapi/proxy/plugin_dispatcher.cc ('k') | ppapi/proxy/proxy_channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698