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

Unified Diff: ui/compositor/test/in_process_context_factory.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, 2 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 | « ui/compositor/test/in_process_context_factory.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 fa2380fc242a7f9c2e188ecc5a4e0137358c9f70..d815a5c9553067e532c66b4e3536eb9df96c35ec 100644
--- a/ui/compositor/test/in_process_context_factory.cc
+++ b/ui/compositor/test/in_process_context_factory.cc
@@ -7,6 +7,7 @@
#include "base/command_line.h"
#include "base/threading/thread.h"
#include "cc/output/output_surface.h"
+#include "cc/surfaces/surface_id_allocator.h"
#include "cc/test/test_shared_bitmap_manager.h"
#include "ui/compositor/compositor_switches.h"
#include "ui/compositor/reflector.h"
@@ -19,7 +20,8 @@
namespace ui {
InProcessContextFactory::InProcessContextFactory()
- : shared_bitmap_manager_(new cc::TestSharedBitmapManager()) {
+ : shared_bitmap_manager_(new cc::TestSharedBitmapManager()),
+ next_surface_id_namespace_(1u) {
DCHECK_NE(gfx::GetGLImplementation(), gfx::kGLImplementationNone)
<< "If running tests, ensure that main() is calling "
<< "gfx::GLSurface::InitializeOneOffForTests()";
@@ -102,4 +104,10 @@ base::MessageLoopProxy* InProcessContextFactory::GetCompositorMessageLoop() {
return compositor_thread_->message_loop_proxy().get();
}
+scoped_ptr<cc::SurfaceIdAllocator>
+InProcessContextFactory::CreateSurfaceIdAllocator() {
+ return make_scoped_ptr(
+ new cc::SurfaceIdAllocator(next_surface_id_namespace_++));
+}
+
} // namespace ui
« no previous file with comments | « ui/compositor/test/in_process_context_factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698