Closed Bug 919268 Opened 11 years ago Closed 11 years ago

Add codegen for worker-only WebIDL callbacks

Categories

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

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla27

People

(Reporter: janv, Assigned: janv)

References

Details

Attachments

(4 files)

I had to do this for sync IDB.
Attached patch patchSplinter Review
Assignee: nobody → Jan.Varga
Status: NEW → ASSIGNED
Attachment #808262 - Flags: review?(bzbarsky)
Blocks: SyncIDB
Comment on attachment 808262 [details] [diff] [review]
patch

This seems like the opposite of what we _want_ to be doing, in general, which is getting rid of worker-specific stuff.  Especially the EventHandler changes here are totally backwards and will prevent sane event targets on workers (which is a _very_ short-term goal here).  So we're not going to be doing that.

I assume the basic issue is that IDB*Sync interfaces have to marked as "worker" interfaces because of the existing EventTarget breakage or something?  Are there any other reason they need to be marked as "worker" interfaces?

If we posit that they do need to be thus marked, how about we only generate worker-descriptored callbacks for those callbacks for which we did not generate a mainthread-descriptored one?  That will avoid breaking EventHandler, at least.
Attachment #808262 - Flags: review?(bzbarsky) → review-
Well there were two options and I clearly chose the bad one :)
When I added:
cgthings.extend(CGCallbackFunction(c, config.getDescriptorProvider(True)) 
                for c in workerCallbacks)

it generated slightly different EventHandlerNonNull bindings (nsDOMEvent vs JSObject, I'll attach the diff)
So I thought that I needed to keep the "Workers" suffix

I don't think IDBTransacionCallback and IDBVersionChangeCallback need to use the suffix.
> it generated slightly different EventHandlerNonNull bindings (nsDOMEvent vs JSObject

Right.  But the latter is supposed to go away ASAP, and would be unused in the meantime.
(In reply to Boris Zbarsky [:bz] from comment #5)
> > it generated slightly different EventHandlerNonNull bindings (nsDOMEvent vs JSObject
> 
> Right.  But the latter is supposed to go away ASAP, and would be unused in
> the meantime.

ok, so I'll try the other option to get rid of the "Workers" suffix
Attached patch interdiffSplinter Review
Boris, something like this ?
I'll submit a new patch for m-c, if you like the approach.
Attachment #809299 - Flags: feedback?(bzbarsky)
Comment on attachment 809299 [details] [diff] [review]
interdiff

Much better, thanks.
Attachment #809299 - Flags: feedback?(bzbarsky) → feedback+
Attached patch final patchSplinter Review
Attachment #809330 - Flags: review?(bzbarsky)
Comment on attachment 809330 [details] [diff] [review]
final patch

r=me
Attachment #809330 - Flags: review?(bzbarsky) → review+
https://hg.mozilla.org/mozilla-central/rev/3b16cca767c4
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla27
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: