Bug 205151 - Refactor ScriptController's proliferation of ExceptionDetails*
Summary: Refactor ScriptController's proliferation of ExceptionDetails*
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brady Eidson
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-12-11 18:45 PST by Brady Eidson
Modified: 2019-12-13 19:13 PST (History)
22 users (show)

See Also:


Attachments
Patch (31.50 KB, patch)
2019-12-11 22:09 PST, Brady Eidson
no flags Details | Formatted Diff | Diff
Patch (31.56 KB, patch)
2019-12-11 22:32 PST, Brady Eidson
no flags Details | Formatted Diff | Diff
Patch (46.41 KB, patch)
2019-12-12 09:58 PST, Brady Eidson
no flags Details | Formatted Diff | Diff
Patch (47.29 KB, patch)
2019-12-12 10:22 PST, Brady Eidson
no flags Details | Formatted Diff | Diff
Patch (49.47 KB, patch)
2019-12-12 11:47 PST, Brady Eidson
no flags Details | Formatted Diff | Diff
Patch (50.19 KB, patch)
2019-12-12 11:57 PST, Brady Eidson
no flags Details | Formatted Diff | Diff
Patch (51.07 KB, patch)
2019-12-12 12:12 PST, Brady Eidson
no flags Details | Formatted Diff | Diff
Patch (51.07 KB, patch)
2019-12-12 12:20 PST, Brady Eidson
no flags Details | Formatted Diff | Diff
Patch (51.07 KB, patch)
2019-12-12 12:25 PST, Brady Eidson
no flags Details | Formatted Diff | Diff
Patch (52.19 KB, patch)
2019-12-12 12:51 PST, Brady Eidson
no flags Details | Formatted Diff | Diff
Patch (52.36 KB, patch)
2019-12-12 13:32 PST, Brady Eidson
no flags Details | Formatted Diff | Diff
Patch (52.85 KB, patch)
2019-12-12 23:59 PST, Brady Eidson
no flags Details | Formatted Diff | Diff
Patch (52.98 KB, patch)
2019-12-13 15:28 PST, Brady Eidson
no flags Details | Formatted Diff | Diff
Patch (53.09 KB, patch)
2019-12-13 16:15 PST, Brady Eidson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brady Eidson 2019-12-11 18:45:04 PST
Refactor ScriptController's proliferation of ExceptionDetails

It's nonsensically everywhere and is getting in the way of upcoming feature work.
Comment 1 Brady Eidson 2019-12-11 22:09:58 PST
Created attachment 385479 [details]
Patch
Comment 2 Brady Eidson 2019-12-11 22:32:15 PST
Created attachment 385480 [details]
Patch
Comment 3 Brady Eidson 2019-12-12 09:58:49 PST
Created attachment 385507 [details]
Patch
Comment 4 Brady Eidson 2019-12-12 10:22:57 PST
Created attachment 385510 [details]
Patch
Comment 5 Sam Weinig 2019-12-12 10:58:53 PST
Comment on attachment 385510 [details]
Patch

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

> Source/WebCore/bindings/js/ScriptController.cpp:115
> +ValueAndException ScriptController::evaluateInWorld(const ScriptSourceCode& sourceCode, DOMWrapperWorld& world)

It feels like this should return something called ValueOrException (which makes me wonder if the existing ExceptionOr<> class could be used here), since it looks like when an exception is thrown, the value is set to { }. If ExceptionOr<> isn't quite right, adding an ExceptionDetailsOr<> seems ok, or just using Expected<JSC::JSValue, ExceptionDetails>
Comment 6 Brady Eidson 2019-12-12 11:47:03 PST
Created attachment 385519 [details]
Patch
Comment 7 EWS Watchlist 2019-12-12 11:47:54 PST
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 8 Brady Eidson 2019-12-12 11:57:18 PST
Created attachment 385522 [details]
Patch
Comment 9 Brady Eidson 2019-12-12 12:12:41 PST
Created attachment 385523 [details]
Patch
Comment 10 Brady Eidson 2019-12-12 12:20:44 PST
Created attachment 385524 [details]
Patch
Comment 11 Brady Eidson 2019-12-12 12:25:02 PST
Created attachment 385525 [details]
Patch
Comment 12 Brady Eidson 2019-12-12 12:51:32 PST
Created attachment 385533 [details]
Patch
Comment 13 Brady Eidson 2019-12-12 13:31:57 PST
Finally got past other platform build errors. Now uploading with refreshed changelogs
Comment 14 Brady Eidson 2019-12-12 13:32:23 PST
Created attachment 385541 [details]
Patch
Comment 15 Brady Eidson 2019-12-12 19:40:58 PST
I don't think this caused API tests QuotaDelegateReload and MediaCache to fail.

I also can't identify how this patch would've cause the layout test changes the bot is still seeing.

Keeping an eye on it...
Comment 16 Brady Eidson 2019-12-12 22:28:55 PST
(In reply to Sam Weinig from comment #5)
> Comment on attachment 385510 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=385510&action=review
> 
> > Source/WebCore/bindings/js/ScriptController.cpp:115
> > +ValueAndException ScriptController::evaluateInWorld(const ScriptSourceCode& sourceCode, DOMWrapperWorld& world)
> 
> It feels like this should return something called ValueOrException (which
> makes me wonder if the existing ExceptionOr<> class could be used here),
> since it looks like when an exception is thrown, the value is set to { }.

Sorry I missed this earlier.

The context missing from this standalone is that this is a precursor to a much larger patch that engrains ValueAndException(Details) in a callback.

> ...or just using Expected<JSC::JSValue, ExceptionDetails>

What is this even.

Looking it up now.
Comment 17 Brady Eidson 2019-12-12 22:39:02 PST
(In reply to Brady Eidson from comment #16)
> (In reply to Sam Weinig from comment #5)
> 
> > ...or just using Expected<JSC::JSValue, ExceptionDetails>
> 
> What is this even.
> 
> Looking it up now.

Never seen it before. Can use. 👍
Comment 18 Brady Eidson 2019-12-12 23:59:41 PST
Created attachment 385583 [details]
Patch
Comment 19 Brady Eidson 2019-12-13 15:28:40 PST
Created attachment 385648 [details]
Patch
Comment 20 Brady Eidson 2019-12-13 16:15:05 PST
Created attachment 385653 [details]
Patch
Comment 21 WebKit Commit Bot 2019-12-13 19:12:19 PST
Comment on attachment 385653 [details]
Patch

Clearing flags on attachment: 385653

Committed r253519: <https://trac.webkit.org/changeset/253519>
Comment 22 WebKit Commit Bot 2019-12-13 19:12:21 PST
All reviewed patches have been landed.  Closing bug.
Comment 23 Radar WebKit Bug Importer 2019-12-13 19:13:24 PST
<rdar://problem/57933050>