| 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/CompositorWorkerThread.h" | 5 #include "modules/compositorworker/CompositorWorkerThread.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 "core/dom/CompositorProxyClient.h" | 10 #include "core/dom/CompositorProxyClient.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 "fake user agent", | 120 "fake user agent", |
| 121 "//fake source code", | 121 "//fake source code", |
| 122 nullptr, | 122 nullptr, |
| 123 DontPauseWorkerGlobalScopeOnStart, | 123 DontPauseWorkerGlobalScopeOnStart, |
| 124 nullptr, | 124 nullptr, |
| 125 "", | 125 "", |
| 126 m_securityOrigin.get(), | 126 m_securityOrigin.get(), |
| 127 clients, | 127 clients, |
| 128 WebAddressSpaceLocal, | 128 WebAddressSpaceLocal, |
| 129 nullptr, | 129 nullptr, |
| 130 nullptr, |
| 130 V8CacheOptionsDefault)); | 131 V8CacheOptionsDefault)); |
| 131 return workerThread; | 132 return workerThread; |
| 132 } | 133 } |
| 133 | 134 |
| 134 // Attempts to run some simple script for |worker|. | 135 // Attempts to run some simple script for |worker|. |
| 135 void checkWorkerCanExecuteScript(WorkerThread* worker) | 136 void checkWorkerCanExecuteScript(WorkerThread* worker) |
| 136 { | 137 { |
| 137 std::unique_ptr<WaitableEvent> waitEvent = wrapUnique(new WaitableEvent(
)); | 138 std::unique_ptr<WaitableEvent> waitEvent = wrapUnique(new WaitableEvent(
)); |
| 138 worker->workerBackingThread().backingThread().postTask(BLINK_FROM_HERE,
crossThreadBind(&CompositorWorkerThreadTest::executeScriptInWorker, crossThreadU
nretained(this), | 139 worker->workerBackingThread().backingThread().postTask(BLINK_FROM_HERE,
crossThreadBind(&CompositorWorkerThreadTest::executeScriptInWorker, crossThreadU
nretained(this), |
| 139 crossThreadUnretained(worker), crossThreadUnretained(waitEvent.get()
))); | 140 crossThreadUnretained(worker), crossThreadUnretained(waitEvent.get()
))); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 v8::Isolate* secondIsolate = secondWorker->isolate(); | 235 v8::Isolate* secondIsolate = secondWorker->isolate(); |
| 235 ASSERT_TRUE(secondIsolate); | 236 ASSERT_TRUE(secondIsolate); |
| 236 EXPECT_EQ(firstIsolate, secondIsolate); | 237 EXPECT_EQ(firstIsolate, secondIsolate); |
| 237 | 238 |
| 238 // Verify that the isolate can run some scripts correctly in the second work
er. | 239 // Verify that the isolate can run some scripts correctly in the second work
er. |
| 239 checkWorkerCanExecuteScript(secondWorker.get()); | 240 checkWorkerCanExecuteScript(secondWorker.get()); |
| 240 secondWorker->terminateAndWait(); | 241 secondWorker->terminateAndWait(); |
| 241 } | 242 } |
| 242 | 243 |
| 243 } // namespace blink | 244 } // namespace blink |
| OLD | NEW |