| 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 std::unique_ptr<CompositorWorkerThread> workerThread = CompositorWorkerT
hread::create(nullptr, *m_objectProxy, 0); | 116 std::unique_ptr<CompositorWorkerThread> workerThread = CompositorWorkerT
hread::create(nullptr, *m_objectProxy, 0); |
| 117 WorkerClients* clients = WorkerClients::create(); | 117 WorkerClients* clients = WorkerClients::create(); |
| 118 provideCompositorProxyClientTo(clients, new TestCompositorProxyClient); | 118 provideCompositorProxyClientTo(clients, new TestCompositorProxyClient); |
| 119 workerThread->start(WorkerThreadStartupData::create( | 119 workerThread->start(WorkerThreadStartupData::create( |
| 120 KURL(ParsedURLString, "http://fake.url/"), | 120 KURL(ParsedURLString, "http://fake.url/"), |
| 121 "fake user agent", | 121 "fake user agent", |
| 122 "//fake source code", | 122 "//fake source code", |
| 123 nullptr, | 123 nullptr, |
| 124 DontPauseWorkerGlobalScopeOnStart, | 124 DontPauseWorkerGlobalScopeOnStart, |
| 125 nullptr, | 125 nullptr, |
| 126 "", |
| 126 m_securityOrigin.get(), | 127 m_securityOrigin.get(), |
| 127 clients, | 128 clients, |
| 128 WebAddressSpaceLocal, | 129 WebAddressSpaceLocal, |
| 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) |
| (...skipping 98 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 |