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

Unified Diff: Source/modules/compositorworker/CompositorWorkerManagerTest.cpp

Issue 1274023003: compositor-worker: Get the thread to run compositor-workers from the Platform. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: . Created 5 years, 4 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: Source/modules/compositorworker/CompositorWorkerManagerTest.cpp
diff --git a/Source/modules/compositorworker/CompositorWorkerManagerTest.cpp b/Source/modules/compositorworker/CompositorWorkerManagerTest.cpp
index 4aac3229f03c8864523fef6880e79a80aefe729c..c52a85027ad3a041f4499188ad133ce588fe6da0 100644
--- a/Source/modules/compositorworker/CompositorWorkerManagerTest.cpp
+++ b/Source/modules/compositorworker/CompositorWorkerManagerTest.cpp
@@ -124,7 +124,7 @@ public:
void checkWorkerCanExecuteScript(WorkerThread* worker)
{
OwnPtr<WebWaitableEvent> waitEvent = adoptPtr(Platform::current()->createWaitableEvent());
- worker->backingThread().platformThread().postTask(FROM_HERE, threadSafeBind(&CompositorWorkerManagerTest::executeScriptInWorker, AllowCrossThreadAccess(this),
+ worker->backingThread().postTask(FROM_HERE, threadSafeBind(&CompositorWorkerManagerTest::executeScriptInWorker, AllowCrossThreadAccess(this),
AllowCrossThreadAccess(worker), AllowCrossThreadAccess(waitEvent.get())));
waitEvent->wait();
}
@@ -174,7 +174,7 @@ TEST_F(CompositorWorkerManagerTest, CreateSecondAndTerminateFirst)
// Create the first worker and wait until it is initialized.
OwnPtr<WebWaitableEvent> firstCreationEvent = adoptPtr(Platform::current()->createWaitableEvent());
RefPtr<CompositorWorkerThread> firstWorker = createCompositorWorker(firstCreationEvent.get());
- WebThreadSupportingGC* firstThread = &CompositorWorkerManager::instance()->compositorWorkerThread();
+ WebThread* firstThread = &CompositorWorkerManager::instance()->compositorWorkerThread();
ASSERT(firstThread);
waitForWaitableEventAfterIteratingCurrentLoop(firstCreationEvent.get());
v8::Isolate* firstIsolate = firstWorker->isolate();
@@ -187,7 +187,7 @@ TEST_F(CompositorWorkerManagerTest, CreateSecondAndTerminateFirst)
// Wait until the second worker is initialized. Verify that the second worker is using the same
// thread and Isolate as the first worker.
- WebThreadSupportingGC* secondThread = &CompositorWorkerManager::instance()->compositorWorkerThread();
+ WebThread* secondThread = &CompositorWorkerManager::instance()->compositorWorkerThread();
ASSERT(secondThread);
waitForWaitableEventAfterIteratingCurrentLoop(secondCreationEvent.get());
EXPECT_EQ(firstThread, secondThread);
@@ -214,7 +214,7 @@ TEST_F(CompositorWorkerManagerTest, TerminateFirstAndCreateSecond)
// Create the first worker, wait until it is initialized, and terminate it.
OwnPtr<WebWaitableEvent> creationEvent = adoptPtr(Platform::current()->createWaitableEvent());
RefPtr<CompositorWorkerThread> compositorWorker = createCompositorWorker(creationEvent.get());
- WebThreadSupportingGC* firstThread = &CompositorWorkerManager::instance()->compositorWorkerThread();
+ WebThread* firstThread = &CompositorWorkerManager::instance()->compositorWorkerThread();
waitForWaitableEventAfterIteratingCurrentLoop(creationEvent.get());
ASSERT(compositorWorker->isolate());
compositorWorker->terminateAndWait();
@@ -223,13 +223,13 @@ TEST_F(CompositorWorkerManagerTest, TerminateFirstAndCreateSecond)
// thread will have been destroyed after destroying the first worker.
creationEvent = adoptPtr(Platform::current()->createWaitableEvent());
compositorWorker = createCompositorWorker(creationEvent.get());
- WebThreadSupportingGC* secondThread = &CompositorWorkerManager::instance()->compositorWorkerThread();
+ WebThread* secondThread = &CompositorWorkerManager::instance()->compositorWorkerThread();
EXPECT_NE(firstThread, secondThread);
waitForWaitableEventAfterIteratingCurrentLoop(creationEvent.get());
// Jump over to the worker's thread to verify that the Isolate is set up correctly and execute script.
OwnPtr<WebWaitableEvent> checkEvent = adoptPtr(Platform::current()->createWaitableEvent());
- secondThread->platformThread().postTask(FROM_HERE, threadSafeBind(&checkCurrentIsolate, AllowCrossThreadAccess(compositorWorker->isolate()), AllowCrossThreadAccess(checkEvent.get())));
+ secondThread->postTask(FROM_HERE, threadSafeBind(&checkCurrentIsolate, AllowCrossThreadAccess(compositorWorker->isolate()), AllowCrossThreadAccess(checkEvent.get())));
waitForWaitableEventAfterIteratingCurrentLoop(checkEvent.get());
checkWorkerCanExecuteScript(compositorWorker.get());
« no previous file with comments | « Source/modules/compositorworker/CompositorWorkerManager.cpp ('k') | Source/modules/compositorworker/CompositorWorkerThread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698