Closed
Bug 1128379
Opened 10 years ago
Closed 10 years ago
[EME] improve error handling in MediaKeys::CreateSession
Categories
(Core :: Audio/Video, defect)
Core
Audio/Video
Tracking
()
RESOLVED
FIXED
mozilla38
People
(Reporter: jwwang, Assigned: jwwang)
References
Details
Attachments
(2 files)
(deleted),
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
lmandel
:
approval-mozilla-beta+
|
Details | Diff | Splinter Review |
Per bug 1121332 comment 63, we would like to throw an error in MediaKeys::CreateSession() if any error occurs during new MediaKeySession(...).
Assignee | ||
Updated•10 years ago
|
Assignee | ||
Comment 1•10 years ago
|
||
Assignee | ||
Comment 2•10 years ago
|
||
Comment on attachment 8557711 [details] [diff] [review]
1128379_improve_error_handling_in_MediaKeys.createSession-v1.patch
Review of attachment 8557711 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/media/eme/MediaKeyStatusMap.cpp
@@ +47,2 @@
> if (NS_WARN_IF(!mMap)) {
> + aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
Throw an error if any failures during construction.
@@ +203,5 @@
> nsresult
> MediaKeyStatusMap::UpdateInternal(const nsTArray<CDMCaps::KeyStatus>& keys)
> {
> AutoJSAPI jsapi;
> + if (NS_WARN_IF(!jsapi.Init(mParent))) {
Now we don't need to handle failures in JS::NewMapObject by checking |mMap| is not null.
::: dom/media/eme/MediaKeys.cpp
@@ +358,5 @@
> }
> }
>
> already_AddRefed<MediaKeySession>
> +MediaKeys::CreateSession(JSContext* aCx,
|aCx| will be passed all the way to the constructor of MediaKeyStatusMap so that we don't need an AutoJSAPI.
Attachment #8557711 -
Flags: review?(cpearce)
Comment 3•10 years ago
|
||
Comment on attachment 8557711 [details] [diff] [review]
1128379_improve_error_handling_in_MediaKeys.createSession-v1.patch
Review of attachment 8557711 [details] [diff] [review]:
-----------------------------------------------------------------
Probably best to get bz to look over this; I don't know much about JSContexts.
Attachment #8557711 -
Flags: review?(cpearce) → review?(bzbarsky)
Assignee | ||
Comment 4•10 years ago
|
||
Comment 5•10 years ago
|
||
Comment on attachment 8557711 [details] [diff] [review]
1128379_improve_error_handling_in_MediaKeys.createSession-v1.patch
Looks good, thanks!
Attachment #8557711 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 6•10 years ago
|
||
Try is green: https://tbpl.mozilla.org/?tree=Try&rev=29153744b0a3
Keywords: checkin-needed
Comment 7•10 years ago
|
||
Keywords: checkin-needed
Comment 8•10 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
Updated•10 years ago
|
Blocks: eme-platform-uplift
Comment 9•10 years ago
|
||
status-firefox37:
--- → fixed
Comment 10•10 years ago
|
||
Patch for beta branch as part of EME platform uplift.
Comment 11•10 years ago
|
||
Comment on attachment 8572342 [details] [diff] [review]
Beta patch
Requesting retroactive approval for Beta landing as part of EME platform uplift.
Attachment #8572342 -
Flags: approval-mozilla-beta?
Updated•10 years ago
|
status-firefox38:
--- → fixed
Comment 12•10 years ago
|
||
Comment on attachment 8572342 [details] [diff] [review]
Beta patch
Approved for Beta as part of EME platform uplift.
Attachment #8572342 -
Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in
before you can comment on or make changes to this bug.
Description
•