preference.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  4. "use strict";
  5. const {Arg, RetVal, generateActorSpec} = require("devtools/shared/protocol");
  6. const preferenceSpec = generateActorSpec({
  7. typeName: "preference",
  8. methods: {
  9. getBoolPref: {
  10. request: { value: Arg(0) },
  11. response: { value: RetVal("boolean") }
  12. },
  13. getCharPref: {
  14. request: { value: Arg(0) },
  15. response: { value: RetVal("string") }
  16. },
  17. getIntPref: {
  18. request: { value: Arg(0) },
  19. response: { value: RetVal("number") }
  20. },
  21. getAllPrefs: {
  22. request: {},
  23. response: { value: RetVal("json") }
  24. },
  25. setBoolPref: {
  26. request: { name: Arg(0), value: Arg(1) },
  27. response: {}
  28. },
  29. setCharPref: {
  30. request: { name: Arg(0), value: Arg(1) },
  31. response: {}
  32. },
  33. setIntPref: {
  34. request: { name: Arg(0), value: Arg(1) },
  35. response: {}
  36. },
  37. clearUserPref: {
  38. request: { name: Arg(0) },
  39. response: {}
  40. }
  41. },
  42. });
  43. exports.preferenceSpec = preferenceSpec;