diff options
author | wjmaclean <wjmaclean@chromium.org> | 2015-06-15 09:49:22 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-06-15 16:49:49 +0000 |
commit | 53032adf732a092a342ae1ef2f3039adf89082d1 (patch) | |
tree | c4eb0c2c6d115a1e2d55f5d09178b21c27a50595 /content/renderer/child_frame_compositing_helper.cc | |
parent | 07bbd38f13474770ab04769480dddefd2042e812 (diff) | |
download | chromium_src-53032adf732a092a342ae1ef2f3039adf89082d1.zip chromium_src-53032adf732a092a342ae1ef2f3039adf89082d1.tar.gz chromium_src-53032adf732a092a342ae1ef2f3039adf89082d1.tar.bz2 |
Convert BrowserPlugin to render using cc::Surfaces.
This CL adds the appropriate machinery to allow BrowserPlugin to render
using surfaces. This directly affects WebView and other GuestView
types, such as the out-of-process PDF viewer.
Where possible, functionality in RenderWidgetHostViewChildFrame that did
not need to be replicated in RenderWidgetHostViewGuest was left
untouched.
This CL is based closely on https://codereview.chromium.org/1094113003/.
BUG=none
Review URL: https://codereview.chromium.org/1169983006
Cr-Commit-Position: refs/heads/master@{#334392}
Diffstat (limited to 'content/renderer/child_frame_compositing_helper.cc')
-rw-r--r-- | content/renderer/child_frame_compositing_helper.cc | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/content/renderer/child_frame_compositing_helper.cc b/content/renderer/child_frame_compositing_helper.cc index d72b3e9..e6a3fab 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,15 @@ 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. + if (render_frame_proxy_) { + render_frame_proxy_->Send( + new FrameHostMsg_SatisfySequence(host_routing_id_, sequence)); + } else if (browser_plugin_.get()) { + browser_plugin_->SendSatisfySequence(sequence); + } CheckSizeAndAdjustLayerProperties(frame_size, scale_factor, surface_layer_.get()); |