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

Unified Diff: third_party/WebKit/Source/core/workers/WorkerThreadTestHelper.h

Issue 1733353004: Introduce WorkerBackingThread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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: third_party/WebKit/Source/core/workers/WorkerThreadTestHelper.h
diff --git a/third_party/WebKit/Source/core/workers/WorkerThreadTestHelper.h b/third_party/WebKit/Source/core/workers/WorkerThreadTestHelper.h
index 83c0a43ec859808a28de8fbe701624f4bc73be33..79f4519f6ebcb16aae868093e7a7b2b793183453 100644
--- a/third_party/WebKit/Source/core/workers/WorkerThreadTestHelper.h
+++ b/third_party/WebKit/Source/core/workers/WorkerThreadTestHelper.h
@@ -7,6 +7,7 @@
#include "bindings/core/v8/V8GCController.h"
#include "core/frame/csp/ContentSecurityPolicy.h"
#include "core/inspector/ConsoleMessage.h"
+#include "core/workers/WorkerBackingThread.h"
#include "core/workers/WorkerClients.h"
#include "core/workers/WorkerLoaderProxy.h"
#include "core/workers/WorkerReportingProxy.h"
@@ -104,25 +105,14 @@ public:
WorkerLoaderProxyProvider* mockWorkerLoaderProxyProvider,
WorkerReportingProxy& mockWorkerReportingProxy)
: WorkerThread(WorkerLoaderProxy::create(mockWorkerLoaderProxyProvider), mockWorkerReportingProxy)
- , m_thread(WebThreadSupportingGC::create("Test thread"))
+ , m_workerBackingThread(WorkerBackingThread::createForTest("Test thread"))
, m_scriptLoadedEvent(adoptPtr(new WaitableEvent()))
{
- ASSERT(m_thread);
}
~WorkerThreadForTest() override { }
- // WorkerThread implementation:
- WebThreadSupportingGC& backingThread() override
- {
- ASSERT(m_thread);
- return *m_thread;
- }
- void willDestroyIsolate() override
- {
- V8GCController::collectAllGarbageForTesting(v8::Isolate::GetCurrent());
- WorkerThread::willDestroyIsolate();
- }
+ WorkerBackingThread& workerBackingThread() override { return *m_workerBackingThread; }
WorkerGlobalScope* createWorkerGlobalScope(PassOwnPtr<WorkerThreadStartupData> startupData) override
{
@@ -163,12 +153,12 @@ public:
void waitForInit()
{
OwnPtr<WaitableEvent> completionEvent = adoptPtr(new WaitableEvent());
- backingThread().postTask(BLINK_FROM_HERE, threadSafeBind(&WaitableEvent::signal, AllowCrossThreadAccess(completionEvent.get())));
+ workerBackingThread().backingThread().postTask(BLINK_FROM_HERE, threadSafeBind(&WaitableEvent::signal, AllowCrossThreadAccess(completionEvent.get())));
completionEvent->wait();
}
private:
- OwnPtr<WebThreadSupportingGC> m_thread;
+ OwnPtr<WorkerBackingThread> m_workerBackingThread;
OwnPtr<WaitableEvent> m_scriptLoadedEvent;
};
« no previous file with comments | « third_party/WebKit/Source/core/workers/WorkerThread.cpp ('k') | third_party/WebKit/Source/modules/ModulesInitializer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698