зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1381638 - Prevent sharing multiple input devices in the same process. r=jesup
This commit is contained in:
Родитель
90a660e634
Коммит
ffa7a61472
|
@ -1232,8 +1232,13 @@ public:
|
|||
self->mSourceListener->GetPrincipalHandle());
|
||||
if (NS_FAILED(rv)) {
|
||||
nsString log;
|
||||
log.AssignASCII("Starting audio failed");
|
||||
error = new MediaMgrError(NS_LITERAL_STRING("InternalError"), log);
|
||||
if (rv == NS_ERROR_NOT_AVAILABLE) {
|
||||
log.AssignASCII("Concurrent mic process limit.");
|
||||
error = new MediaMgrError(NS_LITERAL_STRING("NotReadableError"), log);
|
||||
} else {
|
||||
log.AssignASCII("Starting audio failed");
|
||||
error = new MediaMgrError(NS_LITERAL_STRING("InternalError"), log);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -474,6 +474,13 @@ MediaEngineWebRTCMicrophoneSource::Start(SourceMediaStream *aStream,
|
|||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
// Until we fix bug 1400488 we need to block a second tab (OuterWindow)
|
||||
// from opening an already-open device. If it's the same tab, they
|
||||
// will share a Graph(), and we can allow it.
|
||||
if (!mSources.IsEmpty() && aStream->Graph() != mSources[0]->Graph()) {
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
|
||||
{
|
||||
MonitorAutoLock lock(mMonitor);
|
||||
mSources.AppendElement(aStream);
|
||||
|
|
Загрузка…
Ссылка в новой задаче