New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 270005 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
OOO until 4th
Closed: Oct 2013
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug

Blocked on:
issue 269538



Sign in to add a comment

Add the 'error' property to Workers' 'onerror' handler.

Project Member Reported by mkwst@chromium.org, Aug 8 2013

Issue description

 http://crbug.com/147127  added support for the 'error' property in page's 'window.onerror' handler. We should support the same for 'self.onerror' in Workers.

Note that we should _not_, however, propagate the error object outside of the Worker into the page-level handler.

Doing anything here relies first upon getting the sanitization right, which is covered in  http://crbug.com/269538 .
 
Project Member

Comment 1 by bugdroid1@chromium.org, Aug 12 2013

The following revision refers to this bug:
    http://src.chromium.org/viewvc/blink?view=rev&rev=155953

------------------------------------------------------------------------
r155953 | mkwst@chromium.org | 2013-08-12T21:27:16.989378Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/Source/bindings/v8/V8Initializer.cpp?r1=155953&r2=155952&pathrev=155953
   M http://src.chromium.org/viewvc/blink/trunk/Source/bindings/v8/WorkerScriptController.cpp?r1=155953&r2=155952&pathrev=155953
   M http://src.chromium.org/viewvc/blink/trunk/Source/bindings/v8/V8ErrorHandler.cpp?r1=155953&r2=155952&pathrev=155953
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/http/tests/workers/worker-importScripts-onerror-sameorigin-expected.txt?r1=155953&r2=155952&pathrev=155953
   M http://src.chromium.org/viewvc/blink/trunk/Source/bindings/v8/WorkerScriptController.h?r1=155953&r2=155952&pathrev=155953
   M http://src.chromium.org/viewvc/blink/trunk/Source/bindings/v8/V8ErrorHandler.h?r1=155953&r2=155952&pathrev=155953
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/http/tests/workers/worker-importScripts-onerror-sameorigin.html?r1=155953&r2=155952&pathrev=155953

Add 'error' property to exceptions thrown via Worker::importScripts.

If an imported script throws an exception, and the script is same-origin
with the Worker, we should provide the exception object when handling
the exception via 'self.onerror'. The exception should not, however, be
available to the page-level 'window.onerror' (we'd be leaking state
across worlds otherwise (also, the spec says not to[1])).

This patch pulls the logic governing the exception object's storage
(wrapping the ErrorEvent, storing the value on a hidden property) out of
V8Initializer, and moves it to a static method on V8ErrorHandler so that
it's easily reusable inside WorkerScriptController.

[1]: http://www.whatwg.org/specs/web-apps/current-work/multipage/workers.html#runtime-script-errors-0

BUG= 270005 

Review URL: https://chromiumcodereview.appspot.com/22650008
------------------------------------------------------------------------

Comment 2 by mkwst@chromium.org, Oct 14 2013

Status: Fixed

Sign in to add a comment