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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 CSPHeaderAndType headerAndType("contentSecurityPolicy", | 139 CSPHeaderAndType headerAndType("contentSecurityPolicy", |
140 ContentSecurityPolicyHeaderTypeReport); | 140 ContentSecurityPolicyHeaderTypeReport); |
141 headers->push_back(headerAndType); | 141 headers->push_back(headerAndType); |
142 | 142 |
143 WorkerClients* clients = nullptr; | 143 WorkerClients* clients = nullptr; |
144 | 144 |
145 start(WorkerThreadStartupData::create( | 145 start(WorkerThreadStartupData::create( |
146 KURL(ParsedURLString, "http://fake.url/"), "fake user agent", source, | 146 KURL(ParsedURLString, "http://fake.url/"), "fake user agent", source, |
147 nullptr, DontPauseWorkerGlobalScopeOnStart, headers.get(), "", | 147 nullptr, DontPauseWorkerGlobalScopeOnStart, headers.get(), "", |
148 securityOrigin, clients, WebAddressSpaceLocal, nullptr, nullptr, | 148 securityOrigin, clients, WebAddressSpaceLocal, nullptr, nullptr, |
149 WorkerV8Settings::Default())); | 149 WorkerV8Settings::Default(), false /* inspectorNetworkCapability */)); |
150 } | 150 } |
151 | 151 |
152 void waitForInit() { | 152 void waitForInit() { |
153 std::unique_ptr<WaitableEvent> completionEvent = | 153 std::unique_ptr<WaitableEvent> completionEvent = |
154 WTF::makeUnique<WaitableEvent>(); | 154 WTF::makeUnique<WaitableEvent>(); |
155 workerBackingThread().backingThread().postTask( | 155 workerBackingThread().backingThread().postTask( |
156 BLINK_FROM_HERE, | 156 BLINK_FROM_HERE, |
157 crossThreadBind(&WaitableEvent::signal, | 157 crossThreadBind(&WaitableEvent::signal, |
158 crossThreadUnretained(completionEvent.get()))); | 158 crossThreadUnretained(completionEvent.get()))); |
159 completionEvent->wait(); | 159 completionEvent->wait(); |
(...skipping 30 matching lines...) Expand all Loading... |
190 | 190 |
191 inline WorkerOrWorkletGlobalScope* WorkerThreadForTest::createWorkerGlobalScope( | 191 inline WorkerOrWorkletGlobalScope* WorkerThreadForTest::createWorkerGlobalScope( |
192 std::unique_ptr<WorkerThreadStartupData> startupData) { | 192 std::unique_ptr<WorkerThreadStartupData> startupData) { |
193 return new FakeWorkerGlobalScope( | 193 return new FakeWorkerGlobalScope( |
194 startupData->m_scriptURL, startupData->m_userAgent, this, | 194 startupData->m_scriptURL, startupData->m_userAgent, this, |
195 std::move(startupData->m_starterOriginPrivilegeData), | 195 std::move(startupData->m_starterOriginPrivilegeData), |
196 std::move(startupData->m_workerClients)); | 196 std::move(startupData->m_workerClients)); |
197 } | 197 } |
198 | 198 |
199 } // namespace blink | 199 } // namespace blink |
OLD | NEW |