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

Unified Diff: third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp

Issue 2299883006: [Worker] Call prepareForShutdown ASAP when terminated forcibly (Closed)
Patch Set: fix Created 4 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 | « no previous file | third_party/WebKit/Source/core/workers/WorkerThread.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp
diff --git a/third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp b/third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp
index 1bd3110db62fd7c7ba77ed16b894b06683bf8405..b49170d9b2b2245a223f4114f3f9475c8b1c3376 100644
--- a/third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp
+++ b/third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp
@@ -256,6 +256,9 @@ public:
void onTearDown() override
{
postTaskToWorkerGlobalScope(BLINK_FROM_HERE, createCrossThreadTask(&WorkerThreadableLoaderTestHelper::clearLoader, crossThreadUnretained(this)));
+ WaitableEvent event;
+ postTaskToWorkerGlobalScope(BLINK_FROM_HERE, createCrossThreadTask(&signal, crossThreadUnretained(&event)));
+ event.wait();
m_workerThread->terminateAndWait();
// Needed to clean up the things on the main thread side and
@@ -328,6 +331,11 @@ private:
m_workerThread->postTask(location, std::move(task));
}
+ static void signal(WaitableEvent* event)
nhiroki 2016/09/06 05:06:40 We could remove this as follows? postTaskToWorker
yhirano 2016/09/06 05:38:03 It's a good idea, thank you!
+ {
+ event->signal();
+ }
+
RefPtr<SecurityOrigin> m_securityOrigin;
std::unique_ptr<MockWorkerReportingProxy> m_mockWorkerReportingProxy;
std::unique_ptr<WorkerThreadForTest> m_workerThread;
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/workers/WorkerThread.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698