Commit Graph

314 Commits

Author SHA1 Message Date
Boris Zbarsky
04324f18ad Bug 1424474 part 3. Make sure that we only pass non-system subject principals to setters/methods that later use that principal for loading security checks. r=kmag
MozReview-Commit-ID: IjUEG5xwn5
2017-12-20 17:43:18 -05:00
Narcis Beleuzu
edb8ba34eb Backed out 2 changesets (bug 1424474) for mochitest failures on test_bug494328.html r=backout on a CLOSED TREE
Backed out changeset 39d5991f02ba (bug 1424474)
Backed out changeset da3dec2fce06 (bug 1424474)
2017-12-21 02:55:27 +02:00
Boris Zbarsky
a2696c3c8a Bug 1424474 part 2. Make sure that we only pass non-system subject principals to setters/methods that later use that principal for loading security checks. r=kmag 2017-12-20 17:43:18 -05:00
Gerald Squelart
16a9a0b9d7 Bug 1407810 - Implement HTMLMediaElement::Moz{Enable,Request}DebugLog - r=jwwang
MozReview-Commit-ID: 7Hhy6qBVjDk

--HG--
extra : rebase_source : 5eb33db2c13a4add3bef693af1e558b256732599
2017-10-16 16:18:58 +11:00
Boris Zbarsky
887ce3941a Bug 1419270 part 2. Use getter or setter specific NeedsSubjectPrincipal annotations more. r=qdot
MozReview-Commit-ID: KBwjFh3TMUg
2017-12-05 16:03:18 -05:00
Alastor Wu
258e1d56df Bug 1420488 - part1 : bless media if media has started playing before. r=jwwang
If the media has started playing before, bless it and it would always be allowed
to autoplay.

MozReview-Commit-ID: 4GqMARLXULU

--HG--
extra : rebase_source : 2fdb3937156147755f8e387b1d84311ae1d37ce4
2017-11-29 18:59:56 +08:00
Sebastian Hengst
c4e3d3a858 Backed out 2 changesets (bug 1420488) for eslint failures in toolkit/content/tests/browser/browser_autoplay_policy_play_twice.js. r=backout
Backed out changeset 92bd0fcb67d5 (bug 1420488)
Backed out changeset 0f211029517c (bug 1420488)
2017-11-29 17:31:28 +02:00
Alastor Wu
28c25979d7 Bug 1420488 - part1 : bless media if media has started playing before. r=jwwang
If the media has started playing before, bless it and it would always be allowed
to autoplay.

MozReview-Commit-ID: 28X4TmG25aJ

--HG--
extra : rebase_source : 3fd7cb16da9e7f925ad7020fb74c48537e08a996
2017-11-29 18:05:56 +08:00
Alastor Wu
62e836ef58 Bug 1420192 - when disable autoplay, allow script calls play() once user triggered load() or seek(). r=jwwang
This patch is mainly reverting the changing of bug1382574 part3, but not all the same.

Since youtube would call load() when user clicks to play, and then call play()
later. For the old pref (checking user-input-play), we should still allow the
following play() even it's not triggered via user input. It's also same for
seeking, Youtube would call play() after seeking completed.

In this patch, we would allow the script-calling once play() if user has called load()
or seek() before that.

MozReview-Commit-ID: 1UcxRCVfhnR

--HG--
extra : rebase_source : c72212ebf29ea624128a8190dab67e1197f1f198
2017-11-27 10:55:02 +08:00
Kris Maglione
1c66345e09 Bug 1415352: Part 1a - Pass subject principal through to ParseAttribute. r=bz
This is necessary in order to parse style attributes using the subject
principal of the caller, rather than defaulting to the page principal.

MozReview-Commit-ID: GIshajQ28la

--HG--
extra : rebase_source : 5dba46f61d70ec647cae16383b62961ac72d2f47
2017-11-01 20:35:52 -07:00
Alastor Wu
fe30dc5702 Bug 1382574 - part3 : remove HTMLMediaElement::mHasUserInteraction. r=jwwang
We won't need to check the whether the media element is interacted with user for
autoplay anymore.

MozReview-Commit-ID: 2tll9LtGyVR

--HG--
extra : rebase_source : 0047f482c2932e7063fc556ce8c306ff276efbfd
2017-11-22 00:33:23 +08:00
Alastor Wu
3a53368682 Bug 1382574 - part2 : remove HTMLMediaElement::GetHasUserInteraction(). r=bechen
MozReview-Commit-ID: 3MaumQvcR1q

--HG--
extra : rebase_source : d3dedf365b002680531ffd5e99fc0c0f66547e0f
2017-11-22 00:33:20 +08:00
Timothy Guan-tin Chien
93fb9c8b32 Bug 1327097 - Part III, Trap mouse/touch/pointer events in audio/video element, r=smaug
This patch implements HTMLMediaElement::GetEventTargetParent and set
aVisitor.mCanHandle to false to mouse/touch/pointer events, when
the media control is present. This tells the event dispatcher that
these events are supposed to be handled exclusively by the
videocontrol binding within the media element, and should not
dispatch nor consumed by the content.

MozReview-Commit-ID: BXWZX9SYsuC

--HG--
extra : rebase_source : 5d6633a2e1a456d2d619b6f68498065d94c68c40
2017-11-17 11:07:12 +08:00
JW Wang
1f62c1d92b Bug 1417869. P3 - pass descriptive messages to NetworkError(). r=jya
MozReview-Commit-ID: 6yaFJvXG3g8

--HG--
extra : rebase_source : 2d1c851098be7eb880a01432c504c6db96d86756
extra : source : a30f9699f49687b23d4ccf955d7a0af8ce0c7653
2017-11-17 11:07:30 +08:00
JW Wang
232dbce4f6 Bug 1417869. P1 - show more descriptive messages for MEDIA_ERR_SRC_NOT_SUPPORTED when SelectResource() fails. r=jya
MozReview-Commit-ID: CySbHaJCaC5

--HG--
extra : rebase_source : fa907c6347b7c65e0b3196bbd370e7154307e645
extra : source : a393280da765a4602aa1486db8f891cf0fe188ee
2017-11-17 10:32:41 +08:00
Gurzau Raul
d274011903 Backed out 3 changesets (bug 1327097) for eslint failures toolkit/content/tests/widgets/test_videocontrols.html:228 r=backout on a CLOSED TREE
Backed out changeset 09c0a4c56c78 (bug 1327097)
Backed out changeset c0c5ee67b3ef (bug 1327097)
Backed out changeset 82a6e4dc5da7 (bug 1327097)
2017-11-16 14:23:20 +02:00
Timothy Guan-tin Chien
59cbfa1e3d Bug 1327097 - Part III, Trap mouse/touch/pointer events in audio/video element, r=smaug
This patch implements HTMLMediaElement::GetEventTargetParent and set
aVisitor.mCanHandle to false to mouse/touch/pointer events, when
the media control is present. This tells the event dispatcher that
these events are supposed to be handled exclusively by the
videocontrol binding within the media element, and should not
dispatch nor consumed by the content.

MozReview-Commit-ID: BXWZX9SYsuC

--HG--
extra : rebase_source : e9922ac6064c953ee233d6829e84bc7828518b43
2017-11-16 17:06:36 +08:00
Alastor Wu
147fdb715c Bug 1336400 - part3 : move all autoplay checks to CanActivateAutoplay(). r=jwwang
1. move all checks to CanActivateAutoplay()
2. don't cache the pref's value in advance, it might cause wrong result
   if user changes pref after media was binded to tree.

MozReview-Commit-ID: 3BeOeaq9wGa

--HG--
extra : rebase_source : 74085dce2852d0a608f6455bd0b9337b8223fa20
2017-11-13 18:43:55 +08:00
Alastor Wu
3afdf8f65d Bug 1336400 - part2 : remove MozAutoplayEnabled attribute from HTMLMediaElement. r=smaug
MozReview-Commit-ID: FK5F2zkXRjT

--HG--
extra : rebase_source : 73620e7323e938e47e69b996e2c8aa2fc1e549f7
2017-11-13 18:42:47 +08:00
Chris Pearce
8bddf869cf Bug 1416663 - Move Gecko/HTMLMediaElement specific stuff out of VideoFrameContainer. r=jwwang
MozReview-Commit-ID: 4giNMi8qsTZ

--HG--
extra : rebase_source : 0f9e33c3704aa3925635d2290a5e18f9eebd2b74
2017-11-13 16:09:23 +13:00
James Cheng
91159e3d56 Bug 1416141 - Remove Telemetry VIDEO_EME_PLAY_SUCCESS. r=kikuo
MozReview-Commit-ID: BtiD2tUmbE9

--HG--
extra : rebase_source : 56b23930ea492c67f8c5fbc2a56d77dc7b4cf4af
2017-11-10 14:49:37 +08:00
Kilik Kuo
3f546c6285 Bug 1395922 - [P3] Make HTMLMediaElement::SetMediaKeys asynchronously. r=cpearce
MozReview-Commit-ID: 5M8CTHMsmIh

--HG--
extra : rebase_source : daec666760097b73a7dfad2960881173127eb69e
2017-11-03 20:14:17 +08:00
Kilik Kuo
87d6236019 Bug 1395922 - [P1] Refactor code and move them into specific functions. r=cpearce
MozReview-Commit-ID: 9lwRH66Wllp

--HG--
extra : rebase_source : 8202008d996adb19547a46f051427053c1d48193
2017-11-03 14:35:32 +08:00
Csoregi Natalia
978711ce7c Merge autoland to mozilla-central r=merge a=merge 2017-11-06 12:44:18 +02:00
Csoregi Natalia
6bf19d4921 Backed out 6 changesets (bug 1395922) for failing Media tests test_eme_sample_groups_playback.html and test_eme_sample_groups_playback.html r=backout a=backout
Backed out changeset f856af63682e (bug 1395922)
Backed out changeset f59a7e727f39 (bug 1395922)
Backed out changeset 9cd31c6a8e2c (bug 1395922)
Backed out changeset d46f952f94f8 (bug 1395922)
Backed out changeset f786d928b1e0 (bug 1395922)
Backed out changeset bacda0f99f71 (bug 1395922)
2017-11-06 12:34:02 +02:00
Chris Pearce
ed7f41cdf7 Bug 1414680 - Make MediaDecoderOwner::DispatchAsyncEvent() return void. r=jwwang
The return value is unchecked in MediaDecoder, and we only ever returned
NS_OK anyway. And we if the dispatch fails, we can't really do anything;
dispatching an "error" event probably won't work.

MozReview-Commit-ID: 67K6Mjft6tY

--HG--
extra : rebase_source : ad644e8b97fc11488983bc05e18c9941b3c5b062
2017-11-05 09:12:44 +01:00
Chris Pearce
d716365ee0 Bug 1414680 - Remove IsActive() and IsHidden() from MediaDecoderOwner as they're unused by MediaDecoder. r=jwwang
MozReview-Commit-ID: 7NaPBmQJVQC

--HG--
extra : rebase_source : 0cfe05a1aefb23a4070b2855569110e7a4ab6b2c
2017-11-05 09:11:09 +01:00
JW Wang
7fd4aabd85 Bug 1414121. P1 - let mozDumpDebugInfo() return a promise. r=bz
MozReview-Commit-ID: Klfr3AYdSCG

--HG--
extra : rebase_source : 9f2c89306a274b1d563f53413df668d9b11c7b90
extra : source : 93969bf54c26fd097807f1280db5b6deb20c01db
2017-11-03 10:33:27 +08:00
Kilik Kuo
55be93073e Bug 1395922 - [P3] Make HTMLMediaElement::SetMediaKeys asynchronously. r=cpearce
MozReview-Commit-ID: 5M8CTHMsmIh

--HG--
extra : rebase_source : c1b186f6da354b79036dea7175960e1e33a2eaae
2017-11-03 20:14:17 +08:00
Kilik Kuo
83013776bf Bug 1395922 - [P1] Refactor code and move them into specific functions. r=cpearce
MozReview-Commit-ID: 9lwRH66Wllp

--HG--
extra : rebase_source : 8126fe384c7a6f1c07bdb438507823527f14a4bf
2017-11-03 14:35:32 +08:00
bechen@mozilla.com
35226e578f Bug 1183495 - part2: Remove mozSrcObject in MediaElement. r=jwwang
MozReview-Commit-ID: 2bmYnu2RDdt

--HG--
extra : rebase_source : e6abd85f933463d2dfe73528c63be8736d2a1577
2017-10-20 11:23:07 +08:00
JW Wang
ae3c66bf3c Bug 1409270. P4 - remove mWatchManager. r=gerald
MozReview-Commit-ID: G45ezz1o2x8

--HG--
extra : rebase_source : bbce38d798f908a97d44a698a87f8cee041bdbb5
2017-10-17 15:10:23 +08:00
JW Wang
99ae0ae477 Bug 1409270. P1 - remove Watchable<> from mDownloadSuspendedByCache. r=gerald
MozReview-Commit-ID: K0hhlOKN399

--HG--
extra : rebase_source : 22aa4e513f91b86dffd436e0efbb275ee1fb44bb
2017-10-17 14:46:15 +08:00
JW Wang
e66b8fb19a Bug 1409263. P2 - remove Watchable<> from HTMLMediaElement::mReadyState. r=gerald
MozReview-Commit-ID: EYXY7FDfYvd

--HG--
extra : rebase_source : 188f81254eae6ab94a46b5c956b3b95cb5a3b16e
2017-10-17 14:28:56 +08:00
JW Wang
03ca7715a5 Bug 1407148 - add logs for debugging crashes. r=gerald
MozReview-Commit-ID: FgDbl2tCbEE

--HG--
extra : rebase_source : d94d5783a2a08022d8ef89f14f8f35c99ee124fe
extra : source : 9b4dfa4ccd83c2a933f65d422641c5a9c018ce5c
2017-10-12 10:46:13 +08:00
JW Wang
1a47dd3c0c Bug 1397708 - remove HTMLMediaElement::mBegun. See comment 12 for the root cause. r=cpearce
When network state is changed to IDLE, mBegun is also set to false. [1]
And then when HTMLMediaElement::DownloadResumed(false) is called, network
state is not changed to LOADING for mBegun is false [2]. This prevents us
from firing 'progress' events for the network state is IDLE.

See comment 12 for more details.

[1] http://searchfox.org/mozilla-central/rev/b53e29293c9e9a2905f4849f4e3c415e2013f0cb/dom/html/HTMLMediaElement.cpp#6077
[2] http://searchfox.org/mozilla-central/rev/b53e29293c9e9a2905f4849f4e3c415e2013f0cb/dom/html/HTMLMediaElement.cpp#5673

MozReview-Commit-ID: DOfqKZXAqaz

--HG--
extra : rebase_source : 881b632447d4a78461c235fffad37595f44cc095
extra : source : 2c01d77d3a7e605bf060e17d41afa86ee0f46396
2017-10-10 07:04:18 +08:00
Kris Maglione
ca83a2c304 Bug 1406278: Part 5a - Use subject principal as triggering principal in <audio>/<video> "src" attribute. r=bz
MozReview-Commit-ID: A1JixlTeZGq

--HG--
extra : rebase_source : 011984908aaacf0b90ea6e67c265dcce7b1779c4
2017-10-05 14:47:09 -07:00
Kris Maglione
4275cd1039 Bug 1406278: Part 1 - Pass subject principal to SetAttribute and friends. r=bz
In order to tailor certain security checks to the caller that is attempting to
load a particular piece of content, we need to be able to attach an
appropriate triggering principal to the corresponding requests. Since most
HTML content is loaded based on attribute values, that means capturing the
subject principal of the caller who sets those attributes, which means making
it available to AfterSetAttr hooks.

MozReview-Commit-ID: BMDL2Uepg0X

--HG--
extra : rebase_source : 25e438c243700a9368c393e40e3a6002d968d6c8
2017-10-09 14:33:38 -07:00
Nicholas Nethercote
d225f7151b Bug 1400460 - Rename nsIAtom as nsAtom. r=hiro.
(Path is actually r=froydnj.)

Bug 1400459 devirtualized nsIAtom so that it is no longer a subclass of
nsISupports. This means that nsAtom is now a better name for it than nsIAtom.

MozReview-Commit-ID: 91U22X2NydP

--HG--
rename : xpcom/ds/nsIAtom.h => xpcom/ds/nsAtom.h
extra : rebase_source : ac3e904a21b8b48e74534fff964f1623ee937c67
2017-10-03 09:05:19 +11:00
bechen@mozilla.com
d262781541 Bug 1324883 - part2: Once a MediaElement receive document unload event, remove all MediaElements in gElementTable with the same uri. r=jwwang
MozReview-Commit-ID: 7Z0ouKsebp8

--HG--
extra : rebase_source : ffb52a12f9a31280dc3be1093b73099394fe7a17
2017-10-03 12:07:13 +08:00
bechen@mozilla.com
b6e091b3ea Bug 1324883 - Shutdow the decoder when receiving nsIWebProgressListener with flag LOAD_RELOAD_BYPASS_PROXY_AND_CACHE in docshell. r=jwwang,smaug
We register the nsIWebProgressListener at the root docshell(GetSameTypeRootTreeItem) to handle video element embedded in iframe.

MozReview-Commit-ID: D4CavLDAnKD

--HG--
extra : rebase_source : 93032297272bbfc8570dce0c8c13ea9f0d45f7a8
2017-10-03 12:07:09 +08:00
Catalin Badea
393fe4f3b1 Bug 1380621 - Change the order of member variables in HTMLMediaElement. r=cpearce
This reduces the size of the object by avoiding memory alignment padding.
2017-09-06 11:20:00 +01:00
Catalin Badea
42e06700b2 Bug 1380621 - Use node pointer for HTMLMediaElement::mSourcePointer. r=cpearce
Using a pointer instead of an index helps us avoid some costly
operations such as IndexOf and GetChildAt with the upcoming changes from
bug 651120.
2017-09-06 11:16:23 +01:00
Alastor Wu
24213ab2e7 Bug 1395359 - make sure all references value are set before we use them. r=cpearce
1. since setVolume would trigger updateWakelock(), we should set |mOuter| before that.
2. move outer as required parameter in its constructor.
3. should init all member varaibles which would be referenced by wakeLockWrapper before its initialization.

MozReview-Commit-ID: H9A3aCKp6eT

--HG--
extra : rebase_source : 5ba1c78b305cc0db125b43c29bff1389f3e9ddb1
2017-09-04 11:05:15 +08:00
Chris Pearce
50bc88ccf9 Bug 1395021 - Fix up includes to account for StreamTracks.h not being indirectly included in so many places. r=jwwang
With MediaInfo.h no longer including StreamTracks.h, some things that include
MediaInfo.h now use things that are no longer included. This patch adds the
includes back in, so the build works again.

MozReview-Commit-ID: INpH3vnBAmk

--HG--
extra : rebase_source : 8b91a999c71242c1eb5030f86c2a1f1c85d5fb27
2017-08-30 15:38:56 +12:00
Alastor Wu
ac5a951f4a Bug 1373888 - part6 : only release the wakelock when video is paused. r=cpearce
Wakelock would automatically handle the lock/unlock by listening "hidden/visible", we
don't need to handle it in HTMLVideoElement.

MozReview-Commit-ID: AcOwR2nqm6L

--HG--
extra : rebase_source : 8f96b8cd908332be33ed3289dd288990da56c1c9
2017-08-29 15:25:57 +08:00
Alastor Wu
5aaf1c6ce7 Bug 1373888 - part5 : only request audio wake lock when it's audible. r=cpearce
No need to prevent sleeping for non-audible audio.

MozReview-Commit-ID: 6p3azSUWTU2

--HG--
extra : rebase_source : 89ff9d1753ac4a23269ec100920e18020ab5aafb
2017-08-29 15:25:44 +08:00
Alastor Wu
71ad2fdb83 Bug 1373888 - part2 : remove the timer which was used for b2g. r=cpearce
The timer was added for the b2g issue, now we can remove it.

MozReview-Commit-ID: BNjIghImCzC

--HG--
extra : rebase_source : c5490d417b2d40619eb7092dfc21b19a99982a1c
2017-08-29 10:54:25 +08:00
Alastor Wu
f570c3c5ec Bug 1373888 - part1 : remove useless function. r=cpearce,smaug
These functions didn't be used by anyone, remove them.

MozReview-Commit-ID: BLj8GsVp1gR

--HG--
extra : rebase_source : 1b7eee86c62314401c2374a2979ba2a42fda2490
2017-08-29 10:54:18 +08:00
JW Wang
f8f989dd93 Bug 1394313 - replace use of nsAutoPtr with UniquePtr in MediaDecoderOwner.h. r=cpearce
MozReview-Commit-ID: 49lyvMzg7oY

--HG--
extra : rebase_source : b83cd03b0026c73d0293ef937a3c2544349f464d
2017-08-28 14:10:35 +08:00