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

Unified Diff: third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThreadTest.cpp

Issue 2539443004: Worker: Move ParentFrameTaskRunners from WorkerReportingProxy to ObjectProxy (Closed)
Patch Set: rebase Created 3 years, 11 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/modules/compositorworker/CompositorWorkerThreadTest.cpp
diff --git a/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThreadTest.cpp b/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThreadTest.cpp
index 98c4e2aa63d43574629b346ec4d612ab8e82bd03..0e8d3dee2073f9fc232043b993845dbdb65a29da 100644
--- a/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThreadTest.cpp
+++ b/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThreadTest.cpp
@@ -35,8 +35,10 @@ namespace {
// CompositorWorkerThreads.
class TestCompositorWorkerObjectProxy : public InProcessWorkerObjectProxy {
public:
- static std::unique_ptr<TestCompositorWorkerObjectProxy> create() {
- return WTF::wrapUnique(new TestCompositorWorkerObjectProxy());
+ static std::unique_ptr<TestCompositorWorkerObjectProxy> create(
+ ParentFrameTaskRunners* parentFrameTaskRunners) {
+ return WTF::wrapUnique(
+ new TestCompositorWorkerObjectProxy(parentFrameTaskRunners));
}
// (Empty) WorkerReportingProxy implementation:
@@ -55,9 +57,9 @@ class TestCompositorWorkerObjectProxy : public InProcessWorkerObjectProxy {
void didTerminateWorkerThread() override {}
private:
- TestCompositorWorkerObjectProxy()
- : InProcessWorkerObjectProxy(nullptr,
- ParentFrameTaskRunners::create(nullptr)) {}
+ explicit TestCompositorWorkerObjectProxy(
+ ParentFrameTaskRunners* parentFrameTaskRunners)
+ : InProcessWorkerObjectProxy(nullptr, parentFrameTaskRunners) {}
};
class TestCompositorProxyClient
@@ -97,7 +99,9 @@ class CompositorWorkerThreadTest : public ::testing::Test {
public:
void SetUp() override {
CompositorWorkerThread::createSharedBackingThreadForTest();
- m_objectProxy = TestCompositorWorkerObjectProxy::create();
+ m_parentFrameTaskRunners = ParentFrameTaskRunners::create(nullptr);
+ m_objectProxy =
+ TestCompositorWorkerObjectProxy::create(m_parentFrameTaskRunners.get());
m_securityOrigin =
SecurityOrigin::create(KURL(ParsedURLString, "http://fake.url/"));
}
@@ -108,7 +112,8 @@ class CompositorWorkerThreadTest : public ::testing::Test {
std::unique_ptr<CompositorWorkerThread> createCompositorWorker() {
std::unique_ptr<CompositorWorkerThread> workerThread =
- CompositorWorkerThread::create(nullptr, *m_objectProxy, 0);
+ CompositorWorkerThread::create(nullptr, *m_objectProxy,
+ m_parentFrameTaskRunners.get(), 0);
WorkerClients* clients = WorkerClients::create();
provideCompositorProxyClientTo(clients, new TestCompositorProxyClient);
workerThread->start(WorkerThreadStartupData::create(
@@ -144,6 +149,7 @@ class CompositorWorkerThreadTest : public ::testing::Test {
RefPtr<SecurityOrigin> m_securityOrigin;
std::unique_ptr<InProcessWorkerObjectProxy> m_objectProxy;
+ Persistent<ParentFrameTaskRunners> m_parentFrameTaskRunners;
ScopedTestingPlatformSupport<CompositorWorkerTestPlatform> m_platform;
};

Powered by Google App Engine
This is Rietveld 408576698