Chromium Code Reviews| Index: content/renderer/child_frame_compositing_helper.cc |
| diff --git a/content/renderer/child_frame_compositing_helper.cc b/content/renderer/child_frame_compositing_helper.cc |
| index d72b3e905a087570e34304ca829656d61c35d4f3..00af7dbdc7a5b7cc2b10bb0c55b43a3c1f801fbf 100644 |
| --- a/content/renderer/child_frame_compositing_helper.cc |
| +++ b/content/renderer/child_frame_compositing_helper.cc |
| @@ -288,6 +288,17 @@ void ChildFrameCompositingHelper::RequireCallback( |
| sender->Send(new FrameHostMsg_RequireSequence(host_routing_id, id, sequence)); |
| } |
| +void ChildFrameCompositingHelper::RequireCallbackBrowserPlugin( |
| + scoped_refptr<ThreadSafeSender> sender, |
| + int host_routing_id, |
| + int browser_plugin_instance_id, |
| + cc::SurfaceId id, |
| + cc::SurfaceSequence sequence) { |
| + // This may be called on either the main or impl thread. |
| + sender->Send(new BrowserPluginHostMsg_RequireSequence( |
| + host_routing_id, browser_plugin_instance_id, id, sequence)); |
| +} |
| + |
| void ChildFrameCompositingHelper::OnSetSurface( |
| const cc::SurfaceId& surface_id, |
| const gfx::Size& frame_size, |
| @@ -308,8 +319,13 @@ void ChildFrameCompositingHelper::OnSetSurface( |
| base::Bind(&ChildFrameCompositingHelper::SatisfyCallback, sender, |
| host_routing_id_); |
| cc::SurfaceLayer::RequireCallback require_callback = |
| - base::Bind(&ChildFrameCompositingHelper::RequireCallback, sender, |
| - host_routing_id_); |
| + render_frame_proxy_ |
| + ? base::Bind(&ChildFrameCompositingHelper::RequireCallback, sender, |
| + host_routing_id_) |
| + : base::Bind( |
| + &ChildFrameCompositingHelper::RequireCallbackBrowserPlugin, |
| + sender, host_routing_id_, |
| + browser_plugin_->browser_plugin_instance_id()); |
| surface_layer_ = |
| cc::SurfaceLayer::Create(cc_blink::WebLayerImpl::LayerSettings(), |
| satisfy_callback, require_callback); |
| @@ -320,9 +336,13 @@ void ChildFrameCompositingHelper::OnSetSurface( |
| background_layer_->AddChild(surface_layer_); |
| // The RWHV creates a destruction dependency on the surface that needs to be |
| - // satisfied. |
| - render_frame_proxy_->Send( |
| - new FrameHostMsg_SatisfySequence(host_routing_id_, sequence)); |
| + // satisfied. Note: render_frame_proxy_ is null in the case our client is a |
| + // BrowserPlugin; in this case the BrowserPlugin sends its own SatisfySequence |
| + // message. |
|
kenrb
2015/06/10 20:43:39
This is okay, but is there a reason it is done by
wjmaclean
2015/06/10 21:05:02
I considered adding a new function in the BrowserP
|
| + if (render_frame_proxy_) { |
| + render_frame_proxy_->Send( |
| + new FrameHostMsg_SatisfySequence(host_routing_id_, sequence)); |
| + } |
| CheckSizeAndAdjustLayerProperties(frame_size, scale_factor, |
| surface_layer_.get()); |