| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
| 3 * Copyright (C) 2009 Google Inc. All Rights Reserved. | 3 * Copyright (C) 2009 Google Inc. All Rights Reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 | 131 |
| 132 virtual void performTask(ScriptExecutionContext* context) | 132 virtual void performTask(ScriptExecutionContext* context) |
| 133 { | 133 { |
| 134 Worker* workerObject = m_messagingProxy->workerObject(); | 134 Worker* workerObject = m_messagingProxy->workerObject(); |
| 135 if (!workerObject) | 135 if (!workerObject) |
| 136 return; | 136 return; |
| 137 | 137 |
| 138 // We don't bother checking the askedToTerminate() flag here, because ex
ceptions should *always* be reported even if the thread is terminated. | 138 // We don't bother checking the askedToTerminate() flag here, because ex
ceptions should *always* be reported even if the thread is terminated. |
| 139 // This is intentionally different than the behavior in MessageWorkerTas
k, because terminated workers no longer deliver messages (section 4.6 of the Web
Worker spec), but they do report exceptions. | 139 // This is intentionally different than the behavior in MessageWorkerTas
k, because terminated workers no longer deliver messages (section 4.6 of the Web
Worker spec), but they do report exceptions. |
| 140 | 140 |
| 141 bool errorHandled = !workerObject->dispatchEvent(ErrorEvent::create(m_er
rorMessage, m_sourceURL, m_lineNumber, m_columnNumber)); | 141 bool errorHandled = !workerObject->dispatchEvent(ErrorEvent::create(m_er
rorMessage, m_sourceURL, m_lineNumber, m_columnNumber, ScriptValue())); |
| 142 if (!errorHandled) | 142 if (!errorHandled) |
| 143 context->reportException(m_errorMessage, m_lineNumber, m_columnNumbe
r, m_sourceURL, 0); | 143 context->reportException(m_errorMessage, m_lineNumber, m_columnNumbe
r, m_sourceURL, 0); |
| 144 } | 144 } |
| 145 | 145 |
| 146 String m_errorMessage; | 146 String m_errorMessage; |
| 147 int m_lineNumber; | 147 int m_lineNumber; |
| 148 int m_columnNumber; | 148 int m_columnNumber; |
| 149 String m_sourceURL; | 149 String m_sourceURL; |
| 150 WorkerMessagingProxy* m_messagingProxy; | 150 WorkerMessagingProxy* m_messagingProxy; |
| 151 }; | 151 }; |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 | 471 |
| 472 m_workerThreadHadPendingActivity = hasPendingActivity; | 472 m_workerThreadHadPendingActivity = hasPendingActivity; |
| 473 } | 473 } |
| 474 | 474 |
| 475 bool WorkerMessagingProxy::hasPendingActivity() const | 475 bool WorkerMessagingProxy::hasPendingActivity() const |
| 476 { | 476 { |
| 477 return (m_unconfirmedMessageCount || m_workerThreadHadPendingActivity) && !m
_askedToTerminate; | 477 return (m_unconfirmedMessageCount || m_workerThreadHadPendingActivity) && !m
_askedToTerminate; |
| 478 } | 478 } |
| 479 | 479 |
| 480 } // namespace WebCore | 480 } // namespace WebCore |
| OLD | NEW |