r7446 - mugshot-client/trunk/common/firefox/src



Author: otaylor
Date: 2008-04-24 15:01:34 -0500 (Thu, 24 Apr 2008)
New Revision: 7446

Modified:
   mugshot-client/trunk/common/firefox/src/hippoControl.cpp
Log:
hippoControl.cpp: Use internal strings to work around problem
  with nsString member in nsIDocument

  https://bugzilla.redhat.com/show_bug.cgi?id=441643

Thanks to Jan Kratochvil, Martin Stransky, and Marco Pesenti Gritti 
for tracking this down.


Modified: mugshot-client/trunk/common/firefox/src/hippoControl.cpp
===================================================================
--- mugshot-client/trunk/common/firefox/src/hippoControl.cpp	2008-04-23 21:53:52 UTC (rev 7445)
+++ mugshot-client/trunk/common/firefox/src/hippoControl.cpp	2008-04-24 20:01:34 UTC (rev 7446)
@@ -20,6 +20,29 @@
 #endif
 
 #include "nspr.h"
+
+#ifdef HAVE_XULRUNNER
+/* For our usage of nsIDocument, we hit a problem where the
+ * size of nsString and nsString_external are different on
+ * some architectures. Since nsIDocument has a nsString
+ * member, accessing subsequent members then causes a crash
+ * because of their different location within the structure.
+ * As a workaround, we define MOZILLA_INTERNAL_API to use
+ * the internal nsString; this may cause problems with future
+ * versions of Gecko if the internal strings are made more
+ * strictly private.
+ *
+ *  http://bugzilla.redhat.com/show_bug.cgi?id=441643
+ *  http://bugzilla.mozilla.org/show_bug.cgi?id=430581
+ */
+#define MOZILLA_INTERNAL_API 1
+#include <nsString.h>
+#include <nsEscape.h>
+#else
+#include <nsStringAPI.h>
+#endif
+
+#include <nsString.h>
 #include "nsMemory.h"
 #include "nsNetCID.h"
 #include "nsISupportsUtils.h"
@@ -28,7 +51,6 @@
 #include "nsIURI.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsServiceManagerUtils.h"
-#include "nsStringAPI.h"
 #include "hippoControl.h"
 #ifdef HAVE_XULRUNNER
 #include "nsIClassInfoImpl.h"



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]