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

Unified Diff: android_webview/browser/surfaces_instance.cc

Issue 2691363002: Centralize FrameSinkId allocation in one place (Closed)
Patch Set: explicit 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
« no previous file with comments | « android_webview/browser/surfaces_instance.h ('k') | cc/surfaces/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/browser/surfaces_instance.cc
diff --git a/android_webview/browser/surfaces_instance.cc b/android_webview/browser/surfaces_instance.cc
index 751b55399f7f49198cab74886d1706512729b72f..5fd4ac463eebf3ad5cdb1791eeebeb291c697c0a 100644
--- a/android_webview/browser/surfaces_instance.cc
+++ b/android_webview/browser/surfaces_instance.cc
@@ -28,6 +28,9 @@
namespace android_webview {
namespace {
+// The client_id used here should not conflict with the client_id generated
+// from RenderWidgetHostImpl.
+constexpr uint32_t kDefaultClientId = 0u;
SurfacesInstance* g_surfaces_instance = nullptr;
} // namespace
@@ -39,7 +42,8 @@ scoped_refptr<SurfacesInstance> SurfacesInstance::GetOrCreateInstance() {
}
SurfacesInstance::SurfacesInstance()
- : next_client_id_(1u), frame_sink_id_(AllocateFrameSinkId()) {
+ : frame_sink_id_allocator_(kDefaultClientId),
+ frame_sink_id_(AllocateFrameSinkId()) {
cc::RendererSettings settings;
// Should be kept in sync with compositor_impl_android.cc.
@@ -93,7 +97,7 @@ void SurfacesInstance::DisplayOutputSurfaceLost() {
}
cc::FrameSinkId SurfacesInstance::AllocateFrameSinkId() {
- return cc::FrameSinkId(next_client_id_++, 0 /* sink_id */);
+ return frame_sink_id_allocator_.NextFrameSinkId();
}
cc::SurfaceManager* SurfacesInstance::GetSurfaceManager() {
« no previous file with comments | « android_webview/browser/surfaces_instance.h ('k') | cc/surfaces/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698