Don't use Move() to empty plugins list in GMPServiceParent.cpp

RESOLVED FIXED in Firefox 50

Status

()

Core
Audio/Video: GMP
P2
normal
Rank:
21
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: gerald, Assigned: gerald)

Tracking

50 Branch
mozilla50
Points:
---

Firefox Tracking Flags

(firefox50 fixed)

Details

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

(Assignee)

Description

2 years ago
I've used Move() to move the contents of the plugins list to a local variable in GeckoMediaPluginServiceParent::UnloadPlugins(), expecting that the source list would be emptied. However misleadingly-named Move() does not guarantee that the source object will actually be emptied.
https://hg.mozilla.org/mozilla-central/annotate/09221c72fcb03a7c2b4ab27c75304eae3247e3d1/dom/media/gmp/GMPServiceParent.cpp#l722

An easy fix in this case should be to just swap the contents of the local (empty) list with the plugins list.
(Assignee)

Comment 1

2 years ago
Created attachment 8768788 [details]
Bug 1285231 - Use Swap to move&empty plugins list before unloading -

Review commit: https://reviewboard.mozilla.org/r/62838/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/62838/
Attachment #8768788 - Flags: review?(jwwang)
Attachment #8768788 - Flags: review?(jwwang) → review+
Comment on attachment 8768788 [details]
Bug 1285231 - Use Swap to move&empty plugins list before unloading -

https://reviewboard.mozilla.org/r/62838/#review59736

Updated

2 years ago
Rank: 21
Priority: -- → P2
(Assignee)

Comment 3

2 years ago
Thank you for the review, JW.

Comment 4

2 years ago
Pushed by gsquelart@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9a123c6c6dbf
Use Swap to move&empty plugins list before unloading - r=jwwang

Comment 5

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/9a123c6c6dbf
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox50: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
You need to log in before you can comment on or make changes to this bug.