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 "config.h" | 5 #include "config.h" |
6 #include "core/workers/WorkerThread.h" | 6 #include "core/workers/WorkerThread.h" |
7 | 7 |
8 #include "core/inspector/ConsoleMessage.h" | 8 #include "core/inspector/ConsoleMessage.h" |
9 #include "core/workers/WorkerReportingProxy.h" | 9 #include "core/workers/WorkerReportingProxy.h" |
10 #include "core/workers/WorkerThreadStartupData.h" | 10 #include "core/workers/WorkerThreadStartupData.h" |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
168 } | 168 } |
169 | 169 |
170 void startAndWaitForInit() | 170 void startAndWaitForInit() |
171 { | 171 { |
172 OwnPtr<WebWaitableEvent> completionEvent = adoptPtr(Platform::current()- >createWaitableEvent()); | 172 OwnPtr<WebWaitableEvent> completionEvent = adoptPtr(Platform::current()- >createWaitableEvent()); |
173 | 173 |
174 OwnPtr<Vector<CSPHeaderAndType>> headers = adoptPtr(new Vector<CSPHeader AndType>()); | 174 OwnPtr<Vector<CSPHeaderAndType>> headers = adoptPtr(new Vector<CSPHeader AndType>()); |
175 CSPHeaderAndType headerAndType("contentSecurityPolicy", ContentSecurityP olicyHeaderTypeReport); | 175 CSPHeaderAndType headerAndType("contentSecurityPolicy", ContentSecurityP olicyHeaderTypeReport); |
176 headers->append(headerAndType); | 176 headers->append(headerAndType); |
177 | 177 |
178 OwnPtrWillBeRawPtr<WorkerClients> clients = nullptr; | |
179 | |
178 m_workerThread->start(WorkerThreadStartupData::create( | 180 m_workerThread->start(WorkerThreadStartupData::create( |
179 KURL(ParsedURLString, "http://fake.url/"), | 181 KURL(ParsedURLString, "http://fake.url/"), |
180 "fake user agent", | 182 "fake user agent", |
181 "//fake source code", | 183 "//fake source code", |
182 nullptr, | 184 nullptr, |
183 DontPauseWorkerGlobalScopeOnStart, | 185 DontPauseWorkerGlobalScopeOnStart, |
184 headers.release(), | 186 headers.release(), |
185 m_securityOrigin.get(), | 187 m_securityOrigin.get(), |
186 WorkerClients::create(), | 188 clients.release(), |
haraken
2015/06/07 23:37:11
Can we just use 'nullptr'?
| |
187 V8CacheOptionsDefault)); | 189 V8CacheOptionsDefault)); |
188 m_workerThread->backingThread().postTask(FROM_HERE, new SignalTask(compl etionEvent.get())); | 190 m_workerThread->backingThread().postTask(FROM_HERE, new SignalTask(compl etionEvent.get())); |
189 completionEvent->wait(); | 191 completionEvent->wait(); |
190 } | 192 } |
191 | 193 |
192 void postWakeUpTask(long long waitMs) | 194 void postWakeUpTask(long long waitMs) |
193 { | 195 { |
194 WebScheduler* scheduler = m_workerThread->backingThread().platformThread ().scheduler(); | 196 WebScheduler* scheduler = m_workerThread->backingThread().platformThread ().scheduler(); |
195 | 197 |
196 // The idle task will get posted on an after wake up queue, so we need a nother task | 198 // The idle task will get posted on an after wake up queue, so we need a nother task |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
287 | 289 |
288 completion->wait(); | 290 completion->wait(); |
289 | 291 |
290 // Make sure doIdleGc has not been called by this stage. | 292 // Make sure doIdleGc has not been called by this stage. |
291 Mock::VerifyAndClearExpectations(m_workerThread.get()); | 293 Mock::VerifyAndClearExpectations(m_workerThread.get()); |
292 | 294 |
293 m_workerThread->terminateAndWait(); | 295 m_workerThread->terminateAndWait(); |
294 } | 296 } |
295 | 297 |
296 } // namespace blink | 298 } // namespace blink |
OLD | NEW |