OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
229 m_thread->postTask(new Task(WTF::bind(&WorkerThread::initialize, this))); | 229 m_thread->postTask(new Task(WTF::bind(&WorkerThread::initialize, this))); |
230 } | 230 } |
231 | 231 |
232 void WorkerThread::interruptAndDispatchInspectorCommands() | 232 void WorkerThread::interruptAndDispatchInspectorCommands() |
233 { | 233 { |
234 MutexLocker locker(m_workerInspectorControllerMutex); | 234 MutexLocker locker(m_workerInspectorControllerMutex); |
235 if (m_workerInspectorController) | 235 if (m_workerInspectorController) |
236 m_workerInspectorController->interruptAndDispatchInspectorCommands(); | 236 m_workerInspectorController->interruptAndDispatchInspectorCommands(); |
237 } | 237 } |
238 | 238 |
239 PlatformThreadId WorkerThread::platformThreadId() const | |
240 { | |
241 if (!m_thread) | |
loislo
2014/09/09 13:59:44
Looks like it could be converted into ASSERT
yurys
2014/09/09 15:08:37
In theory WorkerThread::start can be called asynch
| |
242 return 0; | |
243 return m_thread->threadId(); | |
244 } | |
245 | |
239 void WorkerThread::initialize() | 246 void WorkerThread::initialize() |
240 { | 247 { |
241 KURL scriptURL = m_startupData->m_scriptURL; | 248 KURL scriptURL = m_startupData->m_scriptURL; |
242 String sourceCode = m_startupData->m_sourceCode; | 249 String sourceCode = m_startupData->m_sourceCode; |
243 WorkerThreadStartMode startMode = m_startupData->m_startMode; | 250 WorkerThreadStartMode startMode = m_startupData->m_startMode; |
244 | 251 |
245 { | 252 { |
246 MutexLocker lock(m_threadCreationMutex); | 253 MutexLocker lock(m_threadCreationMutex); |
247 | 254 |
248 // The worker was terminated before the thread had a chance to run. | 255 // The worker was terminated before the thread had a chance to run. |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
490 InspectorInstrumentation::didLeaveNestedRunLoop(m_workerGlobalScope.get()); | 497 InspectorInstrumentation::didLeaveNestedRunLoop(m_workerGlobalScope.get()); |
491 } | 498 } |
492 | 499 |
493 void WorkerThread::setWorkerInspectorController(WorkerInspectorController* worke rInspectorController) | 500 void WorkerThread::setWorkerInspectorController(WorkerInspectorController* worke rInspectorController) |
494 { | 501 { |
495 MutexLocker locker(m_workerInspectorControllerMutex); | 502 MutexLocker locker(m_workerInspectorControllerMutex); |
496 m_workerInspectorController = workerInspectorController; | 503 m_workerInspectorController = workerInspectorController; |
497 } | 504 } |
498 | 505 |
499 } // namespace blink | 506 } // namespace blink |
OLD | NEW |