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

Side by Side Diff: third_party/WebKit/Source/core/workers/WorkerThreadTestHelper.h

Issue 2220213002: [worklets] Move ConsoleMessageStorage to WorkerThread instead of WorkerGlobalScope. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments. Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "bindings/core/v8/SourceLocation.h" 5 #include "bindings/core/v8/SourceLocation.h"
6 #include "bindings/core/v8/V8CacheOptions.h" 6 #include "bindings/core/v8/V8CacheOptions.h"
7 #include "bindings/core/v8/V8GCController.h" 7 #include "bindings/core/v8/V8GCController.h"
8 #include "core/frame/csp/ContentSecurityPolicy.h" 8 #include "core/frame/csp/ContentSecurityPolicy.h"
9 #include "core/inspector/ConsoleMessage.h" 9 #include "core/inspector/ConsoleMessage.h"
10 #include "core/workers/WorkerBackingThread.h" 10 #include "core/workers/WorkerBackingThread.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 WorkerReportingProxy& mockWorkerReportingProxy) 86 WorkerReportingProxy& mockWorkerReportingProxy)
87 : WorkerThread(WorkerLoaderProxy::create(mockWorkerLoaderProxyProvider), mockWorkerReportingProxy) 87 : WorkerThread(WorkerLoaderProxy::create(mockWorkerLoaderProxyProvider), mockWorkerReportingProxy)
88 , m_workerBackingThread(WorkerBackingThread::createForTest("Test thread" )) 88 , m_workerBackingThread(WorkerBackingThread::createForTest("Test thread" ))
89 , m_scriptLoadedEvent(wrapUnique(new WaitableEvent())) 89 , m_scriptLoadedEvent(wrapUnique(new WaitableEvent()))
90 { 90 {
91 } 91 }
92 92
93 ~WorkerThreadForTest() override { } 93 ~WorkerThreadForTest() override { }
94 94
95 WorkerBackingThread& workerBackingThread() override { return *m_workerBackin gThread; } 95 WorkerBackingThread& workerBackingThread() override { return *m_workerBackin gThread; }
96 ConsoleMessageStorage* consoleMessageStorage() final { return toWorkerGlobal Scope(globalScope())->consoleMessageStorage(); }
97 96
98 WorkerOrWorkletGlobalScope* createWorkerGlobalScope(std::unique_ptr<WorkerTh readStartupData>) override; 97 WorkerOrWorkletGlobalScope* createWorkerGlobalScope(std::unique_ptr<WorkerTh readStartupData>) override;
99 98
100 void waitUntilScriptLoaded() 99 void waitUntilScriptLoaded()
101 { 100 {
102 m_scriptLoadedEvent->wait(); 101 m_scriptLoadedEvent->wait();
103 } 102 }
104 103
105 void scriptLoaded() 104 void scriptLoaded()
106 { 105 {
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 private: 172 private:
174 WorkerThreadForTest* m_thread; 173 WorkerThreadForTest* m_thread;
175 }; 174 };
176 175
177 inline WorkerOrWorkletGlobalScope* WorkerThreadForTest::createWorkerGlobalScope( std::unique_ptr<WorkerThreadStartupData> startupData) 176 inline WorkerOrWorkletGlobalScope* WorkerThreadForTest::createWorkerGlobalScope( std::unique_ptr<WorkerThreadStartupData> startupData)
178 { 177 {
179 return new FakeWorkerGlobalScope(startupData->m_scriptURL, startupData->m_us erAgent, this, std::move(startupData->m_starterOriginPrivilegeData), std::move(s tartupData->m_workerClients)); 178 return new FakeWorkerGlobalScope(startupData->m_scriptURL, startupData->m_us erAgent, this, std::move(startupData->m_starterOriginPrivilegeData), std::move(s tartupData->m_workerClients));
180 } 179 }
181 180
182 } // namespace blink 181 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698