OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "modules/compositorworker/AnimationWorkletThread.h" | 5 #include "modules/compositorworker/AnimationWorkletThread.h" |
6 | 6 |
7 #include "bindings/core/v8/ScriptSourceCode.h" | 7 #include "bindings/core/v8/ScriptSourceCode.h" |
8 #include "bindings/core/v8/SourceLocation.h" | 8 #include "bindings/core/v8/SourceLocation.h" |
9 #include "bindings/core/v8/V8GCController.h" | 9 #include "bindings/core/v8/V8GCController.h" |
10 #include "bindings/core/v8/WorkerOrWorkletScriptController.h" | 10 #include "bindings/core/v8/WorkerOrWorkletScriptController.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 } | 89 } |
90 | 90 |
91 std::unique_ptr<AnimationWorkletThread> createAnimationWorkletThread() { | 91 std::unique_ptr<AnimationWorkletThread> createAnimationWorkletThread() { |
92 std::unique_ptr<AnimationWorkletThread> thread = | 92 std::unique_ptr<AnimationWorkletThread> thread = |
93 AnimationWorkletThread::create(nullptr, *m_reportingProxy, | 93 AnimationWorkletThread::create(nullptr, *m_reportingProxy, |
94 ParentFrameTaskRunners::create(nullptr)); | 94 ParentFrameTaskRunners::create(nullptr)); |
95 thread->start(WorkerThreadStartupData::create( | 95 thread->start(WorkerThreadStartupData::create( |
96 KURL(ParsedURLString, "http://fake.url/"), "fake user agent", "", | 96 KURL(ParsedURLString, "http://fake.url/"), "fake user agent", "", |
97 nullptr, DontPauseWorkerGlobalScopeOnStart, nullptr, "", | 97 nullptr, DontPauseWorkerGlobalScopeOnStart, nullptr, "", |
98 m_securityOrigin.get(), nullptr, WebAddressSpaceLocal, nullptr, nullptr, | 98 m_securityOrigin.get(), nullptr, WebAddressSpaceLocal, nullptr, nullptr, |
99 WorkerV8Settings::Default())); | 99 WorkerV8Settings::Default(), false /* inspectorNetworkCapability */)); |
100 return thread; | 100 return thread; |
101 } | 101 } |
102 | 102 |
103 // Attempts to run some simple script for |thread|. | 103 // Attempts to run some simple script for |thread|. |
104 void checkWorkletCanExecuteScript(WorkerThread* thread) { | 104 void checkWorkletCanExecuteScript(WorkerThread* thread) { |
105 std::unique_ptr<WaitableEvent> waitEvent = WTF::makeUnique<WaitableEvent>(); | 105 std::unique_ptr<WaitableEvent> waitEvent = WTF::makeUnique<WaitableEvent>(); |
106 thread->workerBackingThread().backingThread().postTask( | 106 thread->workerBackingThread().backingThread().postTask( |
107 BLINK_FROM_HERE, | 107 BLINK_FROM_HERE, |
108 crossThreadBind(&AnimationWorkletThreadTest::executeScriptInWorklet, | 108 crossThreadBind(&AnimationWorkletThreadTest::executeScriptInWorklet, |
109 crossThreadUnretained(this), | 109 crossThreadUnretained(this), |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 ASSERT_TRUE(secondIsolate); | 216 ASSERT_TRUE(secondIsolate); |
217 EXPECT_EQ(firstIsolate, secondIsolate); | 217 EXPECT_EQ(firstIsolate, secondIsolate); |
218 | 218 |
219 // Verify that the isolate can run some scripts correctly in the second | 219 // Verify that the isolate can run some scripts correctly in the second |
220 // worklet. | 220 // worklet. |
221 checkWorkletCanExecuteScript(secondWorklet.get()); | 221 checkWorkletCanExecuteScript(secondWorklet.get()); |
222 secondWorklet->terminateAndWait(); | 222 secondWorklet->terminateAndWait(); |
223 } | 223 } |
224 | 224 |
225 } // namespace blink | 225 } // namespace blink |
OLD | NEW |