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

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: 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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 EnterHostFromHostResource<PPB_Graphics3D_API> enter(context); 250 EnterHostFromHostResource<PPB_Graphics3D_API> enter(context);
251 if (enter.failed()) 251 if (enter.failed()) {
252 state->error = gpu::error::kLostContext;
piman 2012/05/18 02:42:46 Mmh, this is a little bogus, because we're not fil
Fady Samuel 2012/05/18 19:27:48 Done.
252 return; 253 return;
254 }
253 PP_Graphics3DTrustedState pp_state = enter.object()->GetState(); 255 PP_Graphics3DTrustedState pp_state = enter.object()->GetState();
254 *state = GPUStateFromPPState(pp_state); 256 *state = GPUStateFromPPState(pp_state);
255 } 257 }
256 258
257 void PPB_Graphics3D_Proxy::OnMsgFlush(const HostResource& context, 259 void PPB_Graphics3D_Proxy::OnMsgFlush(const HostResource& context,
258 int32 put_offset, 260 int32 put_offset,
259 int32 last_known_get, 261 int32 last_known_get,
260 gpu::CommandBuffer::State* state) { 262 gpu::CommandBuffer::State* state) {
261 EnterHostFromHostResource<PPB_Graphics3D_API> enter(context); 263 EnterHostFromHostResource<PPB_Graphics3D_API> enter(context);
262 if (enter.failed()) 264 if (enter.failed()) {
265 state->error = gpu::error::kLostContext;
263 return; 266 return;
267 }
264 PP_Graphics3DTrustedState pp_state = enter.object()->FlushSyncFast( 268 PP_Graphics3DTrustedState pp_state = enter.object()->FlushSyncFast(
265 put_offset, last_known_get); 269 put_offset, last_known_get);
266 *state = GPUStateFromPPState(pp_state); 270 *state = GPUStateFromPPState(pp_state);
267 } 271 }
268 272
269 void PPB_Graphics3D_Proxy::OnMsgAsyncFlush(const HostResource& context, 273 void PPB_Graphics3D_Proxy::OnMsgAsyncFlush(const HostResource& context,
270 int32 put_offset) { 274 int32 put_offset) {
271 EnterHostFromHostResource<PPB_Graphics3D_API> enter(context); 275 EnterHostFromHostResource<PPB_Graphics3D_API> enter(context);
272 if (enter.succeeded()) 276 if (enter.succeeded())
273 enter.object()->Flush(put_offset); 277 enter.object()->Flush(put_offset);
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 void PPB_Graphics3D_Proxy::SendSwapBuffersACKToPlugin( 332 void PPB_Graphics3D_Proxy::SendSwapBuffersACKToPlugin(
329 int32_t result, 333 int32_t result,
330 const HostResource& context) { 334 const HostResource& context) {
331 dispatcher()->Send(new PpapiMsg_PPBGraphics3D_SwapBuffersACK( 335 dispatcher()->Send(new PpapiMsg_PPBGraphics3D_SwapBuffersACK(
332 API_ID_PPB_GRAPHICS_3D, context, result)); 336 API_ID_PPB_GRAPHICS_3D, context, result));
333 } 337 }
334 338
335 } // namespace proxy 339 } // namespace proxy
336 } // namespace ppapi 340 } // namespace ppapi
337 341
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