| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 double absoluteTime = 0.0; | 154 double absoluteTime = 0.0; |
| 155 if (waitMode == WaitForMessage) | 155 if (waitMode == WaitForMessage) |
| 156 absoluteTime = (predicate.isDefaultMode() && m_sharedTimer->isActive())
? m_sharedTimer->fireTime() : MessageQueue<Task>::infiniteTime(); | 156 absoluteTime = (predicate.isDefaultMode() && m_sharedTimer->isActive())
? m_sharedTimer->fireTime() : MessageQueue<Task>::infiniteTime(); |
| 157 MessageQueueWaitResult result; | 157 MessageQueueWaitResult result; |
| 158 | 158 |
| 159 OwnPtr<WorkerRunLoop::Task> task; | 159 OwnPtr<WorkerRunLoop::Task> task; |
| 160 { | 160 { |
| 161 // FIXME(oilpan): The WorkerContext is kept alive by a persistent handle
in WorkerThread.h | 161 // FIXME(oilpan): The WorkerContext is kept alive by a persistent handle
in WorkerThread.h |
| 162 // and therefore there are no unknown heap pointers on the stack at this
point. | 162 // and therefore there are no unknown heap pointers on the stack at this
point. |
| 163 // We should probably make that more clear somehow. | 163 // We should probably make that more clear somehow. |
| 164 ThreadState::PauseScope paused(ThreadState::NoHeapPointersOnStack); | 164 ThreadState::SafePointScope safePointScope(ThreadState::NoHeapPointersOn
Stack); |
| 165 task = m_messageQueue.waitForMessageFilteredWithTimeout(result, predicat
e, absoluteTime); | 165 task = m_messageQueue.waitForMessageFilteredWithTimeout(result, predicat
e, absoluteTime); |
| 166 } | 166 } |
| 167 | 167 |
| 168 // If the context is closing, don't execute any further JavaScript tasks (pe
r section 4.1.1 of the Web Workers spec). However, there may be implementation
cleanup tasks in the queue, so keep running through it. | 168 // If the context is closing, don't execute any further JavaScript tasks (pe
r section 4.1.1 of the Web Workers spec). However, there may be implementation
cleanup tasks in the queue, so keep running through it. |
| 169 | 169 |
| 170 switch (result) { | 170 switch (result) { |
| 171 case MessageQueueTerminated: | 171 case MessageQueueTerminated: |
| 172 break; | 172 break; |
| 173 | 173 |
| 174 case MessageQueueMessageReceived: | 174 case MessageQueueMessageReceived: |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 m_task->performTask(context); | 230 m_task->performTask(context); |
| 231 } | 231 } |
| 232 | 232 |
| 233 WorkerRunLoop::Task::Task(PassOwnPtr<ScriptExecutionContext::Task> task, const S
tring& mode) | 233 WorkerRunLoop::Task::Task(PassOwnPtr<ScriptExecutionContext::Task> task, const S
tring& mode) |
| 234 : m_task(task) | 234 : m_task(task) |
| 235 , m_mode(mode.isolatedCopy()) | 235 , m_mode(mode.isolatedCopy()) |
| 236 { | 236 { |
| 237 } | 237 } |
| 238 | 238 |
| 239 } // namespace WebCore | 239 } // namespace WebCore |
| OLD | NEW |