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

Unified Diff: ui/compositor/test/in_process_context_factory.cc

Issue 1317743002: cc: Implement shared worker contexts. (v1) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add missing context3d_task_runner_ check Created 5 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: 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 942947d5b1b020f3ebfcfe21cc7cf2097d2067cb..3bb555a80aa40a2b3877bcf0ec7b08648fe5cd7f 100644
--- a/ui/compositor/test/in_process_context_factory.cc
+++ b/ui/compositor/test/in_process_context_factory.cc
@@ -115,6 +115,15 @@ void InProcessContextFactory::CreateOutputSurface(
scoped_refptr<InProcessContextProvider> worker_context_provider =
InProcessContextProvider::CreateOffscreen(&gpu_memory_buffer_manager_,
&image_factory_);
+ if (worker_context_provider &&
+ !worker_context_provider->BindToCurrentThread())
+ worker_context_provider = nullptr;
+ if (worker_context_provider) {
+ worker_context_provider->SetupLock();
+ // Detach from thread to allow context to be destroyed on a different
+ // thread without being used.
+ worker_context_provider->DetachFromThread();
+ }
scoped_ptr<cc::OutputSurface> real_output_surface;

Powered by Google App Engine
This is Rietveld 408576698