Closed
Bug 840559
Opened 11 years ago
Closed 11 years ago
Convert MediaError to WebIDL
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla21
People
(Reporter: baku, Assigned: baku)
References
(Blocks 1 open bug)
Details
Attachments
(2 files, 5 obsolete files)
6.40 KB,
patch
|
baku
:
review+
|
Details | Diff | Splinter Review |
8.73 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Comment 1•11 years ago
|
||
What do we do for enums in webIDL? I left the nsIDOMHTMLMediaError ones.
Attachment #712964 -
Flags: review?(Ms2ger)
Assignee | ||
Comment 2•11 years ago
|
||
Attachment #712965 -
Flags: review?(Ms2ger)
Assignee | ||
Comment 3•11 years ago
|
||
https://tbpl.mozilla.org/?tree=Try&rev=c00801416a72
Comment 4•11 years ago
|
||
Comment on attachment 712964 [details] [diff] [review] part 1 - renaming Review of attachment 712964 [details] [diff] [review]: ----------------------------------------------------------------- ::: content/html/content/src/nsMediaError.cpp @@ +21,5 @@ > NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(MediaError) > NS_INTERFACE_MAP_END > > +MediaError::MediaError(uint16_t aCode) > +: mCode(aCode) Nit: : mCode(aCode) (two spaces, :, one space, mCode)
Attachment #712964 -
Flags: review?(Ms2ger) → review+
Comment 5•11 years ago
|
||
Comment on attachment 712965 [details] [diff] [review] part 2 - webidl Review of attachment 712965 [details] [diff] [review]: ----------------------------------------------------------------- You need more CC magic, at least for the wrapper and mParent. ::: content/html/content/src/MediaError.cpp @@ +23,5 @@ > NS_INTERFACE_MAP_END > > +MediaError::MediaError(nsHTMLMediaElement* aParent, uint16_t aCode) > +: mParent(aParent) > +, mCode(aCode) Same @@ +37,5 @@ > } > > +JSObject* > +MediaError::WrapObject(JSContext* cx, JSObject* scope, > + bool* triedToWrap) aFoo for arguments
Attachment #712965 -
Flags: review?(Ms2ger) → review-
Assignee | ||
Comment 6•11 years ago
|
||
Attachment #712964 -
Attachment is obsolete: true
Attachment #712975 -
Flags: review+
Assignee | ||
Comment 7•11 years ago
|
||
Attachment #712965 -
Attachment is obsolete: true
Attachment #712978 -
Flags: review?(Ms2ger)
Comment 8•11 years ago
|
||
> What do we do for enums in webIDL?
WebIDL uses string-valued enums, because numeric ones don't really make sense in JavaScript...
If we need the numeric constants on the C++ side, we can just leave it in the XPIDL as you have or put them in the C++ impl.
Updated•11 years ago
|
Attachment #712978 -
Flags: review?(bugs)
Comment 9•11 years ago
|
||
Comment on attachment 712978 [details] [diff] [review] part 2 - webidl (b) > namespace mozilla { > namespace dom { > >-NS_IMPL_ADDREF(MediaError) >-NS_IMPL_RELEASE(MediaError) >+NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(MediaError) >+ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS >+ NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mParent) >+NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END > >-NS_INTERFACE_MAP_BEGIN(MediaError) >- NS_INTERFACE_MAP_ENTRY(nsISupports) >+NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(MediaError) >+ NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER >+NS_IMPL_CYCLE_COLLECTION_UNLINK_END >+ >+NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(MediaError) >+ NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER >+NS_IMPL_CYCLE_COLLECTION_TRACE_END NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(MediaError, mParent) should work.
Attachment #712978 -
Flags: review?(bugs) → review+
Comment 10•11 years ago
|
||
Comment on attachment 712978 [details] [diff] [review] part 2 - webidl (b) Review of attachment 712978 [details] [diff] [review]: ----------------------------------------------------------------- r=me with those comments addressed and using NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1. ::: content/html/content/src/MediaError.cpp @@ -20,2 @@ > NS_INTERFACE_MAP_ENTRY(nsIDOMMediaError) > - NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(MediaError) I don't think you should remove this. @@ +36,5 @@ > + > + > +MediaError::MediaError(nsHTMLMediaElement* aParent, uint16_t aCode) > +: mParent(aParent) > +, mCode(aCode) Should indent this by two spaces, as I mentioned. @@ +43,5 @@ > > NS_IMETHODIMP MediaError::GetCode(uint16_t* aCode) > { > if (aCode) > *aCode = mCode; Make this Code() ::: content/html/content/src/MediaError.h @@ +47,2 @@ > // Error code > uint16_t mCode; This could be const ::: dom/webidl/MediaError.webidl @@ +3,5 @@ > + * License, v. 2.0. If a copy of the MPL was not distributed with this file, > + * You can obtain one at http://mozilla.org/MPL/2.0/. > + * > + * The origin of this IDL file is > + * http://dev.w3.org/html5/spec-author-view/video.html#mediaerror You don't want to be looking at w3.org for HTML, and definitely not at spec-author-view. Please link to <http://www.whatwg.org/html/#mediaerror>. @@ +15,5 @@ > + const unsigned short MEDIA_ERR_ABORTED = 1; > + const unsigned short MEDIA_ERR_NETWORK = 2; > + const unsigned short MEDIA_ERR_DECODE = 3; > + const unsigned short MEDIA_ERR_SRC_NOT_SUPPORTED = 4; > + readonly attribute unsigned short code; Add [Constant]
Attachment #712978 -
Flags: review?(Ms2ger) → review+
Assignee | ||
Comment 11•11 years ago
|
||
Attachment #712978 -
Attachment is obsolete: true
Attachment #713402 -
Flags: review+
Assignee | ||
Comment 12•11 years ago
|
||
https://tbpl.mozilla.org/?tree=Try&rev=b0fb29b3c3ed
Assignee | ||
Comment 13•11 years ago
|
||
Attachment #713402 -
Attachment is obsolete: true
Attachment #713883 -
Flags: review?(bugs)
Comment 14•11 years ago
|
||
Comment on attachment 713883 [details] [diff] [review] part 2 - webidl mParent needs to be strong and it needs to be traversed/unlinked
Attachment #713883 -
Flags: review?(bugs) → review-
Assignee | ||
Comment 15•11 years ago
|
||
Attachment #713883 -
Attachment is obsolete: true
Attachment #713888 -
Flags: review?(bugs)
Updated•11 years ago
|
Attachment #713888 -
Flags: review?(bugs) → review+
Assignee | ||
Updated•11 years ago
|
Keywords: checkin-needed
Comment 16•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/a61cbf1da700 https://hg.mozilla.org/integration/mozilla-inbound/rev/d0ff1ebd9885
Keywords: checkin-needed
Comment 17•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/a61cbf1da700 https://hg.mozilla.org/mozilla-central/rev/d0ff1ebd9885
Status: NEW → RESOLVED
Closed: 11 years ago
Flags: in-testsuite?
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•