Bug 945097. Build widget/gtk in unified mode. r=karl,ehsan
authorRobert O'Callahan <robert@ocallahan.org>
Wed, 04 Dec 2013 14:06:16 +1300
changeset 174446 c0b9123264b9bac6d7ed272ea7887715ae721cf0
parent 174445 77c3680c7f5636540c9b6898e9371b78b3957716
child 174447 d791c9be9a6ea664c203973a4bc2ac23041c0778
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskarl, ehsan
bugs945097
milestone28.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 945097. Build widget/gtk in unified mode. r=karl,ehsan
widget/gtk/maiRedundantObjectFactory.c
widget/gtk/moz.build
widget/gtk/mozcontainer.c
--- a/widget/gtk/maiRedundantObjectFactory.c
+++ b/widget/gtk/maiRedundantObjectFactory.c
@@ -10,18 +10,16 @@
 
 static void mai_redundant_object_factory_class_init (
                               maiRedundantObjectFactoryClass *klass);
 
 static AtkObject* mai_redundant_object_factory_create_accessible (
                               GObject *obj);
 static GType mai_redundant_object_factory_get_accessible_type (void);
 
-static gpointer parent_class = NULL;
-
 GType
 mai_redundant_object_factory_get_type (void)
 {
   static GType type = 0;
 
   if (!type)
   {
     static const GTypeInfo tinfo =
@@ -45,18 +43,16 @@ mai_redundant_object_factory_get_type (v
   return type;
 }
 
 static void
 mai_redundant_object_factory_class_init (maiRedundantObjectFactoryClass *klass)
 {
   AtkObjectFactoryClass *class = ATK_OBJECT_FACTORY_CLASS (klass);
 
-  parent_class = g_type_class_peek_parent (klass);
-
   class->create_accessible = mai_redundant_object_factory_create_accessible;
   class->get_accessible_type = mai_redundant_object_factory_get_accessible_type;
 }
 
 /**
  * mai_redundant_object_factory_new:
  *
  * Creates an instance of an #AtkObjectFactory which generates primitive
--- a/widget/gtk/moz.build
+++ b/widget/gtk/moz.build
@@ -10,75 +10,82 @@ else:
     LIBRARY_NAME = 'widget_gtk3'
 
 EXPORTS += [
     'mozcontainer.h',
     'nsGTKToolkit.h',
     'nsIImageToPixbuf.h',
 ]
 
-SOURCES += [
-    'nsAppShell.cpp',
+UNIFIED_SOURCES += [
+    'mozcontainer.c',
     'nsBidiKeyboard.cpp',
     'nsColorPicker.cpp',
     'nsFilePicker.cpp',
-    'nsGtkIMModule.cpp',
     'nsGtkKeyUtils.cpp',
     'nsImageToPixbuf.cpp',
     'nsLookAndFeel.cpp',
     'nsNativeKeyBindings.cpp',
     'nsNativeThemeGTK.cpp',
     'nsScreenGtk.cpp',
     'nsScreenManagerGtk.cpp',
     'nsSound.cpp',
     'nsToolkit.cpp',
-    'nsWidgetFactory.cpp',
-    'nsWindow.cpp',
     'WidgetTraceEvent.cpp',
 ]
 
+# These files force-enable NSPR logging and thus cannot be built in unified mode
+SOURCES += [
+    'nsAppShell.cpp',
+    'nsGtkIMModule.cpp',
+    'nsWidgetFactory.cpp',
+    'nsWindow.cpp',
+]
+
 if CONFIG['MOZ_X11']:
-    SOURCES += [
+    UNIFIED_SOURCES += [
         'nsIdleServiceGTK.cpp',
     ]
 
 if CONFIG['NS_PRINTING']:
-    SOURCES += [
+    UNIFIED_SOURCES += [
         'nsCUPSShim.cpp',
-        'nsDeviceContextSpecG.cpp',
         'nsPaperPS.cpp',
         'nsPrintDialogGTK.cpp',
         'nsPrintOptionsGTK.cpp',
         'nsPrintSettingsGTK.cpp',
         'nsPSPrinters.cpp',
     ]
+    # This file force-enables NSPR logging and thus cannot be built in unified mode
+    SOURCES += [
+        'nsDeviceContextSpecG.cpp',
+    ]
 
 if CONFIG['MOZ_X11']:
+    UNIFIED_SOURCES += [
+        'nsClipboard.cpp',
+    ]
+    # This file force-enables NSPR logging and thus cannot be built in unified mode
     SOURCES += [
-        'nsClipboard.cpp',
         'nsDragService.cpp',
     ]
 
 FAIL_ON_WARNINGS = True
 
-SOURCES += [
-    'mozcontainer.c',
-]
-
 if CONFIG['ACCESSIBILITY']:
-    SOURCES += [
+    UNIFIED_SOURCES += [
         'maiRedundantObjectFactory.c',
     ]
 
 if CONFIG['MOZ_ENABLE_GTK2']:
-    SOURCES += [
+    UNIFIED_SOURCES += [
         'gtk2drawing.c',
     ]
 else:
-    SOURCES += [
+    UNIFIED_SOURCES += [
         'gtk3drawing.c',
     ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 
 LOCAL_INCLUDES += [
--- a/widget/gtk/mozcontainer.c
+++ b/widget/gtk/mozcontainer.c
@@ -43,18 +43,16 @@ struct _MozContainerChild {
     gint y;
 };
 
 static void moz_container_allocate_child (MozContainer      *container,
                                           MozContainerChild *child);
 static MozContainerChild *
 moz_container_get_child (MozContainer *container, GtkWidget *child);
 
-static GtkContainerClass *parent_class = NULL;
-
 /* public methods */
 
 GType
 moz_container_get_type(void)
 {
     static GType moz_container_type = 0;
 
     if (!moz_container_type) {
@@ -148,18 +146,16 @@ moz_container_move (MozContainer *contai
 void
 moz_container_class_init (MozContainerClass *klass)
 {
     /*GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
       GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass); */
     GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);
     GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
 
-    parent_class = g_type_class_peek_parent (klass);
-
     widget_class->map = moz_container_map;
     widget_class->unmap = moz_container_unmap;
     widget_class->realize = moz_container_realize;
     widget_class->size_allocate = moz_container_size_allocate;
 
     container_class->remove = moz_container_remove;
     container_class->forall = moz_container_forall;
     container_class->add = moz_container_add;