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

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

Issue 2513413003: Worker: Provide a way to access parent frame task runners from a worker thread (Closed)
Patch Set: update comments Created 4 years, 1 month 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 53c4442dbdfdc34916ecaffeb79bb098ce3222d1..8777b9e891da5cfb14f83d14c2d43f7ce8bb7d52 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/ParentFrameTaskRunners.h"
#include "core/workers/WorkerBackingThread.h"
#include "core/workers/WorkerClients.h"
#include "core/workers/WorkerGlobalScope.h"
@@ -52,7 +53,8 @@ class MockWorkerLoaderProxyProvider : public WorkerLoaderProxyProvider {
class MockWorkerReportingProxy : public WorkerReportingProxy {
public:
- MockWorkerReportingProxy() {}
+ MockWorkerReportingProxy()
+ : m_parentFrameTaskRunners(ParentFrameTaskRunners::create(nullptr)) {}
~MockWorkerReportingProxy() override {}
MOCK_METHOD3(reportExceptionMock,
@@ -81,6 +83,10 @@ class MockWorkerReportingProxy : public WorkerReportingProxy {
reportExceptionMock(errorMessage, location.get(), exceptionId);
}
+ ParentFrameTaskRunners* getParentFrameTaskRunners() override {
+ return m_parentFrameTaskRunners.get();
+ }
+
void willEvaluateWorkerScript(size_t scriptSize,
size_t cachedMetadataSize) override {
m_scriptEvaluationEvent.signal();
@@ -90,6 +96,7 @@ class MockWorkerReportingProxy : public WorkerReportingProxy {
void waitUntilScriptEvaluation() { m_scriptEvaluationEvent.wait(); }
private:
+ Persistent<ParentFrameTaskRunners> m_parentFrameTaskRunners;
WaitableEvent m_scriptEvaluationEvent;
};

Powered by Google App Engine
This is Rietveld 408576698