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

Unified Diff: mojo/services/view_manager/context_factory_impl.cc

Issue 553213003: Avoid destroying surface before the parent surface stops referencing it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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: mojo/services/view_manager/context_factory_impl.cc
diff --git a/mojo/services/view_manager/context_factory_impl.cc b/mojo/services/view_manager/context_factory_impl.cc
index a4f7d90dcedc4e67e36641b7591559faf1b1d11b..425776e4dc9c9477c17f967d42550f929a398309 100644
--- a/mojo/services/view_manager/context_factory_impl.cc
+++ b/mojo/services/view_manager/context_factory_impl.cc
@@ -5,6 +5,7 @@
#include "mojo/services/view_manager/context_factory_impl.h"
#include "cc/output/output_surface.h"
+#include "cc/surfaces/surface_id_allocator.h"
#include "mojo/cc/context_provider_mojo.h"
#include "ui/compositor/reflector.h"
#include "ui/gl/gl_implementation.h"
@@ -19,6 +20,7 @@ namespace service {
ContextFactoryImpl::ContextFactoryImpl(
ScopedMessagePipeHandle command_buffer_handle)
: command_buffer_handle_(command_buffer_handle.Pass()),
+ next_surface_id_namespace_(0),
did_create_(false) {
DCHECK(command_buffer_handle_.is_valid());
}
@@ -74,5 +76,11 @@ base::MessageLoopProxy* ContextFactoryImpl::GetCompositorMessageLoop() {
return NULL;
}
+scoped_ptr<cc::SurfaceIdAllocator>
+ContextFactoryImpl::CreateSurfaceIdAllocator() {
+ return make_scoped_ptr(
+ new cc::SurfaceIdAllocator(next_surface_id_namespace_++));
+}
+
} // namespace service
} // namespace mojo

Powered by Google App Engine
This is Rietveld 408576698