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) |
| 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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 InspectorInstrumentation::didLeaveNestedRunLoop(m_workerGlobalScope.get()); | 496 InspectorInstrumentation::didLeaveNestedRunLoop(m_workerGlobalScope.get()); |
490 } | 497 } |
491 | 498 |
492 void WorkerThread::setWorkerInspectorController(WorkerInspectorController* worke
rInspectorController) | 499 void WorkerThread::setWorkerInspectorController(WorkerInspectorController* worke
rInspectorController) |
493 { | 500 { |
494 MutexLocker locker(m_workerInspectorControllerMutex); | 501 MutexLocker locker(m_workerInspectorControllerMutex); |
495 m_workerInspectorController = workerInspectorController; | 502 m_workerInspectorController = workerInspectorController; |
496 } | 503 } |
497 | 504 |
498 } // namespace blink | 505 } // namespace blink |
OLD | NEW |