Backout 8ceaedf06a57, f67977dea071 & 3fcaee9224ce (bug 704230) since bug 686466 does the same thing for all platforms; a=glandium
authorEd Morley <bmo@edmorley.co.uk>
Tue, 22 Nov 2011 11:44:41 +0000
changeset 82244 243515ec2ad3f24dfcebc7c319ee4505ded068d4
parent 82243 8ceaedf06a576d3f02365968aa5c3e2f86c38141
child 82251 ea30e13fc978a6929683e174d0ac97a8618d385e
push id519
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 00:38:35 +0000
treeherdermozilla-beta@788ea1ef610b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs704230, 686466
milestone11.0a1
backs out8ceaedf06a576d3f02365968aa5c3e2f86c38141
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
Backout 8ceaedf06a57, f67977dea071 & 3fcaee9224ce (bug 704230) since bug 686466 does the same thing for all platforms; a=glandium
config/autoconf.mk.in
configure.in
mobile/xul/app/Makefile.in
mobile/xul/app/application.ini
mobile/xul/confvars.sh
toolkit/mozapps/update/nsUpdateService.js
toolkit/xre/Makefile.in
toolkit/xre/nsAndroidStartup.cpp
--- a/config/autoconf.mk.in
+++ b/config/autoconf.mk.in
@@ -692,10 +692,8 @@ ifeq ($(HOST_OS_ARCH),WINNT)
 # actually can be found regardless of path-style.
 ifeq (_:,$(.PYMAKE)_$(findstring :,$(srcdir)))
 $(error Windows-style srcdir being used with GNU make. Did you mean to run $(topsrcdir)/build/pymake/make.py instead? [see-also: https://developer.mozilla.org/en/Gmake_vs._Pymake])
 endif
 ifeq (1_a,$(.PYMAKE)_$(firstword a$(subst /, ,$(srcdir))))
 $(error MSYS-style srcdir being used with Pymake. Did you mean to run GNU Make instead? [see-also: https://developer.mozilla.org/en/Gmake_vs._Pymake])
 endif
 endif # WINNT
-
-MOZ_APP_ID = @MOZ_APP_ID@
--- a/configure.in
+++ b/configure.in
@@ -8683,18 +8683,16 @@ AC_SUBST(VPX_X86_ASM)
 AC_SUBST(VPX_ARM_ASM)
 AC_SUBST(VPX_NEED_OBJ_INT_EXTRACT)
 AC_SUBST(MOZ_INSTRUMENT_EVENT_LOOP)
 AC_SUBST(LIBJPEG_TURBO_AS)
 AC_SUBST(LIBJPEG_TURBO_ASFLAGS)
 AC_SUBST(LIBJPEG_TURBO_X86_ASM)
 AC_SUBST(LIBJPEG_TURBO_X64_ASM)
 
-AC_SUBST(MOZ_APP_ID)
-
 AC_MSG_CHECKING([for posix_fallocate])
 AC_TRY_LINK([#define _XOPEN_SOURCE 600
   #include <fcntl.h>],
                  [posix_fallocate(0, 0, 0);],
                  [ac_cv___posix_fallocate=true],
                  [ac_cv___posix_fallocate=false])
 
 if test "$ac_cv___posix_fallocate" = true ; then
--- a/mobile/xul/app/Makefile.in
+++ b/mobile/xul/app/Makefile.in
@@ -100,17 +100,16 @@ endif
 APP_ICON = mobile
 
 DEFINES += -DGRE_MILESTONE=$(GRE_MILESTONE) \
            -DGRE_BUILDID=$(GRE_BUILDID) \
            -DAPP_BUILDID=$(APP_BUILDID) \
            -DAPP_NAME=$(MOZ_APP_NAME) \
            -DAPP_VERSION=$(MOZ_APP_VERSION) \
            -DMOZ_UPDATER=$(MOZ_UPDATER) \
-           -DAPP_ID=$(MOZ_APP_ID) \
            $(NULL)
 
 ifdef MOZILLA_OFFICIAL
 DEFINES += -DMOZILLA_OFFICIAL
 endif
 
 SOURCE_STAMP := $(shell cd $(srcdir)/.. && hg identify 2>/dev/null | cut -f1 -d' ')
 ifdef SOURCE_STAMP
--- a/mobile/xul/app/application.ini
+++ b/mobile/xul/app/application.ini
@@ -5,17 +5,17 @@ Name=Fennec
 Version=@APP_VERSION@
 BuildID=@APP_BUILDID@
 #ifdef MOZ_SOURCE_REPO
 SourceRepository=@MOZ_SOURCE_REPO@
 #endif
 #ifdef MOZ_SOURCE_STAMP
 SourceStamp=@MOZ_SOURCE_STAMP@
 #endif
-ID=@APP_ID@
+ID={a23983c0-fd0e-11dc-95ff-0800200c9a66}
 
 [Gecko]
 MinVersion=1.9.2b5pre
 MaxVersion=@GRE_MILESTONE@
 
 [XRE]
 EnableExtensionManager=1
 
--- a/mobile/xul/confvars.sh
+++ b/mobile/xul/confvars.sh
@@ -62,10 +62,8 @@ MOZ_RAW=1
 fi
 
 # Needed for building our components as part of libxul
 MOZ_APP_COMPONENT_LIBS="browsercomps"
 MOZ_APP_COMPONENT_INCLUDE=nsBrowserComponents.h
 
 # use custom widget for html:select
 MOZ_USE_NATIVE_POPUP_WINDOWS=1
-
-MOZ_APP_ID={a23983c0-fd0e-11dc-95ff-0800200c9a66}
--- a/toolkit/mozapps/update/nsUpdateService.js
+++ b/toolkit/mozapps/update/nsUpdateService.js
@@ -682,28 +682,28 @@ function cleanupActiveUpdate() {
 
 /**
  * Gets the locale from the update.locale file for replacing %LOCALE% in the
  * update url. The update.locale file can be located in the application
  * directory or the GRE directory with preference given to it being located in
  * the application directory.
  */
 function getLocale() {
-
   if (gLocale)
     return gLocale;
 
   var localeFile = FileUtils.getFile(KEY_APPDIR, [FILE_UPDATE_LOCALE]);
   if (!localeFile.exists())
     localeFile = FileUtils.getFile(KEY_GRED, [FILE_UPDATE_LOCALE]);
 
-  if (!localeFile.exists()) {
-    // XXX temp workaround.  see bug 704230
-    return "en-US";
-  }
+  if (!localeFile.exists())
+    throw Components.Exception(FILE_UPDATE_LOCALE + " file doesn't exist in " +
+                               "either the " + KEY_APPDIR + " or " + KEY_GRED +
+                               " directories", Cr.NS_ERROR_FILE_NOT_FOUND);
+
   gLocale = readStringFromFile(localeFile);
   LOG("getLocale - getting locale from file: " + localeFile.path +
       ", locale: " + gLocale);
   return gLocale;
 }
 
 /**
  * Read the update channel from defaults only.  We do this to ensure that
--- a/toolkit/xre/Makefile.in
+++ b/toolkit/xre/Makefile.in
@@ -246,30 +246,18 @@ endif
 endif
 
 # Solaris /usr/bin/diff doesn't have -n option
 GRE_MILESTONE := $(shell tail -n 1 $(topsrcdir)/config/milestone.txt 2>/dev/null || tail -1 $(topsrcdir)/config/milestone.txt)
 GRE_BUILDID := $(shell cat $(DEPTH)/config/buildid)
  
 DEFINES += -DGRE_MILESTONE=$(GRE_MILESTONE) -DGRE_BUILDID=$(GRE_BUILDID)
 
-ifdef MOZILLA_OFFICIAL
-DEFINES += -DMOZILLA_OFFICIAL
-endif
-
-DEFINES += -DAPP_VERSION=$(MOZ_APP_VERSION)
-
-DEFINES += -DAPP_ID=$(MOZ_APP_ID)
-
 $(srcdir)/nsAppRunner.cpp: $(DEPTH)/config/buildid $(topsrcdir)/config/milestone.txt
 
-ifeq ($(OS_TARGET),Android)
-nsAndroidStartup.o: $(DEPTH)/config/buildid $(topsrcdir)/config/milestone.txt
-endif
-
 platform.ini: FORCE
 	$(PYTHON) $(srcdir)/make-platformini.py --buildid=$(shell cat $(DEPTH)/config/buildid) $(INIARGS) $(topsrcdir)/config/milestone.txt > $@
 
 GARBAGE += platform.ini
 
 libs:: platform.ini
 	$(INSTALL) $^ $(DIST)/bin
 
--- a/toolkit/xre/nsAndroidStartup.cpp
+++ b/toolkit/xre/nsAndroidStartup.cpp
@@ -52,19 +52,16 @@
 #include "nsILocalFile.h"
 #include "nsAppRunner.h"
 #include "AndroidBridge.h"
 #include "APKOpen.h"
 #include "nsExceptionHandler.h"
 
 #define LOG(args...) __android_log_print(ANDROID_LOG_INFO, MOZ_APP_NAME, args)
 
-#define _STR(s) # s
-#define STR(s) _STR(s)
-
 struct AutoAttachJavaThread {
     AutoAttachJavaThread() {
         attached = mozilla_AndroidBridge_SetMainThread((void*)pthread_self());
     }
     ~AutoAttachJavaThread() {
         mozilla_AndroidBridge_SetMainThread(nsnull);
         attached = false;
     }
@@ -95,57 +92,55 @@ GeckoStart(void *data)
 
     nsresult rv;
     nsCOMPtr<nsILocalFile> appini;
     char* greHome = getenv("GRE_HOME");
     if (!greHome) {
         LOG("Failed to get GRE_HOME from the env vars");
         return 0;
     }
+    nsCAutoString appini_path(greHome);
+    appini_path.AppendLiteral("/application.ini");
+    rv = NS_NewNativeLocalFile(appini_path, false, getter_AddRefs(appini));
+    if (NS_FAILED(rv)) {
+        LOG("Failed to create nsILocalFile for appdata\n");
+        return 0;
+    }
+
+    nsXREAppData *appData;
+    rv = XRE_CreateAppData(appini, &appData);
+    if (NS_FAILED(rv)) {
+        LOG("Failed to load application.ini from %s\n", appini_path.get());
+        return 0;
+    }
 
     nsCOMPtr<nsILocalFile> xreDir;
     rv = NS_NewNativeLocalFile(nsDependentCString(greHome), false, getter_AddRefs(xreDir));
     if (NS_FAILED(rv)) {
         LOG("Failed to create nsIFile for xreDirectory");
         return 0;
     }
 
-    nsXREAppData appData = {
-        sizeof(nsXREAppData),
-        xreDir.get(),
-        "Mozilla",
-        "Fennec",
-        STR(APP_VERSION),
-        STR(GRE_BUILDID),
-        STR(APP_ID),
-        NULL,
-#ifdef MOZILLA_OFFICIAL
-        NS_XRE_ENABLE_EXTENSION_MANAGER | NS_XRE_ENABLE_CRASH_REPORTER,
-#else
-        NS_XRE_ENABLE_EXTENSION_MANAGER,
-#endif
-        xreDir.get(),
-        STR(GRE_MILESTONE),
-        STR(GRE_MILESTONE),
-        "https://crash-reports.mozilla.com/submit"
-    };
+    appData->xreDirectory = xreDir.get();
 
     nsTArray<char *> targs;
     char *arg = strtok(static_cast<char *>(data), " ");
     while (arg) {
         targs.AppendElement(arg);
         arg = strtok(NULL, " ");
     }
     targs.AppendElement(static_cast<char *>(nsnull));
 
-    int result = XRE_main(targs.Length() - 1, targs.Elements(), &appData);
+    int result = XRE_main(targs.Length() - 1, targs.Elements(), appData);
 
     if (result)
         LOG("XRE_main returned %d", result);
 
+    XRE_FreeAppData(appData);
+
     mozilla::AndroidBridge::Bridge()->NotifyXreExit();
 
     free(targs[0]);
     nsMemory::Free(data);
     return 0;
 }
 
 extern "C" NS_EXPORT void JNICALL