Index: webkit/glue/webworkerclient_impl.cc |
=================================================================== |
--- webkit/glue/webworkerclient_impl.cc (revision 21664) |
+++ webkit/glue/webworkerclient_impl.cc (working copy) |
@@ -212,10 +212,17 @@ |
return; |
} |
- script_execution_context_->reportException( |
- webkit_glue::WebStringToString(error_message), |
- line_number, |
- webkit_glue::WebStringToString(source_url)); |
+ bool handled = false; |
+ if (worker_->onerror()) |
+ handled = worker_->dispatchScriptErrorEvent( |
+ webkit_glue::WebStringToString(error_message), |
+ webkit_glue::WebStringToString(source_url), |
+ line_number); |
+ if (!handled) |
+ script_execution_context_->reportException( |
+ webkit_glue::WebStringToString(error_message), |
+ line_number, |
+ webkit_glue::WebStringToString(source_url)); |
} |
void WebWorkerClientImpl::postConsoleMessageToWorkerObject( |
@@ -325,8 +332,13 @@ |
const WebCore::String& error_message, |
int line_number, |
const WebCore::String& source_url) { |
- this_ptr->script_execution_context_->reportException( |
- error_message, line_number, source_url); |
+ bool handled = false; |
+ if (this_ptr->worker_ && this_ptr->worker_->onerror()) |
+ handled = this_ptr->worker_->dispatchScriptErrorEvent( |
+ error_message, source_url, line_number); |
+ if (!handled) |
+ this_ptr->script_execution_context_->reportException( |
+ error_message, line_number, source_url); |
} |
void WebWorkerClientImpl::PostConsoleMessageToWorkerObjectTask( |