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

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

Issue 774763005: Revert "Hold the Pepper proxy lock for all Pepper GL calls." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 // 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
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
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