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

Unified Diff: content/renderer/child_frame_compositing_helper.cc

Issue 1169983006: Convert BrowserPlugin to render using cc::Surfaces. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update test to always call UpdateGuestSizeIfNecessary(). Created 5 years, 6 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 | « content/renderer/child_frame_compositing_helper.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..e6a3fabf2073dbcbfcc3f9760ae0fbcd69007531 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());
« no previous file with comments | « content/renderer/child_frame_compositing_helper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698