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 "core/workers/ThreadedWorkletMessagingProxy.h" | 5 #include "core/workers/ThreadedWorkletMessagingProxy.h" |
6 | 6 |
7 #include "bindings/core/v8/ScriptSourceCode.h" | 7 #include "bindings/core/v8/ScriptSourceCode.h" |
8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
9 #include "core/dom/SecurityContext.h" | 9 #include "core/dom/SecurityContext.h" |
10 #include "core/frame/csp/ContentSecurityPolicy.h" | 10 #include "core/frame/csp/ContentSecurityPolicy.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 std::unique_ptr<WorkerSettings> workerSettings = | 42 std::unique_ptr<WorkerSettings> workerSettings = |
43 WTF::wrapUnique(new WorkerSettings(document->settings())); | 43 WTF::wrapUnique(new WorkerSettings(document->settings())); |
44 | 44 |
45 // TODO(ikilpatrick): Decide on sensible a value for referrerPolicy. | 45 // TODO(ikilpatrick): Decide on sensible a value for referrerPolicy. |
46 std::unique_ptr<WorkerThreadStartupData> startupData = | 46 std::unique_ptr<WorkerThreadStartupData> startupData = |
47 WorkerThreadStartupData::create( | 47 WorkerThreadStartupData::create( |
48 scriptURL, document->userAgent(), String(), nullptr, startMode, | 48 scriptURL, document->userAgent(), String(), nullptr, startMode, |
49 csp->headers().get(), /* referrerPolicy */ String(), starterOrigin, | 49 csp->headers().get(), /* referrerPolicy */ String(), starterOrigin, |
50 nullptr, document->addressSpace(), | 50 nullptr, document->addressSpace(), |
51 OriginTrialContext::getTokens(document).get(), | 51 OriginTrialContext::getTokens(document).get(), |
52 std::move(workerSettings), WorkerV8Settings::Default()); | 52 std::move(workerSettings), WorkerV8Settings::Default(), |
| 53 false /* inspectorNetworkCapability */); |
53 | 54 |
54 initializeWorkerThread(std::move(startupData)); | 55 initializeWorkerThread(std::move(startupData)); |
55 workerInspectorProxy()->workerThreadCreated(document, workerThread(), | 56 workerInspectorProxy()->workerThreadCreated(document, workerThread(), |
56 scriptURL); | 57 scriptURL); |
57 } | 58 } |
58 | 59 |
59 void ThreadedWorkletMessagingProxy::evaluateScript( | 60 void ThreadedWorkletMessagingProxy::evaluateScript( |
60 const ScriptSourceCode& scriptSourceCode) { | 61 const ScriptSourceCode& scriptSourceCode) { |
61 postTaskToWorkerGlobalScope( | 62 postTaskToWorkerGlobalScope( |
62 BLINK_FROM_HERE, | 63 BLINK_FROM_HERE, |
63 crossThreadBind(&ThreadedWorkletObjectProxy::evaluateScript, | 64 crossThreadBind(&ThreadedWorkletObjectProxy::evaluateScript, |
64 crossThreadUnretained(m_workletObjectProxy.get()), | 65 crossThreadUnretained(m_workletObjectProxy.get()), |
65 scriptSourceCode.source(), scriptSourceCode.url(), | 66 scriptSourceCode.source(), scriptSourceCode.url(), |
66 crossThreadUnretained(workerThread()))); | 67 crossThreadUnretained(workerThread()))); |
67 } | 68 } |
68 | 69 |
69 void ThreadedWorkletMessagingProxy::terminateWorkletGlobalScope() { | 70 void ThreadedWorkletMessagingProxy::terminateWorkletGlobalScope() { |
70 terminateGlobalScope(); | 71 terminateGlobalScope(); |
71 } | 72 } |
72 | 73 |
73 } // namespace blink | 74 } // namespace blink |
OLD | NEW |