[tor-commits] [tor-browser] 25/43: Bug 1765610 - Add missing check of gamepad testing pref. r=dveditz, mccr8 a=RyanVM

gitolite role git at cupani.torproject.org
Tue May 31 07:07:08 UTC 2022


This is an automated email from the git hooks/post-receive script.

pierov pushed a commit to branch tor-browser-91.10.0esr-11.0-1
in repository tor-browser.

commit c5d23b71d7d203f080a42c9983888e7d30f1fb55
Author: Chris Martin <cmartin at mozilla.com>
AuthorDate: Tue May 10 13:22:30 2022 +0000

    Bug 1765610 - Add missing check of gamepad testing pref. r=dveditz,mccr8 a=RyanVM
    
    Differential Revision: https://phabricator.services.mozilla.com/D145805
---
 dom/gamepad/ipc/GamepadTestChannelParent.cpp | 6 ++++++
 modules/libpref/init/StaticPrefList.yaml     | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/dom/gamepad/ipc/GamepadTestChannelParent.cpp b/dom/gamepad/ipc/GamepadTestChannelParent.cpp
index c652486506633..1c8d67491e3c0 100644
--- a/dom/gamepad/ipc/GamepadTestChannelParent.cpp
+++ b/dom/gamepad/ipc/GamepadTestChannelParent.cpp
@@ -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();
 }
diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml
index 058df55a189d4..24f736afef570 100644
--- a/modules/libpref/init/StaticPrefList.yaml
+++ b/modules/libpref/init/StaticPrefList.yaml
@@ -2120,7 +2120,7 @@
   mirror: always
 
 - name: dom.gamepad.test.enabled
-  type: bool
+  type: RelaxedAtomicBool
   value: false
   mirror: always
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the tor-commits mailing list