mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 798966: Create a preference to bypass gUM permission; r=jesup
This commit is contained in:
parent
969a991bb2
commit
b768c06860
@ -18,6 +18,8 @@
|
||||
#include "nsDOMFile.h"
|
||||
#include "nsGlobalWindow.h"
|
||||
|
||||
#include "mozilla/Preferences.h"
|
||||
|
||||
/* Using WebRTC backend on Desktops (Mac, Windows, Linux), otherwise default */
|
||||
#include "MediaEngineDefault.h"
|
||||
#if defined(MOZ_WEBRTC)
|
||||
@ -673,6 +675,11 @@ MediaManager::GetUserMedia(bool aPrivileged, nsPIDOMWindow* aWindow,
|
||||
mActiveWindows.Put(windowID, listeners);
|
||||
}
|
||||
|
||||
// Developer preference for turning off permission check.
|
||||
if (Preferences::GetBool("media.navigator.permission.disabled", false)) {
|
||||
aPrivileged = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pass runnables along to GetUserMediaRunnable so it can add the
|
||||
* MediaStreamListener to the runnable list. The last argument can
|
||||
@ -706,7 +713,7 @@ MediaManager::GetUserMedia(bool aPrivileged, nsPIDOMWindow* aWindow,
|
||||
if (picture) {
|
||||
// ShowFilePickerForMimeType() must run on the Main Thread! (on Android)
|
||||
NS_DispatchToMainThread(gUMRunnable);
|
||||
} else if (aPrivileged) {
|
||||
} else if (aPrivileged || fake) {
|
||||
if (!mMediaThread) {
|
||||
nsresult rv = NS_NewThread(getter_AddRefs(mMediaThread));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
@ -174,6 +174,7 @@ pref("media.h264.enabled", true);
|
||||
#ifdef MOZ_WEBRTC
|
||||
pref("media.navigator.enabled", false);
|
||||
pref("media.peerconnection.enabled", false);
|
||||
pref("media.navigator.permission.disabled", false);
|
||||
#else
|
||||
#ifdef ANDROID
|
||||
pref("media.navigator.enabled", true);
|
||||
|
Loading…
Reference in New Issue
Block a user