Closed
Bug 900904
Opened 11 years ago
Closed 11 years ago
Support webidl-only generated events
Categories
(Core :: DOM: Events, defect)
Core
DOM: Events
Tracking
()
RESOLVED
FIXED
mozilla26
People
(Reporter: Ms2ger, Assigned: smaug)
References
Details
Attachments
(8 files, 1 obsolete file)
1.29 KB,
text/plain
|
Details | |
2.19 KB,
text/plain
|
Details | |
3.93 KB,
text/plain
|
Details | |
29.03 KB,
patch
|
Details | Diff | Splinter Review | |
35.68 KB,
patch
|
khuey
:
review+
|
Details | Diff | Splinter Review |
32.89 KB,
patch
|
Details | Diff | Splinter Review | |
6.48 KB,
patch
|
gps
:
review+
|
Details | Diff | Splinter Review |
39.59 KB,
patch
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → bugs
Assignee | ||
Comment 1•11 years ago
|
||
FYI, my current plan is to fix this on the week starting Aug 26
Reporter | ||
Comment 2•11 years ago
|
||
This might allow removing nsIDOMBluetoothDevice.
Assignee | ||
Comment 3•11 years ago
|
||
Yes, and various other interfaces.
Assignee | ||
Comment 4•11 years ago
|
||
Assignee | ||
Updated•11 years ago
|
Attachment #799608 -
Attachment mime type: text/x-csrc → text/plain
Assignee | ||
Comment 5•11 years ago
|
||
Assignee | ||
Comment 6•11 years ago
|
||
Assignee | ||
Comment 7•11 years ago
|
||
Assignee | ||
Comment 8•11 years ago
|
||
Assignee | ||
Comment 9•11 years ago
|
||
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)
Assignee | ||
Comment 10•11 years ago
|
||
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)
Assignee | ||
Comment 11•11 years ago
|
||
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+
Assignee | ||
Comment 13•11 years ago
|
||
(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.
Assignee | ||
Comment 14•11 years ago
|
||
> > @@ +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.
Reporter | ||
Comment 15•11 years ago
|
||
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.
Assignee | ||
Comment 16•11 years ago
|
||
Assignee | ||
Comment 17•11 years ago
|
||
I think this builds. I tried to copy paste what is done with normal webidl files.
Attachment #802478 -
Flags: review?(gps)
Comment 18•11 years ago
|
||
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+
Assignee | ||
Comment 19•11 years ago
|
||
Assignee | ||
Comment 20•11 years ago
|
||
Comment 21•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
You need to log in
before you can comment on or make changes to this bug.
Description
•