Closed Bug 900904 Opened 11 years ago Closed 11 years ago

Support webidl-only generated events

Categories

(Core :: DOM: Events, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla26

People

(Reporter: Ms2ger, Assigned: smaug)

References

Details

Attachments

(8 files, 1 obsolete file)

No description provided.
Assignee: nobody → bugs
FYI, my current plan is to fix this on the week starting Aug 26
This might allow removing nsIDOMBluetoothDevice.
Yes, and various other interfaces.
Attached file TestEvent.webidl
Attachment #799608 - Attachment mime type: text/x-csrc → text/plain
Attached file TestEvent.h
Attached file TestEvent.cpp
Attached patch patch v2Splinter Review
Comment on attachment 799648 [details] [diff] [review] v3 + BlobEvent as webidl only event You can admire my beautiful python code. Note, the codegen supports only rather basic types for now, since those are the common ones. And no inheritance from other than Event interface, since that is also the common case. And all the properties in dictionaries must have default values - since that is the only reasonable thing for this kind of codegenerator. I moved OwningNonNull to BindingDeclarations because bz asked to do that to fix certain compilation problems. I converted BlobEvent as an example.
Attachment #799648 - Flags: review?(khuey)
Comment on attachment 799648 [details] [diff] [review] v3 + BlobEvent as webidl only event A new patch with a small tweak coming.
Attachment #799648 - Flags: review?(khuey)
Attached patch v4Splinter Review
Attachment #799648 - Attachment is obsolete: true
Attachment #801490 - Flags: review?(khuey)
Comment on attachment 801490 [details] [diff] [review] v4 Review of attachment 801490 [details] [diff] [review]: ----------------------------------------------------------------- I didn't review the actual code generator that hard. I assumed that you knew what you were doing ;-) ::: dom/bindings/BindingDeclarations.h @@ +611,5 @@ > nsWrapperCache* const mWrapperCache; > }; > > +template<class T> > +class OwningNonNull Can you move this in a separate changeset? ::: dom/bindings/Codegen.py @@ +10608,5 @@ > + attr), > + (attr.type, []), > + ea) > + > + def define(self, cgClass): nit: put define at the end of the class. @@ +10615,5 @@ > + args = (', '.join([a.declare() for a in self.args])) > + body = self.getMethodBody() > + return ret + "\n" + methodName + '(' + args + ') const\n{\n' + body + "\n}\n" > + > + def retval(self, type): Why don't you just use CGNativeMember.getRetvalInfo (perhaps with some whitelisting of which types are allowed)? @@ +10672,5 @@ > + return " return " + memberName + ";" > + if type.isDOMString() or type.isByteString(): > + return " aRetVal = " + memberName + ";"; > + if type.isSpiderMonkeyInterface() or type.isObject(): > + ret = " xpc_UnmarkGrayObject(%s);\n" % memberName I removed xpc_UnmarkGrayObject last night. @@ +10946,5 @@ > + > + # And now some include guards > + self.root = CGIncludeGuard(interfaceName, self.root) > + > + # And our license block comes before everything else Use AUTOGENERATED_WARNING_COMMENT too.
Attachment #801490 - Flags: review?(khuey) → review+
(In reply to Kyle Huey [:khuey] (khuey@mozilla.com) from comment #12) > I didn't review the actual code generator that hard. I assumed that you > knew what you were doing ;-) oh dear. > > ::: dom/bindings/BindingDeclarations.h > @@ +611,5 @@ > > nsWrapperCache* const mWrapperCache; > > }; > > > > +template<class T> > > +class OwningNonNull > > Can you move this in a separate changeset? Not sure why. > > + def retval(self, type): > > Why don't you just use CGNativeMember.getRetvalInfo (perhaps with some > whitelisting of which types are allowed)? Well, it is easier to see in one place what all the codegen supports. I tried to use it at some point but it got messy > I removed xpc_UnmarkGrayObject last night. Yes. ugh.
> > @@ +611,5 @@ > > > nsWrapperCache* const mWrapperCache; > > > }; > > > > > > +template<class T> > > > +class OwningNonNull > > > > Can you move this in a separate changeset? > Not sure why. Looks like someone else did that change already.
Comment on attachment 801490 [details] [diff] [review] v4 Review of attachment 801490 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/bindings/BindingGen.py @@ +66,5 @@ > file.close() > return contents > allWebIDLFiles = readFile(args[2]).split() > + generatedEventsWebIDLFiles = readFile(args[3]).split() > + changedDeps = readFile(args[4]).split() Please update the usagestring variable above ::: dom/bindings/BindingUtils.h @@ -1440,5 @@ > nsTArray<nsString>& names, > bool shadowPrototypeProperties, JS::AutoIdVector& props); > > -template<class T> > -class OwningNonNull This is in OwningNonNull.h now.
Attached patch v5Splinter Review
I think this builds. I tried to copy paste what is done with normal webidl files.
Attachment #802478 - Flags: review?(gps)
Comment on attachment 802478 [details] [diff] [review] handle generated_events_webidl_files Review of attachment 802478 [details] [diff] [review]: ----------------------------------------------------------------- ::: python/mozbuild/mozbuild/frontend/sandbox_symbols.py @@ +401,5 @@ > > + 'GENERATED_EVENTS_WEBIDL_FILES': (StrictOrderingOnAppendList, list, [], > + """WebIDL source files for generated events. > + > + These will be parsed and converted to .cpp and .h files. Nit: Trailing whitespace.
Attachment #802478 - Flags: review?(gps) → review+
Attached patch v6Splinter Review
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
Depends on: 915622
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: