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

Unified Diff: content/browser/compositor/gpu_process_transport_factory.cc

Issue 2691363002: Centralize FrameSinkId allocation in one place (Closed)
Patch Set: fix nits 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/compositor/gpu_process_transport_factory.cc
diff --git a/content/browser/compositor/gpu_process_transport_factory.cc b/content/browser/compositor/gpu_process_transport_factory.cc
index 713812a1012a9e7a75bde89fbb3c362a4d9426a0..ffe7e05045fd13e327967292125cd9d95f2e4177 100644
--- a/content/browser/compositor/gpu_process_transport_factory.cc
+++ b/content/browser/compositor/gpu_process_transport_factory.cc
@@ -103,6 +103,9 @@ using gpu::gles2::GLES2Interface;
namespace {
const int kNumRetriesBeforeSoftwareFallback = 4;
+// The client_id used here should not conflict with the client_id generated
+// from RenderWidgetHostImpl.
+constexpr uint32_t kDefaultClientId = 0u;
bool IsUsingMus() {
return service_manager::ServiceManagerIsRemote();
@@ -175,7 +178,8 @@ struct GpuProcessTransportFactory::PerCompositorData {
};
GpuProcessTransportFactory::GpuProcessTransportFactory()
- : task_graph_runner_(new cc::SingleThreadTaskGraphRunner),
+ : frame_sink_id_allocator_(kDefaultClientId),
+ task_graph_runner_(new cc::SingleThreadTaskGraphRunner),
callback_factory_(this) {
cc::SetClientNameForMetrics("Browser");
@@ -689,12 +693,7 @@ GpuProcessTransportFactory::GetContextFactoryPrivate() {
}
cc::FrameSinkId GpuProcessTransportFactory::AllocateFrameSinkId() {
- // The FrameSinkId generated here must be unique with
- // RenderWidgetHostViewAura's
- // and RenderWidgetHostViewMac's FrameSinkId allocation.
- // TODO(crbug.com/685777): Centralize allocation in one place for easier
- // maintenance.
- return cc::FrameSinkId(0, next_sink_id_++);
+ return frame_sink_id_allocator_.NextFrameSinkId();
}
void GpuProcessTransportFactory::SetDisplayVisible(ui::Compositor* compositor,

Powered by Google App Engine
This is Rietveld 408576698