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

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

Issue 2691363002: Centralize FrameSinkId allocation in one place (Closed)
Patch Set: fix based on comment 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/context_provider_factory_impl_android.cc
diff --git a/content/browser/renderer_host/context_provider_factory_impl_android.cc b/content/browser/renderer_host/context_provider_factory_impl_android.cc
index 2437ca8146246f27cccb170c615d5f4cffafa755..08b8464ba3d8fff8ab9cf37dd63f85c105753588 100644
--- a/content/browser/renderer_host/context_provider_factory_impl_android.cc
+++ b/content/browser/renderer_host/context_provider_factory_impl_android.cc
@@ -66,7 +66,9 @@ ContextProviderFactoryImpl::ContextProviderFactoryImpl(
: gpu_channel_factory_(gpu_channel_factory),
in_handle_pending_requests_(false),
in_shutdown_(false),
- next_sink_id_(1u),
+ frame_sink_id_allocator_(
+ 0 /* client_id, not to conflict with the client_id
+ generated from RenderWidgetHostImpl */),
weak_factory_(this) {
DCHECK(gpu_channel_factory_);
}
@@ -136,12 +138,7 @@ cc::SurfaceManager* ContextProviderFactoryImpl::GetSurfaceManager() {
}
cc::FrameSinkId ContextProviderFactoryImpl::AllocateFrameSinkId() {
- // The FrameSinkId generated here must be unique with
- // RenderWidgetHostViewAndroid's
- // FrameSinkId allocation.
- // TODO(crbug.com/685777): Centralize allocation in one place for easier
- // maintenance.
- return cc::FrameSinkId(0 /* client_id */, next_sink_id_++);
+ return frame_sink_id_allocator_.NextFrameSinkId();
}
gpu::GpuMemoryBufferManager*

Powered by Google App Engine
This is Rietveld 408576698