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

Unified Diff: cc/test/test_context_provider.cc

Issue 1336733002: Re-land: cc: Implement shared worker contexts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix LayerTreeHostClientTakeAwayOutputSurface test. Content provider is always destroyed on the clie… 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
« no previous file with comments | « cc/test/test_context_provider.h ('k') | cc/tiles/tile_manager_perftest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/test_context_provider.cc
diff --git a/cc/test/test_context_provider.cc b/cc/test/test_context_provider.cc
index ca7714d30cf9f4ca1b0eaaaeb7c117f7ddd180de..5e43ee3fcc5892c73b5afa24124d42c2479a57b5 100644
--- a/cc/test/test_context_provider.cc
+++ b/cc/test/test_context_provider.cc
@@ -19,7 +19,20 @@ namespace cc {
// static
scoped_refptr<TestContextProvider> TestContextProvider::Create() {
- return Create(TestWebGraphicsContext3D::Create().Pass());
+ return Create(TestWebGraphicsContext3D::Create());
+}
+
+// static
+scoped_refptr<TestContextProvider> TestContextProvider::CreateWorker() {
+ scoped_refptr<TestContextProvider> worker_context_provider =
+ Create(TestWebGraphicsContext3D::Create());
+ if (!worker_context_provider)
+ return nullptr;
+ // Worker contexts are bound to the thread they are created on.
+ if (!worker_context_provider->BindToCurrentThread())
+ return nullptr;
+ worker_context_provider->SetupLock();
+ return worker_context_provider;
}
// static
« no previous file with comments | « cc/test/test_context_provider.h ('k') | cc/tiles/tile_manager_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698