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

Unified Diff: content/browser/renderer_host/render_widget_host_view_mac.mm

Issue 2656893003: Let DelegateFrameHost in Mac and Android use correct FrameSinkId during creation (Closed)
Patch Set: nits Created 3 years, 11 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
Index: content/browser/renderer_host/render_widget_host_view_mac.mm
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
index c91614f5c60f505661f68f3390315a215913abfc..593ba3f9ae8bff3060f4b1057dbd3731951352f4 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -468,8 +468,19 @@ RenderWidgetHostViewMac::RenderWidgetHostViewMac(RenderWidgetHost* widget,
[cocoa_view_ setLayer:background_layer_];
[cocoa_view_ setWantsLayer:YES];
- browser_compositor_.reset(new BrowserCompositorMac(
- this, this, render_widget_host_->is_hidden(), [cocoa_view_ window]));
+ // GuestViews have two RenderWidgetHostViews and so we need to make sure
boliu 2017/01/26 00:14:39 can you explain a bit how this works? will both RW
xlai (Olivia) 2017/01/26 15:56:11 I copied this comment and the same piece of code f
Fady Samuel 2017/01/26 16:06:36 guest_view_hack a flag used for the BrowserPlugin
boliu 2017/01/26 19:24:46 Same question here, how do we know AllocateFrameSi
xlai (Olivia) 2017/01/26 20:50:21 Mac is using GPUProcessTransportFactory so it's sa
+ // we don't have FrameSinkId collisions.
+ ImageTransportFactory* factory = ImageTransportFactory::GetInstance();
+ cc::FrameSinkId frame_sink_id =
+ is_guest_view_hack_
+ ? factory->GetContextFactoryPrivate()->AllocateFrameSinkId()
+ : cc::FrameSinkId(base::checked_cast<uint32_t>(
+ render_widget_host_->GetProcess()->GetID()),
+ base::checked_cast<uint32_t>(
+ render_widget_host_->GetRoutingID()));
+ browser_compositor_.reset(
+ new BrowserCompositorMac(this, this, render_widget_host_->is_hidden(),
+ [cocoa_view_ window], frame_sink_id));
display::Screen::GetScreen()->AddObserver(this);

Powered by Google App Engine
This is Rietveld 408576698