Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Feb 2012 14:18:18 GMT
From:      svn-freebsd-gecko@chruetertee.ch
To:        freebsd-gecko@freebsd.org
Subject:   [SVN-Commit] r698 - branches/experimental/www/libxul/files
Message-ID:  <201202181418.q1IEIImn008801@trillian.chruetertee.ch>

next in thread | raw e-mail | index | archive | help
Author: flo
Date: Sat Feb 18 14:18:18 2012
New Revision: 698

Log:
another oops commit... forgot to svn rm/add files

Added:
   branches/experimental/www/libxul/files/patch-browser-app-nsBrowserApp.cpp
   branches/experimental/www/libxul/files/patch-ipc-chromium-src-base-dir_reader_linux.h
   branches/experimental/www/libxul/files/patch-js-src-jscpucfg.h
Deleted:
   branches/experimental/www/libxul/files/patch-bugzilla-659932
   branches/experimental/www/libxul/files/patch-ipc-chromium-src-base-file_util.h

Added: branches/experimental/www/libxul/files/patch-browser-app-nsBrowserApp.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/experimental/www/libxul/files/patch-browser-app-nsBrowserApp.cpp	Sat Feb 18 14:18:18 2012	(r698)
@@ -0,0 +1,221 @@
+--- browser/app/nsBrowserApp.cpp	2011-09-28 22:24:36.000000000 +0200
++++ ../../ff6/mozilla-release/browser/app/nsBrowserApp.cpp	2011-09-02 22:15:19.000000000 +0200
+@@ -36,19 +36,14 @@
+  *
+  * ***** END LICENSE BLOCK ***** */
+ 
+-#include "nsXPCOMGlue.h"
+ #include "nsXULAppAPI.h"
+-#if defined(XP_WIN)
++#ifdef XP_WIN
+ #include <windows.h>
+ #include <stdlib.h>
+-#elif defined(XP_UNIX)
+-#include <sys/time.h>
+-#include <sys/resource.h>
+ #endif
+ 
+ #include <stdio.h>
+ #include <stdarg.h>
+-#include <string.h>
+ 
+ #include "plstr.h"
+ #include "prprf.h"
+@@ -59,16 +54,11 @@
+ #include "nsStringGlue.h"
+ 
+ #ifdef XP_WIN
++// we want to use the DLL blocklist if possible
++#define XRE_WANT_DLL_BLOCKLIST
+ // we want a wmain entry point
+ #include "nsWindowsWMain.cpp"
+-#define snprintf _snprintf
+-#define strcasecmp _stricmp
+ #endif
+-#include "BinaryPath.h"
+-
+-#include "nsXPCOMPrivate.h" // for MAXPATHLEN and XPCOM_DLL
+-
+-#include "mozilla/Telemetry.h"
+ 
+ static void Output(const char *fmt, ... )
+ {
+@@ -95,12 +85,12 @@
+   {
+     if (*++arg == '-')
+       ++arg;
+-    return !strcasecmp(arg, s);
++    return !PL_strcasecmp(arg, s);
+   }
+ 
+ #if defined(XP_WIN) || defined(XP_OS2)
+   if (*arg == '/')
+-    return !strcasecmp(++arg, s);
++    return !PL_strcasecmp(++arg, s);
+ #endif
+ 
+   return PR_FALSE;
+@@ -116,48 +106,22 @@
+   ~ScopedLogging() { NS_LogTerm(); }
+ };
+ 
+-XRE_GetFileFromPathType XRE_GetFileFromPath;
+-XRE_CreateAppDataType XRE_CreateAppData;
+-XRE_FreeAppDataType XRE_FreeAppData;
+-#ifdef XRE_HAS_DLL_BLOCKLIST
+-XRE_SetupDllBlocklistType XRE_SetupDllBlocklist;
+-#endif
+-XRE_TelemetryAccumulateType XRE_TelemetryAccumulate;
+-XRE_mainType XRE_main;
+-
+-static const nsDynamicFunctionLoad kXULFuncs[] = {
+-    { "XRE_GetFileFromPath", (NSFuncPtr*) &XRE_GetFileFromPath },
+-    { "XRE_CreateAppData", (NSFuncPtr*) &XRE_CreateAppData },
+-    { "XRE_FreeAppData", (NSFuncPtr*) &XRE_FreeAppData },
+-#ifdef XRE_HAS_DLL_BLOCKLIST
+-    { "XRE_SetupDllBlocklist", (NSFuncPtr*) &XRE_SetupDllBlocklist },
+-#endif
+-    { "XRE_TelemetryAccumulate", (NSFuncPtr*) &XRE_TelemetryAccumulate },
+-    { "XRE_main", (NSFuncPtr*) &XRE_main },
+-    { nsnull, nsnull }
+-};
+-
+-static int do_main(const char *exePath, int argc, char* argv[])
++int main(int argc, char* argv[])
+ {
++  ScopedLogging log;
++
+   nsCOMPtr<nsILocalFile> appini;
+-#ifdef XP_WIN
+-  // exePath comes from mozilla::BinaryPath::Get, which returns a UTF-8
+-  // encoded path, so it is safe to convert it
+-  nsresult rv = NS_NewLocalFile(NS_ConvertUTF8toUTF16(exePath), false,
+-                                getter_AddRefs(appini));
+-#else
+-  nsresult rv = NS_NewNativeLocalFile(nsDependentCString(exePath), false,
+-                                      getter_AddRefs(appini));
+-#endif
++  nsresult rv = XRE_GetBinaryPath(argv[0], getter_AddRefs(appini));
+   if (NS_FAILED(rv)) {
++    Output("Couldn't calculate the application directory.");
+     return 255;
+   }
+-
+   appini->SetNativeLeafName(NS_LITERAL_CSTRING("application.ini"));
+ 
+   // Allow firefox.exe to launch XULRunner apps via -app <application.ini>
+   // Note that -app must be the *first* argument.
+-  const char *appDataFile = getenv("XUL_APP_FILE");
++  char *appEnv = nsnull;
++  const char *appDataFile = PR_GetEnv("XUL_APP_FILE");
+   if (appDataFile && *appDataFile) {
+     rv = XRE_GetFileFromPath(appDataFile, getter_AddRefs(appini));
+     if (NS_FAILED(rv)) {
+@@ -177,12 +141,8 @@
+       return 255;
+     }
+ 
+-    char appEnv[MAXPATHLEN];
+-    snprintf(appEnv, MAXPATHLEN, "XUL_APP_FILE=%s", argv[2]);
+-    if (putenv(appEnv)) {
+-      Output("Couldn't set %s.\n", appEnv);
+-      return 255;
+-    }
++    appEnv = PR_smprintf("XUL_APP_FILE=%s", argv[2]);
++    PR_SetEnv(appEnv);
+     argv[2] = argv[0];
+     argv += 2;
+     argc -= 2;
+@@ -197,90 +157,7 @@
+ 
+   int result = XRE_main(argc, argv, appData);
+   XRE_FreeAppData(appData);
+-  return result;
+-}
+-
+-int main(int argc, char* argv[])
+-{
+-  char exePath[MAXPATHLEN];
+-
+-  nsresult rv = mozilla::BinaryPath::Get(argv[0], exePath);
+-  if (NS_FAILED(rv)) {
+-    Output("Couldn't calculate the application directory.\n");
+-    return 255;
+-  }
+-
+-  char *lastSlash = strrchr(exePath, XPCOM_FILE_PATH_SEPARATOR[0]);
+-  if (!lastSlash || (lastSlash - exePath > MAXPATHLEN - sizeof(XPCOM_DLL) - 1))
+-    return 255;
+-
+-  strcpy(++lastSlash, XPCOM_DLL);
+-
+-  int gotCounters;
+-#if defined(XP_UNIX)
+-  struct rusage initialRUsage;
+-  gotCounters = !getrusage(RUSAGE_SELF, &initialRUsage);
+-#elif defined(XP_WIN)
+-  // GetProcessIoCounters().ReadOperationCount seems to have little to
+-  // do with actual read operations. It reports 0 or 1 at this stage
+-  // in the program. Luckily 1 coincides with when prefetch is
+-  // enabled. If Windows prefetch didn't happen we can do our own
+-  // faster dll preloading.
+-  IO_COUNTERS ioCounters;
+-  gotCounters = GetProcessIoCounters(GetCurrentProcess(), &ioCounters);
+-  if (gotCounters && !ioCounters.ReadOperationCount)
+-#endif
+-  {
+-      XPCOMGlueEnablePreload();
+-  }
+-
+-
+-  rv = XPCOMGlueStartup(exePath);
+-  if (NS_FAILED(rv)) {
+-    Output("Couldn't load XPCOM.\n");
+-    return 255;
+-  }
+-
+-  rv = XPCOMGlueLoadXULFunctions(kXULFuncs);
+-  if (NS_FAILED(rv)) {
+-    Output("Couldn't load XRE functions.\n");
+-    return 255;
+-  }
+-
+-#ifdef XRE_HAS_DLL_BLOCKLIST
+-  XRE_SetupDllBlocklist();
+-#endif
+-
+-  if (gotCounters) {
+-#if defined(XP_WIN)
+-    XRE_TelemetryAccumulate(mozilla::Telemetry::EARLY_GLUESTARTUP_READ_OPS,
+-                            int(ioCounters.ReadOperationCount));
+-    XRE_TelemetryAccumulate(mozilla::Telemetry::EARLY_GLUESTARTUP_READ_TRANSFER,
+-                            int(ioCounters.ReadTransferCount / 1024));
+-    IO_COUNTERS newIoCounters;
+-    if (GetProcessIoCounters(GetCurrentProcess(), &newIoCounters)) {
+-      XRE_TelemetryAccumulate(mozilla::Telemetry::GLUESTARTUP_READ_OPS,
+-                              int(newIoCounters.ReadOperationCount - ioCounters.ReadOperationCount));
+-      XRE_TelemetryAccumulate(mozilla::Telemetry::GLUESTARTUP_READ_TRANSFER,
+-                              int((newIoCounters.ReadTransferCount - ioCounters.ReadTransferCount) / 1024));
+-    }
+-#elif defined(XP_UNIX)
+-    XRE_TelemetryAccumulate(mozilla::Telemetry::EARLY_GLUESTARTUP_HARD_FAULTS,
+-                            int(initialRUsage.ru_majflt));
+-    struct rusage newRUsage;
+-    if (!getrusage(RUSAGE_SELF, &newRUsage)) {
+-      XRE_TelemetryAccumulate(mozilla::Telemetry::GLUESTARTUP_HARD_FAULTS,
+-                              int(newRUsage.ru_majflt - initialRUsage.ru_majflt));
+-    }
+-#endif
+-  }
+-
+-  int result;
+-  {
+-    ScopedLogging log;
+-    result = do_main(exePath, argc, argv);
+-  }
+-
+-  XPCOMGlueShutdown();
++  if (appEnv)
++    PR_smprintf_free(appEnv);
+   return result;
+ }

Deleted: branches/experimental/www/libxul/files/patch-bugzilla-659932
==============================================================================
--- branches/experimental/www/libxul/files/patch-bugzilla-659932	Sat Feb 18 14:18:18 2012	(r697)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,35 +0,0 @@
---- toolkit/xre/glxtest.cpp.orig	2011-08-11 17:41:31.000000000 -0400
-+++ toolkit/xre/glxtest.cpp	2011-08-23 15:09:48.000000000 -0400
-@@ -114,6 +114,9 @@
-   typedef GLXFBConfig* (* PFNGLXQUERYEXTENSION) (Display *, int *, int *);
-   PFNGLXQUERYEXTENSION glXQueryExtension = cast<PFNGLXQUERYEXTENSION>(dlsym(libgl, "glXQueryExtension"));
- 
-+  typedef GLXFBConfig* (* PFNGLXQUERYVERSION) (Display *, int *, int *);
-+  PFNGLXQUERYVERSION glXQueryVersion = cast<PFNGLXQUERYVERSION>(dlsym(libgl, "glXQueryVersion"));
-+
-   typedef GLXFBConfig* (* PFNGLXCHOOSEFBCONFIG) (Display *, int, const int *, int *);
-   PFNGLXCHOOSEFBCONFIG glXChooseFBConfig = cast<PFNGLXCHOOSEFBCONFIG>(dlsym(libgl, "glXChooseFBConfig"));
- 
-@@ -139,6 +142,7 @@
-   PFNGLGETSTRING glGetString = cast<PFNGLGETSTRING>(dlsym(libgl, "glGetString"));
- 
-   if (!glXQueryExtension ||
-+      !glXQueryVersion ||
-       !glXChooseFBConfig ||
-       !glXGetVisualFromFBConfig ||
-       !glXCreatePixmap ||
-@@ -158,6 +162,14 @@
-   ///// Check that the GLX extension is present /////
-   if (!glXQueryExtension(dpy, NULL, NULL))
-     fatal_error("GLX extension missing");
-+  
-+  ///// Check that the GLX version is >= 1.3, needed for glXCreatePixmap, bug 659932 /////
-+  int majorVersion, minorVersion;
-+  if (!glXQueryVersion(dpy, &majorVersion, &minorVersion))
-+    fatal_error("Unable to query GLX version");
-+
-+  if (majorVersion < 1 || (majorVersion == 1 && minorVersion < 3))
-+    fatal_error("GLX version older than the required 1.3");
- 
-   XSetErrorHandler(x_error_handler);
- 

Added: branches/experimental/www/libxul/files/patch-ipc-chromium-src-base-dir_reader_linux.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/experimental/www/libxul/files/patch-ipc-chromium-src-base-dir_reader_linux.h	Sat Feb 18 14:18:18 2012	(r698)
@@ -0,0 +1,45 @@
+--- ipc/chromium/src/base/dir_reader_linux.h.orig	2011-12-16 21:29:22.000000000 +0100
++++ ipc/chromium/src/base/dir_reader_linux.h	2011-12-19 21:00:27.000000000 +0100
+@@ -9,6 +9,7 @@
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <stdint.h>
++#include <sys/dirent.h>
+ #include <sys/syscall.h>
+ #include <unistd.h>
+ 
+@@ -19,6 +20,8 @@
+ 
+ namespace base {
+ 
++#define linux_dirent struct dirent
++#if 0
+ struct linux_dirent {
+   uint64_t        d_ino;
+   int64_t         d_off;
+@@ -26,11 +29,16 @@
+   unsigned char   d_type;
+   char            d_name[0];
+ };
++#endif
+ 
+ class DirReaderLinux {
+  public:
+   explicit DirReaderLinux(const char* directory_path)
++#ifdef O_DIRECTORY
+       : fd_(open(directory_path, O_RDONLY | O_DIRECTORY)),
++#else
++      : fd_(open(directory_path, O_RDONLY)),
++#endif
+         offset_(0),
+         size_(0) {
+     memset(buf_, 0, sizeof(buf_));
+@@ -57,7 +65,7 @@
+     if (offset_ != size_)
+       return true;
+ 
+-    const int r = syscall(__NR_getdents64, fd_, buf_, sizeof(buf_));
++    const int r = syscall(SYS_getdents, fd_, buf_, sizeof(buf_));
+     if (r == 0)
+       return false;
+     if (r == -1) {

Deleted: branches/experimental/www/libxul/files/patch-ipc-chromium-src-base-file_util.h
==============================================================================
--- branches/experimental/www/libxul/files/patch-ipc-chromium-src-base-file_util.h	Sat Feb 18 14:18:18 2012	(r697)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,13 +0,0 @@
---- ipc/chromium/src/base/file_util.h~
-+++ ipc/chromium/src/base/file_util.h
-@@ -15,8 +15,9 @@
- #elif defined(ANDROID)
- #include <sys/stat.h>
- #elif defined(OS_POSIX) 
-+#include <sys/types.h>
-+#include <sys/stat.h>
- #include <fts.h>
--#include <sys/stat.h>
- #endif
- 
- #include <stdio.h>

Added: branches/experimental/www/libxul/files/patch-js-src-jscpucfg.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/experimental/www/libxul/files/patch-js-src-jscpucfg.h	Sat Feb 18 14:18:18 2012	(r698)
@@ -0,0 +1,22 @@
+--- js/src/jscpucfg.h.orig	2012-01-18 17:38:54.409461514 +0100
++++ js/src/jscpucfg.h	2012-01-18 17:38:59.522462164 +0100
+@@ -77,6 +77,19 @@
+ #define IS_BIG_ENDIAN 1
+ #endif
+ 
++#elif defined(__FreeBSD__)
++#include <sys/endian.h>
++
++#if defined(BYTE_ORDER)
++#if BYTE_ORDER == LITTLE_ENDIAN
++#define IS_LITTLE_ENDIAN 1
++#undef  IS_BIG_ENDIAN
++#elif BYTE_ORDER == BIG_ENDIAN
++#undef  IS_LITTLE_ENDIAN
++#define IS_BIG_ENDIAN 1
++#endif
++#endif
++
+ #elif defined(JS_HAVE_ENDIAN_H)
+ #include <endian.h>
+ 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201202181418.q1IEIImn008801>