Bug 54249 - Throwing in an IndexedDB error or success event should lead to the transaction aborting
Summary: Throwing in an IndexedDB error or success event should lead to the transactio...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other OS X 10.5
: P2 Normal
Assignee: Jeremy Orlow
URL:
Keywords:
Depends on: 54543
Blocks:
  Show dependency treegraph
 
Reported: 2011-02-10 14:57 PST by Jeremy Orlow
Modified: 2011-02-17 13:06 PST (History)
9 users (show)

See Also:


Attachments
Patch (34.16 KB, patch)
2011-02-10 14:59 PST, Jeremy Orlow
no flags Details | Formatted Diff | Diff
Patch (34.20 KB, patch)
2011-02-10 15:05 PST, Jeremy Orlow
no flags Details | Formatted Diff | Diff
Patch (24.12 KB, patch)
2011-02-17 12:43 PST, Jeremy Orlow
japhet: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremy Orlow 2011-02-10 14:57:07 PST
Throwing in an IndexedDB error or success event should lead to the transaction aborting
Comment 1 Jeremy Orlow 2011-02-10 14:59:36 PST
Created attachment 82054 [details]
Patch
Comment 2 Jeremy Orlow 2011-02-10 15:00:33 PST
please review
Comment 3 Jeremy Orlow 2011-02-10 15:05:19 PST
Created attachment 82057 [details]
Patch
Comment 4 Nate Chapin 2011-02-15 16:10:12 PST
Comment on attachment 82057 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=82057&action=review

> Source/WebCore/dom/EventTarget.h:154
> +        virtual void uncaughtExceptionInEventHandler();

Is there any way to avoid having this function show up all the way down in EventTarget?  Alternatively, is it likely other EventTargets will find this method useful?
Comment 5 Jeremy Orlow 2011-02-15 16:24:34 PST
Comment on attachment 82057 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=82057&action=review

>> Source/WebCore/dom/EventTarget.h:154
>> +        virtual void uncaughtExceptionInEventHandler();
> 
> Is there any way to avoid having this function show up all the way down in EventTarget?  Alternatively, is it likely other EventTargets will find this method useful?

is there a better place for it?  I don't think this is a great one, but I didn't see any other better ones either.

I'm not aware of any other API that would make use of it, but it is possible one would in the future.  Are you concerned about adding yet another vtable entry?  I actually can't think of any way around putting some entry in EventTarget (even if it's something to say that it can be static casted to some other type that would have the method call on it).
Comment 6 Nate Chapin 2011-02-15 16:29:06 PST
Comment on attachment 82057 [details]
Patch

It's just my little peeve that there are a fair number of these one-off functions in base classes that are empty or hardcoded and only overridden in one subclass.  I can't think of anything better, but I figured I should at least ask :)
Comment 7 Jeremy Orlow 2011-02-15 17:24:18 PST
Committed r78655: <http://trac.webkit.org/changeset/78655>
Comment 8 anton muhin 2011-02-16 02:11:23 PST
Comment on attachment 82057 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=82057&action=review

> Source/WebCore/bindings/v8/V8AbstractEventListener.cpp:155
> +            innerTryCatch.Reset();

Just FYI: you don't need to Reset innerTryCatch---it catches all the exceptions by default (you need explicit Rethrow to propagate exception caught).
Comment 9 Mikhail Naganov 2011-02-16 07:45:45 PST
Patch reverted.
Comment 10 Jeremy Orlow 2011-02-16 11:02:09 PST
Mikhail: in the future, you should post some context in the bug when you're reverting.  I now have absolutely no idea what the failures are and will likely need to re-land just to see what went wrong.
Comment 11 Jeremy Orlow 2011-02-16 11:07:56 PST
(In reply to comment #10)
> Mikhail: in the future, you should post some context in the bug when you're reverting.  I now have absolutely no idea what the failures are and will likely need to re-land just to see what went wrong.

Never mind....the results were still available.  Please do post a few links when reverting stuff though.  Sorry for the trouble the patch caused.
Comment 12 Jeremy Orlow 2011-02-16 11:13:24 PST
Mads/Anton: Can you please take a look at this patch and see if you can tell what's wrong with it?  It's causing subtle issues in a lot of layout tests.  Most look something like this though: http://test-results.appspot.com/dashboards/flakiness_dashboard.html#tests=fast%2Finspector-support%2Funcaught-dom3-exception.html&showExpectations=true&group=%40ToT%20-%20chromium.org
Comment 13 Mikhail Naganov 2011-02-16 11:16:44 PST
Jeremy, I'm sorry. Next time I will provide links to logs.
Comment 14 anton muhin 2011-02-16 12:37:27 PST
I'll have a look tomorrow.
Comment 15 Mads Ager 2011-02-16 23:06:24 PST
Comment on attachment 82057 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=82057&action=review

> Source/WebCore/bindings/v8/V8AbstractEventListener.cpp:151
> +            v8::TryCatch innerTryCatch;

I think this is your behavioral change. This inner TryCatch is not verbose which means that the errors are not reported. Does it help to put in innerTryCatch.SetVerbose(true).
Comment 16 Jeremy Orlow 2011-02-16 23:36:54 PST
(In reply to comment #15)
> (From update of attachment 82057 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=82057&action=review
> 
> > Source/WebCore/bindings/v8/V8AbstractEventListener.cpp:151
> > +            v8::TryCatch innerTryCatch;
> 
> I think this is your behavioral change. This inner TryCatch is not verbose which means that the errors are not reported. Does it help to put in innerTryCatch.SetVerbose(true).

Followed up on chat.  Turns out I don't even need the inner one and everything should just work if I check whether it's been caught before the reset.  Clearly I really confused myself on this one.  :-)
Comment 17 Jeremy Orlow 2011-02-17 12:43:13 PST
Created attachment 82849 [details]
Patch
Comment 18 Jeremy Orlow 2011-02-17 13:06:33 PST
Committed r78908: <http://trac.webkit.org/changeset/78908>