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

Side by Side Diff: webkit/plugins/ppapi/ppapi_plugin_instance.cc

Issue 6493004: Implement basic crash detection and shutdown handling for out of process PPAP... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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
« no previous file with comments | « webkit/plugins/ppapi/ppapi_plugin_instance.h ('k') | webkit/plugins/ppapi/ppb_proxy_impl.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "webkit/plugins/ppapi/ppapi_plugin_instance.h" 5 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/scoped_ptr.h" 9 #include "base/scoped_ptr.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 return bound_graphics_3d()->GetBackingTextureId(); 410 return bound_graphics_3d()->GetBackingTextureId();
411 } 411 }
412 412
413 void PluginInstance::CommitBackingTexture() { 413 void PluginInstance::CommitBackingTexture() {
414 if (fullscreen_container_) 414 if (fullscreen_container_)
415 fullscreen_container_->Invalidate(); 415 fullscreen_container_->Invalidate();
416 else 416 else
417 container_->commitBackingTexture(); 417 container_->commitBackingTexture();
418 } 418 }
419 419
420 void PluginInstance::InstanceCrashed() {
421 // Force free all resources and vars.
422 ResourceTracker::Get()->InstanceCrashed(pp_instance());
423
424 // Free any associated graphics.
425 SetFullscreen(false);
426 bound_graphics_ = NULL;
427 InvalidateRect(gfx::Rect());
428
429 // TODO(brettw) show a crashed plugin screen.
430 }
431
420 PP_Var PluginInstance::GetWindowObject() { 432 PP_Var PluginInstance::GetWindowObject() {
421 if (!container_) 433 if (!container_)
422 return PP_MakeUndefined(); 434 return PP_MakeUndefined();
423 435
424 WebFrame* frame = container_->element().document().frame(); 436 WebFrame* frame = container_->element().document().frame();
425 if (!frame) 437 if (!frame)
426 return PP_MakeUndefined(); 438 return PP_MakeUndefined();
427 439
428 return ObjectVar::NPObjectToPPVar(this, frame->windowObject()); 440 return ObjectVar::NPObjectToPPVar(this, frame->windowObject());
429 } 441 }
(...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after
1268 return found->second; 1280 return found->second;
1269 } 1281 }
1270 1282
1271 bool PluginInstance::IsFullPagePlugin() const { 1283 bool PluginInstance::IsFullPagePlugin() const {
1272 WebFrame* frame = container()->element().document().frame(); 1284 WebFrame* frame = container()->element().document().frame();
1273 return frame->view()->mainFrame()->document().isPluginDocument(); 1285 return frame->view()->mainFrame()->document().isPluginDocument();
1274 } 1286 }
1275 1287
1276 } // namespace ppapi 1288 } // namespace ppapi
1277 } // namespace webkit 1289 } // namespace webkit
OLDNEW
« no previous file with comments | « webkit/plugins/ppapi/ppapi_plugin_instance.h ('k') | webkit/plugins/ppapi/ppb_proxy_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698