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

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

Issue 10387182: Browser Plugin: PpapiCommandBufferProxy should see a lost context if the embedder has deleted the P… (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Updated per piman@'s suggestions Created 8 years, 7 months 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 | Annotate | Revision Log
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/ppb_graphics_3d_proxy.h" 5 #include "ppapi/proxy/ppb_graphics_3d_proxy.h"
6 6
7 #include "gpu/command_buffer/client/gles2_implementation.h" 7 #include "gpu/command_buffer/client/gles2_implementation.h"
8 #include "ppapi/c/pp_errors.h" 8 #include "ppapi/c/pp_errors.h"
9 #include "ppapi/proxy/enter_proxy.h" 9 #include "ppapi/proxy/enter_proxy.h"
10 #include "ppapi/proxy/plugin_dispatcher.h" 10 #include "ppapi/proxy/plugin_dispatcher.h"
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 239
240 void PPB_Graphics3D_Proxy::OnMsgSetGetBuffer( 240 void PPB_Graphics3D_Proxy::OnMsgSetGetBuffer(
241 const HostResource& context, 241 const HostResource& context,
242 int32 transfer_buffer_id) { 242 int32 transfer_buffer_id) {
243 EnterHostFromHostResource<PPB_Graphics3D_API> enter(context); 243 EnterHostFromHostResource<PPB_Graphics3D_API> enter(context);
244 if (enter.succeeded()) 244 if (enter.succeeded())
245 enter.object()->SetGetBuffer(transfer_buffer_id); 245 enter.object()->SetGetBuffer(transfer_buffer_id);
246 } 246 }
247 247
248 void PPB_Graphics3D_Proxy::OnMsgGetState(const HostResource& context, 248 void PPB_Graphics3D_Proxy::OnMsgGetState(const HostResource& context,
249 gpu::CommandBuffer::State* state) { 249 gpu::CommandBuffer::State* state,
250 bool* success) {
250 EnterHostFromHostResource<PPB_Graphics3D_API> enter(context); 251 EnterHostFromHostResource<PPB_Graphics3D_API> enter(context);
251 if (enter.failed()) 252 if (enter.failed()) {
253 *success = false;
252 return; 254 return;
255 }
253 PP_Graphics3DTrustedState pp_state = enter.object()->GetState(); 256 PP_Graphics3DTrustedState pp_state = enter.object()->GetState();
254 *state = GPUStateFromPPState(pp_state); 257 *state = GPUStateFromPPState(pp_state);
258 *success = true;
255 } 259 }
256 260
257 void PPB_Graphics3D_Proxy::OnMsgFlush(const HostResource& context, 261 void PPB_Graphics3D_Proxy::OnMsgFlush(const HostResource& context,
258 int32 put_offset, 262 int32 put_offset,
259 int32 last_known_get, 263 int32 last_known_get,
260 gpu::CommandBuffer::State* state) { 264 gpu::CommandBuffer::State* state,
265 bool* success) {
261 EnterHostFromHostResource<PPB_Graphics3D_API> enter(context); 266 EnterHostFromHostResource<PPB_Graphics3D_API> enter(context);
262 if (enter.failed()) 267 if (enter.failed()) {
268 *success = false;
263 return; 269 return;
270 }
264 PP_Graphics3DTrustedState pp_state = enter.object()->FlushSyncFast( 271 PP_Graphics3DTrustedState pp_state = enter.object()->FlushSyncFast(
265 put_offset, last_known_get); 272 put_offset, last_known_get);
266 *state = GPUStateFromPPState(pp_state); 273 *state = GPUStateFromPPState(pp_state);
274 *success = true;
267 } 275 }
268 276
269 void PPB_Graphics3D_Proxy::OnMsgAsyncFlush(const HostResource& context, 277 void PPB_Graphics3D_Proxy::OnMsgAsyncFlush(const HostResource& context,
270 int32 put_offset) { 278 int32 put_offset) {
271 EnterHostFromHostResource<PPB_Graphics3D_API> enter(context); 279 EnterHostFromHostResource<PPB_Graphics3D_API> enter(context);
272 if (enter.succeeded()) 280 if (enter.succeeded())
273 enter.object()->Flush(put_offset); 281 enter.object()->Flush(put_offset);
274 } 282 }
275 283
276 void PPB_Graphics3D_Proxy::OnMsgCreateTransferBuffer( 284 void PPB_Graphics3D_Proxy::OnMsgCreateTransferBuffer(
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 void PPB_Graphics3D_Proxy::SendSwapBuffersACKToPlugin( 336 void PPB_Graphics3D_Proxy::SendSwapBuffersACKToPlugin(
329 int32_t result, 337 int32_t result,
330 const HostResource& context) { 338 const HostResource& context) {
331 dispatcher()->Send(new PpapiMsg_PPBGraphics3D_SwapBuffersACK( 339 dispatcher()->Send(new PpapiMsg_PPBGraphics3D_SwapBuffersACK(
332 API_ID_PPB_GRAPHICS_3D, context, result)); 340 API_ID_PPB_GRAPHICS_3D, context, result));
333 } 341 }
334 342
335 } // namespace proxy 343 } // namespace proxy
336 } // namespace ppapi 344 } // namespace ppapi
337 345
OLDNEW
« ppapi/proxy/ppapi_command_buffer_proxy.cc ('K') | « ppapi/proxy/ppapi_command_buffer_proxy.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698