Bug 1344038 - Remove --disable-gio. r=karlt
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 05 Apr 2017 14:06:25 +0900
changeset 558284 91f503f8385118a6f37e2c639a17c43a143e741d
parent 558283 7ad4be04d16e0d86508c15c104f9686f2493061a
child 558285 5fbd12b4d8e7f48343efa361ab8094ebaf1af6b9
push id52860
push userbmo:walkingice0204@gmail.com
push dateFri, 07 Apr 2017 13:29:26 +0000
reviewerskarlt
bugs1344038
milestone55.0a1
Bug 1344038 - Remove --disable-gio. r=karlt
build/moz.configure/old.configure
config/system-headers
image/decoders/icon/gtk/nsIconChannel.cpp
netwerk/base/nsIOService.cpp
netwerk/protocol/gio/moz.build
old-configure.in
toolkit/components/downloads/nsDownloadManager.cpp
toolkit/components/jsdownloads/src/DownloadPlatform.cpp
toolkit/system/gnome/moz.build
toolkit/system/gnome/nsGnomeModule.cpp
--- a/build/moz.configure/old.configure
+++ b/build/moz.configure/old.configure
@@ -174,17 +174,16 @@ def old_configure_options(*options):
     '--enable-dump-painting',
     '--enable-elf-hack',
     '--enable-extensions',
     '--enable-faststripe',
     '--enable-feeds',
     '--enable-gamepad',
     '--enable-gconf',
     '--enable-gczeal',
-    '--enable-gio',
     '--enable-gnomeui',
     '--enable-gold',
     '--enable-hardware-aec-ns',
     '--enable-icf',
     '--enable-install-strip',
     '--enable-ion',
     '--enable-ios-target',
     '--enable-jitspew',
--- a/config/system-headers
+++ b/config/system-headers
@@ -1266,19 +1266,17 @@ libsn/sn-monitor.h
 libsn/sn-util.h
 #endif
 #if MOZ_SYSTEM_HUNSPELL==1
 hunspell.hxx
 #endif
 #if MOZ_SYSTEM_BZ2==1
 bzlib.h
 #endif
-#ifdef MOZ_ENABLE_GIO
 gio/gio.h
-#endif
 #if MOZ_SYSTEM_LIBEVENT==1
 event.h
 #else
 sys/event.h
 #endif
 #ifdef MOZ_ENABLE_LIBPROXY
 proxy.h
 #endif
--- a/image/decoders/icon/gtk/nsIconChannel.cpp
+++ b/image/decoders/icon/gtk/nsIconChannel.cpp
@@ -7,19 +7,17 @@
 
 #include <stdlib.h>
 #include <unistd.h>
 
 #include "mozilla/DebugOnly.h"
 #include "mozilla/EndianUtils.h"
 #include <algorithm>
 
-#ifdef MOZ_ENABLE_GIO
 #include <gio/gio.h>
-#endif
 
 #include <gtk/gtk.h>
 
 #include "nsMimeTypes.h"
 #include "nsIMIMEService.h"
 
 #include "nsServiceManagerUtils.h"
 
@@ -163,17 +161,16 @@ moz_gtk_icon_size(const char* name)
 
   if (strcmp(name, "dialog") == 0) {
     return GTK_ICON_SIZE_DIALOG;
   }
 
   return GTK_ICON_SIZE_MENU;
 }
 
-#ifdef MOZ_ENABLE_GIO
 static int32_t
 GetIconSize(nsIMozIconURI* aIconURI)
 {
   nsAutoCString iconSizeString;
 
   aIconURI->GetIconSize(iconSizeString);
   if (iconSizeString.IsEmpty()) {
     uint32_t size;
@@ -296,36 +293,31 @@ nsIconChannel::InitWithGIO(nsIMozIconURI
   nsresult rv = ScaleIconBuf(&buf, iconSize);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = moz_gdk_pixbuf_to_channel(buf, aIconURI,
                                  getter_AddRefs(mRealChannel));
   g_object_unref(buf);
   return rv;
 }
-#endif // MOZ_ENABLE_GIO
 
 nsresult
 nsIconChannel::Init(nsIURI* aURI)
 {
   nsCOMPtr<nsIMozIconURI> iconURI = do_QueryInterface(aURI);
   NS_ASSERTION(iconURI, "URI is not an nsIMozIconURI");
 
   if (gfxPlatform::IsHeadless()) {
     return NS_ERROR_NOT_AVAILABLE;
   }
 
   nsAutoCString stockIcon;
   iconURI->GetStockIcon(stockIcon);
   if (stockIcon.IsEmpty()) {
-#ifdef MOZ_ENABLE_GIO
     return InitWithGIO(iconURI);
-#else
-    return NS_ERROR_NOT_AVAILABLE;
-#endif
   }
 
   // Search for stockIcon
   nsAutoCString iconSizeString;
   iconURI->GetIconSize(iconSizeString);
 
   nsAutoCString iconStateString;
   iconURI->GetIconState(iconStateString);
--- a/netwerk/base/nsIOService.cpp
+++ b/netwerk/base/nsIOService.cpp
@@ -537,17 +537,17 @@ nsIOService::GetProtocolHandler(const ch
         ToLowerCase(contractID);
 
         rv = CallGetService(contractID.get(), result);
         if (NS_SUCCEEDED(rv)) {
             CacheProtocolHandler(scheme, *result);
             return rv;
         }
 
-#ifdef MOZ_ENABLE_GIO
+#ifdef MOZ_WIDGET_GTK
         // check to see whether GVFS can handle this URI scheme.  if it can
         // create a nsIURI for the "scheme:", then we assume it has support for
         // the requested protocol.  otherwise, we failover to using the default
         // protocol handler.
 
         rv = CallGetService(NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX"moz-gio",
                             result);
         if (NS_SUCCEEDED(rv)) {
--- a/netwerk/protocol/gio/moz.build
+++ b/netwerk/protocol/gio/moz.build
@@ -5,13 +5,13 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 SOURCES += [
     'nsGIOProtocolHandler.cpp',
 ]
 
 FINAL_LIBRARY = 'xul'
 
-CXXFLAGS += CONFIG['MOZ_GIO_CFLAGS']
+CXXFLAGS += CONFIG['TK_CFLAGS']
 
 with Files('**'):
     BUG_COMPONENT = ('Core', 'Widget: Gtk')
 
--- a/old-configure.in
+++ b/old-configure.in
@@ -52,17 +52,16 @@ NSPR_MINVER=4.14
 NSS_VERSION=3
 
 dnl Set the minimum version of toolkit libs used by mozilla
 dnl ========================================================
 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
-GIO_VERSION=2.22
 CAIRO_VERSION=1.10
 GTK2_VERSION=2.18.0
 GTK3_VERSION=3.4.0
 GDK_VERSION_MAX_ALLOWED=GDK_VERSION_3_4
 WINDRES_VERSION=2.14.90
 W32API_VERSION=3.14
 GNOMEUI_VERSION=2.2.0
 GCONF_VERSION=1.2.1
@@ -2532,60 +2531,27 @@ dnl values set by configure.sh above.
 dnl ========================================================
 
 MOZ_ANDROID_GOOGLE_PLAY_SERVICES
 MOZ_ANDROID_GOOGLE_CLOUD_MESSAGING
 MOZ_ANDROID_INSTALL_TRACKING
 
 
 dnl ========================================================
-dnl = GIO and GConf support module
+dnl = GConf support module
 dnl ========================================================
 
 if test "$MOZ_X11"
 then
-    dnl build the GIO extension by default only when the
-    dnl GTK2 toolkit is in use.
     if test "$MOZ_ENABLE_GTK"
     then
-        MOZ_ENABLE_GIO=1
         MOZ_ENABLE_GCONF=1
     fi
 
     dnl ========================================================
-    dnl = GIO support module
-    dnl ========================================================
-    MOZ_ARG_DISABLE_BOOL(gio,
-    [  --disable-gio           Disable GIO support],
-        MOZ_ENABLE_GIO=,
-        MOZ_ENABLE_GIO=force)
-
-    if test "$MOZ_ENABLE_GIO" -a "$MOZ_ENABLE_GTK"
-    then
-        if test "$MOZ_WIDGET_TOOLKIT" = gtk2
-        then
-            PKG_CHECK_MODULES(_GTKCHECK, gtk+-2.0 >= 2.14, ,
-                              [AC_MSG_ERROR([* * * Could not find gtk+-2.0 > 2.14. Required for build with gio.])])
-        fi
-        PKG_CHECK_MODULES(MOZ_GIO, gio-2.0 >= $GIO_VERSION,[
-            MOZ_GIO_LIBS=`echo $MOZ_GIO_LIBS | sed 's/-llinc\>//'`
-            MOZ_ENABLE_GIO=1
-            AC_DEFINE(MOZ_ENABLE_GIO)
-        ],[
-            if test "$MOZ_ENABLE_GIO" = "force"
-            then
-                AC_MSG_ERROR([* * * Could not find gio-2.0 >= $GIO_VERSION])
-            fi
-            MOZ_ENABLE_GIO=
-        ])
-    fi
-
-    AC_SUBST(MOZ_ENABLE_GIO)
-
-    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"
--- a/toolkit/components/downloads/nsDownloadManager.cpp
+++ b/toolkit/components/downloads/nsDownloadManager.cpp
@@ -2643,17 +2643,17 @@ NS_IMETHODIMP nsDownload::SetSignatureIn
 
 NS_IMETHODIMP nsDownload::SetRedirects(nsIArray* aRedirects) {
   MOZ_ASSERT(NS_IsMainThread(), "Must call SetRedirects on main thread");
   // This will be used later to query the application reputation service.
   mRedirects = aRedirects;
   return NS_OK;
 }
 
-#ifdef MOZ_ENABLE_GIO
+#ifdef MOZ_WIDGET_GTK
 static void gio_set_metadata_done(GObject *source_obj, GAsyncResult *res, gpointer user_data)
 {
   GError *err = nullptr;
   g_file_set_attributes_finish(G_FILE(source_obj), res, nullptr, &err);
   if (err) {
 #ifdef DEBUG
     NS_DebugBreak(NS_DEBUG_WARNING, "Set file metadata failed: ", err->message, __FILE__, __LINE__);
 #endif
@@ -2812,17 +2812,17 @@ nsDownload::SetState(DownloadState aStat
                                            nullptr, nullptr);
             if (uri) {
               gtk_recent_manager_add_item(manager, uri);
               g_free(uri);
             }
 #endif
           }
 #endif
-#ifdef MOZ_ENABLE_GIO
+#ifdef MOZ_WIDGET_GTK
           // Use GIO to store the source URI for later display in the file manager.
           GFile* gio_file = g_file_new_for_path(NS_ConvertUTF16toUTF8(path).get());
           nsCString source_uri;
           rv = mSource->GetSpec(source_uri);
           NS_ENSURE_SUCCESS(rv, rv);
           GFileInfo *file_info = g_file_info_new();
           g_file_info_set_attribute_string(file_info, "metadata::download-uri", source_uri.get());
           g_file_set_attributes_async(gio_file,
--- a/toolkit/components/jsdownloads/src/DownloadPlatform.cpp
+++ b/toolkit/components/jsdownloads/src/DownloadPlatform.cpp
@@ -54,17 +54,17 @@ DownloadPlatform* DownloadPlatform::GetD
 
 #if defined(MOZ_WIDGET_GTK)
   g_type_init();
 #endif
 
   return gDownloadPlatformService;
 }
 
-#ifdef MOZ_ENABLE_GIO
+#ifdef MOZ_WIDGET_GTK
 static void gio_set_metadata_done(GObject *source_obj, GAsyncResult *res, gpointer user_data)
 {
   GError *err = nullptr;
   g_file_set_attributes_finish(G_FILE(source_obj), res, nullptr, &err);
   if (err) {
 #ifdef DEBUG
     NS_DebugBreak(NS_DEBUG_WARNING, "Set file metadata failed: ", err->message, __FILE__, __LINE__);
 #endif
@@ -126,17 +126,17 @@ nsresult DownloadPlatform::DownloadDone(
                                        nullptr, nullptr);
         if (uri) {
           gtk_recent_manager_add_item(manager, uri);
           g_free(uri);
         }
 #endif
       }
 #endif
-#ifdef MOZ_ENABLE_GIO
+#ifdef MOZ_WIDGET_GTK
       // Use GIO to store the source URI for later display in the file manager.
       GFile* gio_file = g_file_new_for_path(NS_ConvertUTF16toUTF8(path).get());
       nsCString source_uri;
       nsresult rv = aSource->GetSpec(source_uri);
       NS_ENSURE_SUCCESS(rv, rv);
       GFileInfo *file_info = g_file_info_new();
       g_file_info_set_attribute_string(file_info, "metadata::download-uri", source_uri.get());
       g_file_set_attributes_async(gio_file,
--- a/toolkit/system/gnome/moz.build
+++ b/toolkit/system/gnome/moz.build
@@ -10,28 +10,24 @@ SOURCES += [
     'nsSystemAlertsService.cpp',
 ]
 
 if CONFIG['MOZ_ENABLE_GCONF']:
     SOURCES += [
         'nsGConfService.cpp',
     ]
 
-if CONFIG['MOZ_ENABLE_GIO']:
-    SOURCES += [
-        'nsGIOService.cpp',
-        'nsGSettingsService.cpp',
-        'nsPackageKitService.cpp'
-    ]
+SOURCES += [
+    'nsGIOService.cpp',
+    'nsGSettingsService.cpp',
+    'nsPackageKitService.cpp'
+]
 
 FINAL_LIBRARY = 'xul'
 
 LOCAL_INCLUDES += [
     '/toolkit/components/build/',
 ]
 
 CXXFLAGS += CONFIG['MOZ_GCONF_CFLAGS']
-CXXFLAGS += CONFIG['MOZ_GIO_CFLAGS']
 CXXFLAGS += CONFIG['GLIB_CFLAGS']
 CXXFLAGS += CONFIG['MOZ_DBUS_GLIB_CFLAGS']
-
-if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
-    CXXFLAGS += CONFIG['TK_CFLAGS']
+CXXFLAGS += CONFIG['TK_CFLAGS']
--- a/toolkit/system/gnome/nsGnomeModule.cpp
+++ b/toolkit/system/gnome/nsGnomeModule.cpp
@@ -7,59 +7,51 @@
 #include "mozilla/ModuleUtils.h"
 
 #include <glib-object.h>
 
 #ifdef MOZ_ENABLE_GCONF
 #include "nsGConfService.h"
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGConfService, Init)
 #endif
-#ifdef MOZ_ENABLE_GIO
 #include "nsGIOService.h"
 #include "nsGSettingsService.h"
 #include "nsPackageKitService.h"
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsGIOService)
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGSettingsService, Init)
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPackageKitService, Init)
-#endif
 #include "nsSystemAlertsService.h"
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsSystemAlertsService, Init)
 
 #ifdef MOZ_ENABLE_GCONF
 NS_DEFINE_NAMED_CID(NS_GCONFSERVICE_CID);
 #endif
-#ifdef MOZ_ENABLE_GIO
 NS_DEFINE_NAMED_CID(NS_GIOSERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_GSETTINGSSERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_PACKAGEKITSERVICE_CID);
-#endif
 NS_DEFINE_NAMED_CID(NS_SYSTEMALERTSSERVICE_CID);
 
 static const mozilla::Module::CIDEntry kGnomeCIDs[] = {
 #ifdef MOZ_ENABLE_GCONF
   { &kNS_GCONFSERVICE_CID, false, nullptr, nsGConfServiceConstructor },
 #endif
-#ifdef MOZ_ENABLE_GIO
   { &kNS_GIOSERVICE_CID, false, nullptr, nsGIOServiceConstructor },
   { &kNS_GSETTINGSSERVICE_CID, false, nullptr, nsGSettingsServiceConstructor },
   { &kNS_PACKAGEKITSERVICE_CID, false, nullptr, nsPackageKitServiceConstructor },
-#endif
   { &kNS_SYSTEMALERTSSERVICE_CID, false, nullptr, nsSystemAlertsServiceConstructor },
   { nullptr }
 };
 
 static const mozilla::Module::ContractIDEntry kGnomeContracts[] = {
 #ifdef MOZ_ENABLE_GCONF
   { NS_GCONFSERVICE_CONTRACTID, &kNS_GCONFSERVICE_CID },
 #endif
-#ifdef MOZ_ENABLE_GIO
   { NS_GIOSERVICE_CONTRACTID, &kNS_GIOSERVICE_CID },
   { NS_GSETTINGSSERVICE_CONTRACTID, &kNS_GSETTINGSSERVICE_CID },
   { NS_PACKAGEKITSERVICE_CONTRACTID, &kNS_PACKAGEKITSERVICE_CID },
-#endif
   { NS_SYSTEMALERTSERVICE_CONTRACTID, &kNS_SYSTEMALERTSSERVICE_CID },
   { nullptr }
 };
 
 static nsresult
 InitGType ()
 {
   g_type_init();