Bug 174140 - [WebIDL] Convert MutationCallback to be a normal generated callback
Summary: [WebIDL] Convert MutationCallback to be a normal generated callback
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sam Weinig
URL:
Keywords: InRadar
Depends on: 178013 174434
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-04 14:17 PDT by Sam Weinig
Modified: 2022-02-28 03:27 PST (History)
7 users (show)

See Also:


Attachments
Patch (31.87 KB, patch)
2017-07-04 14:27 PDT, Sam Weinig
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews101 for mac-elcapitan (1.03 MB, application/zip)
2017-07-04 15:44 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews104 for mac-elcapitan-wk2 (1.08 MB, application/zip)
2017-07-04 15:48 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews123 for ios-simulator-wk2 (6.29 MB, application/zip)
2017-07-04 16:18 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews112 for mac-elcapitan (1.79 MB, application/zip)
2017-07-04 17:39 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews117 for mac-elcapitan (1.78 MB, application/zip)
2017-07-04 19:40 PDT, Build Bot
no flags Details
Patch (68.50 KB, patch)
2017-07-05 22:53 PDT, Sam Weinig
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews103 for mac-elcapitan (984.87 KB, application/zip)
2017-07-05 23:59 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews106 for mac-elcapitan-wk2 (1.14 MB, application/zip)
2017-07-06 00:05 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews122 for ios-simulator-wk2 (948.22 KB, application/zip)
2017-07-06 00:28 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews114 for mac-elcapitan (1.83 MB, application/zip)
2017-07-06 01:47 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews112 for mac-elcapitan (1.78 MB, application/zip)
2017-07-06 03:50 PDT, Build Bot
no flags Details
Patch (73.15 KB, patch)
2017-07-06 15:22 PDT, Sam Weinig
no flags Details | Formatted Diff | Diff
Patch (110.46 KB, patch)
2017-08-02 14:58 PDT, Sam Weinig
no flags Details | Formatted Diff | Diff
Patch (116.87 KB, patch)
2017-08-02 15:54 PDT, Sam Weinig
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews101 for mac-elcapitan (1.10 MB, application/zip)
2017-08-02 17:00 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews121 for ios-simulator-wk2 (959.74 KB, application/zip)
2017-08-02 17:46 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews107 for mac-elcapitan-wk2 (1.42 MB, application/zip)
2017-08-02 18:08 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews117 for mac-elcapitan (1.85 MB, application/zip)
2017-08-02 18:48 PDT, Build Bot
no flags Details
Patch (113.59 KB, patch)
2017-08-02 20:20 PDT, Sam Weinig
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Weinig 2017-07-04 14:17:35 PDT
[WebIDL] Convert MutationCallback to be a normal generate callback
Comment 1 Sam Weinig 2017-07-04 14:27:42 PDT Comment hidden (obsolete)
Comment 2 Build Bot 2017-07-04 15:44:11 PDT Comment hidden (obsolete)
Comment 3 Build Bot 2017-07-04 15:44:12 PDT Comment hidden (obsolete)
Comment 4 Build Bot 2017-07-04 15:48:57 PDT Comment hidden (obsolete)
Comment 5 Build Bot 2017-07-04 15:48:58 PDT Comment hidden (obsolete)
Comment 6 Build Bot 2017-07-04 16:18:09 PDT Comment hidden (obsolete)
Comment 7 Build Bot 2017-07-04 16:18:11 PDT Comment hidden (obsolete)
Comment 8 Build Bot 2017-07-04 17:39:13 PDT Comment hidden (obsolete)
Comment 9 Build Bot 2017-07-04 17:39:14 PDT Comment hidden (obsolete)
Comment 10 Build Bot 2017-07-04 19:40:16 PDT Comment hidden (obsolete)
Comment 11 Build Bot 2017-07-04 19:40:17 PDT Comment hidden (obsolete)
Comment 12 Sam Weinig 2017-07-05 10:46:28 PDT
I need to come up with a way to pass a this object to a callback. I have two ideas.
1) Add a setThisObject(...) function that the callback needs to implement which should be called before handleEvent().
2) For callbacks that need a this object, pass it as the first argument, and offset the rest of the arguments by one.

I think I am leaning toward the second option.
Comment 13 Sam Weinig 2017-07-05 22:53:56 PDT Comment hidden (obsolete)
Comment 14 Build Bot 2017-07-05 23:59:18 PDT Comment hidden (obsolete)
Comment 15 Build Bot 2017-07-05 23:59:19 PDT Comment hidden (obsolete)
Comment 16 Build Bot 2017-07-06 00:05:31 PDT Comment hidden (obsolete)
Comment 17 Build Bot 2017-07-06 00:05:33 PDT Comment hidden (obsolete)
Comment 18 Build Bot 2017-07-06 00:28:07 PDT Comment hidden (obsolete)
Comment 19 Build Bot 2017-07-06 00:28:08 PDT Comment hidden (obsolete)
Comment 20 Build Bot 2017-07-06 01:47:02 PDT Comment hidden (obsolete)
Comment 21 Build Bot 2017-07-06 01:47:04 PDT Comment hidden (obsolete)
Comment 22 Build Bot 2017-07-06 03:50:28 PDT Comment hidden (obsolete)
Comment 23 Build Bot 2017-07-06 03:50:29 PDT Comment hidden (obsolete)
Comment 24 Sam Weinig 2017-07-06 15:22:20 PDT
Created attachment 314762 [details]
Patch
Comment 25 Chris Dumez 2017-07-09 10:20:28 PDT
Comment on attachment 314762 [details]
Patch

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

r=me

> Source/WebCore/ChangeLog:3
> +        [WebIDL] Convert MutationCallback to be a normal generate callback

"normal generate callback" ?

> Source/WebCore/ChangeLog:9
> +        - Added the ability to for non-nullable interfaces in sequences to be passed

"to for"?
Comment 26 Sam Weinig 2017-07-11 14:07:11 PDT
Committed r219361: <http://trac.webkit.org/changeset/219361>
Comment 27 WebKit Commit Bot 2017-07-12 13:39:48 PDT
Re-opened since this is blocked by bug 174434
Comment 28 Sam Weinig 2017-08-02 14:58:34 PDT Comment hidden (obsolete)
Comment 29 Build Bot 2017-08-02 15:51:42 PDT Comment hidden (obsolete)
Comment 30 Sam Weinig 2017-08-02 15:54:53 PDT Comment hidden (obsolete)
Comment 31 Build Bot 2017-08-02 17:00:12 PDT Comment hidden (obsolete)
Comment 32 Build Bot 2017-08-02 17:00:14 PDT Comment hidden (obsolete)
Comment 33 Build Bot 2017-08-02 17:46:03 PDT Comment hidden (obsolete)
Comment 34 Build Bot 2017-08-02 17:46:04 PDT Comment hidden (obsolete)
Comment 35 Build Bot 2017-08-02 18:08:19 PDT Comment hidden (obsolete)
Comment 36 Build Bot 2017-08-02 18:08:21 PDT Comment hidden (obsolete)
Comment 37 Build Bot 2017-08-02 18:48:40 PDT Comment hidden (obsolete)
Comment 38 Build Bot 2017-08-02 18:48:41 PDT Comment hidden (obsolete)
Comment 39 Sam Weinig 2017-08-02 20:20:07 PDT
Created attachment 317077 [details]
Patch
Comment 40 Darin Adler 2017-08-03 09:44:17 PDT
Comment on attachment 317077 [details]
Patch

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

> Source/WebCore/ChangeLog:3
> +        [WebIDL] Convert MutationCallback to be a normal generate callback

generated?

> Source/WebCore/Modules/geolocation/PositionCallback.h:38
> +    using ActiveDOMCallback::ActiveDOMCallback;

What does this do? I have never seen this syntax before; it looks like it would make a base class constructor public, but I not know what that means. And also, it seems that since we inherit from ActiveDOMCallback publicly that it would already be public, so what is this for?

> Source/WebCore/Modules/geolocation/PositionCallback.h:40
>      virtual ~PositionCallback() { }

This is no longer needed now that we have a base class that already makes the detstructor virtual.

> Source/WebCore/Modules/geolocation/PositionCallback.h:41
>      virtual CallbackResult<void> handleEvent(Geoposition*) = 0;

Wish this was a reference instead of a pointer.

> Source/WebCore/Modules/geolocation/PositionErrorCallback.h:40
> +    using ActiveDOMCallback::ActiveDOMCallback;
> +
>      virtual ~PositionErrorCallback() { }

Ditto. Same for all the other classes.
Comment 41 Sam Weinig 2017-08-03 09:57:55 PDT
(In reply to Darin Adler from comment #40)
> Comment on attachment 317077 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=317077&action=review
> 
> > Source/WebCore/ChangeLog:3
> > +        [WebIDL] Convert MutationCallback to be a normal generate callback
> 
> generated?

Yep. Will fix.

> 
> > Source/WebCore/Modules/geolocation/PositionCallback.h:38
> > +    using ActiveDOMCallback::ActiveDOMCallback;
> 
> What does this do? I have never seen this syntax before; it looks like it
> would make a base class constructor public, but I not know what that means.
> And also, it seems that since we inherit from ActiveDOMCallback publicly
> that it would already be public, so what is this for?

It adds all the constructors from ActiveDOMCallback to, in this case, PositionCallback. I found the section called "Inheriting constructors" in http://en.cppreference.com/w/cpp/language/using_declaration useful and interesting.

> 
> > Source/WebCore/Modules/geolocation/PositionCallback.h:40
> >      virtual ~PositionCallback() { }
> 
> This is no longer needed now that we have a base class that already makes
> the detstructor virtual.

Good point, will remove.

> 
> > Source/WebCore/Modules/geolocation/PositionCallback.h:41
> >      virtual CallbackResult<void> handleEvent(Geoposition*) = 0;
> 
> Wish this was a reference instead of a pointer.

Me too. :(.
Comment 42 Sam Weinig 2017-08-03 10:51:24 PDT
Committed r220210: <http://trac.webkit.org/changeset/220210>
Comment 43 Radar WebKit Bug Importer 2017-08-03 10:52:26 PDT
<rdar://problem/33703510>
Comment 44 Chris Dumez 2017-08-24 16:19:59 PDT
The changes to MutationObserver / MutationCallback may have caused crashes (rdar://problem/34062022).