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

Unified Diff: ui/compositor/test/in_process_context_factory.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: ui/compositor/test/in_process_context_factory.cc
diff --git a/ui/compositor/test/in_process_context_factory.cc b/ui/compositor/test/in_process_context_factory.cc
index 0a5be65e9fa2348b8cd73284239acb861ecfc957..1cd0e712871358f6117cc674e1a8c8c5f4dd2b88 100644
--- a/ui/compositor/test/in_process_context_factory.cc
+++ b/ui/compositor/test/in_process_context_factory.cc
@@ -129,7 +129,9 @@ struct InProcessContextFactory::PerCompositorData {
InProcessContextFactory::InProcessContextFactory(
bool context_factory_for_test,
cc::SurfaceManager* surface_manager)
- : next_surface_sink_id_(1u),
+ : frame_sink_id_allocator_(
+ 0 /* client_id, not to conflict with the client_id
+ generated from RenderWidgetHostImpl */),
use_test_surface_(true),
context_factory_for_test_(context_factory_for_test),
surface_manager_(surface_manager) {
@@ -285,12 +287,7 @@ cc::TaskGraphRunner* InProcessContextFactory::GetTaskGraphRunner() {
}
cc::FrameSinkId InProcessContextFactory::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_surface_sink_id_++);
+ return frame_sink_id_allocator_.NextFrameSinkId();
}
cc::SurfaceManager* InProcessContextFactory::GetSurfaceManager() {

Powered by Google App Engine
This is Rietveld 408576698