Bug 1765610 - Add missing check of gamepad testing pref r=dveditz,mccr8

Differential Revision: https://phabricator.services.mozilla.com/D145805
This commit is contained in:
Chris Martin 2022-05-10 13:22:30 +00:00
parent 66144974a5
commit 7d35776a8b
2 changed files with 7 additions and 1 deletions

View File

@ -8,11 +8,17 @@
#include "mozilla/dom/GamepadPlatformService.h"
#include "mozilla/ipc/BackgroundParent.h"
#include "mozilla/StaticPrefs_dom.h"
#include "mozilla/Unused.h"
namespace mozilla::dom {
already_AddRefed<GamepadTestChannelParent> GamepadTestChannelParent::Create() {
// Refuse to create the parent actor if this pref is disabled
if (!StaticPrefs::dom_gamepad_test_enabled()) {
return nullptr;
}
return RefPtr<GamepadTestChannelParent>(new GamepadTestChannelParent())
.forget();
}

View File

@ -2329,7 +2329,7 @@
mirror: always
- name: dom.gamepad.test.enabled
type: bool
type: RelaxedAtomicBool
value: false
mirror: always