| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #if ENABLE(WORKERS) | 7 #if ENABLE(WORKERS) |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 | 10 |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 if (WTF::currentThread() != worker_thread_id_) { | 230 if (WTF::currentThread() != worker_thread_id_) { |
| 231 script_execution_context_->postTask( | 231 script_execution_context_->postTask( |
| 232 WebCore::createCallbackTask(&PostExceptionToWorkerObjectTask, this, | 232 WebCore::createCallbackTask(&PostExceptionToWorkerObjectTask, this, |
| 233 webkit_glue::WebStringToString(error_message), | 233 webkit_glue::WebStringToString(error_message), |
| 234 line_number, | 234 line_number, |
| 235 webkit_glue::WebStringToString(source_url))); | 235 webkit_glue::WebStringToString(source_url))); |
| 236 return; | 236 return; |
| 237 } | 237 } |
| 238 | 238 |
| 239 bool handled = false; | 239 bool handled = false; |
| 240 if (worker_->onerror()) | 240 handled = worker_->dispatchScriptErrorEvent( |
| 241 handled = worker_->dispatchScriptErrorEvent( | 241 webkit_glue::WebStringToString(error_message), |
| 242 webkit_glue::WebStringToString(error_message), | 242 webkit_glue::WebStringToString(source_url), |
| 243 webkit_glue::WebStringToString(source_url), | 243 line_number); |
| 244 line_number); | |
| 245 if (!handled) | 244 if (!handled) |
| 246 script_execution_context_->reportException( | 245 script_execution_context_->reportException( |
| 247 webkit_glue::WebStringToString(error_message), | 246 webkit_glue::WebStringToString(error_message), |
| 248 line_number, | 247 line_number, |
| 249 webkit_glue::WebStringToString(source_url)); | 248 webkit_glue::WebStringToString(source_url)); |
| 250 } | 249 } |
| 251 | 250 |
| 252 void WebWorkerClientImpl::postConsoleMessageToWorkerObject( | 251 void WebWorkerClientImpl::postConsoleMessageToWorkerObject( |
| 253 int destination_id, | 252 int destination_id, |
| 254 int source_id, | 253 int source_id, |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 } | 351 } |
| 353 } | 352 } |
| 354 | 353 |
| 355 void WebWorkerClientImpl::PostExceptionToWorkerObjectTask( | 354 void WebWorkerClientImpl::PostExceptionToWorkerObjectTask( |
| 356 WebCore::ScriptExecutionContext* context, | 355 WebCore::ScriptExecutionContext* context, |
| 357 WebWorkerClientImpl* this_ptr, | 356 WebWorkerClientImpl* this_ptr, |
| 358 const WebCore::String& error_message, | 357 const WebCore::String& error_message, |
| 359 int line_number, | 358 int line_number, |
| 360 const WebCore::String& source_url) { | 359 const WebCore::String& source_url) { |
| 361 bool handled = false; | 360 bool handled = false; |
| 362 if (this_ptr->worker_ && this_ptr->worker_->onerror()) | 361 if (this_ptr->worker_) |
| 363 handled = this_ptr->worker_->dispatchScriptErrorEvent( | 362 handled = this_ptr->worker_->dispatchScriptErrorEvent( |
| 364 error_message, source_url, line_number); | 363 error_message, source_url, line_number); |
| 365 if (!handled) | 364 if (!handled) |
| 366 this_ptr->script_execution_context_->reportException( | 365 this_ptr->script_execution_context_->reportException( |
| 367 error_message, line_number, source_url); | 366 error_message, line_number, source_url); |
| 368 } | 367 } |
| 369 | 368 |
| 370 void WebWorkerClientImpl::PostConsoleMessageToWorkerObjectTask( | 369 void WebWorkerClientImpl::PostConsoleMessageToWorkerObjectTask( |
| 371 WebCore::ScriptExecutionContext* context, | 370 WebCore::ScriptExecutionContext* context, |
| 372 WebWorkerClientImpl* this_ptr, | 371 WebWorkerClientImpl* this_ptr, |
| (...skipping 21 matching lines...) Expand all Loading... |
| 394 } | 393 } |
| 395 | 394 |
| 396 void WebWorkerClientImpl::ReportPendingActivityTask( | 395 void WebWorkerClientImpl::ReportPendingActivityTask( |
| 397 WebCore::ScriptExecutionContext* context, | 396 WebCore::ScriptExecutionContext* context, |
| 398 WebWorkerClientImpl* this_ptr, | 397 WebWorkerClientImpl* this_ptr, |
| 399 bool has_pending_activity) { | 398 bool has_pending_activity) { |
| 400 this_ptr->worker_context_had_pending_activity_ = has_pending_activity; | 399 this_ptr->worker_context_had_pending_activity_ = has_pending_activity; |
| 401 } | 400 } |
| 402 | 401 |
| 403 #endif | 402 #endif |
| OLD | NEW |