| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 thread->start(WorkerThreadStartupData::create( | 92 thread->start(WorkerThreadStartupData::create( |
| 93 KURL(ParsedURLString, "http://fake.url/"), "fake user agent", "", | 93 KURL(ParsedURLString, "http://fake.url/"), "fake user agent", "", |
| 94 nullptr, DontPauseWorkerGlobalScopeOnStart, nullptr, "", | 94 nullptr, DontPauseWorkerGlobalScopeOnStart, nullptr, "", |
| 95 m_securityOrigin.get(), nullptr, WebAddressSpaceLocal, nullptr, nullptr, | 95 m_securityOrigin.get(), nullptr, WebAddressSpaceLocal, nullptr, nullptr, |
| 96 V8CacheOptionsDefault)); | 96 V8CacheOptionsDefault)); |
| 97 return thread; | 97 return thread; |
| 98 } | 98 } |
| 99 | 99 |
| 100 // Attempts to run some simple script for |thread|. | 100 // Attempts to run some simple script for |thread|. |
| 101 void checkWorkletCanExecuteScript(WorkerThread* thread) { | 101 void checkWorkletCanExecuteScript(WorkerThread* thread) { |
| 102 std::unique_ptr<WaitableEvent> waitEvent = wrapUnique(new WaitableEvent()); | 102 std::unique_ptr<WaitableEvent> waitEvent = makeUnique<WaitableEvent>(); |
| 103 thread->workerBackingThread().backingThread().postTask( | 103 thread->workerBackingThread().backingThread().postTask( |
| 104 BLINK_FROM_HERE, | 104 BLINK_FROM_HERE, |
| 105 crossThreadBind(&AnimationWorkletThreadTest::executeScriptInWorklet, | 105 crossThreadBind(&AnimationWorkletThreadTest::executeScriptInWorklet, |
| 106 crossThreadUnretained(this), | 106 crossThreadUnretained(this), |
| 107 crossThreadUnretained(thread), | 107 crossThreadUnretained(thread), |
| 108 crossThreadUnretained(waitEvent.get()))); | 108 crossThreadUnretained(waitEvent.get()))); |
| 109 waitEvent->wait(); | 109 waitEvent->wait(); |
| 110 } | 110 } |
| 111 | 111 |
| 112 private: | 112 private: |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 ASSERT_TRUE(secondIsolate); | 211 ASSERT_TRUE(secondIsolate); |
| 212 EXPECT_EQ(firstIsolate, secondIsolate); | 212 EXPECT_EQ(firstIsolate, secondIsolate); |
| 213 | 213 |
| 214 // Verify that the isolate can run some scripts correctly in the second | 214 // Verify that the isolate can run some scripts correctly in the second |
| 215 // worklet. | 215 // worklet. |
| 216 checkWorkletCanExecuteScript(secondWorklet.get()); | 216 checkWorkletCanExecuteScript(secondWorklet.get()); |
| 217 secondWorklet->terminateAndWait(); | 217 secondWorklet->terminateAndWait(); |
| 218 } | 218 } |
| 219 | 219 |
| 220 } // namespace blink | 220 } // namespace blink |
| OLD | NEW |