Commit Graph
38 Commits
Author SHA1 Message Date
JW Wang 13e52587ab Bug 1400166. P2 - Flush() should dispatch a task to clear arrays. r=gerald
If mBlockChanges is cleared when PerformBlockIOs() is dropping the data lock,
blockIndex will become an invalid index after it acquire the data lock again.

MozReview-Commit-ID: 5Cu2TgEO3F5
2017-09-18 11:07:52 +08:00
JW Wang f5b0fcf275 Bug 1400166. P1 - move re-initialization code to Flush() for it is confusing to call Init() twice. r=gerald
MozReview-Commit-ID: 6KolHyGkqXo
2017-09-18 10:52:17 +08:00
Chris Pearce 843b5fd9b4 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
2017-08-30 15:38:56 +12:00
Bevis Tseng 2ecbda13e2 Bug 1378930 - Part 2: Remove the aName parameter from SchedulerGroup/DocGroup/DispatcherTrait. r=billm 2017-07-26 16:13:35 +08:00
Gerald Squelart 720d6c7dc1 Bug 1379091 - Let block cache tell MediaCache its block use limit - r=cpearce
MozReview-Commit-ID: 5ZCD3NoeYEP
2017-07-10 10:23:02 +12:00
Bill McCloskey ce42826bdf Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-26 14:19:58 -07:00
Carsten "Tomcat" Book 238bf154d5 Backed out changeset 4f6302a98ae4 (bug 1372405) 2017-06-21 13:59:26 +02:00
Bill McCloskey 67e8af4720 Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-20 21:44:11 -07:00
Carsten "Tomcat" Book bbe9441993 Backed out changeset 9846de3bd954 (bug 1372405) 2017-06-20 08:27:02 +02:00
Bill McCloskey f69608368b Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-19 22:25:47 -07:00
Gerald Squelart f9cbbe4bc9 Bug 1371882 - MediaBlockCacheBase::Init may be called again to re-initialize cache - r=cpearce
This will be useful to let the MediaCache flush its block cache without having
to restart from scratch (and risk failing).

MozReview-Commit-ID: At3mxH9jb9m
2017-06-15 15:55:39 +12:00
Gerald Squelart c6ecb5dcf3 Bug 1371882 - Remove MediaBlockCacheBase::Close() - r=cpearce
The only external use of Close was always followed by an implicit destruction
(by resetting the RefPtr), so we don't need to expose it, and it can be done
from the destructor.

FileBlockCache keeps its Close() function for internal use.
Also, FileBlockCache::mIsOpen is redundant, as it's true iff mThread is not
null.

MozReview-Commit-ID: LV7YVrwJvGG
2017-06-15 14:10:05 +12:00
Gerald Squelart 6d72c9345a Bug 1371882 - Remove FileBlockCache's dependency on Runnable - r=cpearce
This is necessary before we can make FileBlockCache depend on another
ref-counted base in the following patch.

MozReview-Commit-ID: 8bfNwQhY8k0
2017-06-09 14:51:17 +12:00
Gerald Squelart b92946b145 Bug 1367155 - Handle async-closed FileBlockCached::mFD when reading/writing - r=cpearce
Also, close the FD if FileBlockCache::Closed() was called between Init() and
SetCacheFile().

MozReview-Commit-ID: 5p8NslMow7D
2017-05-24 13:21:28 +12:00
Gerald Squelart 2d72c7a5ab Bug 1365538 - Postpone FileBlockCache writes while reading - r=cpearce
While inside FileBlock::Read, the mIsReading flag is set, which in turn
prevents starting the writer task, or makes it exit as soon as possible.
This should help multi-block reads (while data is being received) by giving
them priority, so that that blocking call can return faster.
At the end of Read, the writer task is re-dispatched if needed.

MozReview-Commit-ID: J32tHGFRMNU
2017-05-17 17:10:57 +12:00
Gerald Squelart 50724fa3bf Bug 1365538 - Use Mutex instead of Monitor in FileBlockCache - r=cpearce
Since both FileBlockCache Monitor's are only used as locks, we should just use
simple Mutex'es (smaller, faster, and tighter API).

MozReview-Commit-ID: DdNNPN1kFrs
2017-05-17 16:36:26 +12:00
Gerald Squelart f137815110 Bug 1365534 - Close temp file in FileBlockCache thread - r=cpearce
Closing the temporary file was done in the FileBlockCache destructor, which is
called on the main thread.

Instead, we are now dispatching a new final task from Close, which will close
the temporary file and then shutdown the thread.
The thread and FD ownerships are transferred to that final task, so that no
more tasks may be unexpectly queued to that thread, and both members can
immediately be reused after Close() returns.

MozReview-Commit-ID: L9djYGhDFn4
2017-05-17 16:00:39 +12:00
Gerald Squelart ce6d43625f Bug 1365534 - In non-e10s, open temp file in FileBlockCache thread - r=cpearce
In a parent process, the temporary file was created and opened by calling
NS_OpenAnonymousTemporaryFile() from Init, which was called from the main
thread.
In addition to being called at least once when the first media file is fetched,
it may also be called if caches need to be emptied.

So it should help to move this operation on the FileBlockCache thread, if only
to remove potential background-hang reports from non-e10s configurations.

MozReview-Commit-ID: CjPsHEsL3Ch
2017-05-17 15:30:32 +12:00
Gerald Squelart 19ce64822b Bug 1365534 - Remove unneeded IsMainThread assertions - r=cpearce
SetCacheFile, Init, Close, and MoveBlock all had NS_IsMainThread() assertions.
However they all use Monitor's to access member data, so they should be thread-
safe.
(Upcoming patches will actually start using some of these functions from non-
main-threads.)

MozReview-Commit-ID: E1auNEXuoF9
2017-05-18 16:17:08 +12:00
JW Wang 3d6e1d2bc4 Bug 1355393. P1 - let FileBlockCache::WriteBlock() take 2 buffers instead of one. r=cpearce
This allows us to save copies in combining 2 bufffers into one before calling
FileBlockCache::WriteBlock().

MozReview-Commit-ID: 62kQIxp3Ju0
2017-04-11 15:47:46 +08:00
JW Wang ee4737601a Bug 1354444 - use shorter names for logging macros in FileBlockCache. r=kaku
MozReview-Commit-ID: 4uyYRjBupfN
2017-04-07 15:05:30 +08:00
Chris Pearce 247a2adfe1 Bug 1349746 - Ensure we close media cache's temporary file if the cache shuts down while we're waiting for the FD to arrive. r=jwwang
MozReview-Commit-ID: HNXt3pYb1Iv
2017-04-07 17:51:47 +12:00
Chris Pearce 856ea9d47a Bug 1347031 - Move the MediaCache off of opening its temporary file fd synchronously in the content process. r=jwwang
In bug 1346987 we're attempting to remove uses of the
NS_OpenAnonymousTemporaryFile() in the content process as it sends a
synchronous IPC to the parent process on the main thread, which can cause UI
jank. This patch makes the MediaCache use the async anonymous temporary file
creation function added in bug 1346987.

The file descriptor is held by the FileBlockCache. This object buffers data
passed to it in memory, and defers writing of said data to another thread. I
added the async wait for the file descriptor to be inside that async "defer to
other thread" step.

This means that while the content process is waiting for the file descriptor to
come down from the parent process, we'll buffer media data being streamed in
memory. Given that our MSE implementation will buffer up to 100MB of media data
in memory anyway, it seems that more buffering in the src=url case while we
wait for an async IPC to do a round trip to the main process is acceptable.

MozReview-Commit-ID: 3OTBTWw5pr0
2017-03-17 09:54:23 +13:00
JW Wang dfd1918c39 Bug 1345751. P2 - use SystemGroup to dispatch the event. r=cpearce
MozReview-Commit-ID: B8HuIpbpm06
2017-03-09 14:46:58 +08:00
JW Wang 52596a4c95 Bug 1345751. P1 - remove the else branch for MediaShutdownManager ensures all media activities are finished before "xpcom-shutdown-threads" starts. r=cpearce
MozReview-Commit-ID: BdNnlHEb1Nk
2017-03-09 14:45:09 +08:00
Markus Stange a24593a89f Bug 1323100 - Assign names to all remaining threads that are created through NS_NewThread and create them using NS_NewNamedThread instead. r=froydnj
MozReview-Commit-ID: 7W1dt2BBKJZ
2016-12-21 11:43:50 +01:00
Andrew McCreight 209d4ee048 Bug 1323042 - forbid MOZ_COUNT_{CTOR,DTOR} for nsISupports classes; r=froydnj 2016-12-12 09:27:58 -05:00
Nathan Froyd f2d50c26f4 Backout aba6c73511a2 (bug 1307961) for massive test bustage resulting in a CLOSED TREE; r=alltheorange 2016-12-12 08:45:46 -05:00
Andrew McCreight 2f93d6e48d Bug 1307961 - require consistent bloatview reporting for nsISupports classes; r=froydnj 2016-12-12 07:58:33 -05:00
JW Wang 648bd0b726 Bug 1275807 - Remove remaining use of FlushableTaskQueue. r=cpearce.
MozReview-Commit-ID: L12wxh7GPIr
2016-05-24 16:48:26 +08:00
Gerald Squelart c0db14f365 Bug 1256533 - Use std::deque<int32_t> instead of nsDeque - r=cpearce
The queue of pending block indexes was implemented using nsDeque where
item pointers were perverted into pure 32-bit numbers, causing a size
mismatch on 64-bit platforms, which was picked by VS2015.

Note: We're using a deque because we need to implement a 'contains' method,
which would be unreasonably-difficult with a pure queue.

MozReview-Commit-ID: HpDBIwgSs9
2016-03-20 16:52:34 +11: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
Bobby Holley 950df6af04 Bug 1190496 - Remove dependency on VideoUtils.h for stack size. r=cpearce 2015-08-04 14:00:19 -07:00
Randell Jesup ba5a89c946 Bug 1155059: Patch 8 - Don't leak runnables when MediaCache/FileBlockCache get shut down after XPCOM is in final shutdown r=cpearce 2015-07-09 23:21:46 -04:00
Nicholas Nethercote 0247de46d8 Bug 1127201 (attempt 2, part 1) - Replace most NS_ABORT_IF_FALSE calls with MOZ_ASSERT. r=Waldo. 2015-02-09 14:34:50 -08:00
Andrew McCreight e048a7df33 Back out Bug 1127201 (part 2) for various problems. 2015-02-06 15:04:32 -08:00
Nicholas Nethercote 40ab0270d5 Bug 1127201 (part 2) - Convert all NS_ABORT_IF_FALSE calls to MOZ_ASSERT. r=Waldo. 2015-02-04 20:05:36 -08:00
Birunthan Mohanathas 417b400d55 Bug 946065 - Part 10: Move content/media/ to dom/. r=peterv 2014-10-25 20:24:36 +03:00