| 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 14c337e58e93aec4aa933091c6a505cfbdd7105b..d7a3bb8516f97e31c5864facdff8dd57e9ba4f62 100644
|
| --- a/content/renderer/pepper/pepper_plugin_instance_impl.cc
|
| +++ b/content/renderer/pepper/pepper_plugin_instance_impl.cc
|
| @@ -536,27 +536,26 @@ PepperPluginInstanceImpl::PepperPluginInstanceImpl(
|
| module_->InstanceCreated(this);
|
|
|
| if (render_frame) { // NULL in tests
|
| - render_frame->render_view()->PepperInstanceCreated(this);
|
| - // Bind a callback now so that we can inform the RenderViewImpl when we are
|
| + render_frame->GetRenderWidget()->PepperInstanceCreated(this);
|
| + // Bind a callback now so that we can inform the RenderWidget when we are
|
| // destroyed. This works around a temporary problem stemming from work to
|
| - // move parts of RenderViewImpl in to RenderFrameImpl (see
|
| + // move parts of RenderWidget in to RenderFrameImpl (see
|
| // crbug.com/245126). If destruction happens in this order:
|
| // 1) RenderFrameImpl
|
| // 2) PepperPluginInstanceImpl
|
| - // 3) RenderViewImpl
|
| + // 3) RenderWidget
|
| // Then after 1), the PepperPluginInstanceImpl doesn't have any way to talk
|
| - // to the RenderViewImpl. But when the instance is destroyed, it still
|
| - // needs to inform the RenderViewImpl that it has gone away, otherwise
|
| - // between (2) and (3), the RenderViewImpl will still have the dead
|
| + // to the RenderWidget. But when the instance is destroyed, it still
|
| + // needs to inform the RenderWidget that it has gone away, otherwise
|
| + // between (2) and (3), the RenderWidget will still have the dead
|
| // instance in its active set, and so might make calls on the deleted
|
| // instance. See crbug.com/343576 for more information. Once the plugin
|
| - // calls move entirely from RenderViewImpl in to RenderFrameImpl, this
|
| + // calls move entirely from RenderWidget in to RenderFrameImpl, this
|
| // can be a little bit simplified by instead making a direct call on
|
| // RenderFrameImpl in the destructor (but only if render_frame_ is valid).
|
| - instance_deleted_callback_ =
|
| - base::Bind(&RenderViewImpl::PepperInstanceDeleted,
|
| - render_frame->render_view()->AsWeakPtr(),
|
| - base::Unretained(this));
|
| + instance_deleted_callback_ = base::Bind(
|
| + &RenderWidget::PepperInstanceDeleted,
|
| + render_frame->GetRenderWidget()->AsWeakPtr(), base::Unretained(this));
|
| view_data_.is_page_visible = !render_frame_->GetRenderWidget()->is_hidden();
|
|
|
| // Set the initial focus.
|
| @@ -1634,7 +1633,7 @@ bool PepperPluginInstanceImpl::PluginHasFocus() const {
|
| }
|
|
|
| void PepperPluginInstanceImpl::SendFocusChangeNotification() {
|
| - // Keep a reference on the stack. RenderViewImpl::PepperFocusChanged may
|
| + // Keep a reference on the stack. RenderWidget::PepperFocusChanged may
|
| // remove the <embed> from the DOM, which will make the PepperWebPluginImpl
|
| // drop its reference, usually the last one. This is similar to possible
|
| // plugin behavior described at the NOTE above Delete().
|
| @@ -1644,7 +1643,7 @@ void PepperPluginInstanceImpl::SendFocusChangeNotification() {
|
| return;
|
|
|
| bool has_focus = PluginHasFocus();
|
| - render_frame_->render_view()->PepperFocusChanged(this, has_focus);
|
| + render_frame_->GetRenderWidget()->PepperFocusChanged(this, has_focus);
|
|
|
| // instance_interface_ may have been cleared in Delete() if the
|
| // PepperWebPluginImpl is destroyed.
|
|
|