Closed Bug 830099 Opened 12 years ago Closed 12 years ago

Don't generate dictionary code for workers when binding is used only in the main thread

Categories

(Core :: DOM: Core & HTML, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla21

People

(Reporter: smaug, Assigned: bzbarsky)

References

Details

(Keywords: dev-doc-complete)

Attachments

(1 file, 1 obsolete file)

Seems like we generate worker code for dictionaries which are main thread only. Either .conf is missing something, or we just generate the code always.
We always generate both worker and main-thread code for workers, yes. Same thing for callbacks (modulo WorkerOnly annotations), as I recall. We could try to do something smarter, I guess. Maybe using code similar to that which generates includes and forward-declares...
So some thoughts on implementing this, so I can sleep: The right approach seems to be to start at relevant descriptors (all main-thread ones or all worker ones, including callback interface descriptors for main-thread) and then go through all the types listed. For each type, if it's a union add all types in the union, if it's a callback add the return type and all argument types, if it's a dictionary add all member types. This is kinda like the callForEachType setup, except that only takes a subset of descriptors and expects to be handed the dictionaries and callbacks, whereas here we'd figure those bits out. Then we see what callbacks and dictionaries are in that set of types, and only generate code for those. Note that all that information will not depend on the WebIDL file, so only needs to be computed once. I wonder whether we can pickle it... need to check what we pickle right now.
Assignee: nobody → bzbarsky
Whiteboard: [need review]
Depends on: 822470
Attached patch Merged on top of bug 822470 (deleted) — Splinter Review
Attachment #704009 - Flags: review?(peterv)
Attachment #702139 - Attachment is obsolete: true
Attachment #702139 - Flags: review?(peterv)
Attachment #704009 - Attachment description: Merged on top of → Merged on top of bug 822470
If this lands as-is, I should remember to remove the docs for [WorkerOnly]
Keywords: dev-doc-needed
Attachment #704009 - Flags: review?(peterv) → review+
Flags: in-testsuite-
Whiteboard: [need review]
Target Milestone: --- → mozilla21
Documentation updated.
Ah, yes, RTCIceServer C++ uses got added without any actual WebIDL using it... Added it to the DummyBinding and relanded: http://hg.mozilla.org/integration/mozilla-inbound/rev/b3cabb259af7
And a followup to fix the RTC stuff on Android: https://hg.mozilla.org/integration/mozilla-inbound/rev/c5238879470f
Gah. I'm so tired of all the goddamned ifdefed not-WebIDL-but-pretending crap. :(
Once more, with feeling, and a lot fewer ifdefs in our IDL: https://hg.mozilla.org/integration/mozilla-inbound/rev/2b9a689ac459
Er, I meant https://hg.mozilla.org/integration/mozilla-inbound/rev/e894c103775f Can this now qualify for Most Confusing Bug Ever awards?
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: