Closed
Bug 1173255
Opened 9 years ago
Closed 9 years ago
Cleanup MediaManager e10s code (avoids opening it on clear cookies) in prep for deviceId constraint
Categories
(Core :: WebRTC, defect, P2)
Core
WebRTC
Tracking
()
RESOLVED
FIXED
mozilla41
backlog | webrtc/webaudio+ |
People
(Reporter: jib, Assigned: jib)
References
Details
Attachments
(6 files, 6 obsolete files)
Decided to separate out this chunk of work from Bug 1037389. The raw deviceId is a simple property. The problem is we need to operate not on the raw ids but on the same origin-unique ids the content script is using (from enumerateDevices), which is harder. This is some needed cleanup in preparation for the deviceId constraint implementation: 0 A cleanupfacingmode: deviceId prep + move facingMode constraint 1 A pcontent.patch: move PMedia from PBackground to PContent 2 A omain: refactor getOriginKey to main 3 A newtaskfrom: cleanup runnables and task in MediaManager 4 A none10s: compensate for PContent being useless in non-e10s This means a lot less thread-hopping (in both content and chrome process) for enumerateDevices which was getting unwieldy. This is important because enumerateDevices will play a role internally in getUserMedia from now on, now that origin-unique ids are needed to resolve potential deviceId constraints. Refactored the relevant MediaManager runnables to use lambdas, to keep better track of the extra dispatches, and to allow using media::Pledges effectively to avoid passing DOM objects off-main-thread (or now off-process). A side-benefit of this cleanup is that MediaManager + thread should no longer be opened by the act of clearing cookies, which if you run with "Clear cookies on shutdown" is on every startup and shutdown. Things seem to be working as well as before locally, though I'm sure there may be kinks on try, but I think this is ready for review.
Assignee | ||
Comment 1•9 years ago
|
||
Bug 1173255 - deviceId prep + move facingMode constraint
Attachment #8617757 -
Flags: review?(rjesup)
Assignee | ||
Comment 2•9 years ago
|
||
Bug 1173255 - move PMedia from PBackground to PContent
Attachment #8617758 -
Flags: review?(rjesup)
Assignee | ||
Comment 3•9 years ago
|
||
Bug 1173255 - refactor getOriginKey to main
Attachment #8617759 -
Flags: review?(rjesup)
Assignee | ||
Comment 4•9 years ago
|
||
Bug 1173255 - cleanup runnables and task in MediaManager
Attachment #8617760 -
Flags: review?(rjesup)
Assignee | ||
Comment 5•9 years ago
|
||
Bug 1173255 - compensate for PContent being useless in non-e10s
Attachment #8617761 -
Flags: review?(rjesup)
Assignee | ||
Comment 6•9 years ago
|
||
Discussed with botond on irc: Some of the try problems are from Bug 1170388 which is being reopened.
Depends on: 1170388
Updated•9 years ago
|
backlog: --- → webRTC+
Rank: 21
Comment 7•9 years ago
|
||
Comment on attachment 8617757 [details] MozReview Request: Bug 1173255 - move facingMode constraint. r=jesup https://reviewboard.mozilla.org/r/10715/#review9493 ::: dom/media/webrtc/MediaEngineCameraVideoSource.h:89 (Diff revision 1) > + static uint32_t FitnessDistance(nsString aN, I note this is "aN" and the other FitnessDistance()es above use "n". Minor; prefer to see them match ::: dom/webidl/MediaTrackConstraintSet.webidl:1 (Diff revision 1) > /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ Need a DOM peer review for webidl files
Attachment #8617757 -
Flags: review?(rjesup) → review+
Comment 8•9 years ago
|
||
Comment on attachment 8617758 [details] MozReview Request: Bug 1173255 - move PMedia from PBackground to PContent. r=jesup https://reviewboard.mozilla.org/r/10717/#review9497 r+ing since the sChild issue is pre-existing; we may want a followup on it ::: dom/media/MediaManager.cpp:1489 (Diff revision 1) > + media::Child::Get(); Add a comment ::: dom/media/systemservices/MediaChild.cpp:40 (Diff revision 1) > +static Child* sChild; Raw static non-refcounted pointer? Is Child refcounted? Will this leak? What's the threading requirements on sChild? And is there a reason it's a global static, not a class static? (Likely this is largely managed by the IPC calls.) At least needs some comments and maybe thread asserts on accessors; may need more. And yes, I realize you just moved it. :-)
Attachment #8617758 -
Flags: review?(rjesup) → review+
Comment 9•9 years ago
|
||
Comment on attachment 8617759 [details] MozReview Request: Bug 1173255 - refactor getOriginKey to main https://reviewboard.mozilla.org/r/10719/#review9501 Presuming that's an oops ::: dom/media/MediaManager.cpp:1434 (Diff revision 1) > + if (true) { I think this was an oops....
Attachment #8617759 -
Flags: review?(rjesup) → review+
Comment 10•9 years ago
|
||
Comment on attachment 8617760 [details] MozReview Request: Bug 1173255 - cleanup runnables and task in MediaManager https://reviewboard.mozilla.org/r/10721/#review9503 ::: dom/media/MediaManager.cpp:1280 (Diff revision 1) > - if (true) { > + if (!mgr) { I see this patch fixes that ::: dom/media/MediaManager.cpp:1905 (Diff revision 1) > + trailing space ::: dom/media/systemservices/MediaUtils.h:70 (Diff revision 1) > + class F : public FunctorsBase 'F' is kinda non-descriptive - is there a better name?
Attachment #8617760 -
Flags: review?(rjesup) → review+
Updated•9 years ago
|
Attachment #8617761 -
Flags: review?(rjesup) → review+
Comment 11•9 years ago
|
||
Comment on attachment 8617761 [details] MozReview Request: Bug 1173255 - compensate for PContent being useless in non-e10s https://reviewboard.mozilla.org/r/10723/#review9505 Ship It!
Updated•9 years ago
|
tracking-e10s:
--- → +
Assignee | ||
Comment 12•9 years ago
|
||
(In reply to Randell Jesup [:jesup] from comment #7) > ::: dom/webidl/MediaTrackConstraintSet.webidl:1 > (Diff revision 1) > > /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ > > Need a DOM peer review for webidl files Actually, let me remove those changes as they're not needed yet. That should take care of the extra review requirement.
Assignee | ||
Comment 13•9 years ago
|
||
https://reviewboard.mozilla.org/r/10717/#review9525 > Add a comment This may be redundant as well now that I think about it. Removing the line instead. > Raw static non-refcounted pointer? Is Child refcounted? Will this leak? What's the threading requirements on sChild? And is there a reason it's a global static, not a class static? > > (Likely this is largely managed by the IPC calls.) > > At least needs some comments and maybe thread asserts on accessors; may need more. > > And yes, I realize you just moved it. :-) Child is not ref-counted and does not leak, because IPC (in this case PContent) handles lifetimes for actors, and does so without ref-counting. [1] While using ref-counting is an option, as described a bit down in [1] - and I took that approach for MediaParent because I needed it there - it adds complexity, so I didn't do that for MediaChild. PContent is main-thread-only is what I've been told (and matches my observations). I'll throw in a MOZ_ASSERT. The pattern seems common to me [2] e.g. [3] is not even static. No reason it can't be class static, except it seems redundant given it's already in the media:: namespace. [1] https://developer.mozilla.org/en-US/docs/IPDL/Tutorial#Subprotocol_Actor_Lifetime [2] http://mxr.mozilla.org/mozilla-central/search?string=Child-%3ESend [3] http://mxr.mozilla.org/mozilla-central/source/netwerk/ipc/NeckoChild.cpp?rev=3182e5961729#38
Assignee | ||
Comment 14•9 years ago
|
||
Bug 1173255 - move facingMode constraint. r=jesup
Assignee | ||
Comment 15•9 years ago
|
||
Bug 1173255 - move PMedia from PBackground to PContent. r=jesup
Assignee | ||
Comment 16•9 years ago
|
||
Bug 1173255 - refactor getOriginKey to main
Assignee | ||
Comment 17•9 years ago
|
||
Bug 1173255 - cleanup runnables and task in MediaManager
Assignee | ||
Comment 18•9 years ago
|
||
Bug 1173255 - compensate for PContent being useless in non-e10s
Assignee | ||
Comment 19•9 years ago
|
||
Bug 1173255 - incorporate feedback. r=jesup
Attachment #8621913 -
Flags: review?(rjesup)
Assignee | ||
Comment 20•9 years ago
|
||
Review board hosed my review series (Bug 1174353) so I had to submit afresh using a separate reviewid. I figure this still beats splinter with all the whitespace changes. /r/11083 - Bug 1173255 - move facingMode constraint. r=jesup /r/11085 - Bug 1173255 - move PMedia from PBackground to PContent. r=jesup /r/11087 - Bug 1173255 - refactor getOriginKey to main /r/11089 - Bug 1173255 - cleanup runnables and task in MediaManager /r/11091 - Bug 1173255 - compensate for PContent being useless in non-e10s /r/11093 - Bug 1173255 - incorporate feedback. r=jesup Basically I made changes where you see r= above (the first two and the last) I edited the first two patches (to avoid touching the webidl file, and some other reason). I put all other changes (review feedback and try fixes) in the last patch. I would like a review on the last patch even though I marked it r= (my mistake).
Assignee | ||
Updated•9 years ago
|
Attachment #8617757 -
Attachment is obsolete: true
Assignee | ||
Updated•9 years ago
|
Attachment #8617758 -
Attachment is obsolete: true
Assignee | ||
Updated•9 years ago
|
Attachment #8617759 -
Attachment is obsolete: true
Assignee | ||
Updated•9 years ago
|
Attachment #8617760 -
Attachment is obsolete: true
Assignee | ||
Updated•9 years ago
|
Attachment #8617761 -
Attachment is obsolete: true
Assignee | ||
Comment 21•9 years ago
|
||
https://reviewboard.mozilla.org/r/11093/#review9685 ::: dom/media/tests/mochitest/test_getUserMedia_constraints.html (Diff revision 1) > - { message: "video overconstrained by facingMode fails", > - constraints: { video: { facingMode:{ exact: 'left' } }, > - fake: true }, > - error: "NotFoundError" }, > - { message: "video overconstrained by facingMode array fails", > - constraints: { video: { facingMode:{ exact: ['left', 'right'] } }, > - fake: true }, > - error: "NotFoundError" }, I had to remove these tests that failed. The reason these tests no longer work is that the facingMode constraint checking code has moved from MediaManager.cpp to down to webrtc/MediaEngineCameraVideoSource.cpp to join the other constraints. This means that the "fake" devices no longer respond to facingMode (which was a little weird to begin with, since it was the only constraint they implemented).
Assignee | ||
Comment 22•9 years ago
|
||
smacleod force-pushed my broken review series which seems to have fixed it, yay! So lets use that. I'll try to remove the new redundant one.
Assignee | ||
Comment 23•9 years ago
|
||
I spoke too soon bug 1174353 comment 9.
Assignee | ||
Comment 24•9 years ago
|
||
OK so good news is the diffs are available in bz://1173255/jib but I wouldn't touch anything there, or you'll likely end up blocked by a busted draft like I am and have to log out of Review board to see the diffs. We should therefore probably put further review comments in bz://1173255/jib2
Assignee | ||
Updated•9 years ago
|
Attachment #8617757 -
Attachment description: MozReview Request: Bug 1173255 - deviceId prep + move facingMode constraint → MozReview Request: Bug 1173255 - move facingMode constraint. r=jesup
Attachment #8617757 -
Attachment is obsolete: false
Attachment #8617757 -
Flags: review+
Assignee | ||
Comment 25•9 years ago
|
||
Comment on attachment 8617757 [details] MozReview Request: Bug 1173255 - move facingMode constraint. r=jesup Bug 1173255 - move facingMode constraint. r=jesup
Assignee | ||
Comment 26•9 years ago
|
||
Comment on attachment 8617758 [details] MozReview Request: Bug 1173255 - move PMedia from PBackground to PContent. r=jesup Bug 1173255 - move PMedia from PBackground to PContent. r=jesup
Attachment #8617758 -
Attachment description: MozReview Request: Bug 1173255 - move PMedia from PBackground to PContent → MozReview Request: Bug 1173255 - move PMedia from PBackground to PContent. r=jesup
Attachment #8617758 -
Attachment is obsolete: false
Attachment #8617758 -
Flags: review+
Assignee | ||
Comment 27•9 years ago
|
||
Comment on attachment 8617759 [details] MozReview Request: Bug 1173255 - refactor getOriginKey to main Bug 1173255 - refactor getOriginKey to main
Attachment #8617759 -
Attachment is obsolete: false
Attachment #8617759 -
Flags: review+
Assignee | ||
Comment 28•9 years ago
|
||
Comment on attachment 8617760 [details] MozReview Request: Bug 1173255 - cleanup runnables and task in MediaManager Bug 1173255 - cleanup runnables and task in MediaManager
Attachment #8617760 -
Attachment is obsolete: false
Attachment #8617760 -
Flags: review+
Assignee | ||
Comment 29•9 years ago
|
||
Comment on attachment 8617761 [details] MozReview Request: Bug 1173255 - compensate for PContent being useless in non-e10s Bug 1173255 - compensate for PContent being useless in non-e10s
Attachment #8617761 -
Attachment is obsolete: false
Attachment #8617761 -
Flags: review+
Assignee | ||
Comment 30•9 years ago
|
||
Bug 1173255 - incorporate feedback. r=jesup
Attachment #8622792 -
Flags: review?(rjesup)
Assignee | ||
Updated•9 years ago
|
Attachment #8621908 -
Attachment is obsolete: true
Assignee | ||
Updated•9 years ago
|
Attachment #8621909 -
Attachment is obsolete: true
Assignee | ||
Updated•9 years ago
|
Attachment #8621910 -
Attachment is obsolete: true
Assignee | ||
Updated•9 years ago
|
Attachment #8621911 -
Attachment is obsolete: true
Assignee | ||
Updated•9 years ago
|
Attachment #8621912 -
Attachment is obsolete: true
Assignee | ||
Updated•9 years ago
|
Attachment #8621913 -
Attachment is obsolete: true
Attachment #8621913 -
Flags: review?(rjesup)
Assignee | ||
Comment 31•9 years ago
|
||
Review Board has been fixed (Bug 1174353) so updated review request. Still chasing a leak.
Comment 32•9 years ago
|
||
The UI of reviewboard is confusing - what exactly am I supposed to be reviewing? Is it the "incorporate feedback" patch? If so, is it both revisions, or just the last one?
Flags: needinfo?(jib)
Comment 33•9 years ago
|
||
Comment on attachment 8622792 [details] MozReview Request: Bug 1173255 - incorporate feedback. r=jesup https://reviewboard.mozilla.org/r/11005/#review9819 Ship It!
Attachment #8622792 -
Flags: review?(rjesup) → review+
Assignee | ||
Comment 34•9 years ago
|
||
(In reply to Randell Jesup [:jesup] from comment #32) > The UI of reviewboard is confusing - what exactly am I supposed to be > reviewing? Review board lets you cut the cake both ways. It treats the 6 patches individually, but also keeps track of changes between pushes to mozReview (Rev 1 vs 2). > Is it the "incorporate feedback" patch? If so, is it both > revisions, or just the last one? Yes, I put new changes in that patch. Both revisions: https://reviewboard.mozilla.org/r/11005/diff/2 But I also updated the first two patches from feedback (see comment 20 and comment 21): https://reviewboard.mozilla.org/r/10715/diff/1-2 https://reviewboard.mozilla.org/r/10717/diff/1-2 Note that the second diff pulls in stuff from being rebased. I just removed media::Child::Get(); Reference: /r/10715 - Bug 1173255 - move facingMode constraint. r=jesup /r/10717 - Bug 1173255 - move PMedia from PBackground to PContent. r=jesup /r/10719 - Bug 1173255 - refactor getOriginKey to main /r/10721 - Bug 1173255 - cleanup runnables and task in MediaManager /r/10723 - Bug 1173255 - compensate for PContent being useless in non-e10s /r/11005 - Bug 1173255 - incorporate feedback. r=jesup
Flags: needinfo?(jib)
Assignee | ||
Comment 35•9 years ago
|
||
Comment on attachment 8617757 [details] MozReview Request: Bug 1173255 - move facingMode constraint. r=jesup Bug 1173255 - move facingMode constraint. r=jesup
Assignee | ||
Comment 36•9 years ago
|
||
Comment on attachment 8617758 [details] MozReview Request: Bug 1173255 - move PMedia from PBackground to PContent. r=jesup Bug 1173255 - move PMedia from PBackground to PContent. r=jesup
Assignee | ||
Comment 37•9 years ago
|
||
Comment on attachment 8617759 [details] MozReview Request: Bug 1173255 - refactor getOriginKey to main Bug 1173255 - refactor getOriginKey to main
Assignee | ||
Comment 38•9 years ago
|
||
Comment on attachment 8617760 [details] MozReview Request: Bug 1173255 - cleanup runnables and task in MediaManager Bug 1173255 - cleanup runnables and task in MediaManager
Assignee | ||
Comment 39•9 years ago
|
||
Comment on attachment 8617761 [details] MozReview Request: Bug 1173255 - compensate for PContent being useless in non-e10s Bug 1173255 - compensate for PContent being useless in non-e10s
Assignee | ||
Comment 40•9 years ago
|
||
Comment on attachment 8622792 [details] MozReview Request: Bug 1173255 - incorporate feedback. r=jesup Bug 1173255 - incorporate feedback. r=jesup
Attachment #8622792 -
Flags: review+ → review?(rjesup)
Comment 42•9 years ago
|
||
Comment on attachment 8622792 [details] MozReview Request: Bug 1173255 - incorporate feedback. r=jesup Reviewboard didn't give me the option to Ship It, and when I published the review it game me "Something went wrong"... so doing it manually
Attachment #8622792 -
Flags: review?(rjesup) → review+
Assignee | ||
Comment 43•9 years ago
|
||
Comment on attachment 8617759 [details] MozReview Request: Bug 1173255 - refactor getOriginKey to main Bug 1173255 - refactor getOriginKey to main
Assignee | ||
Comment 44•9 years ago
|
||
Comment on attachment 8617760 [details] MozReview Request: Bug 1173255 - cleanup runnables and task in MediaManager Bug 1173255 - cleanup runnables and task in MediaManager
Assignee | ||
Comment 45•9 years ago
|
||
Comment on attachment 8617761 [details] MozReview Request: Bug 1173255 - compensate for PContent being useless in non-e10s Bug 1173255 - compensate for PContent being useless in non-e10s
Assignee | ||
Comment 46•9 years ago
|
||
Comment on attachment 8622792 [details] MozReview Request: Bug 1173255 - incorporate feedback. r=jesup Bug 1173255 - incorporate feedback. r=jesup
Attachment #8622792 -
Flags: review+ → review?(rjesup)
Assignee | ||
Comment 47•9 years ago
|
||
Leak fixed. Embarrassing. https://treeherder.mozilla.org/#/jobs?repo=try&revision=34ecd9839f6b Doing a full try (in review board) just in case.
Assignee | ||
Comment 48•9 years ago
|
||
Comment on attachment 8617757 [details] MozReview Request: Bug 1173255 - move facingMode constraint. r=jesup Bug 1173255 - move facingMode constraint. r=jesup
Assignee | ||
Comment 49•9 years ago
|
||
Comment on attachment 8617758 [details] MozReview Request: Bug 1173255 - move PMedia from PBackground to PContent. r=jesup Bug 1173255 - move PMedia from PBackground to PContent. r=jesup
Assignee | ||
Comment 50•9 years ago
|
||
Comment on attachment 8617759 [details] MozReview Request: Bug 1173255 - refactor getOriginKey to main Bug 1173255 - refactor getOriginKey to main
Assignee | ||
Comment 51•9 years ago
|
||
Comment on attachment 8617760 [details] MozReview Request: Bug 1173255 - cleanup runnables and task in MediaManager Bug 1173255 - cleanup runnables and task in MediaManager
Assignee | ||
Comment 52•9 years ago
|
||
Comment on attachment 8617761 [details] MozReview Request: Bug 1173255 - compensate for PContent being useless in non-e10s Bug 1173255 - compensate for PContent being useless in non-e10s
Assignee | ||
Comment 53•9 years ago
|
||
Comment on attachment 8622792 [details] MozReview Request: Bug 1173255 - incorporate feedback. r=jesup Bug 1173255 - incorporate feedback. r=jesup
Assignee | ||
Comment 54•9 years ago
|
||
Rebased.
Comment 55•9 years ago
|
||
https://reviewboard.mozilla.org/r/10713/#review10131 ship it... if it lets me say so
Comment 56•9 years ago
|
||
Comment on attachment 8622792 [details] MozReview Request: Bug 1173255 - incorporate feedback. r=jesup Of course it didn't give me the option to r+ it, so doing it manually
Attachment #8622792 -
Flags: review?(rjesup) → review+
Assignee | ||
Updated•9 years ago
|
Keywords: checkin-needed
Assignee | ||
Comment 57•9 years ago
|
||
Green try all - https://treeherder.mozilla.org/#/jobs?repo=try&revision=70440ab92ab3
Comment 58•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/53063473eb54
Keywords: checkin-needed
Comment 59•9 years ago
|
||
This patch added a new method in MediaChild.h which was correctly annotated as 'override'. However, the same class had a preexisting method that could (should) have been annotated as 'override' but was not yet. When clang 3.6 & newer sees inconsistent override usage within a class, it warns, and warnings are fatal in this directory, so this caused local build bustage for anyone with clang 3.6+. I pushed a followup to add the missing 'override' keyword, with blanket r+ that ehsan granted me for fixes of this sort over in bug 1126447 comment 2: https://hg.mozilla.org/integration/mozilla-inbound/rev/edbf66bef7d7
Comment 60•9 years ago
|
||
> so this caused local build bustage for anyone with clang 3.6+.
(er, a local build warning, which is bustage if you're building with --enable-warnings-as-errors)
Assignee | ||
Comment 61•9 years ago
|
||
Thanks Daniel!
Comment 62•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/53063473eb54 https://hg.mozilla.org/mozilla-central/rev/edbf66bef7d7
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
Blocks: 1213738
You need to log in
before you can comment on or make changes to this bug.
Description
•