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

Unified Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 2691363002: Centralize FrameSinkId allocation in one place (Closed)
Patch Set: android Created 3 years, 10 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_impl.cc
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 9b64f82bd3e837edad5a73c5f131a1f964fca930..a19140728132e9c1f44176303e7d139a692ecb20 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -95,6 +95,9 @@
#if defined(OS_ANDROID)
#include "ui/android/view_android.h"
+#else
+#include "content/browser/compositor/image_transport_factory.h"
+#include "ui/compositor/compositor.h" // nogncheck
xlai (Olivia) 2017/02/15 18:05:46 Need nogncheck to pass Android analyze. This is sa
boliu 2017/02/15 19:59:20 So he problem is gn check isn't aware of OS define
xlai (Olivia) 2017/02/15 22:38:36 Done.
#endif
#if defined(OS_MACOSX)
@@ -425,6 +428,21 @@ RenderWidgetHostViewBase* RenderWidgetHostImpl::GetView() const {
return view_.get();
}
+cc::FrameSinkId RenderWidgetHostImpl::AllocateFrameSinkId(
+ bool is_guest_view_hack) {
+// GuestViews have two RenderWidgetHostViews and so we need to make sure
+// we don't have FrameSinkId collisions.
+#if !defined(OS_ANDROID)
+ if (is_guest_view_hack) {
+ ImageTransportFactory* factory = ImageTransportFactory::GetInstance();
+ return factory->GetContextFactoryPrivate()->AllocateFrameSinkId();
+ }
+#endif
+ return cc::FrameSinkId(
boliu 2017/02/15 19:59:20 keep the comment that this scheme must be unique w
xlai (Olivia) 2017/02/15 22:38:36 Done.
+ base::checked_cast<uint32_t>(this->GetProcess()->GetID()),
+ base::checked_cast<uint32_t>(this->GetRoutingID()));
+}
+
void RenderWidgetHostImpl::ResetSizeAndRepaintPendingFlags() {
resize_ack_pending_ = false;
if (repaint_ack_pending_) {

Powered by Google App Engine
This is Rietveld 408576698