Backed out 3 changesets (bug 1344038) for bustage

Backed out changeset 4befea89d81b (bug 1344038)
Backed out changeset c859506b2e4e (bug 1344038)
Backed out changeset 5d28a6382285 (bug 1344038)

--HG--
rename : netwerk/protocol/gio/moz.build => extensions/gio/moz.build
rename : netwerk/protocol/gio/nsGIOProtocolHandler.cpp => extensions/gio/nsGIOProtocolHandler.cpp
This commit is contained in:
Iris Hsiao 2017-04-06 10:35:56 +08:00
Родитель 2a33c81425
Коммит 15a34cacd2
15 изменённых файлов: 127 добавлений и 14 удалений

Просмотреть файл

@ -38,6 +38,7 @@ MOZ_ENABLE_SIGNMAR=1
MOZ_APP_VERSION=$FIREFOX_VERSION
MOZ_APP_VERSION_DISPLAY=$FIREFOX_VERSION_DISPLAY
MOZ_EXTENSIONS_DEFAULT=" gio"
# MOZ_APP_DISPLAYNAME will be set by branding/configure.sh
# MOZ_BRANDING_DIRECTORY is the default branding directory used when none is
# specified. It should never point to the "official" branding directory.

Просмотреть файл

@ -179,6 +179,8 @@ def old_configure_options(*options):
'--enable-gamepad',
'--enable-gconf',
'--enable-gczeal',
'--enable-gio',
'--enable-gnomeui',
'--enable-gold',
'--enable-hardware-aec-ns',
'--enable-icf',

Просмотреть файл

@ -1271,7 +1271,9 @@ hunspell.hxx
#if MOZ_SYSTEM_BZ2==1
bzlib.h
#endif
#ifdef MOZ_ENABLE_GIO
gio/gio.h
#endif
#if MOZ_SYSTEM_LIBEVENT==1
event.h
#else

Просмотреть файл

@ -7,3 +7,4 @@ MOZ_APP_NAME=geckoembed
MOZ_APP_DISPLAYNAME=GeckoEmbed
MOZ_UPDATER=
MOZ_APP_VERSION=$MOZILLA_VERSION
MOZ_EXTENSIONS_DEFAULT=" gio"

Просмотреть файл

@ -10,7 +10,7 @@ SOURCES += [
FINAL_LIBRARY = 'xul'
CXXFLAGS += CONFIG['TK_CFLAGS']
CXXFLAGS += CONFIG['MOZ_GIO_CFLAGS']
with Files('**'):
BUG_COMPONENT = ('Core', 'Widget: Gtk')

Просмотреть файл

@ -10,4 +10,7 @@ SOURCES += [
FINAL_LIBRARY = 'xul'
CXXFLAGS += CONFIG['TK_CFLAGS']
if CONFIG['MOZ_ENABLE_GNOMEUI']:
CXXFLAGS += CONFIG['MOZ_GNOMEUI_CFLAGS']
else:
CXXFLAGS += CONFIG['TK_CFLAGS']

Просмотреть файл

@ -12,7 +12,9 @@
#include "mozilla/EndianUtils.h"
#include <algorithm>
#ifdef MOZ_ENABLE_GIO
#include <gio/gio.h>
#endif
#include <gtk/gtk.h>
@ -166,6 +168,7 @@ moz_gtk_icon_size(const char* name)
return GTK_ICON_SIZE_MENU;
}
#ifdef MOZ_ENABLE_GIO
static int32_t
GetIconSize(nsIMozIconURI* aIconURI)
{
@ -298,6 +301,7 @@ nsIconChannel::InitWithGIO(nsIMozIconURI* aIconURI)
g_object_unref(buf);
return rv;
}
#endif // MOZ_ENABLE_GIO
nsresult
nsIconChannel::Init(nsIURI* aURI)
@ -312,7 +316,11 @@ nsIconChannel::Init(nsIURI* aURI)
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

Просмотреть файл

@ -542,7 +542,7 @@ nsIOService::GetProtocolHandler(const char* scheme, nsIProtocolHandler* *result)
return rv;
}
#ifdef MOZ_WIDGET_GTK
#ifdef MOZ_ENABLE_GIO
// 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

Просмотреть файл

@ -57,12 +57,14 @@ 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
STARTUP_NOTIFICATION_VERSION=0.8
DBUS_VERSION=0.60
@ -2535,16 +2537,49 @@ MOZ_ANDROID_INSTALL_TRACKING
dnl ========================================================
dnl = GConf support module
dnl = GIO and 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 ========================================================
@ -2596,6 +2631,38 @@ then
fi
AC_SUBST(MOZ_ENABLE_LIBPROXY)
dnl ========================================================
dnl = libgnomeui support module
dnl ========================================================
if test "$MOZ_ENABLE_GTK"
then
MOZ_ARG_ENABLE_BOOL(gnomeui,
[ --enable-gnomeui Enable libgnomeui instead of GIO & GTK for icon theme support ],
MOZ_ENABLE_GNOMEUI=force,
MOZ_ENABLE_GNOMEUI=)
if test "$MOZ_ENABLE_GNOMEUI"
then
PKG_CHECK_MODULES(MOZ_GNOMEUI, libgnomeui-2.0 >= $GNOMEUI_VERSION,
[
MOZ_ENABLE_GNOMEUI=1
],[
if test "$MOZ_ENABLE_GNOMEUI" = "force"
then
AC_MSG_ERROR([* * * Could not find libgnomeui-2.0 >= $GNOMEUI_VERSION])
fi
MOZ_ENABLE_GNOMEUI=
])
fi
if test "$MOZ_ENABLE_GNOMEUI"; then
AC_DEFINE(MOZ_ENABLE_GNOMEUI)
fi
fi
AC_SUBST(MOZ_ENABLE_GNOMEUI)
dnl ========================================================
dnl = dbus support
dnl ========================================================
@ -3504,6 +3571,20 @@ MOZ_ARG_ENABLE_STRING(extensions,
done],
MOZ_EXTENSIONS="$MOZ_EXTENSIONS_DEFAULT")
if test -z "$MOZ_ENABLE_GIO" -a `echo "$MOZ_EXTENSIONS" | grep -c gio` -ne 0; then
# Suppress warning on non-X11 platforms
if test -n "$MOZ_X11"; then
AC_MSG_WARN([Removing gio from MOZ_EXTENSIONS due to --disable-gio.])
fi
MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gio||'`
fi
if test `echo "$MOZ_EXTENSIONS" | grep -c gio` -ne 0; then
MOZ_GIO_COMPONENT=1
MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gio||'`
fi
AC_SUBST(MOZ_GIO_COMPONENT)
dnl Ensure every extension exists, to avoid mostly-inscrutable error messages
dnl when trying to build a nonexistent extension.
for extension in $MOZ_EXTENSIONS; do

Просмотреть файл

@ -2648,7 +2648,7 @@ NS_IMETHODIMP nsDownload::SetRedirects(nsIArray* aRedirects) {
return NS_OK;
}
#ifdef MOZ_WIDGET_GTK
#ifdef MOZ_ENABLE_GIO
static void gio_set_metadata_done(GObject *source_obj, GAsyncResult *res, gpointer user_data)
{
GError *err = nullptr;
@ -2817,7 +2817,7 @@ nsDownload::SetState(DownloadState aState)
#endif
}
#endif
#ifdef MOZ_WIDGET_GTK
#ifdef MOZ_ENABLE_GIO
// 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;

Просмотреть файл

@ -59,7 +59,7 @@ DownloadPlatform* DownloadPlatform::GetDownloadPlatform()
return gDownloadPlatformService;
}
#ifdef MOZ_WIDGET_GTK
#ifdef MOZ_ENABLE_GIO
static void gio_set_metadata_done(GObject *source_obj, GAsyncResult *res, gpointer user_data)
{
GError *err = nullptr;
@ -131,7 +131,7 @@ nsresult DownloadPlatform::DownloadDone(nsIURI* aSource, nsIURI* aReferrer, nsIF
#endif
}
#endif
#ifdef MOZ_WIDGET_GTK
#ifdef MOZ_ENABLE_GIO
// 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;

Просмотреть файл

@ -15,11 +15,12 @@ if CONFIG['MOZ_ENABLE_GCONF']:
'nsGConfService.cpp',
]
SOURCES += [
'nsGIOService.cpp',
'nsGSettingsService.cpp',
'nsPackageKitService.cpp'
]
if CONFIG['MOZ_ENABLE_GIO']:
SOURCES += [
'nsGIOService.cpp',
'nsGSettingsService.cpp',
'nsPackageKitService.cpp'
]
FINAL_LIBRARY = 'xul'
@ -28,6 +29,9 @@ LOCAL_INCLUDES += [
]
CXXFLAGS += CONFIG['MOZ_GCONF_CFLAGS']
CXXFLAGS += CONFIG['MOZ_GIO_CFLAGS']
CXXFLAGS += CONFIG['GLIB_CFLAGS']
CXXFLAGS += CONFIG['MOZ_DBUS_GLIB_CFLAGS']
CXXFLAGS += CONFIG['TK_CFLAGS']
if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
CXXFLAGS += CONFIG['TK_CFLAGS']

Просмотреть файл

@ -12,30 +12,36 @@
#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 }
};
@ -44,9 +50,11 @@ 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 }
};

Просмотреть файл

@ -139,6 +139,9 @@ DIRS += [
'/other-licenses/snappy',
]
if CONFIG['MOZ_GIO_COMPONENT']:
DIRS += ['/extensions/gio']
if CONFIG['MOZ_RUST']:
DIRS += [
'/toolkit/library/gtest/rust',