| 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 "bindings/core/v8/SourceLocation.h" | 5 #include "bindings/core/v8/SourceLocation.h" |
| 6 #include "bindings/core/v8/V8CacheOptions.h" | 6 #include "bindings/core/v8/V8CacheOptions.h" |
| 7 #include "bindings/core/v8/V8GCController.h" | 7 #include "bindings/core/v8/V8GCController.h" |
| 8 #include "core/frame/csp/ContentSecurityPolicy.h" | 8 #include "core/frame/csp/ContentSecurityPolicy.h" |
| 9 #include "core/inspector/ConsoleMessage.h" | 9 #include "core/inspector/ConsoleMessage.h" |
| 10 #include "core/workers/WorkerBackingThread.h" | 10 #include "core/workers/WorkerBackingThread.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 securityOrigin, | 124 securityOrigin, |
| 125 clients, | 125 clients, |
| 126 WebAddressSpaceLocal, | 126 WebAddressSpaceLocal, |
| 127 nullptr, | 127 nullptr, |
| 128 V8CacheOptionsDefault)); | 128 V8CacheOptionsDefault)); |
| 129 } | 129 } |
| 130 | 130 |
| 131 void waitForInit() | 131 void waitForInit() |
| 132 { | 132 { |
| 133 std::unique_ptr<WaitableEvent> completionEvent = wrapUnique(new Waitable
Event()); | 133 std::unique_ptr<WaitableEvent> completionEvent = wrapUnique(new Waitable
Event()); |
| 134 workerBackingThread().backingThread().postTask(BLINK_FROM_HERE, threadSa
feBind(&WaitableEvent::signal, AllowCrossThreadAccess(completionEvent.get()))); | 134 workerBackingThread().backingThread().postTask(BLINK_FROM_HERE, threadSa
feBind(&WaitableEvent::signal, crossThreadUnretained(completionEvent.get()))); |
| 135 completionEvent->wait(); | 135 completionEvent->wait(); |
| 136 } | 136 } |
| 137 | 137 |
| 138 private: | 138 private: |
| 139 std::unique_ptr<WorkerBackingThread> m_workerBackingThread; | 139 std::unique_ptr<WorkerBackingThread> m_workerBackingThread; |
| 140 std::unique_ptr<WaitableEvent> m_scriptLoadedEvent; | 140 std::unique_ptr<WaitableEvent> m_scriptLoadedEvent; |
| 141 }; | 141 }; |
| 142 | 142 |
| 143 class FakeWorkerGlobalScope : public WorkerGlobalScope { | 143 class FakeWorkerGlobalScope : public WorkerGlobalScope { |
| 144 public: | 144 public: |
| (...skipping 25 matching lines...) Expand all Loading... |
| 170 private: | 170 private: |
| 171 WorkerThreadForTest* m_thread; | 171 WorkerThreadForTest* m_thread; |
| 172 }; | 172 }; |
| 173 | 173 |
| 174 inline WorkerGlobalScope* WorkerThreadForTest::createWorkerGlobalScope(std::uniq
ue_ptr<WorkerThreadStartupData> startupData) | 174 inline WorkerGlobalScope* WorkerThreadForTest::createWorkerGlobalScope(std::uniq
ue_ptr<WorkerThreadStartupData> startupData) |
| 175 { | 175 { |
| 176 return new FakeWorkerGlobalScope(startupData->m_scriptURL, startupData->m_us
erAgent, this, std::move(startupData->m_starterOriginPrivilegeData), std::move(s
tartupData->m_workerClients)); | 176 return new FakeWorkerGlobalScope(startupData->m_scriptURL, startupData->m_us
erAgent, this, std::move(startupData->m_starterOriginPrivilegeData), std::move(s
tartupData->m_workerClients)); |
| 177 } | 177 } |
| 178 | 178 |
| 179 } // namespace blink | 179 } // namespace blink |
| OLD | NEW |