Browser Plugin: PpapiCommandBufferProxy should see a lost context if the embedder has deleted the PluginInstance

In cross-process navigation we swap out PluginInstances and delete the swapped out instance.
PpapiCommandBufferProxy is sitting in WebGraphicsContext3DCommandBufferImpl, and is unaware of the destruction.
It attempts to talk to the embedder to flush over and over again and hangs the guest renderer.

With this change, the renderer's compositor will realize that the context is lost, and will drop it.

BUG=none
TEST=manually.


Review URL: https://chromiumcodereview.appspot.com/10387182

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137981 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/ppapi/proxy/ppb_graphics_3d_proxy.cc b/ppapi/proxy/ppb_graphics_3d_proxy.cc
index 75f7d83..2a708a3 100644
--- a/ppapi/proxy/ppb_graphics_3d_proxy.cc
+++ b/ppapi/proxy/ppb_graphics_3d_proxy.cc
@@ -246,24 +246,32 @@
 }
 
 void PPB_Graphics3D_Proxy::OnMsgGetState(const HostResource& context,
-                                         gpu::CommandBuffer::State* state) {
+                                         gpu::CommandBuffer::State* state,
+                                         bool* success) {
   EnterHostFromHostResource<PPB_Graphics3D_API> enter(context);
-  if (enter.failed())
+  if (enter.failed()) {
+    *success = false;
     return;
+  }
   PP_Graphics3DTrustedState pp_state = enter.object()->GetState();
   *state = GPUStateFromPPState(pp_state);
+  *success = true;
 }
 
 void PPB_Graphics3D_Proxy::OnMsgFlush(const HostResource& context,
                                       int32 put_offset,
                                       int32 last_known_get,
-                                      gpu::CommandBuffer::State* state) {
+                                      gpu::CommandBuffer::State* state,
+                                      bool* success) {
   EnterHostFromHostResource<PPB_Graphics3D_API> enter(context);
-  if (enter.failed())
+  if (enter.failed()) {
+    *success = false;
     return;
+  }
   PP_Graphics3DTrustedState pp_state = enter.object()->FlushSyncFast(
       put_offset, last_known_get);
   *state = GPUStateFromPPState(pp_state);
+  *success = true;
 }
 
 void PPB_Graphics3D_Proxy::OnMsgAsyncFlush(const HostResource& context,