Граф коммитов

232 Коммитов

Автор SHA1 Сообщение Дата
Ryan Hunt 00e98538aa Bug 1523969 part 6 - Move method definition inline comments to new line in 'dom/'. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D21106

--HG--
extra : rebase_source : ea3f51c2c11247114deccbc86e90fb02b8a97257
2019-02-25 16:05:29 -06:00
Sylvestre Ledru 804b8b8883 Bug 1204606 - Reformat of dom/media r=jya
# skip-blame

Differential Revision: https://phabricator.services.mozilla.com/D12251

--HG--
extra : moz-landing-system : lando
2018-11-19 13:25:37 +00:00
Jean-Yves Avenard 5957f22482 Bug 1492365 - Prevent arithmetic overflow. r=gerald
Should mStreamLength be > 2^32, we could have overflowed leading to false positive test.

Differential Revision: https://phabricator.services.mozilla.com/D6235

--HG--
extra : moz-landing-system : lando
2018-09-19 08:34:15 +00:00
Jean-Yves Avenard 8768e0b175 Bug 1491132 - Clamp cache reads to content size. r=gerald
Prior bug 1416085, reads were clamped to the content's duration (if known). It appears that the new code relied on MediaCacheReadBlockFromCache to properly account for the end of content.

However, this was not the case, the MediaCache always reads (and write) one full block at a time regardles of the size requested (a block is 32768 bytes).

Rather than clamping in the Read() method as it used to be, we clamp in ReadBlockFromCache as such safety will benefit other callers that would have otherwise also returned garbage reads.

Differential Revision: https://phabricator.services.mozilla.com/D5964

--HG--
extra : moz-landing-system : lando
2018-09-17 17:41:31 +00:00
Chris Peterson 2afd829d0f Bug 1469769 - Part 6: Replace non-failing NS_NOTREACHED with MOZ_ASSERT_UNREACHABLE. r=froydnj
This patch is an automatic replacement of s/NS_NOTREACHED/MOZ_ASSERT_UNREACHABLE/. Reindenting long lines and whitespace fixups follow in patch 6b.

MozReview-Commit-ID: 5UQVHElSpCr

--HG--
extra : rebase_source : 4c1b2fc32b269342f07639266b64941e2270e9c4
extra : source : 907543f6eae716f23a6de52b1ffb1c82908d158a
2018-06-17 22:43:11 -07:00
Andi-Bogdan Postelnicu 60732a90a5 Bug 1453795 - DOM/Media - Initialize member fields in classes/ structures. r=jyavenard
--HG--
extra : rebase_source : 0c785260497fadf98cf3cff8b9fcae8ea699c2c1
2018-06-15 10:25:02 +03:00
Jean-Yves Avenard 15d6ce1610 Bug 1450607 - P3. Remove unused argument. r=gerald
MozReview-Commit-ID: 6NU9BLJi6kl

--HG--
extra : rebase_source : a9fca396ca5c353be979196dde4b1b02137cc9ca
2018-05-24 17:38:02 +02:00
Jean-Yves Avenard f1f3bc2758 Bug 1450607 - P2. Synchronously seek to prepare for resuming following stop request. r=gerald
Bug 1415090 attempted to remove the need to access from the MediaResource members of MediaCacheStream from the main thread.
However, by doing so the logic flow for resuming the channel changed from a synchronous access to an asynchronous one.
This changed some assumptions and allowed the ChannelMediaResource to be used before the Seek call completed.

For now, re-add a cross thread access to the MediaCacheStream. A more elegant fix will be worked on in bug 1464045

MozReview-Commit-ID: 2xBTjDEqrkI

--HG--
extra : rebase_source : 0aa3cfcb8371d5147cbed746d9200dd22df4821b
2018-05-24 14:36:58 +02:00
Jean-Yves Avenard 1d73f87b45 Bug 1450607 - P1. Fix constness. r=gerald
MozReview-Commit-ID: CeftB0qmzTf

--HG--
extra : rebase_source : 7d8a75754990fd6cab1ad8f620d5d5675c46ea88
2018-05-23 21:27:31 +02:00
Nicholas Nethercote 51f2b494ea Bug 1448222 - Remove MediaPrefs. r=jya
This patch converts all the prefs in MediaPrefs to the new StaticPrefs system.

Note that the "media.wmf.skip-blacklist" pref was present in both MediaPrefs
and gfxPrefs. The copy in MediaPrefs was never used; this explains why this
patch does not add an entry for it to StaticPrefList.h.

Note also that the patch removes themedia.rust.mp4parser pref, because it's
unused.

MozReview-Commit-ID: IfHP37NbIjY

--HG--
extra : rebase_source : df84ea813b7c366d7be663c696891325610149c8
2018-03-20 09:48:56 +11:00
Sebastian Hengst 0819f35e51 Backed out 4 changesets (bug 525063) on request from Andi. a=backout
Backed out changeset 516c4fb1e4b8 (bug 525063)
Backed out changeset 6ff8aaef2866 (bug 525063)
Backed out changeset bf13e4103150 (bug 525063)
Backed out changeset d7d2f08e051c (bug 525063)
2018-04-13 16:01:28 +03:00
Tristan Bourvon a3a77c0312 Bug 525063 - Initialize uninitialized class attributes in m-c. r=ehsan 2018-04-10 21:11:02 +02:00
JW Wang 1192c9ff4d Bug 1416084. P2 - wake up readers when download is suspended. r=bechen,gerald
It is possible that download is suspended after all bytes are received but
before OnStopRequest is notified. In that case, we will fail to wake up the
readers waiting to read the partial block and cause bug 1412737 comment 30.

MozReview-Commit-ID: GUk4lXO6Upk

--HG--
extra : rebase_source : 2fc277fa54842e434c3f69a474c44fb4c58c976e
2018-01-15 10:25:11 +08:00
JW Wang 0ac7a8be1f Bug 1416084. P1 - reapply bug 1412737 P4: wake up readers only when we have blocks committed to the cache. r=bechen,gerald
Per bug 1412737 P2 changes, a reader will always read data from the cache or
from the last block in the memory. NotifyDataReceived() will be slightly more
efficient if we don't wake up readers unnecessarily when there are no new blocks
committed to the cache.

MozReview-Commit-ID: Afcy5OOeIk3

--HG--
extra : rebase_source : 64916432081d23234e4cc923c343a9724d6c77db
2018-01-15 10:09:02 +08:00
JW Wang 45984a084a Bug 1428951 - add a getter for MediaCacheStream::GetDebugInfo() to take the cache monitor on the main thread. r=bechen,gerald
MozReview-Commit-ID: 8qkZg0MJsGQ

--HG--
extra : rebase_source : 0ff2f6ebe8908bd5dade301f6c2c52e718a23c47
2018-01-09 10:29:10 +08:00
JW Wang 51a137168e Bug 1427699. P2 - rewrite InitAsCloneInternal() to mimic the case where data is downloaded from a channel. r=gerald
Note we add mClient->CacheClientSuspend() so the network state of the element
is changed to IDLE because we have no channel to fetch data initially.

MozReview-Commit-ID: DgJbMxvJBzH

--HG--
extra : rebase_source : 69a3ef35d4b5faaaa645fabe02246d49aebce22e
extra : source : 61ec40ce378a444ec0f74d474c28b6a9db3aa830
2018-01-05 16:31:39 +08:00
JW Wang 5f75454142 Bug 1428242. P3 - use a non-reentrant monitor. r=bechen,gerald
MozReview-Commit-ID: GCXBHugTLJV

--HG--
extra : rebase_source : 099334dd48b7aa2817578f618d3ab12e1b01cf8f
2018-01-05 10:49:38 +08:00
JW Wang c5fd248bb7 Bug 1428242. P2 - MediaCache::ReadCacheFile() doesn't need to drop the cache monitor. r=bechen,gerald
Since we now never take the lock on the main thread, we can safely do file IO
while holding the lock without blocking the main thread.

This reverts the change of Bug 1354389 P1.

MozReview-Commit-ID: EhEwTjINQIT

--HG--
extra : rebase_source : 7eca1226d53a26025188e01837de645a1c879d7b
2018-01-05 10:48:14 +08:00
JW Wang 66c3598324 Bug 1428242. P1 - assert we always take the MediaCache monitor off the main thread. r=bechen,gerald
MozReview-Commit-ID: 6fxhzTOFaWx

--HG--
extra : rebase_source : ad507e823ed90356e6b1b7452460fa8462240021
extra : intermediate-source : 1dc9fa1ba116ef65fddc076bf5508701d85d788b
extra : source : d5a6e82b6f344c59814c30b950577fd67ee0b7e3
2017-12-20 15:28:52 +08:00
JW Wang fb4b1616ab Bug 1428184 - copy mStreams before iterating the array. r=bechen,gerald
It is bad to modify the array while iterating it.

MozReview-Commit-ID: JbpoRmM7GqP

--HG--
extra : rebase_source : 92523a0741aa6014808b182954f653fce54161fd
2018-01-05 11:34:59 +08:00
JW Wang 3834402eca Bug 1427931. P2 - assert MediaCacheStream::Pin/Unpin is called off the main thread. r=bechen,gerald
MozReview-Commit-ID: 7tanbwvNfEh

--HG--
extra : rebase_source : cac6f3cf525884a280bca20684a8d9ba89716b7d
2018-01-04 10:30:07 +08:00
JW Wang 31fbfceb45 Bug 1427667 - move the call to mMediaCache->ReleaseStream() from the destructor to CloseInternal(). r=bechen,gerald
So we won't need to take the cache monitor on the main thread.

MozReview-Commit-ID: FavZKcfaHn8

--HG--
extra : rebase_source : 8a0483a5db9db3d39dccf110ba363144f5e9b6dd
extra : intermediate-source : 214edc1ef96cc2f8b60a86ce068cb8b0593cb1f7
extra : source : ce13b43e884185a988205d0f3e860cf823458b37
2017-12-19 17:51:51 +08:00
JW Wang 240c0a0c9a Bug 1427666 - MediaCacheStream::InitAsCloneInternal() should notify the client that new data is available. r=bechen,gerald
We should call ChannelMediaResource::CacheClientNotifyDataReceived() no matter
new data is coming from the channel or copied from the original cache stream
so the decoder has a chance to compute 'canplaythrough' and buffer ranges.

MozReview-Commit-ID: I4cLow2VzJg

--HG--
extra : rebase_source : ede936c94a6d728cf6c596863e45aa45d2617d45
2018-01-03 10:33:11 +08:00
JW Wang bb6429d366 Bug 1426578. P5 - offload Init() to another thread. r=bechen,gerald
MozReview-Commit-ID: Fv7eq39GNsk

--HG--
extra : rebase_source : 483cd70c65a4f724b40aaa11eece60b6a2a85e25
extra : source : db2632bf1828721b94bda877bf23bc59d189206e
2017-12-19 17:38:40 +08:00
JW Wang ea7483e4ce Bug 1426578. P4 - offload InitAsClone() to another thread. r=bechen,gerald
MozReview-Commit-ID: H8bQRmkJ8jU

--HG--
extra : rebase_source : a6fd3ec4d48974a36c0eec24503d10258ed5f5d4
extra : source : 2ffac43de24706551d3e183072d4e53c137ecb5f
2017-12-19 17:32:55 +08:00
JW Wang e43ca27ba0 Bug 1426578. P3 - make MediaCacheStream::InitAsClone() infallible. r=bechen,gerald
It must be infallible for there is no way to propagate the error back to the
main thread when part of the init functions run on another thread. It is OK to
clone a stream that ends abnormally as long as we don't copy the error status
of EOS. The cloned stream will open a new channel when necessary.

Note we also copy the partial block from the original stream to get as much
data as possible and thus reducing the chance of reopening the channel.

MozReview-Commit-ID: 37iYQonFdBU

--HG--
extra : rebase_source : 6bb9983bc8d1f2675557a14acf1824dba4a98fff
extra : intermediate-source : a20ff9a873db93c85750bb2af5bf05c27c9da3c3
extra : source : 0763fb0e7b4ed1096e406dadccb3ca698f39b207
2017-12-16 23:50:07 +08:00
JW Wang 1aec590c73 Bug 1426578. P2 - always access MediaCache::mStreams while the cache monitor is held. r=bechen,gerald
Note we offload MediaCache::CloseStreamsForPrivateBrowsing() to another thread
so we don't need to take the cache monitor on the main thread.

MozReview-Commit-ID: 9hYszHZ0OJJ

--HG--
extra : rebase_source : 652b4ca783a52d28b0948e81d7b54ed79094230d
extra : intermediate-source : 46316625deb99585c42026010d994fa22b5b3dca
extra : source : 8c9e8ac739eb347b3b8ba24229cafcf2a3e3c4cd
2017-12-15 11:23:27 +08:00
JW Wang 0c88150fb7 Bug 1426578. P1 - tweak the constructor and init functions of ChannelMediaResource/MediaCacheStream. r=bechen,gerald
We want to init as many members as possible before taking the cache monitor.
This makes it easier to move part of the init functions to another thread.

MozReview-Commit-ID: 6mmO356nCyQ

--HG--
extra : rebase_source : 0e5093e01227e2008200cc1fa02aaac445833614
extra : intermediate-source : 2a6bf63954734d0c6470b425a9a8a77f8a805dc3
extra : source : 782ebf089ec17570650ce1635a591c3a9838d7a3
2017-12-14 16:08:17 +08:00
JW Wang 61603d61fe Bug 1426061. P2 - offload MediaCacheStream::Close() to another thread. r=bechen,gerald
So we won't take the cache lock on the main thread.

MozReview-Commit-ID: KYSB0vonOZ2

--HG--
extra : rebase_source : 142884bb450a5469b2634a676ce2d4f3c1790954
extra : intermediate-source : 0911c55511374cd19719743531c136fc122e4ab0
extra : source : 2f46a7eddea484fc5dec773d9d57896e524e014d
2017-12-15 10:29:29 +08:00
JW Wang 32de19ef80 Bug 1426061. P1 - always access MediaCacheStream::mClosed while holding the lock. r=bechen,gerald
We will offload MediaCacheStream::Close() to another thread and need to access
mClosed off the main thread.

MozReview-Commit-ID: 891rzC8dOON

--HG--
extra : rebase_source : 5cf18c4cdfe32dcc1894d5849b74a16582dcde51
extra : intermediate-source : 77febb3f2ca53cd5bb4834b110a4ff44a21556b0
extra : source : b4513de1038e6413477d09ef531f076ecb3955b3
2017-12-14 16:22:53 +08:00
JW Wang 99bec39793 Bug 1426056. P4 - fix a case where we don't reopen the channel. r=bechen,gerald
In MediaCacheStream::NotifyResume(), it will not reopen the channel if
|mChannelOffset==mStreamLength && 0 <= mSeekTarget < mStreamLength| while we should.

MozReview-Commit-ID: 2knkgy6FEVw

--HG--
extra : rebase_source : 28e7910572bd25d189b942f9961f77ec336dea19
2017-12-19 14:35:25 +08:00
JW Wang d7abdb2b86 Bug 1426056. P3 - assert MediaCacheStream::GetLength() is called off the main thread. r=bechen,gerald
MozReview-Commit-ID: 7L8C4f2Lg3C

--HG--
extra : rebase_source : bfa198778bab4b7e0f39d52b292754c2feeff5ec
extra : intermediate-source : 075391df39fd04af006dab86937b37fe3eec80b9
extra : source : ab007303c8bfe447b6a6128adfc55337127923a2
2017-12-07 15:50:41 +08:00
JW Wang 37e466a4bf Bug 1426056. P2 - remove unused members. r=bechen,gerald
MozReview-Commit-ID: 6CjxrFzutkP

--HG--
extra : rebase_source : b9c9a858e08ea0aa35c074ac7734d62b1d8fe219
extra : intermediate-source : ce131c8c66ef1dc89c69fd0e2332b838419a3cc3
extra : source : e6ece8e702100d23540caf9fbcfea561dcb3e172
2017-12-07 15:45:15 +08:00
JW Wang 313522ae1f Bug 1426056. P1 - move the decision of resuming download to another thread. r=bechen,gerald
So we won't access mStreamLength/mChannelOffset (which are protected by the
cache monitor) on the main thread.

MozReview-Commit-ID: 2pKEttZOfB9

--HG--
extra : rebase_source : a683d7297e241f2aeaf60ba9ad558763d17ee094
extra : intermediate-source : 0a6c10e10d1e558b19799b720935bbdaa56728bf
extra : source : 282de2a9189e5e05f5f817174ebcffe1b592bb1a
2017-12-07 15:43:36 +08:00
JW Wang a6dc3c33c1 Bug 1425170. P2 - remove unused members. r=bechen,gerald
MozReview-Commit-ID: TJZzVuEI8J

--HG--
extra : rebase_source : 3f6208a74c2a2d88373936a3dc4ee5c873fc297a
2017-12-14 10:19:41 +08:00
JW Wang 0764603851 Bug 1424937 - read as many bytes as possible before giving up reading due to download ends abnormally. r=bechen,gerald
MozReview-Commit-ID: 39vdgyY5NCT

--HG--
extra : rebase_source : d476d0d2b725b94ed750c575bbb6708098f89bb3
2017-12-13 18:28:16 +08:00
JW Wang dffc1aa9bb Bug 1423465. P6 - assert some MediaCacheStream functions are run off the main thread. r=bechen,gerald
MozReview-Commit-ID: I0GWj6I82Iv

--HG--
extra : rebase_source : 1f0271b1eae63391d23f5997359227af73d427d5
extra : intermediate-source : 30c996ff54197b85b97393762b7598cbbb528c0c
extra : source : 1f3a35716479caf1e493472762e28c586ef5f7dd
2017-12-05 15:23:43 +08:00
JW Wang 26a216be5d Bug 1423465. P3 - assert MediaCacheStream::SetPlaybackRate() is called off the main thread. r=bechen,gerald
MozReview-Commit-ID: CZCLkRa0T2v

--HG--
extra : rebase_source : d0a8afda90bd429891ead94788de81d743c1216c
extra : intermediate-source : 4adc4ebb716f29f0a2de5510ff36607283024687
extra : source : 1ed4c290b9294e965f2d9a80ace20776a5e84ead
2017-12-05 14:15:38 +08:00
JW Wang 0d7066652a Bug 1421864 - move mChannelStatistics from ChannelMediaResource to MediaCacheStream. r=bechen,gerald
So it is callable from non-main thread.

MozReview-Commit-ID: atYmz4u2c9

--HG--
extra : rebase_source : 2e10064730b3e7e1ecb1a4fd65cf2e2da0390290
extra : source : 5680a6942f6985f9c6bbf284a9768ab910b37804
2017-11-29 16:49:54 +08:00
JW Wang 0e04b33f33 Bug 1421134. P2 - run MediaCacheStream::SetReadMode() off the main thread. r=bechen,gerald
MozReview-Commit-ID: A6ui5dtWhNt

--HG--
extra : rebase_source : fef676273887d5db2fd798a6bcc25fbc936c375d
extra : source : beaec56918f2dbd0e1bd052d92a31fbcca1cd084
2017-11-28 10:51:47 +08:00
JW Wang 1ae4603e61 Bug 1421134. P1 - default MediaCacheStream::mCurrentMode to MODE_METADATA. r=bechen,gerald
We always read metadata when decoding starts. This allows us to remove the call
to mResource->SetReadMode(MediaCacheStream::MODE_METADATA) in ChannelMediaDecoder::Load().

MozReview-Commit-ID: AQMq4HxDZdT

--HG--
extra : rebase_source : 141c43bb93f274d8320a270b5c7289bd1eab134d
extra : source : 7de3d88ddb5c99352f4b5bd0b5e648a52a4a67a5
2017-11-28 10:43:50 +08:00
JW Wang 57ea5cf9d9 Bug 1420819 - run MediaCache::Flush() off the main thread. r=bechen,gerald
MozReview-Commit-ID: 4QR1TvORZlz

--HG--
extra : rebase_source : 1451c437c6daf80b15b6f23552900e2ef2467324
extra : intermediate-source : 3a0bdc29f6c70ac2a1479dbc7f10ebbd52a68456
extra : source : da25c3537d9b4665dff55f615467bcb62e5dde56
2017-11-27 15:04:21 +08:00
JW Wang 99bc08968c Bug 1420798 - apply the 'ProofOfLock' pattern to MediaCache. r=bechen,gerald
See comment 0 for the detail.

We will replace ReentrantMonitor with Monitor in the future.

MozReview-Commit-ID: 63ygEFWXHZd

--HG--
extra : rebase_source : 71d1049663e5af5ca178402f84fabdc4ab0f8758
extra : intermediate-source : 20d349df7c16227b6fa1cd3c1d38b1065c93da8c
extra : source : 9cdcfd446686eace7258d18262d8dd92c0f70331
2017-11-22 17:14:02 +08:00
JW Wang ce20f92811 Bug 1420016 - remove ChannelMediaResource::IsSuspendedByCache(). r=bechen,gerald
For it is used internally by CacheClientNotifySuspendedStatusChanged() only.

MozReview-Commit-ID: 8XVUHhdERYR

--HG--
extra : rebase_source : 60b97821b3e1c13bf1ba706ad1431b9e323df319
extra : intermediate-source : 6891fae737691efcf0885ff90fc7af777f9493d8
extra : source : 8c49a2fbc12f59c83809d233c9c0e9fa404cdd21
2017-11-23 11:30:07 +08:00
JW Wang eb912e4057 Bug 1418918. P2 - add thread/monitor assertions. r=bechen,gerald
MozReview-Commit-ID: 3J8pRFnpm77

--HG--
extra : rebase_source : 722b2f5df7d2b6f95d806b334a9382f80ac4ea07
extra : intermediate-source : cb6319d0c879e9d57a46ff261bb9e1d5a16e2ad9
extra : source : 5b99626480b1c190f03a61635b7a2174b38c87b1
2017-11-20 16:30:05 +08:00
JW Wang 106e488634 Bug 1418918. P1 - remove unused FlushPartialBlock(). r=bechen,gerald
MozReview-Commit-ID: GSda1KfPWXE

--HG--
extra : rebase_source : 8bb0b962e6fec586dd68587d6e43b542d37f6a2d
extra : intermediate-source : d58472fa128100ed3bbc8e07d4e72ac7cc5bfe09
extra : source : e3925d43d873e20ad95a48550f271b832f852b7d
2017-11-20 16:00:22 +08:00
JW Wang ff8c3ed9fd Bug 1418917. P2 - NotifyClientSuspended() should check mClosed. r=bechen,gerald
MozReview-Commit-ID: 9mBPwfyfWCV

--HG--
extra : rebase_source : 7fc6194a99d656f8e9a80430e41486c2ab7f117c
extra : intermediate-source : a601c40d46b2db64372345a3c5e39a1eeab7e326
extra : source : b5d520b8ddbf9926fe6e3a87d667a6c10c9dde5f
2017-11-20 14:21:22 +08:00
JW Wang e672887f6f Bug 1418917. P1 - run some functions off the main thread. r=bechen,gerald
MozReview-Commit-ID: Fn9OveV69hX

--HG--
extra : rebase_source : 36ed72bea695f07694d83c418ba45d89cf1f03be
extra : intermediate-source : e25c80e8ea6991b4f06bc4305b602c792a5b1e8a
extra : source : d20765cfa8575943c62b933563e36ee9ffa4e765
2017-11-16 15:41:36 +08:00
JW Wang f874190157 Bug 1418430. P2 - simplify the if statement of "reopen on error". r=bechen,gerald
A truth table is listed to illustrate all conditions of length/offset/reopen.

The original code doesn't handle the following cases correctly:
1. length == offset == 0, shouldn't reopen the channel for there is no data to download.
2. length == -1 && offset > 0, should reopen the channel if seekable.

MozReview-Commit-ID: IisnrA8hK4M

--HG--
extra : rebase_source : c5826f314b09b2ae9c3e7f2cc1f6ce285fc612df
2017-11-22 11:21:57 +08:00
JW Wang df2b00d7a6 Bug 1418430. P1 - always check "reopen on error" when a connection is closed. r=bechen,gerald
The server might send us fewer bytes than requested. So we also need
"reopen on error" in this case as well.

MozReview-Commit-ID: Fi82x4h1TZ0

--HG--
extra : rebase_source : 3a19838de9c11545f00778623735c7e9a5cb1439
2017-11-22 10:35:48 +08:00