OLD | NEW |
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/dom/ExecutionContextTask.h" | 8 #include "core/dom/ExecutionContextTask.h" |
9 #include "core/frame/csp/ContentSecurityPolicy.h" | 9 #include "core/frame/csp/ContentSecurityPolicy.h" |
10 #include "core/inspector/ConsoleMessage.h" | 10 #include "core/inspector/ConsoleMessage.h" |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 CSPHeaderAndType headerAndType("contentSecurityPolicy", | 143 CSPHeaderAndType headerAndType("contentSecurityPolicy", |
144 ContentSecurityPolicyHeaderTypeReport); | 144 ContentSecurityPolicyHeaderTypeReport); |
145 headers->push_back(headerAndType); | 145 headers->push_back(headerAndType); |
146 | 146 |
147 WorkerClients* clients = nullptr; | 147 WorkerClients* clients = nullptr; |
148 | 148 |
149 start(WorkerThreadStartupData::create( | 149 start(WorkerThreadStartupData::create( |
150 KURL(ParsedURLString, "http://fake.url/"), "fake user agent", source, | 150 KURL(ParsedURLString, "http://fake.url/"), "fake user agent", source, |
151 nullptr, DontPauseWorkerGlobalScopeOnStart, headers.get(), "", | 151 nullptr, DontPauseWorkerGlobalScopeOnStart, headers.get(), "", |
152 securityOrigin, clients, WebAddressSpaceLocal, nullptr, nullptr, | 152 securityOrigin, clients, WebAddressSpaceLocal, nullptr, nullptr, |
153 WorkerV8Settings::Default(), false /* inspectorNetworkCapability */)); | 153 WorkerV8Settings::Default())); |
154 } | 154 } |
155 | 155 |
156 void waitForInit() { | 156 void waitForInit() { |
157 std::unique_ptr<WaitableEvent> completionEvent = | 157 std::unique_ptr<WaitableEvent> completionEvent = |
158 WTF::makeUnique<WaitableEvent>(); | 158 WTF::makeUnique<WaitableEvent>(); |
159 workerBackingThread().backingThread().postTask( | 159 workerBackingThread().backingThread().postTask( |
160 BLINK_FROM_HERE, | 160 BLINK_FROM_HERE, |
161 crossThreadBind(&WaitableEvent::signal, | 161 crossThreadBind(&WaitableEvent::signal, |
162 crossThreadUnretained(completionEvent.get()))); | 162 crossThreadUnretained(completionEvent.get()))); |
163 completionEvent->wait(); | 163 completionEvent->wait(); |
(...skipping 30 matching lines...) Expand all Loading... |
194 | 194 |
195 inline WorkerOrWorkletGlobalScope* WorkerThreadForTest::createWorkerGlobalScope( | 195 inline WorkerOrWorkletGlobalScope* WorkerThreadForTest::createWorkerGlobalScope( |
196 std::unique_ptr<WorkerThreadStartupData> startupData) { | 196 std::unique_ptr<WorkerThreadStartupData> startupData) { |
197 return new FakeWorkerGlobalScope( | 197 return new FakeWorkerGlobalScope( |
198 startupData->m_scriptURL, startupData->m_userAgent, this, | 198 startupData->m_scriptURL, startupData->m_userAgent, this, |
199 std::move(startupData->m_starterOriginPrivilegeData), | 199 std::move(startupData->m_starterOriginPrivilegeData), |
200 std::move(startupData->m_workerClients)); | 200 std::move(startupData->m_workerClients)); |
201 } | 201 } |
202 | 202 |
203 } // namespace blink | 203 } // namespace blink |
OLD | NEW |