Bug 1433685 - Remove nsGConfService, r=glandium
authorMartin Stransky <stransky@redhat.com>
Wed, 10 Apr 2019 10:18:14 +0000
changeset 468761 e18f4ceca46b6495c991df728897a2de340c48be
parent 468760 6f7ae02cc16c16fedd7faed3b24eef3674758175
child 468762 205b23b72638bfa3ede3942b3ba035ddb59ce8dc
push id35850
push userdvarga@mozilla.com
push dateWed, 10 Apr 2019 21:52:56 +0000
treeherdermozilla-central@9d3dbe3fef26 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1433685
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1433685 - Remove nsGConfService, r=glandium Differential Revision: https://phabricator.services.mozilla.com/D26484
browser/components/shell/moz.build
browser/components/shell/test/browser_420786.js
browser/components/shell/test/unit/test_421977.js
browser/components/shell/test/unit/xpcshell.ini
old-configure.in
toolkit/crashreporter/client/crashreporter_gtk_common.cpp
toolkit/crashreporter/client/crashreporter_linux.cpp
toolkit/system/gnome/components.conf
toolkit/system/gnome/moz.build
toolkit/system/gnome/nsGConfService.cpp
toolkit/system/gnome/nsGConfService.h
widget/gtk/nsWindow.cpp
xpcom/system/moz.build
xpcom/system/nsIGConfService.idl
--- a/browser/components/shell/moz.build
+++ b/browser/components/shell/moz.build
@@ -4,17 +4,16 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 # For BinaryPath::GetLong for Windows
 LOCAL_INCLUDES += [
     '/xpcom/build'
 ]
 
-XPCSHELL_TESTS_MANIFESTS += ['test/unit/xpcshell.ini']
 BROWSER_CHROME_MANIFESTS += ['test/browser.ini']
 MOCHITEST_CHROME_MANIFESTS += ['test/chrome.ini']
 
 JAR_MANIFESTS += ['jar.mn']
 
 XPIDL_SOURCES += [
     'nsIShellService.idl',
 ]
--- a/browser/components/shell/test/browser_420786.js
+++ b/browser/components/shell/test/browser_420786.js
@@ -65,41 +65,17 @@ add_task(async function() {
           "Wallpaper position GSettings key is correct");
       };
 
       restoreSettings = function() {
         gsettings.setString(GS_IMAGE_KEY, prevImage);
         gsettings.setString(GS_OPTION_KEY, prevOption);
         gsettings.setBoolean(GS_DRAW_BG_KEY, prevDrawBG);
       };
-    } catch (e) {
-      // Fallback to GConf
-      var gconf = Cc["@mozilla.org/gnome-gconf-service;1"].
-                  getService(Ci.nsIGConfService);
-
-      var prevImageKey = gconf.getString(DG_IMAGE_KEY);
-      var prevOptionKey = gconf.getString(DG_OPTION_KEY);
-      var prevDrawBgKey = gconf.getBool(DG_DRAW_BG_KEY);
-
-      checkWallpaper = function(position, expectedGConfPosition) {
-        shell.setDesktopBackground(image, position, "");
-        ok(wpFile.exists(), "Wallpaper was written to disk");
-        is(gconf.getString(DG_IMAGE_KEY), wpFile.path,
-           "Wallpaper file GConf key is correct");
-        is(gconf.getString(DG_OPTION_KEY), expectedGConfPosition,
-           "Wallpaper position GConf key is correct");
-        wpFile.remove(false);
-      };
-
-      restoreSettings = function() {
-        gconf.setString(DG_IMAGE_KEY, prevImageKey);
-        gconf.setString(DG_OPTION_KEY, prevOptionKey);
-        gconf.setBool(DG_DRAW_BG_KEY, prevDrawBgKey);
-      };
-    }
+    } catch (e) {}
 
     checkWallpaper(Ci.nsIShellService.BACKGROUND_TILE, "wallpaper");
     checkWallpaper(Ci.nsIShellService.BACKGROUND_STRETCH, "stretched");
     checkWallpaper(Ci.nsIShellService.BACKGROUND_CENTER, "centered");
     checkWallpaper(Ci.nsIShellService.BACKGROUND_FILL, "zoom");
     checkWallpaper(Ci.nsIShellService.BACKGROUND_FIT, "scaled");
     checkWallpaper(Ci.nsIShellService.BACKGROUND_SPAN, "spanned");
 
deleted file mode 100644
--- a/browser/components/shell/test/unit/test_421977.js
+++ /dev/null
@@ -1,114 +0,0 @@
-const GCONF_BG_COLOR_KEY = "/desktop/gnome/background/primary_color";
-
-var gShell;
-var gGConf;
-
-/**
- * Converts from a rgb numerical color valule (r << 16 | g << 8 | b)
- * into a hex string in #RRGGBB format.
- */
-function colorToHex(aColor) {
-  const rMask = 4294901760;
-  const gMask = 65280;
-  const bMask = 255;
-
-  var r = (aColor & rMask) >> 16;
-  var g = (aColor & gMask) >> 8;
-  var b = (aColor & bMask);
-
-  return "#" + [r, g, b].map(aInt =>
-                              aInt.toString(16).replace(/^(.)$/, "0$1"))
-                             .join("").toUpperCase();
-}
-
-/**
- * Converts a color string in #RRGGBB format to a rgb numerical color value
- *  (r << 16 | g << 8 | b).
- */
-function hexToColor(aString) {
-  return parseInt(aString.substring(1, 3), 16) << 16 |
-         parseInt(aString.substring(3, 5), 16) << 8 |
-         parseInt(aString.substring(5, 7), 16);
-}
-
-/**
- * Checks that setting the GConf background key to aGConfColor will
- * result in the Shell component returning a background color equals
- * to aExpectedShellColor in #RRGGBB format.
- */
-function checkGConfToShellColor(aGConfColor, aExpectedShellColor) {
-  gGConf.setString(GCONF_BG_COLOR_KEY, aGConfColor);
-  var shellColor = colorToHex(gShell.desktopBackgroundColor);
-
-  Assert.equal(shellColor, aExpectedShellColor);
-}
-
-/**
- * Checks that setting the background color (in #RRGGBB format) using the Shell
- * component will result in having a GConf key for the background color set to
- * aExpectedGConfColor.
- */
-function checkShellToGConfColor(aShellColor, aExpectedGConfColor) {
-  gShell.desktopBackgroundColor = hexToColor(aShellColor);
-  var gconfColor = gGConf.getString(GCONF_BG_COLOR_KEY);
-
-  Assert.equal(gconfColor, aExpectedGConfColor);
-}
-
-function run_test() {
-  // This test is Linux specific for now
-  if (!("@mozilla.org/gnome-gconf-service;1" in Cc))
-    return;
-
-  try {
-    // If GSettings is available, then the GConf tests
-    // will fail
-    Cc["@mozilla.org/gsettings-service;1"].
-      getService(Ci.nsIGSettingsService).
-      getCollectionForSchema("org.gnome.desktop.background");
-    return;
-  } catch (e) { }
-
-  gGConf = Cc["@mozilla.org/gnome-gconf-service;1"].
-           getService(Ci.nsIGConfService);
-
-  gShell = Cc["@mozilla.org/browser/shell-service;1"].
-           getService(Ci.nsIShellService);
-
-  // Save the original background color so that we can restore it
-  // after the test.
-  var origGConfColor = gGConf.getString(GCONF_BG_COLOR_KEY);
-
-  try {
-    checkGConfToShellColor("#000", "#000000");
-    checkGConfToShellColor("#00f", "#0000FF");
-    checkGConfToShellColor("#b2f", "#BB22FF");
-    checkGConfToShellColor("#fff", "#FFFFFF");
-
-    checkGConfToShellColor("#000000", "#000000");
-    checkGConfToShellColor("#0000ff", "#0000FF");
-    checkGConfToShellColor("#b002f0", "#B002F0");
-    checkGConfToShellColor("#ffffff", "#FFFFFF");
-
-    checkGConfToShellColor("#000000000", "#000000");
-    checkGConfToShellColor("#00f00f00f", "#000000");
-    checkGConfToShellColor("#aaabbbccc", "#AABBCC");
-    checkGConfToShellColor("#fffffffff", "#FFFFFF");
-
-    checkGConfToShellColor("#000000000000", "#000000");
-    checkGConfToShellColor("#000f000f000f", "#000000");
-    checkGConfToShellColor("#00ff00ff00ff", "#000000");
-    checkGConfToShellColor("#aaaabbbbcccc", "#AABBCC");
-    checkGConfToShellColor("#111122223333", "#112233");
-    checkGConfToShellColor("#ffffffffffff", "#FFFFFF");
-
-    checkShellToGConfColor("#000000", "#000000000000");
-    checkShellToGConfColor("#0000FF", "#00000000ffff");
-    checkShellToGConfColor("#FFFFFF", "#ffffffffffff");
-    checkShellToGConfColor("#0A0B0C", "#0a0a0b0b0c0c");
-    checkShellToGConfColor("#A0B0C0", "#a0a0b0b0c0c0");
-    checkShellToGConfColor("#AABBCC", "#aaaabbbbcccc");
-  } finally {
-    gGConf.setString(GCONF_BG_COLOR_KEY, origGConfColor);
-  }
-}
deleted file mode 100644
--- a/browser/components/shell/test/unit/xpcshell.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[DEFAULT]
-head = 
-firefox-appdir = browser
-skip-if = toolkit == 'android'
-
-[test_421977.js]
--- a/old-configure.in
+++ b/old-configure.in
@@ -56,17 +56,16 @@ GLIB_VERSION=2.22
 # 2_26 is the earliest version we can set GLIB_VERSION_MIN_REQUIRED.
 # The macro won't be used when compiling with earlier versions anyway.
 GLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_26
 CAIRO_VERSION=1.10
 GTK2_VERSION=2.18.0
 GTK3_VERSION=3.4.0
 GDK_VERSION_MAX_ALLOWED=GDK_VERSION_3_4
 W32API_VERSION=3.14
-GCONF_VERSION=1.2.1
 STARTUP_NOTIFICATION_VERSION=0.8
 DBUS_VERSION=0.60
 SQLITE_VERSION=3.27.2
 
 dnl Set various checks
 dnl ========================================================
 MISSING_X=
 
@@ -1904,57 +1903,16 @@ MOZ_ARG_WITH_STRING(distribution-id,
 if test -z "$MOZ_DISTRIBUTION_ID"; then
    MOZ_DISTRIBUTION_ID="org.mozilla"
 fi
 
 AC_DEFINE_UNQUOTED(MOZ_DISTRIBUTION_ID,"$MOZ_DISTRIBUTION_ID")
 AC_SUBST(MOZ_DISTRIBUTION_ID)
 
 dnl ========================================================
-dnl = GConf support module
-dnl ========================================================
-
-if test "$MOZ_X11"
-then
-    if test "$MOZ_ENABLE_GTK"
-    then
-        MOZ_ENABLE_GCONF=1
-    fi
-
-    dnl ========================================================
-    dnl = GConf support module
-    dnl ========================================================
-    MOZ_ARG_DISABLE_BOOL(gconf,
-    [  --disable-gconf      Disable Gconf support ],
-        MOZ_ENABLE_GCONF=,
-        MOZ_ENABLE_GCONF=1)
-
-    if test "$MOZ_ENABLE_GCONF"
-    then
-        PKG_CHECK_MODULES(MOZ_GCONF, gconf-2.0 >= $GCONF_VERSION gobject-2.0 ,[
-            MOZ_GCONF_LIBS=`$PKG_CONFIG --libs gobject-2.0`
-            MOZ_ENABLE_GCONF=1
-        ],[
-            if test -n "$MOZ_ENABLE_GCONF";
-            then
-                AC_MSG_ERROR([* * * Could not find gconf-2.0 ])
-            else
-                AC_MSG_WARN([Many automated tests will fail with --disable-gconf. See bug 1167201.])
-            fi
-        ])
-    fi
-
-    if test "$MOZ_ENABLE_GCONF"; then
-        AC_DEFINE(MOZ_ENABLE_GCONF)
-    fi
-
-    AC_SUBST(MOZ_ENABLE_GCONF)
-fi
-
-dnl ========================================================
 dnl = libproxy support
 dnl ========================================================
 
 if test "$MOZ_ENABLE_GTK"
 then
     MOZ_ENABLE_LIBPROXY=
 
     MOZ_ARG_ENABLE_BOOL(libproxy,
--- a/toolkit/crashreporter/client/crashreporter_gtk_common.cpp
+++ b/toolkit/crashreporter/client/crashreporter_gtk_common.cpp
@@ -102,17 +102,16 @@ static gboolean ReportCompleted(gpointer
   gtk_widget_hide(gThrobber);
   string str =
       success ? gStrings[ST_REPORTSUBMITSUCCESS] : gStrings[ST_SUBMITFAILED];
   gtk_label_set_text(GTK_LABEL(gProgressLabel), str.c_str());
   g_timeout_add(5000, CloseApp, 0);
   return FALSE;
 }
 
-#ifdef MOZ_ENABLE_GCONF
 #  define HTTP_PROXY_DIR "/system/http_proxy"
 
 void LoadProxyinfo() {
   class GConfClient;
   typedef GConfClient* (*_gconf_default_fn)();
   typedef gboolean (*_gconf_bool_fn)(GConfClient*, const gchar*, GError**);
   typedef gint (*_gconf_int_fn)(GConfClient*, const gchar*, GError**);
   typedef gchar* (*_gconf_string_fn)(GConfClient*, const gchar*, GError**);
@@ -174,17 +173,16 @@ void LoadProxyinfo() {
       g_free(auth);
     }
   }
 
   g_object_unref(conf);
 
   // Don't dlclose gconfLib as libORBit-2 uses atexit().
 }
-#endif
 
 gpointer SendThread(gpointer args) {
   string response, error;
   long response_code;
 
   bool success = google_breakpad::HTTPUpload::SendRequest(
       gSendURL, gQueryParameters, gFiles, gHttpProxy, gAuth, gCACertificateFile,
       &response, &response_code, &error);
--- a/toolkit/crashreporter/client/crashreporter_linux.cpp
+++ b/toolkit/crashreporter/client/crashreporter_linux.cpp
@@ -90,19 +90,17 @@ void SaveSettings() {
       gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(gSubmitReportCheck)) ? "1"
                                                                           : "0";
 
   WriteStringsToFile(gSettingsPath + "/" + kIniFile, "Crash Reporter", settings,
                      true);
 }
 
 void SendReport() {
-#ifdef MOZ_ENABLE_GCONF
   LoadProxyinfo();
-#endif
 
   // spawn a thread to do the sending
   gSendThreadID = g_thread_create(SendThread, nullptr, TRUE, nullptr);
 }
 
 void DisableGUIAndSendReport() {
   // disable all our gui controls, show the throbber + change the progress text
   gtk_widget_set_sensitive(gSubmitReportCheck, FALSE);
--- a/toolkit/system/gnome/components.conf
+++ b/toolkit/system/gnome/components.conf
@@ -27,19 +27,8 @@ Classes = [
     {
         'cid': '{84e11f80-ca55-11dd-ad8b-0800200c9a66}',
         'contract_ids': ['@mozilla.org/system-alerts-service;1'],
         'type': 'nsSystemAlertsService',
         'headers': ['/toolkit/system/gnome/nsSystemAlertsService.h'],
         'init_method': 'Init',
     },
 ]
-
-if defined('MOZ_ENABLE_GCONF'):
-    Classes += [
-        {
-            'cid': '{d96d5985-a13a-4bdc-9386-ef348d7a97a1}',
-            'contract_ids': ['@mozilla.org/gnome-gconf-service;1'],
-            'type': 'nsGConfService',
-            'headers': ['/toolkit/system/gnome/nsGConfService.h'],
-            'init_method': 'Init',
-        },
-    ]
--- a/toolkit/system/gnome/moz.build
+++ b/toolkit/system/gnome/moz.build
@@ -8,32 +8,26 @@ with Files('**'):
     BUG_COMPONENT = ('Firefox', 'Shell Integration')
 
 SOURCES += [
     'nsAlertsIconListener.cpp',
     'nsGnomeModule.cpp',
     'nsSystemAlertsService.cpp',
 ]
 
-if CONFIG['MOZ_ENABLE_GCONF']:
-    SOURCES += [
-        'nsGConfService.cpp',
-    ]
-
 SOURCES += [
     'nsGIOService.cpp',
     'nsGSettingsService.cpp',
 ]
 
 XPCOM_MANIFESTS += [
     'components.conf',
 ]
 
 FINAL_LIBRARY = 'xul'
 
 LOCAL_INCLUDES += [
     '/toolkit/components/build/',
 ]
 
-CXXFLAGS += CONFIG['MOZ_GCONF_CFLAGS']
 CXXFLAGS += CONFIG['GLIB_CFLAGS']
 CXXFLAGS += CONFIG['MOZ_DBUS_GLIB_CFLAGS']
 CXXFLAGS += CONFIG['TK_CFLAGS']
deleted file mode 100644
--- a/toolkit/system/gnome/nsGConfService.cpp
+++ /dev/null
@@ -1,296 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "mozilla/ArrayUtils.h"
-#include "nsGConfService.h"
-#include "nsString.h"
-#include "nsCOMPtr.h"
-#include "nsComponentManagerUtils.h"
-#include "nsISupportsPrimitives.h"
-#include "nsIMutableArray.h"
-#include "nsXULAppAPI.h"
-#include "prlink.h"
-
-#include <gconf/gconf-client.h>
-
-using namespace mozilla;
-
-#define GCONF_FUNCTIONS                                                       \
-  FUNC(gconf_client_get_default, GConfClient *, (void))                       \
-  FUNC(gconf_client_get_bool, gboolean,                                       \
-       (GConfClient *, const gchar *, GError **))                             \
-  FUNC(gconf_client_get_string, gchar *,                                      \
-       (GConfClient *, const gchar *, GError **))                             \
-  FUNC(gconf_client_get_int, gint, (GConfClient *, const gchar *, GError **)) \
-  FUNC(gconf_client_get_float, gdouble,                                       \
-       (GConfClient *, const gchar *, GError **))                             \
-  FUNC(gconf_client_get_list, GSList *,                                       \
-       (GConfClient *, const gchar *, GConfValueType, GError **))             \
-  FUNC(gconf_client_set_bool, gboolean,                                       \
-       (GConfClient *, const gchar *, gboolean, GError **))                   \
-  FUNC(gconf_client_set_string, gboolean,                                     \
-       (GConfClient *, const gchar *, const gchar *, GError **))              \
-  FUNC(gconf_client_set_int, gboolean,                                        \
-       (GConfClient *, const gchar *, gint, GError **))                       \
-  FUNC(gconf_client_set_float, gboolean,                                      \
-       (GConfClient *, const gchar *, gdouble, GError **))                    \
-  FUNC(gconf_client_unset, gboolean, (GConfClient *, const gchar *, GError **))
-
-#define FUNC(name, type, params)      \
-  typedef type(*_##name##_fn) params; \
-  static _##name##_fn _##name;
-
-GCONF_FUNCTIONS
-
-#undef FUNC
-
-#define gconf_client_get_default _gconf_client_get_default
-#define gconf_client_get_bool _gconf_client_get_bool
-#define gconf_client_get_string _gconf_client_get_string
-#define gconf_client_get_int _gconf_client_get_int
-#define gconf_client_get_float _gconf_client_get_float
-#define gconf_client_get_list _gconf_client_get_list
-#define gconf_client_set_bool _gconf_client_set_bool
-#define gconf_client_set_string _gconf_client_set_string
-#define gconf_client_set_int _gconf_client_set_int
-#define gconf_client_set_float _gconf_client_set_float
-#define gconf_client_unset _gconf_client_unset
-
-static PRLibrary *gconfLib = nullptr;
-
-typedef void (*nsGConfFunc)();
-struct nsGConfDynamicFunction {
-  const char *functionName;
-  nsGConfFunc *function;
-};
-
-nsGConfService::~nsGConfService() {
-  if (mClient) g_object_unref(mClient);
-
-  // We don't unload gconf here because liborbit uses atexit(). In addition to
-  // this, it's not a good idea to unload any gobject based library, as it
-  // leaves types registered in glib's type system
-}
-
-nsresult nsGConfService::Init() {
-#define FUNC(name, type, params) {#name, (nsGConfFunc *)&_##name},
-  static const nsGConfDynamicFunction kGConfSymbols[] = {GCONF_FUNCTIONS};
-#undef FUNC
-
-  if (NS_WARN_IF(XRE_IsContentProcess())) {
-    return NS_ERROR_SERVICE_NOT_AVAILABLE;
-  }
-
-  if (!gconfLib) {
-    gconfLib = PR_LoadLibrary("libgconf-2.so.4");
-    if (!gconfLib) return NS_ERROR_FAILURE;
-  }
-
-  for (auto GConfSymbol : kGConfSymbols) {
-    *GConfSymbol.function =
-        PR_FindFunctionSymbol(gconfLib, GConfSymbol.functionName);
-    if (!*GConfSymbol.function) {
-      return NS_ERROR_FAILURE;
-    }
-  }
-
-  mClient = gconf_client_get_default();
-  return mClient ? NS_OK : NS_ERROR_FAILURE;
-}
-
-NS_IMPL_ISUPPORTS(nsGConfService, nsIGConfService)
-
-NS_IMETHODIMP
-nsGConfService::GetBool(const nsACString &aKey, bool *aResult) {
-  GError *error = nullptr;
-  *aResult =
-      gconf_client_get_bool(mClient, PromiseFlatCString(aKey).get(), &error);
-
-  if (error) {
-    g_error_free(error);
-    return NS_ERROR_FAILURE;
-  }
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsGConfService::GetString(const nsACString &aKey, nsACString &aResult) {
-  GError *error = nullptr;
-  gchar *result =
-      gconf_client_get_string(mClient, PromiseFlatCString(aKey).get(), &error);
-
-  if (error) {
-    g_error_free(error);
-    return NS_ERROR_FAILURE;
-  }
-
-  // We do a string copy here so that the caller doesn't need to worry about
-  // freeing the string with g_free().
-
-  aResult.Assign(result);
-  g_free(result);
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsGConfService::GetInt(const nsACString &aKey, int32_t *aResult) {
-  GError *error = nullptr;
-  *aResult =
-      gconf_client_get_int(mClient, PromiseFlatCString(aKey).get(), &error);
-
-  if (error) {
-    g_error_free(error);
-    return NS_ERROR_FAILURE;
-  }
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsGConfService::GetFloat(const nsACString &aKey, float *aResult) {
-  GError *error = nullptr;
-  *aResult =
-      gconf_client_get_float(mClient, PromiseFlatCString(aKey).get(), &error);
-
-  if (error) {
-    g_error_free(error);
-    return NS_ERROR_FAILURE;
-  }
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsGConfService::GetStringList(const nsACString &aKey, nsIArray **aResult) {
-  nsCOMPtr<nsIMutableArray> items(do_CreateInstance(NS_ARRAY_CONTRACTID));
-  if (!items) return NS_ERROR_OUT_OF_MEMORY;
-
-  GError *error = nullptr;
-  GSList *list = gconf_client_get_list(mClient, PromiseFlatCString(aKey).get(),
-                                       GCONF_VALUE_STRING, &error);
-  if (error) {
-    g_error_free(error);
-    return NS_ERROR_FAILURE;
-  }
-
-  for (GSList *l = list; l; l = l->next) {
-    nsCOMPtr<nsISupportsString> obj(
-        do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID));
-    if (!obj) {
-      g_slist_free(list);
-      return NS_ERROR_OUT_OF_MEMORY;
-    }
-    obj->SetData(NS_ConvertUTF8toUTF16((const char *)l->data));
-    items->AppendElement(obj);
-    g_free(l->data);
-  }
-
-  g_slist_free(list);
-  items.forget(aResult);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsGConfService::SetBool(const nsACString &aKey, bool aValue) {
-  bool res = gconf_client_set_bool(mClient, PromiseFlatCString(aKey).get(),
-                                   aValue, nullptr);
-
-  return res ? NS_OK : NS_ERROR_FAILURE;
-}
-
-NS_IMETHODIMP
-nsGConfService::SetString(const nsACString &aKey, const nsACString &aValue) {
-  bool res = gconf_client_set_string(mClient, PromiseFlatCString(aKey).get(),
-                                     PromiseFlatCString(aValue).get(), nullptr);
-
-  return res ? NS_OK : NS_ERROR_FAILURE;
-}
-
-NS_IMETHODIMP
-nsGConfService::SetInt(const nsACString &aKey, int32_t aValue) {
-  bool res = gconf_client_set_int(mClient, PromiseFlatCString(aKey).get(),
-                                  aValue, nullptr);
-
-  return res ? NS_OK : NS_ERROR_FAILURE;
-}
-
-NS_IMETHODIMP
-nsGConfService::SetFloat(const nsACString &aKey, float aValue) {
-  bool res = gconf_client_set_float(mClient, PromiseFlatCString(aKey).get(),
-                                    aValue, nullptr);
-
-  return res ? NS_OK : NS_ERROR_FAILURE;
-}
-
-NS_IMETHODIMP
-nsGConfService::GetAppForProtocol(const nsACString &aScheme, bool *aEnabled,
-                                  nsACString &aHandler) {
-  nsAutoCString key("/desktop/gnome/url-handlers/");
-  key.Append(aScheme);
-  key.AppendLiteral("/command");
-
-  GError *err = nullptr;
-  gchar *command = gconf_client_get_string(mClient, key.get(), &err);
-  if (!err && command) {
-    key.ReplaceLiteral(key.Length() - 7, 7, "enabled");
-    *aEnabled = gconf_client_get_bool(mClient, key.get(), &err);
-  } else {
-    *aEnabled = false;
-  }
-
-  aHandler.Assign(command);
-  g_free(command);
-
-  if (err) {
-    g_error_free(err);
-    return NS_ERROR_FAILURE;
-  }
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsGConfService::HandlerRequiresTerminal(const nsACString &aScheme,
-                                        bool *aResult) {
-  nsAutoCString key("/desktop/gnome/url-handlers/");
-  key.Append(aScheme);
-  key.AppendLiteral("/requires_terminal");
-
-  GError *err = nullptr;
-  *aResult = gconf_client_get_bool(mClient, key.get(), &err);
-  if (err) {
-    g_error_free(err);
-    return NS_ERROR_FAILURE;
-  }
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsGConfService::SetAppForProtocol(const nsACString &aScheme,
-                                  const nsACString &aCommand) {
-  nsAutoCString key("/desktop/gnome/url-handlers/");
-  key.Append(aScheme);
-  key.AppendLiteral("/command");
-
-  bool res = gconf_client_set_string(
-      mClient, key.get(), PromiseFlatCString(aCommand).get(), nullptr);
-  if (res) {
-    key.ReplaceLiteral(key.Length() - 7, 7, "enabled");
-    res = gconf_client_set_bool(mClient, key.get(), true, nullptr);
-    if (res) {
-      key.ReplaceLiteral(key.Length() - 7, 7, "needs_terminal");
-      res = gconf_client_set_bool(mClient, key.get(), false, nullptr);
-      if (res) {
-        key.ReplaceLiteral(key.Length() - 14, 14, "command-id");
-        res = gconf_client_unset(mClient, key.get(), nullptr);
-      }
-    }
-  }
-
-  return res ? NS_OK : NS_ERROR_FAILURE;
-}
deleted file mode 100644
--- a/toolkit/system/gnome/nsGConfService.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nsGConfService_h_
-#define nsGConfService_h_
-
-#include "nsIGConfService.h"
-#include "mozilla/Attributes.h"
-
-extern "C" {
-struct _GConfClient;
-typedef struct _GConfClient GConfClient;
-}
-
-class nsGConfService final : public nsIGConfService {
- public:
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSIGCONFSERVICE
-
-  nsGConfService() : mClient(nullptr) {}
-  nsresult Init();
-
- private:
-  ~nsGConfService();
-
-  GConfClient *mClient;
-};
-
-#endif
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -67,17 +67,16 @@
 #  define SN_API_NOT_YET_FROZEN
 #  include <startup-notification-1.0/libsn/sn.h>
 #endif
 
 #include "mozilla/Assertions.h"
 #include "mozilla/Likely.h"
 #include "mozilla/Preferences.h"
 #include "nsIPrefService.h"
-#include "nsIGConfService.h"
 #include "nsIServiceManager.h"
 #include "nsGfxCIID.h"
 #include "nsGtkUtils.h"
 #include "nsIObserverService.h"
 #include "mozilla/layers/LayersTypes.h"
 #include "nsIIdleServiceInternal.h"
 #include "nsIPropertyBag2.h"
 #include "GLContext.h"
--- a/xpcom/system/moz.build
+++ b/xpcom/system/moz.build
@@ -3,17 +3,16 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 XPIDL_SOURCES += [
     'nsIBlocklistService.idl',
     'nsICrashReporter.idl',
     'nsIDeviceSensors.idl',
-    'nsIGConfService.idl',
     'nsIGeolocationProvider.idl',
     'nsIGIOService.idl',
     'nsIGSettingsService.idl',
     'nsIHapticFeedback.idl',
     'nsIPlatformInfo.idl',
     'nsIXULAppInfo.idl',
     'nsIXULRuntime.idl',
 ]
deleted file mode 100644
--- a/xpcom/system/nsIGConfService.idl
+++ /dev/null
@@ -1,50 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsISupports.idl"
-
-interface nsIArray;
-
-[scriptable, uuid(5009acae-6973-48c3-b6d6-52c692cc5d9d)]
-interface nsIGConfService : nsISupports
-{
-  /* Basic registry access */
-  boolean       getBool(in AUTF8String key);
-  AUTF8String   getString(in AUTF8String key);
-  long          getInt(in AUTF8String key);
-  float         getFloat(in AUTF8String key);
-
-  /*
-   * Use this to return any list items in GConf, this will return
-   * an array of UTF16 nsISupportsString's.
-   */
-  nsIArray      getStringList(in AUTF8String key);
-
-  void setBool(in AUTF8String key, in boolean value);
-  void setString(in AUTF8String key, in AUTF8String value);
-  void setInt(in AUTF8String key, in long value);
-  void setFloat(in AUTF8String key, in float value);
-
-  /*
-   * Look up the handler for a protocol under the
-   * /desktop/gnome/url-handlers hierarchy.
-   */
-  AUTF8String getAppForProtocol(in AUTF8String scheme, out boolean enabled);
-
-  /*
-   * Check whether the handler for a scheme requires a terminal to run.
-   */
-  boolean handlerRequiresTerminal(in AUTF8String scheme);
-
-  /*
-   * Set the handler for a protocol, marking it as enabled.
-   * This removes any GnomeVFSMimeApp association for the protocol.
-   */
-  void   setAppForProtocol(in AUTF8String scheme, in AUTF8String command);
-};
-
-%{C++
-#define NS_GCONFSERVICE_CONTRACTID "@mozilla.org/gnome-gconf-service;1"
-%}