зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1495302 - FeaturePolicy: midi, r=qdot
This commit is contained in:
Родитель
e6bb32cdcb
Коммит
7b93c4f163
|
@ -8,6 +8,7 @@
|
|||
#include "mozilla/dom/MIDIAccess.h"
|
||||
#include "mozilla/dom/MIDIManagerChild.h"
|
||||
#include "mozilla/dom/MIDIPermissionRequest.h"
|
||||
#include "mozilla/dom/FeaturePolicyUtils.h"
|
||||
#include "mozilla/dom/Promise.h"
|
||||
#include "nsIGlobalObject.h"
|
||||
#include "mozilla/ClearOnShutdown.h"
|
||||
|
@ -70,6 +71,12 @@ MIDIAccessManager::RequestMIDIAccess(nsPIDOMWindowInner* aWindow,
|
|||
aRv.Throw(NS_ERROR_FAILURE);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!FeaturePolicyUtils::IsFeatureAllowed(doc, NS_LITERAL_STRING("midi"))) {
|
||||
aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIRunnable> permRunnable = new MIDIPermissionRequest(aWindow, p, aOptions);
|
||||
aRv = NS_DispatchToMainThread(permRunnable);
|
||||
if (NS_WARN_IF(aRv.Failed())) {
|
||||
|
|
|
@ -45,7 +45,6 @@ static FeatureMap sSupportedFeatures[] = {
|
|||
{ "magnetometer", FeatureMap::eSelf },
|
||||
// TODO: not supported yet!!!
|
||||
{ "microphone", FeatureMap::eSelf },
|
||||
// TODO: not supported yet!!!
|
||||
{ "midi", FeatureMap::eSelf },
|
||||
{ "payment", FeatureMap::eSelf },
|
||||
// TODO: not supported yet!!!
|
||||
|
|
Загрузка…
Ссылка в новой задаче