Closed Bug 1128379 Opened 10 years ago Closed 10 years ago

[EME] improve error handling in MediaKeys::CreateSession

Categories

(Core :: Audio/Video, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla38
Tracking Status
firefox37 --- fixed
firefox38 --- fixed

People

(Reporter: jwwang, Assigned: jwwang)

References

Details

Attachments

(2 files)

Per bug 1121332 comment 63, we would like to throw an error in MediaKeys::CreateSession() if any error occurs during new MediaKeySession(...).
Assignee: nobody → jwwang
Status: NEW → ASSIGNED
Depends on: 1121332
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 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)
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+
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
Attached patch Beta patch (deleted) — Splinter Review
Patch for beta branch as part of EME platform uplift.
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?
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.

Attachment

General

Created:
Updated:
Size: