Closed
Bug 1025973
Opened 12 years ago
Closed 12 years ago
webidl codegen creates inconsistent constructor signatures when JSContext needed
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla33
People
(Reporter: bkelly, Assigned: bkelly)
References
Details
Attachments
(2 files, 2 obsolete files)
|
25.33 KB,
patch
|
bkelly
:
review+
|
Details | Diff | Splinter Review |
|
13.94 KB,
patch
|
bkelly
:
review+
|
Details | Diff | Splinter Review |
For the ServiceWorker Cache and Fetch APIs we need to define bindings for both worker and window contexts. In particular the CacheStorage webidl has a constructor like:
[Constructor(sequence<any> iterable)]
I have this in my Bindings.conf:
'CacheStorage': [{
'headerFile': 'mozilla/dom/CacheStorage.h',
'nativeType': 'mozilla::dom::CacheStorage'
}, {
'headerFile': 'mozilla/dom/CacheStorage.h',
'nativeType': 'mozilla::dom::CacheStorage',
'workers': True,
}],
So I am getting both window and workers. The window based _constructor() calls:
result = mozilla::dom::CacheStorage::Constructor(global, cx, Constify(arg0), rv);
While the worker based _constructor() calls:
result = mozilla::dom::CacheStorage::Constructor(global, Constify(arg0), rv);
From talking with Boris, this inconsistency was introduced in bug 816088 because there was a separate WorkerGlobalObject type that contained a JSContext. Later, this type was consolidated into just GlobalObject.
Boris suggests that we clean this up and remove the JSContext from the non-worker case since its not needed there any more.
| Assignee | ||
Comment 1•12 years ago
|
||
I wrote this patch on an m-c from last Friday. Rebuilding now to make sure nothing changed and broke it, but I think its good to go.
https://tbpl.mozilla.org/?tree=Try&rev=020477e46a4f
Attachment #8440791 -
Flags: review?(bzbarsky)
| Assignee | ||
Comment 2•12 years ago
|
||
Kyle suggests renaming GetContext() to just Context(). Should we do that here?
| Assignee | ||
Comment 3•12 years ago
|
||
Comment on attachment 8440791 [details] [diff] [review]
Do not pass JSContext to static webidl methods in non-worker case.
Drop flag for now as IRC concluded "sure, why not?".
Attachment #8440791 -
Flags: review?(bzbarsky)
Comment 4•12 years ago
|
||
Comment on attachment 8440791 [details] [diff] [review]
Do not pass JSContext to static webidl methods in non-worker case.
r=me; the rename should just be a separate diff.
Attachment #8440791 -
Flags: review+
| Assignee | ||
Comment 5•12 years ago
|
||
Attachment #8440886 -
Flags: review?(bzbarsky)
| Assignee | ||
Comment 6•12 years ago
|
||
Carry r+ forward. Mechanical update from GetContext() to Context() in the patch.
New try:
https://tbpl.mozilla.org/?tree=Try&rev=95b2f4360810
Attachment #8440791 -
Attachment is obsolete: true
Attachment #8440888 -
Flags: review+
Comment 7•12 years ago
|
||
Comment on attachment 8440886 [details] [diff] [review]
P1 Rename GlobalObject::GetContext() to Context()
r=me
Attachment #8440886 -
Flags: review?(bzbarsky) → review+
| Assignee | ||
Comment 8•12 years ago
|
||
Try build caught a use of GetContext() in dom/nfc that dxr didn't seem to find for some reason. This only fails on b2g builds.
Carry r+ forward.
Attachment #8440886 -
Attachment is obsolete: true
Attachment #8440933 -
Flags: review+
| Assignee | ||
Comment 9•12 years ago
|
||
| Assignee | ||
Updated•12 years ago
|
Keywords: checkin-needed
Comment 10•12 years ago
|
||
> that dxr didn't seem to find for some reason
Because dxr only knows about code it compiled. :(
Comment 11•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/fc1f605dda9d
https://hg.mozilla.org/integration/mozilla-inbound/rev/961dbfea27d3
Keywords: checkin-needed
Comment 12•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/fc1f605dda9d
https://hg.mozilla.org/mozilla-central/rev/961dbfea27d3
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
Comment 13•11 years ago
|
||
Updated the docs to take note of this change.
Updated•7 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•