зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1747282: dom/media/File* cleanup r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D138509
This commit is contained in:
Родитель
6063921e0f
Коммит
1415ca78a7
|
@ -31,8 +31,7 @@ static void CloseFD(PRFileDesc* aFD) {
|
|||
}
|
||||
|
||||
void FileBlockCache::SetCacheFile(PRFileDesc* aFD) {
|
||||
LOG("SetFD(aFD=%p) mBackgroundET=%p", aFD, mBackgroundET.get());
|
||||
|
||||
LOG("SetCacheFile aFD=%p", aFD);
|
||||
if (!aFD) {
|
||||
// Failed to get a temporary file. Shutdown.
|
||||
Close();
|
||||
|
@ -44,6 +43,8 @@ void FileBlockCache::SetCacheFile(PRFileDesc* aFD) {
|
|||
}
|
||||
{
|
||||
MutexAutoLock lock(mDataMutex);
|
||||
LOG("SetFileCache mBackgroundET=%p, mIsWriteScheduled %d",
|
||||
mBackgroundET.get(), mIsWriteScheduled);
|
||||
if (mBackgroundET) {
|
||||
// Still open, complete the initialization.
|
||||
mInitialized = true;
|
||||
|
@ -317,8 +318,8 @@ nsresult FileBlockCache::MoveBlockInFile(int32_t aSourceBlockIndex,
|
|||
}
|
||||
|
||||
void FileBlockCache::PerformBlockIOs() {
|
||||
MOZ_ASSERT(mBackgroundET->IsOnCurrentThread());
|
||||
MutexAutoLock mon(mDataMutex);
|
||||
MOZ_ASSERT(mBackgroundET->IsOnCurrentThread());
|
||||
NS_ASSERTION(mIsWriteScheduled, "Should report write running or scheduled.");
|
||||
|
||||
LOG("Run() mFD=%p mBackgroundET=%p", mFD, mBackgroundET.get());
|
||||
|
|
|
@ -59,6 +59,7 @@ nsresult FileMediaResource::Open(nsIStreamListener** aStreamListener) {
|
|||
*aStreamListener = nullptr;
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
MutexAutoLock lock(mLock);
|
||||
// The channel is already open. We need a synchronous stream that
|
||||
// implements nsISeekableStream, so we have to find the underlying
|
||||
// file and reopen it
|
||||
|
|
Загрузка…
Ссылка в новой задаче