mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset 3a7830a019ac (bug 1218337) for breaking hazard builds
This commit is contained in:
parent
5cc67cb339
commit
d123a0c8c4
@ -116,11 +116,6 @@ this.PermissionsTable = { geolocation: {
|
||||
privileged: DENY_ACTION,
|
||||
certified: ALLOW_ACTION
|
||||
},
|
||||
"speech-recognition": {
|
||||
app: DENY_ACTION,
|
||||
privileged: ALLOW_ACTION,
|
||||
certified: ALLOW_ACTION
|
||||
},
|
||||
telephony: {
|
||||
app: DENY_ACTION,
|
||||
privileged: DENY_ACTION,
|
||||
|
@ -21,11 +21,8 @@
|
||||
#include "endpointer.h"
|
||||
|
||||
#include "mozilla/dom/SpeechRecognitionEvent.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "nsIPermissionManager.h"
|
||||
#include "nsIPrincipal.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include "nsQueryObject.h"
|
||||
@ -163,25 +160,11 @@ SpeechRecognition::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
|
||||
bool
|
||||
SpeechRecognition::IsAuthorized(JSContext* aCx, JSObject* aGlobal)
|
||||
{
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIPermissionManager> mgr = do_GetService(NS_PERMISSIONMANAGER_CONTRACTID, &rv);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32_t speechRecognition = nsIPermissionManager::UNKNOWN_ACTION;
|
||||
nsIPrincipal* principal = nsContentUtils::ObjectPrincipal(aGlobal);
|
||||
rv = mgr->TestExactPermissionFromPrincipal(principal, "speech-recognition", &speechRecognition);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool hasPermission = (speechRecognition == nsIPermissionManager::ALLOW_ACTION);
|
||||
|
||||
bool inPrivilegedApp = IsInPrivilegedApp(aCx, aGlobal);
|
||||
bool enableTests = Preferences::GetBool(TEST_PREFERENCE_ENABLE);
|
||||
bool enableRecognitionEnable = Preferences::GetBool(TEST_PREFERENCE_RECOGNITION_ENABLE);
|
||||
bool enableRecognitionForceEnable = Preferences::GetBool(TEST_PREFERENCE_RECOGNITION_FORCE_ENABLE);
|
||||
return (hasPermission || enableRecognitionForceEnable || enableTests) && enableRecognitionEnable;
|
||||
return (inPrivilegedApp || enableRecognitionForceEnable || enableTests) && enableRecognitionEnable;
|
||||
}
|
||||
|
||||
already_AddRefed<SpeechRecognition>
|
||||
|
Loading…
Reference in New Issue
Block a user