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

Unified Diff: content/renderer/pepper/pepper_plugin_instance_impl.cc

Issue 2322503003: Fix crash when a frame is detached while a PepperPluginInstance is being (Closed)
Patch Set: Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/pepper_plugin_instance_impl.cc
diff --git a/content/renderer/pepper/pepper_plugin_instance_impl.cc b/content/renderer/pepper/pepper_plugin_instance_impl.cc
index 1e5d7bbd9922a4ffa34971ea9fafaceb69f7b9d4..6c56fc6a427985460a65f5b3ac57c119e241adf9 100644
--- a/content/renderer/pepper/pepper_plugin_instance_impl.cc
+++ b/content/renderer/pepper/pepper_plugin_instance_impl.cc
@@ -540,8 +540,8 @@ PepperPluginInstanceImpl::PepperPluginInstanceImpl(
memset(&current_print_settings_, 0, sizeof(current_print_settings_));
module_->InstanceCreated(this);
- if (render_frame) { // NULL in tests
- render_frame->PepperInstanceCreated(this);
+ if (render_frame_) { // NULL in tests or if the frame has been destroyed.
+ render_frame_->PepperInstanceCreated(this);
bbudge 2016/09/07 18:25:07 I don't see how render_frame_ would be different f
view_data_.is_page_visible = !render_frame_->GetRenderWidget()->is_hidden();
// Set the initial focus.
@@ -2144,7 +2144,9 @@ void PepperPluginInstanceImpl::AccessibilityModeChanged() {
plugin_pdf_interface_->EnableAccessibility(pp_instance());
}
-void PepperPluginInstanceImpl::OnDestruct() { render_frame_ = NULL; }
+void PepperPluginInstanceImpl::OnDestruct() {
+ render_frame_ = nullptr;
+}
void PepperPluginInstanceImpl::OnThrottleStateChange() {
SendDidChangeView();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698