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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 RefPtr<ErrorEvent> event = ErrorEvent::create(m_errorMessage, m_sourceUR
L, m_lineNumber, m_columnNumber); | 141 RefPtr<ErrorEvent> event = ErrorEvent::create(m_errorMessage, m_sourceUR
L, m_lineNumber, m_columnNumber); |
142 bool errorHandled = !workerObject->dispatchEvent(event); | 142 bool errorHandled = !workerObject->dispatchEvent(event); |
143 if (!errorHandled) | 143 if (!errorHandled) |
144 context->reportException(event, 0); | 144 context->reportException(event, 0, NotSharableCrossOrigin); |
145 } | 145 } |
146 | 146 |
147 String m_errorMessage; | 147 String m_errorMessage; |
148 int m_lineNumber; | 148 int m_lineNumber; |
149 int m_columnNumber; | 149 int m_columnNumber; |
150 String m_sourceURL; | 150 String m_sourceURL; |
151 WorkerMessagingProxy* m_messagingProxy; | 151 WorkerMessagingProxy* m_messagingProxy; |
152 }; | 152 }; |
153 | 153 |
154 class WorkerGlobalScopeDestroyedTask : public ScriptExecutionContext::Task { | 154 class WorkerGlobalScopeDestroyedTask : public ScriptExecutionContext::Task { |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 | 472 |
473 m_workerThreadHadPendingActivity = hasPendingActivity; | 473 m_workerThreadHadPendingActivity = hasPendingActivity; |
474 } | 474 } |
475 | 475 |
476 bool WorkerMessagingProxy::hasPendingActivity() const | 476 bool WorkerMessagingProxy::hasPendingActivity() const |
477 { | 477 { |
478 return (m_unconfirmedMessageCount || m_workerThreadHadPendingActivity) && !m
_askedToTerminate; | 478 return (m_unconfirmedMessageCount || m_workerThreadHadPendingActivity) && !m
_askedToTerminate; |
479 } | 479 } |
480 | 480 |
481 } // namespace WebCore | 481 } // namespace WebCore |
OLD | NEW |