This is an experimental nightly build of SeaMonkey for OS/2. It was made from code in comm-central and mozilla-1.9.1 dated 2009-06-28 08:00:00 PDT (changesets 235b52d1d665 and 443e352ba424, resp.). But it contains code that is not yet in the Mercurial repositories. This code is partly needed to complete the build (with GCC 3.3.5, bug 487567, bug 451278, and bug 453705) and partly to enable new features that are available on other platforms but not yet on OS/2 (fix for Java plugin support, bug 484744). See all patches against mozilla-1.9.1 below. diff --git a/js/src/xpconnect/src/qsgen.py b/js/src/xpconnect/src/qsgen.py --- a/js/src/xpconnect/src/qsgen.py +++ b/js/src/xpconnect/src/qsgen.py @@ -470,6 +470,12 @@ "XPCVariant::newVariant(ccx, ${argVal})));\n" " if (!${name})\n" " return JS_FALSE;\n") + if os.name == 'os2': # Workaround for GCC 3.3.x bug. + template = ( + " nsCOMPtr ${name}(" + "XPCVariant::newVariant(ccx, ${argVal}));\n" + " if (!${name})\n" + " return JS_FALSE;\n") f.write(substitute(template, params)) return elif type.name == 'nsIAtom': diff --git a/xpcom/string/public/nsTString.h b/xpcom/string/public/nsTString.h --- a/xpcom/string/public/nsTString.h +++ b/xpcom/string/public/nsTString.h @@ -439,19 +439,24 @@ class nsTFixedString_CharT : public nsTS * fixed-size buffer to be used by the string (the contents of * this buffer may be modified by the string) * @param storageSize * the size of the fixed buffer * @param length (optional) * the length of the string already contained in the buffer */ +#ifdef XP_OS2 /* Workaround for GCC 3.3.x bug. */ + nsTFixedString_CharT( char_type* data, size_type storageSize ) NS_COM; + nsTFixedString_CharT( char_type* data, size_type storageSize, size_type length ) NS_COM; +#else NS_COM nsTFixedString_CharT( char_type* data, size_type storageSize ); NS_COM nsTFixedString_CharT( char_type* data, size_type storageSize, size_type length ); +#endif // |operator=| does not inherit, so we must define our own self_type& operator=( char_type c ) { Assign(c); return *this; } self_type& operator=( const char_type* data ) { Assign(data); return *this; } self_type& operator=( const substring_type& str ) { Assign(str); return *this; } self_type& operator=( const substring_tuple_type& tuple ) { Assign(tuple); return *this; } protected: diff --git a/xpcom/string/public/nsTSubstring.h b/xpcom/string/public/nsTSubstring.h --- a/xpcom/string/public/nsTSubstring.h +++ b/xpcom/string/public/nsTSubstring.h @@ -491,17 +491,21 @@ class nsTSubstring_CharT public: /** * this is public to support automatic conversion of tuple to string * base type, which helps avoid converting to nsTAString. */ +#ifdef XP_OS2 /* Workaround for GCC 3.3.x bug. */ + nsTSubstring_CharT(const substring_tuple_type& tuple) NS_COM; +#else NS_COM nsTSubstring_CharT(const substring_tuple_type& tuple); +#endif /** * allows for direct initialization of a nsTSubstring object. * * NOTE: this constructor is declared public _only_ for convenience * inside the string implementation. */ #ifdef XP_OS2 /* Workaround for GCC 3.3.x bug. */ @@ -517,25 +521,33 @@ class nsTSubstring_CharT // XXX GCC 3.4 needs this :-( friend class nsTPromiseFlatString_CharT; char_type* mData; size_type mLength; PRUint32 mFlags; // default initialization +#ifdef XP_OS2 /* Workaround for GCC 3.3.x bug. */ + nsTSubstring_CharT() NS_COM; +#else NS_COM nsTSubstring_CharT(); +#endif // version of constructor that leaves mData and mLength uninitialized explicit NS_COM nsTSubstring_CharT( PRUint32 flags ); // copy-constructor, constructs as dependent on given object // (NOTE: this is for internal use only) +#ifdef XP_OS2 /* Workaround for GCC 3.3.x bug. */ + nsTSubstring_CharT( const self_type& str ) NS_COM; +#else NS_COM nsTSubstring_CharT( const self_type& str ); +#endif /** * this function releases mData and does not change the value of * any of its member variables. in other words, this function acts * like a destructor. */ void NS_FASTCALL Finalize(); diff --git a/security/nss/lib/freebl/os2_rand.c b/security/nss/lib/freebl/os2_rand.c --- a/security/nss/lib/freebl/os2_rand.c +++ b/security/nss/lib/freebl/os2_rand.c @@ -369,5 +369,5 @@ size_t RNG_SystemRNG(void *dest, size_t maxLen) { - return rng_systemFromNoise(dest,maxlen); + return rng_systemFromNoise(dest,maxLen); } diff --git a/dom/src/base/nsGlobalWindow.cpp b/dom/src/base/nsGlobalWindow.cpp --- a/dom/src/base/nsGlobalWindow.cpp +++ b/dom/src/base/nsGlobalWindow.cpp @@ -439,17 +439,17 @@ nsDummyJavaPluginOwner::Destroy() // If we have a plugin instance, stop it and destroy it now. if (mInstance) { mInstance->Stop(); mInstance->Destroy(); nsCOMPtr peer; mInstance->GetPeer(getter_AddRefs(peer)); - nsCOMPtr peer2(do_QueryInterface(peer)); + nsCOMPtr peer2(do_QueryInterface(peer)); // This plugin owner is going away, tell the peer. if (peer2) peer2->InvalidateOwner(); mInstance = nsnull; } diff -r bdd9bf909dd7 layout/generic/nsObjectFrame.cpp --- a/layout/generic/nsObjectFrame.cpp Sun Jan 25 22:14:44 2009 -0800 +++ b/layout/generic/nsObjectFrame.cpp Wed Jun 24 16:58:12 2009 -0700 @@ -2307,17 +2307,17 @@ nsPluginInstanceOwner::~nsPluginInstance pph->DeletePluginNativeWindow(mPluginWindow); mPluginWindow = nsnull; } if (mInstance) { nsCOMPtr peer; mInstance->GetPeer(getter_AddRefs(peer)); - nsCOMPtr peer2(do_QueryInterface(peer)); + nsCOMPtr peer2(do_QueryInterface(peer)); if (peer2) { // Tell the peer that its owner is going away. peer2->InvalidateOwner(); } } } diff -r bdd9bf909dd7 modules/plugin/base/public/nsIPluginInstancePeer2.idl --- a/modules/plugin/base/public/nsIPluginInstancePeer2.idl Sun Jan 25 22:14:44 2009 -0800 +++ b/modules/plugin/base/public/nsIPluginInstancePeer2.idl Wed Jun 24 16:58:12 2009 -0700 @@ -56,17 +56,17 @@ struct JSContext; [ptr] native JSContextPtr(JSContext); /** * The nsIPluginInstancePeer2 interface extends the nsIPluginInstancePeer * interface, providing access to functionality provided by newer browsers. * All functionality in nsIPluginInstancePeer can be mapped to the 4.X * plugin API. */ -[uuid(79a2d210-55e4-4687-bd87-64b10c2466cc)] +[uuid(e7d48c00-e1f1-11d2-8360-fbc8abc4ae7c)] interface nsIPluginInstancePeer2 : nsIPluginInstancePeer { /** * Get the JavaScript window object corresponding to this plugin instance. * * @param aJSWindow - the resulting JavaScript window object * @result - NS_OK if this operation was successful */ @@ -83,14 +83,18 @@ interface nsIPluginInstancePeer2 : nsIPl /** * Get the JavaScript context to this plugin instance. * * @param aJSContext - the resulting JavaScript context * @result - NS_OK if this operation was successful */ readonly attribute JSContextPtr JSContext; +}; +[uuid(79a2d210-55e4-4687-bd87-64b10c2466cc)] +interface nsIPluginInstancePeer2_1_9_1_BRANCH : nsIPluginInstancePeer2 +{ /** * Drop our reference to our owner. */ void invalidateOwner(); }; diff --git a/modules/plugin/base/src/nsPluginHostImpl.cpp b/modules/plugin/base/src/nsPluginHostImpl.cpp --- a/modules/plugin/base/src/nsPluginHostImpl.cpp +++ b/modules/plugin/base/src/nsPluginHostImpl.cpp @@ -368,17 +368,17 @@ nsActivePlugin::~nsActivePlugin() if (mPeer) { nsresult rv = NS_OK; nsCOMPtr peer(do_QueryInterface(mPeer)); nsCOMPtr owner; rv = peer->GetOwner(getter_AddRefs(owner)); if (owner) owner->SetInstance(nsnull); - nsCOMPtr peer2(do_QueryInterface(peer)); + nsCOMPtr peer2(do_QueryInterface(peer)); if (peer2) { peer2->InvalidateOwner(); } } // now check for cached plugins because they haven't had nsIPluginInstance::Destroy() // called yet. For non-cached plugins, nsIPluginInstance::Destroy() is called diff -r bdd9bf909dd7 modules/plugin/base/src/nsPluginInstancePeer.cpp --- a/modules/plugin/base/src/nsPluginInstancePeer.cpp Sun Jan 25 22:14:44 2009 -0800 +++ b/modules/plugin/base/src/nsPluginInstancePeer.cpp Wed Jun 24 16:58:12 2009 -0700 @@ -78,28 +78,30 @@ nsPluginInstancePeerImpl::~nsPluginInsta } } static NS_DEFINE_IID(kIPluginTagInfoIID, NS_IPLUGINTAGINFO_IID); static NS_DEFINE_IID(kIPluginTagInfo2IID, NS_IPLUGINTAGINFO2_IID); #ifdef OJI static NS_DEFINE_IID(kIJVMPluginTagInfoIID, NS_IJVMPLUGINTAGINFO_IID); -NS_IMPL_ISUPPORTS7(nsPluginInstancePeerImpl, +NS_IMPL_ISUPPORTS8(nsPluginInstancePeerImpl, nsIPluginInstancePeer, nsIPluginInstancePeer2, + nsIPluginInstancePeer2_1_9_1_BRANCH, nsIWindowlessPluginInstancePeer, nsIPluginTagInfo, nsIPluginTagInfo2, nsIJVMPluginTagInfo, nsPIPluginInstancePeer) #else -NS_IMPL_ISUPPORTS6(nsPluginInstancePeerImpl, +NS_IMPL_ISUPPORTS7(nsPluginInstancePeerImpl, nsIPluginInstancePeer, nsIPluginInstancePeer2, + nsIPluginInstancePeer2_1_9_1_BRANCH, nsIWindowlessPluginInstancePeer, nsIPluginTagInfo, nsIPluginTagInfo2, nsPIPluginInstancePeer) #endif NS_IMETHODIMP nsPluginInstancePeerImpl::GetValue(nsPluginInstancePeerVariable variable, diff -r bdd9bf909dd7 modules/plugin/base/src/nsPluginInstancePeer.h --- a/modules/plugin/base/src/nsPluginInstancePeer.h Sun Jan 25 22:14:44 2009 -0800 +++ b/modules/plugin/base/src/nsPluginInstancePeer.h Wed Jun 24 16:58:12 2009 -0700 @@ -44,33 +44,34 @@ #include "nsIPluginInstanceOwner.h" #ifdef OJI #include "nsIJVMPluginTagInfo.h" #endif #include "nsPIPluginInstancePeer.h" #include "nsCOMPtr.h" -class nsPluginInstancePeerImpl : public nsIPluginInstancePeer2, +class nsPluginInstancePeerImpl : public nsIPluginInstancePeer2_1_9_1_BRANCH, public nsIWindowlessPluginInstancePeer, public nsIPluginTagInfo2, #ifdef OJI public nsIJVMPluginTagInfo, #endif public nsPIPluginInstancePeer { public: nsPluginInstancePeerImpl(); virtual ~nsPluginInstancePeerImpl(); NS_DECL_ISUPPORTS NS_DECL_NSIPLUGININSTANCEPEER NS_DECL_NSIWINDOWLESSPLUGININSTANCEPEER NS_DECL_NSIPLUGININSTANCEPEER2 + NS_DECL_NSIPLUGININSTANCEPEER2_1_9_1_BRANCH NS_DECL_NSIPLUGINTAGINFO NS_DECL_NSIPLUGINTAGINFO2 //XXX Why isn't this ifdef'd like the class declaration? //nsIJVMPluginTagInfo interface NS_IMETHOD GetCode(const char* *result);