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

Unified Diff: android_webview/browser/surfaces_instance.cc

Issue 2166423002: ui::ContextFactory should not create SurfaceIdAllocators (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Dana's nit Created 4 years, 5 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') | ash/sysui/stub_context_factory.h » ('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 d7b2647c52e4b0ef0b6dc68874fa3dbf9c450bb8..a2e30f38250bd80db6adac3c54126fb2ec769623 100644
--- a/android_webview/browser/surfaces_instance.cc
+++ b/android_webview/browser/surfaces_instance.cc
@@ -52,7 +52,7 @@ SurfacesInstance::SurfacesInstance()
surface_manager_.reset(new cc::SurfaceManager);
surface_id_allocator_.reset(
new cc::SurfaceIdAllocator(next_surface_client_id_++));
- surface_id_allocator_->RegisterSurfaceClientId(surface_manager_.get());
+ surface_manager_->RegisterSurfaceClientId(surface_id_allocator_->client_id());
std::unique_ptr<cc::BeginFrameSource> begin_frame_source(
new cc::StubBeginFrameSource);
@@ -87,14 +87,13 @@ SurfacesInstance::~SurfacesInstance() {
DCHECK(child_ids_.empty());
if (!root_id_.is_null())
surface_factory_->Destroy(root_id_);
+
+ surface_manager_->InvalidateSurfaceClientId(
+ surface_id_allocator_->client_id());
}
-std::unique_ptr<cc::SurfaceIdAllocator>
-SurfacesInstance::CreateSurfaceIdAllocator() {
- std::unique_ptr<cc::SurfaceIdAllocator> allocator =
- base::WrapUnique(new cc::SurfaceIdAllocator(next_surface_client_id_++));
- allocator->RegisterSurfaceClientId(surface_manager_.get());
- return allocator;
+uint32_t SurfacesInstance::AllocateSurfaceClientId() {
+ return next_surface_client_id_++;
}
cc::SurfaceManager* SurfacesInstance::GetSurfaceManager() {
« no previous file with comments | « android_webview/browser/surfaces_instance.h ('k') | ash/sysui/stub_context_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698