mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-04 13:07:52 +00:00
Bug 1426578. P5 - offload Init() to another thread. r=bechen,gerald
MozReview-Commit-ID: Fv7eq39GNsk --HG-- extra : rebase_source : 483cd70c65a4f724b40aaa11eece60b6a2a85e25 extra : source : db2632bf1828721b94bda877bf23bc59d189206e
This commit is contained in:
parent
ea7483e4ce
commit
bb6429d366
@ -2868,8 +2868,13 @@ MediaCacheStream::Init(int64_t aContentLength)
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
AutoLock lock(mMediaCache->Monitor());
|
||||
mMediaCache->OpenStream(lock, this);
|
||||
OwnerThread()->Dispatch(NS_NewRunnableFunction(
|
||||
"MediaCacheStream::Init",
|
||||
[ this, res = RefPtr<ChannelMediaResource>(mClient) ]() {
|
||||
AutoLock lock(mMediaCache->Monitor());
|
||||
mMediaCache->OpenStream(lock, this);
|
||||
}));
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user