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]
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]
Attachment #704009 - Flags: review?(peterv) → review+
Whiteboard: [need review]
Target Milestone: --- → mozilla21
Backed out because of build bustage: https://hg.mozilla.org/integration/mozilla-inbound/rev/2f6fa70c289a https://tbpl.mozilla.org/?tree=Mozilla-Inbound&rev=32786d29daf8
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
And backed them both out in https://hg.mozilla.org/integration/mozilla-inbound/rev/003632d51638 for https://tbpl.mozilla.org/php/getParsedLog.php?id=19224713&tree=Mozilla-Inbound bustage on b2g.
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: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.