Commit Graph
91 Commits
Author SHA1 Message Date
JW Wang 1ead867458 Bug 1364001. P1 - add an API to throttle download. r=cpearce
MozReview-Commit-ID: HdmAgvo1GE3
2017-05-11 16:49:36 +08:00
Andrea Marchesini 702d803204 Bug 1353629 - PBlob refactoring - part 15 - FileMediaResource is used for in-process blobURL, r=jwwang 2017-04-24 12:09:41 +02:00
Andrea Marchesini 72ff053a1f Bug 1353629 - PBlob refactoring - part 12 - nsInputStreamPump should use BufferedStreams, r=smaug
nsInputStreamPump should use the stream as nsIAsyncInputStream if available.
In order to do so, we need to wrap a BufferedStream around it.

MediaResource cannot use a simple sync nsIInputStream when BlobURL are involved
in the content process.
2017-04-24 12:09:41 +02:00
JW Wang 4a9179873b Bug 1194891. P1 - plumb 'isPrivateBrowsing' down to MediaCacheStream. r=cpearce
MozReview-Commit-ID: EBKkOfK7K1p
2017-04-06 16:20:00 +08:00
JW Wang c32eb32811 Bug 1353668. P3 - rename CMLOG to LOG. r=kaku
MozReview-Commit-ID: 67dN3NEBCA7
2017-04-05 17:38:20 +08:00
JW Wang e8ebf1e525 Bug 1353668. P2 - remove RESOURCE_LOG. r=kaku
MozReview-Commit-ID: 1PelTy83ETW
2017-04-05 17:27:35 +08:00
JW Wang 3990945e41 Bug 1353668. P1 - add a member function, CopySegmentToCache. r=kaku
MozReview-Commit-ID: 5uEWpMigspX
2017-04-05 17:24:03 +08:00
Wei-Cheng Pan 7a678cdad2 Bug 1310127 - Part 17: Use MOZ_MUST_USE in netwerk/protocol/http r=smaug
MozReview-Commit-ID: 5gvVZtsa3yS
2016-12-20 11:49:32 +08:00
Kaku Kuo 2d289e9b94 Bug 1344621 - Label runnables in dom/media/MediaResource.cpp; r=jwwang
MozReview-Commit-ID: EEZoUIdKOkK
2017-03-06 15:30:49 +08:00
Tom Tromey a4b717ab39 Bug 1060419 - make log_print use Printf.h, r=froydnj
MozReview-Commit-ID: BIZ1GQEZ1vs
2016-12-15 20:16:31 -07:00
Bill McCloskey f79edeabc9 Bug 1339289 - Give names to a lot of common runnables (r=ehsan)
MozReview-Commit-ID: 5IdvK6kgoAW
2017-02-15 12:30:01 -08:00
Gerald Squelart d8bde2ea6c Bug 1331289 - Use MediaContainerType in MediaResource, SourceBuffer, TrackBuffersManager, and dependencies - r=jya
Continuing the work of replacing MIME strings with MediaContainerType, starting
from MediaResource and following the dependencies.

Most changes are mechanical: Just change ns*String into MediaContainerType, and
MIME string literals into MEDIAMIMETYPE("a/b").
Some checks for empty/invalid strings and lowercase comparisons can go, thanks
to the always-valid always-lowercase-MIME invariants of MediaContainerType.

One special case in is MediaSourceResource, which used to have an empty string
as its type (because its own type is not relevant, but its SourceBuffers carry
types). Because the inherited GetContentType *must* be overridden, and must
return a MediaContainerType, we needed a valid type even though it should not
be seen in the real world. I've chosen "application/x.mediasource" for that.

MozReview-Commit-ID: 1aCH75Kh2e6
2016-12-28 18:59:02 +11:00
JW Wang 8f0f177a0a Bug 1322087. Part 3 - allow MediaResoure::Tell() to be called on the main thread. r=cpearce
It is safe to call Tell() on the main thread because it won't block the main thread like Read() does.

MozReview-Commit-ID: 64B41l8fe1
2016-12-07 03:22:32 -10:00
JW Wang 32f6cc83f4 Bug 1304633 - Treating resources as finite when the response code is 206. r=cpearce
MozReview-Commit-ID: 13GF2E5IwSs
2016-09-22 15:15:01 +08:00
Nicholas Nethercote 887efe04d5 Bug 1299727 - Rename NS_WARN_IF_FALSE as NS_WARNING_ASSERTION. r=erahm.
The new name makes the sense of the condition much clearer. E.g. compare:

  NS_WARN_IF_FALSE(!rv.Failed());

with:

  NS_WARNING_ASSERTION(!rv.Failed());

The new name also makes it clearer that it only has effect in debug builds,
because that's standard for assertions.
2016-09-01 15:01:16 +10:00
bechen e2ae2d2c33 Bug 1291629 - Remove RTSP code. r=jwwang
MozReview-Commit-ID: AxaLwO4rTuY
2016-08-10 10:32:25 +08:00
Nicholas Nethercote 8f3c6e7c32 Bug 1294645 - Don't use NS_CALLBACK for callbacks in nsI{Input,Output,UnicharInput},Stream.idl. r=froydnj.
Slightly less than half (93 / 210) of the NS_METHOD instances in the codebase
are because of the use of NS_CALLBACK in
nsI{Input,Output,UnicharInput},Stream.idl. The use of __stdcall on Win32 isn't
important for these callbacks because they are only used as arguments to
[noscript] methods.

This patch converts them to vanilla |nsresult| functions. It increases the size
of xul.dll by about ~600 bytes, which is about 0.001%.
2016-08-12 17:36:22 +10:00
Christoph Kerschbaumer d5670ccb25 Bug 1274170 - Remove unnecessary includes of nsCorsListenerProxy. r=jkingston 2016-06-21 12:54:03 +02:00
Matthew Gregan 0d845421c5 Bug 910329 - Don't use the channel status as a proxy for load group membership. r=mayhemer 2016-06-09 13:36:58 +12:00
JW Wang f7e9abe04a Bug 1273063 - remove ChannelMediaResource::mIsTransportSeekable. r=cpearce.
MozReview-Commit-ID: DvBaIzbh72D
2016-05-17 10:33:34 +08:00
Kyle Huey b972c94d0f Bug 1268313: Part 7 - Move NS_NewRunnableMethod and friends to mozilla::NewRunnableMethod. r=froydnj 2016-05-05 01:45:00 -07:00
Carsten "Tomcat" Book aadd508ffe Backed out changeset 85ce8cb0639a (bug 1268313) 2016-04-29 14:21:16 +02:00
Kyle Huey e62a0823c9 Bug 1268313: Part 7 - Move NS_NewRunnableMethod and friends to mozilla::NewRunnableMethod. r=froydnj 2016-04-28 14:08:25 -07:00
Kyle Huey 20d0dc7286 Bug 1259294: Part 2 - Use MOZ_ALWAYS_SUCCEEDS. r=froydnj 2016-03-28 10:28:15 -07:00
Christoph Kerschbaumer f16bc06af6 Bug 1228677 - Do not enforce CORS when loading file for MediaResource. r=cpearce
MozReview-Commit-ID: 4RNWLi1QQC7
2016-03-06 19:17:43 -08:00
Jean-Yves Avenard b815b108e9 Bug 1251044: P2. Remove dead code and generalise the use of content-range header. r=roc
MozReview-Commit-ID: ESMlcBOQKsy
2016-02-29 11:41:14 +11:00
Jean-Yves Avenard 92e1e662fd Bug 1251044: P1. Use content-range values to determine content's length. r=roc
MozReview-Commit-ID: 7oAmvRGxzw3
2016-02-29 11:41:07 +11:00
Jean-Yves Avenard 9c780e0392 Bug 1249904: Use content-range values to determine length if content-length is unknown. r=roc
While currently unused, the functionality of mByteRange was preserved.
To avoid unforeseen regressions, we only error on an invalid Content-Range response if mByteRange was set, otherwise the error is ignored and code proceed as before.

MozReview-Commit-ID: BRiO633uTh7
2016-02-25 10:02:53 +11:00
Jean-Yves Avenard 4ebfbe827a Bug 1240411: P9. Clean up media headers. r=jwwang
Remove redundant virtual keyword and add missing override if any.
2016-01-19 19:47:36 +11:00
Francois Marier 5834a16220 Bug 1231557 - Use the URL Classifier in Media elements. r=cpearce,r=gcp 2015-12-16 13:24:40 -08:00
Jean-Yves Avenard 3fd7fa641a Bug 1227396: P7. Replace nsTArray<MediaByteRange> with dedicated MediaByteRangeSet object. r=cpearce 2015-11-30 11:29:34 +11:00
Jean-Yves Avenard 4b46aac327 Bug 1227396: P2. Rename some MediaByteRange methods. r=cpearce
Will facilitate the replacement of MediaByteRange by Interval<int64_t>
2015-11-30 11:29:30 +11:00
Birunthan Mohanathas e95885610b Bug 1217307 - Remove some unnecessary null checks in rest of dom/. r=njn 2015-11-19 09:13:49 +02:00
JW Wang 0b163fff0a Bug 1221009. Part 1 - add a class to forward notifications from MediaResource to MediaDecoder. r=roc. 2015-11-16 07:50:55 +08:00
sajitk 13171aa66e Bug 1219480 - Replace PRLogModuleInfo with LazyLogModule in the media directory. r=rillian 2015-11-15 14:49:01 +01:00
JW Wang c920811bf0 Bug 1223599 - Remove the throttling argument from AbstractMediaDecoder::NotifyDataArrived(). r=jya. 2015-11-11 17:59:16 +08:00
Wes Kocher 9ec1c7554a Backed out changeset 1e5f3d1151d6 (bug 1219480) for cpp unittest bustage CLOSED TREE 2015-11-11 09:36:56 -08:00
sajitk 47326a1fc0 Bug 1219480 - Replace PRLogModuleInfo with LazyLogModule in the media directory. r=rillian 2015-11-11 06:52:00 +01:00
JW Wang f3692b1d56 Bug 1220558. Part 1 - remove unused arguments from MediaDecoderReader::DispatchNotifyDataArrived() and its callees/callers. r=jya. 2015-11-11 07:43:38 +08:00
JW Wang 1d5763e304 Bug 1218280. Part 2 - remove unused code. r=roc. 2015-10-27 10:28:28 +08:00
JW Wang 47bf57bd93 Bug 1218280. Part 1 - create MediaResourceCallback for MediaResource to send notifications. r=roc. 2015-10-27 10:28:26 +08:00
Nathan Froyd 4e6d8f6705 Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout.  The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.

CLOSED TREE makes big refactorings like this a piece of cake.

 # The main substitution.
find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    xargs perl -p -i -e '
 s/nsRefPtr\.h/RefPtr\.h/g; # handle includes
 s/nsRefPtr ?</RefPtr</g;   # handle declarations and variables
'

 # Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h.
perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h

 # Handle nsRefPtr.h itself, a couple places that define constructors
 # from nsRefPtr, and code generators specially.  We do this here, rather
 # than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename
 # things like nsRefPtrHashtable.
perl -p -i -e 's/nsRefPtr/RefPtr/g' \
     mfbt/nsRefPtr.h \
     xpcom/glue/nsCOMPtr.h \
     xpcom/base/OwningNonNull.h \
     ipc/ipdl/ipdl/lower.py \
     ipc/ipdl/ipdl/builtin.py \
     dom/bindings/Codegen.py \
     python/lldbutils/lldbutils/utils.py

 # In our indiscriminate substitution above, we renamed
 # nsRefPtrGetterAddRefs, the class behind getter_AddRefs.  Fix that up.
find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \
    xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g'

if [ -d .git ]; then
    git mv mfbt/nsRefPtr.h mfbt/RefPtr.h
else
    hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h
fi
2015-10-18 01:24:48 -04:00
Nathan Froyd bf7f6dda03 Bug 1207245 - part 3 - switch all uses of mozilla::RefPtr<T> to nsRefPtr<T>; r=ehsan
This commit was generated using the following script, executed at the
top level of a typical source code checkout.

 # Don't modify select files in mfbt/ because it's not worth trying to
 # tease out the dependencies currently.
 #
 # Don't modify anything in media/gmp-clearkey/0.1/ because those files
 # use their own RefPtr, defined in their own RefCounted.h.
find . -name '*.cpp' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    grep -v 'mfbt/RefPtr.h' | \
    grep -v 'mfbt/nsRefPtr.h' | \
    grep -v 'mfbt/RefCounted.h' | \
    grep -v 'media/gmp-clearkey/0.1/' | \
    xargs perl -p -i -e '
 s/mozilla::RefPtr/nsRefPtr/g; # handle declarations in headers
 s/\bRefPtr</nsRefPtr</g; # handle local variables in functions
 s#mozilla/RefPtr.h#mozilla/nsRefPtr.h#; # handle #includes
 s#mfbt/RefPtr.h#mfbt/nsRefPtr.h#;       # handle strange #includes
'

 # |using mozilla::RefPtr;| is OK; |using nsRefPtr;| is invalid syntax.
find . -name '*.cpp' -o -name '*.mm' | xargs sed -i -e '/using nsRefPtr/d'

 # RefPtr.h used |byRef| for dealing with COM-style outparams.
 # nsRefPtr.h uses |getter_AddRefs|.
 # Fixup that mismatch.
find . -name '*.cpp' -o -name '*.h'| \
    xargs perl -p -i -e 's/byRef/getter_AddRefs/g'
2015-10-18 00:40:10 -04:00
Chris Pearce 119195c861 Bug 1207019 - Remove WMF availability check in MediaKeySystemAccess requests. r=edwin 2015-10-05 15:03:48 +13:00
Christoph Kerschbaumer 410eb8816a Bug 1194524 - Use channel->ascynOpen2 in dom/media/MediaResource.cpp (r=sicking) 2015-09-12 12:59:08 -07:00
JW Wang f352f06cc7 Bug 1068596 - Pass SHARE_DELETE when opening a file so the file can be deleted without waiting for GC. r=roc 2015-08-27 08:14:07 -04:00
Ryan VanderMeulen 5e010fc43a Backed out changeset d2e4ce298bab (bug 1068596) for Windows crashes. 2015-08-27 07:29:06 -04:00
JW Wang be1028071a Bug 1068596 - pass SHARE_DELETE when opening a file so the file can be deleted without waiting for GC. r=roc. 2015-08-27 14:45:41 +08:00
Alastor Wu f7c4eeba28 Bug 1187092 - Refactor the suspend process. r=jwwang 2015-08-19 12:43:25 +08:00
Ryan VanderMeulen e53e65ee11 Backed out changeset ee800c0e234f (bug 1187092) for media crashes/asserts. 2015-08-18 13:11:05 -04:00