diff --git a/allmakefiles.sh b/allmakefiles.sh index 145b88697660..3c81d6f014cb 100755 --- a/allmakefiles.sh +++ b/allmakefiles.sh @@ -96,3 +96,11 @@ done if test -z "$LIBXUL_SDK"; then . "${srcdir}/toolkit/toolkit-makefiles.sh" fi + +if test -n "$MOZ_BRANDING_DIRECTORY"; then + add_makefiles " + $MOZ_BRANDING_DIRECTORY/Makefile + $MOZ_BRANDING_DIRECTORY/content/Makefile + $MOZ_BRANDING_DIRECTORY/locales/Makefile + " +fi diff --git a/browser/build.mk b/browser/build.mk index 9b64cd88062d..8f43ca73ec86 100644 --- a/browser/build.mk +++ b/browser/build.mk @@ -60,6 +60,12 @@ package: install:: @$(MAKE) -C browser/installer install +clean:: + @$(MAKE) -C browser/installer clean + +distclean:: + @$(MAKE) -C browser/installer distclean + ifdef ENABLE_TESTS # Implemented in testing/testsuite-targets.mk diff --git a/browser/components/migration/src/nsDogbertProfileMigrator.cpp b/browser/components/migration/src/nsDogbertProfileMigrator.cpp index b05eb2031a8c..9269e55cddc2 100644 --- a/browser/components/migration/src/nsDogbertProfileMigrator.cpp +++ b/browser/components/migration/src/nsDogbertProfileMigrator.cpp @@ -58,9 +58,12 @@ #include "nsDirectoryServiceDefs.h" #include "nsDirectoryServiceUtils.h" #include +#include #ifndef MAXPATHLEN -#ifdef _MAX_PATH +#ifdef PATH_MAX +#define MAXPATHLEN PATH_MAX +#elif defined(_MAX_PATH) #define MAXPATHLEN _MAX_PATH #elif defined(CCHMAXPATH) #define MAXPATHLEN CCHMAXPATH diff --git a/browser/components/migration/src/nsProfileMigrator.cpp b/browser/components/migration/src/nsProfileMigrator.cpp index 57135ba0c98c..73f615cdd338 100644 --- a/browser/components/migration/src/nsProfileMigrator.cpp +++ b/browser/components/migration/src/nsProfileMigrator.cpp @@ -63,12 +63,16 @@ #include #include "nsIWindowsRegKey.h" #include "nsILocalFileWin.h" +#else +#include #endif #include "nsAutoPtr.h" #ifndef MAXPATHLEN -#ifdef _MAX_PATH +#ifdef PATH_MAX +#define MAXPATHLEN PATH_MAX +#elif defined(_MAX_PATH) #define MAXPATHLEN _MAX_PATH #elif defined(CCHMAXPATH) #define MAXPATHLEN CCHMAXPATH diff --git a/browser/installer/Makefile.in b/browser/installer/Makefile.in index 0e9330e5d1a6..8229f5497eee 100644 --- a/browser/installer/Makefile.in +++ b/browser/installer/Makefile.in @@ -88,6 +88,8 @@ MOZ_PKG_MANIFEST = packages-static $(MOZ_PKG_MANIFEST): $(MOZ_PKG_MANIFEST_P) $(PERL) $(topsrcdir)/config/preprocessor.pl $(DEFINES) $(ACDEFINES) $< > $@ + +GARBAGE += $(MOZ_PKG_MANIFEST) endif ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) diff --git a/client.mk b/client.mk index ba6e4579b055..3f51e9237ef6 100644 --- a/client.mk +++ b/client.mk @@ -93,10 +93,6 @@ endif # MacOS X 10.4 sends "no autoconf*" errors to stdout, discard those via grep AUTOCONF ?= $(shell which autoconf-2.13 autoconf2.13 autoconf213 2>/dev/null | grep -v '^no autoconf' | head -1) -ifeq (,$(strip $(AUTOCONF))) -$(error Couldn't find autoconf 2.13) -endif - MKDIR := mkdir SH := /bin/sh ifndef MAKE diff --git a/config/autoconf.mk.in b/config/autoconf.mk.in index 668d49c6ef48..2a95df918e03 100644 --- a/config/autoconf.mk.in +++ b/config/autoconf.mk.in @@ -266,6 +266,8 @@ MOZ_NATIVE_NSS = @MOZ_NATIVE_NSS@ CROSS_COMPILE = @CROSS_COMPILE@ +WCHAR_CFLAGS = @WCHAR_CFLAGS@ + OS_CPPFLAGS = @CPPFLAGS@ OS_CFLAGS = $(OS_CPPFLAGS) @CFLAGS@ OS_CXXFLAGS = $(OS_CPPFLAGS) @CXXFLAGS@ diff --git a/configure.in b/configure.in index c17199b1cb98..16afdae794ea 100644 --- a/configure.in +++ b/configure.in @@ -1148,7 +1148,7 @@ CYGWIN32_NT|CYGWIN_NT*|MINGW*_NT*) ;; AIX) OS_RELEASE=`uname -v`.`uname -r` - OS_TEST=`uname -p` + OS_TEST=${target_cpu} ;; BSD_386) OS_ARCH=BSD @@ -1250,7 +1250,7 @@ case "$OS_TEST" in CPU_ARCH=x86 ;; -powerpc* | ppc) +powerpc* | ppc | rs6000) CPU_ARCH=ppc ;; @@ -1621,15 +1621,15 @@ case "$target" in if test "$COMPILE_ENVIRONMENT"; then AC_LANG_SAVE AC_LANG_CPLUSPLUS - AC_MSG_CHECKING([for VisualAge C++ compiler version >= 5.0.2.0]) + AC_MSG_CHECKING([for VisualAge C++ compiler version >= 6.0.0.3]) AC_TRY_COMPILE([], - [#if (__IBMCPP__ < 502) + [#if (__IBMCPP__ < 600) #error "Bad compiler" #endif], _BAD_COMPILER=,_BAD_COMPILER=1) if test -n "$_BAD_COMPILER"; then AC_MSG_RESULT([no]) - AC_MSG_ERROR([VisualAge C++ version 5.0.2.0 or higher is required to build.]) + AC_MSG_ERROR([VisualAge C++ version 6.0.0.3 or higher is required to build.]) else AC_MSG_RESULT([yes]) fi @@ -1854,8 +1854,7 @@ case "$target" in MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS=1 ;; mips*) - CFLAGS="$CFLAGS -Wa,-xgot" - CXXFLAGS="$CXXFLAGS -Wa,-xgot" + MOZ_DEBUG_FLAGS="-g" # We want inlining ;; esac ;; @@ -2783,6 +2782,7 @@ dnl Note that we assume that mac & win32 have short wchar (see nscore.h) if test "$ac_cv_have_usable_wchar_option_v2" = "yes"; then AC_DEFINE(HAVE_CPP_2BYTE_WCHAR_T) HAVE_CPP_2BYTE_WCHAR_T=1 + WCHAR_CFLAGS="-fshort-wchar" else CXXFLAGS=$_SAVE_CXXFLAGS fi @@ -7938,6 +7938,7 @@ AC_SUBST(COMPILE_CXXFLAGS) AC_SUBST(LDFLAGS) AC_SUBST(LIBS) AC_SUBST(CROSS_COMPILE) +AC_SUBST(WCHAR_CFLAGS) AC_SUBST(HOST_CC) AC_SUBST(HOST_CXX) diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index 8fe7f84f0033..9525c88bae9d 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -806,7 +806,7 @@ nsExternalResourceEnumArgs void *data; }; -PR_STATIC_CALLBACK(PLDHashOperator) +static PLDHashOperator ExternalResourceEnumerator(nsIURI* aKey, nsExternalResourceMap::ExternalResource* aData, void* aClosure) @@ -826,7 +826,7 @@ nsExternalResourceMap::EnumerateResources(nsIDocument::nsSubDocEnumFunc aCallbac mMap.EnumerateRead(ExternalResourceEnumerator, &args); } -PR_STATIC_CALLBACK(PLDHashOperator) +static PLDHashOperator ExternalResourceTraverser(nsIURI* aKey, nsExternalResourceMap::ExternalResource* aData, void* aClosure) diff --git a/content/base/src/nsXMLHttpRequest.cpp b/content/base/src/nsXMLHttpRequest.cpp index cf48d2d473f7..d67b09f642cc 100644 --- a/content/base/src/nsXMLHttpRequest.cpp +++ b/content/base/src/nsXMLHttpRequest.cpp @@ -974,7 +974,7 @@ nsAccessControlLRUCache::Clear() mTable.Clear(); } -/* static */ PR_CALLBACK PLDHashOperator +/* static */ PLDHashOperator nsAccessControlLRUCache::RemoveExpiredEntries(const nsACString& aKey, nsAutoPtr& aValue, void* aUserData) diff --git a/content/base/src/nsXMLHttpRequest.h b/content/base/src/nsXMLHttpRequest.h index 8dc29455e818..9768885bd7d7 100644 --- a/content/base/src/nsXMLHttpRequest.h +++ b/content/base/src/nsXMLHttpRequest.h @@ -130,7 +130,7 @@ public: void Clear(); private: - PR_STATIC_CALLBACK(PLDHashOperator) + static PLDHashOperator RemoveExpiredEntries(const nsACString& aKey, nsAutoPtr& aValue, void* aUserData); diff --git a/dom/public/idl/geolocation/nsIDOMGeoPositionOptions.idl b/dom/public/idl/geolocation/nsIDOMGeoPositionOptions.idl index 6d8532df2a8f..d723a8b94af2 100644 --- a/dom/public/idl/geolocation/nsIDOMGeoPositionOptions.idl +++ b/dom/public/idl/geolocation/nsIDOMGeoPositionOptions.idl @@ -37,8 +37,9 @@ #include "domstubs.idl" -[scriptable, uuid(03723BAE-E1EC-4F35-965F-0A9FDF573D86)] +[scriptable, uuid(74FA3BE6-4CBF-47C7-9BE1-FB9F17DD0D5D)] interface nsIDOMGeoPositionOptions : nsISupports { - attribute boolean enableHiqhAccuracy; + attribute boolean enableHighAccuracy; + attribute unsigned long timeout; }; diff --git a/dom/src/geolocation/nsGeolocation.cpp b/dom/src/geolocation/nsGeolocation.cpp index 76831e3fe1ac..eaa8ff8c3cc8 100644 --- a/dom/src/geolocation/nsGeolocation.cpp +++ b/dom/src/geolocation/nsGeolocation.cpp @@ -47,7 +47,6 @@ #include "nsIObserverService.h" #include "nsIPrefService.h" #include "nsIPrefBranch2.h" -#include "nsIProxyObjectManager.h" #include "nsIJSContextStack.h" #include @@ -69,13 +68,12 @@ public: NS_DECL_ISUPPORTS NS_DECL_NSIDOMGEOPOSITIONERROR - nsDOMGeoPositionError(PRInt16 aCode, const nsAString& aMessage); + nsDOMGeoPositionError(PRInt16 aCode); + void NotifyCallback(nsIDOMGeoPositionErrorCallback* callback); private: ~nsDOMGeoPositionError(); PRInt16 mCode; - nsString mMessage; - }; NS_INTERFACE_MAP_BEGIN(nsDOMGeoPositionError) @@ -87,8 +85,8 @@ NS_INTERFACE_MAP_END NS_IMPL_THREADSAFE_ADDREF(nsDOMGeoPositionError) NS_IMPL_THREADSAFE_RELEASE(nsDOMGeoPositionError) -nsDOMGeoPositionError::nsDOMGeoPositionError(PRInt16 aCode, const nsAString& aMessage) - : mCode(aCode), mMessage(aMessage) +nsDOMGeoPositionError::nsDOMGeoPositionError(PRInt16 aCode) + : mCode(aCode) { } @@ -106,16 +104,43 @@ nsDOMGeoPositionError::GetCode(PRInt16 *aCode) NS_IMETHODIMP nsDOMGeoPositionError::GetMessage(nsAString & aMessage) { - aMessage = mMessage; + aMessage.Truncate(); return NS_OK; } +void +nsDOMGeoPositionError::NotifyCallback(nsIDOMGeoPositionErrorCallback* aCallback) +{ + if (!aCallback) + return; + + // Ensure that the proper context is on the stack (bug 452762) + nsCOMPtr stack(do_GetService("@mozilla.org/js/xpc/ContextStack;1")); + if (!stack || NS_FAILED(stack->Push(nsnull))) + return; + + aCallback->HandleEvent(this); + + // remove the stack + JSContext* cx; + stack->Pop(&cx); +} //////////////////////////////////////////////////// // nsGeolocationRequest //////////////////////////////////////////////////// -nsGeolocationRequest::nsGeolocationRequest(nsGeolocation* locator, nsIDOMGeoPositionCallback* callback, nsIDOMGeoPositionErrorCallback* errorCallback) - : mAllowed(PR_FALSE), mCleared(PR_FALSE), mFuzzLocation(PR_FALSE), mCallback(callback), mErrorCallback(errorCallback), mLocator(locator) +nsGeolocationRequest::nsGeolocationRequest(nsGeolocation* aLocator, + nsIDOMGeoPositionCallback* aCallback, + nsIDOMGeoPositionErrorCallback* aErrorCallback, + nsIDOMGeoPositionOptions* aOptions) + : mAllowed(PR_FALSE), + mCleared(PR_FALSE), + mFuzzLocation(PR_FALSE), + mHasSentData(PR_FALSE), + mCallback(aCallback), + mErrorCallback(aErrorCallback), + mOptions(aOptions), + mLocator(aLocator) { } @@ -126,11 +151,41 @@ nsGeolocationRequest::~nsGeolocationRequest() NS_INTERFACE_MAP_BEGIN(nsGeolocationRequest) NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIGeolocationRequest) NS_INTERFACE_MAP_ENTRY(nsIGeolocationRequest) + NS_INTERFACE_MAP_ENTRY(nsITimerCallback) NS_INTERFACE_MAP_END NS_IMPL_ADDREF(nsGeolocationRequest) NS_IMPL_RELEASE(nsGeolocationRequest) + +void +nsGeolocationRequest::NotifyError(PRInt16 errorCode) +{ + nsRefPtr positionError = new nsDOMGeoPositionError(errorCode); + if (!positionError) + return; + + positionError->NotifyCallback(mErrorCallback); +} + + +NS_IMETHODIMP +nsGeolocationRequest::Notify(nsITimer* aTimer) +{ + // If we haven't gotten an answer from the geolocation + // provider yet, cancel the request. Same logic as + // ::Cancel, just a different error + + if (!mHasSentData) { + NotifyError(NS_GEO_ERROR_CODE_TIMEOUT); + // remove ourselves from the locator's callback lists. + mLocator->RemoveRequest(this); + } + + mTimeoutTimer = nsnull; + return NS_OK; +} + NS_IMETHODIMP nsGeolocationRequest::GetRequestingURI(nsIURI * *aRequestingURI) { @@ -152,6 +207,8 @@ nsGeolocationRequest::GetRequestingWindow(nsIDOMWindow * *aRequestingWindow) NS_IMETHODIMP nsGeolocationRequest::Cancel() { + NotifyError(NS_GEO_ERROR_CODE_PERMISSION_ERROR); + // remove ourselves from the locators callback lists. mLocator->RemoveRequest(this); return NS_OK; @@ -165,35 +222,15 @@ nsGeolocationRequest::Allow() nsresult rv = geoService->StartDevice(); if (NS_FAILED(rv)) { + // Location provider error + NotifyError(NS_GEO_ERROR_CODE_LOCATION_PROVIDER_ERROR); + return NS_OK; + } - if (!mErrorCallback) - return NS_OK; // If no one is listening for errors, fail silently. - - // TODO what are the real error values here!! - nsRefPtr positionError = new nsDOMGeoPositionError(1, NS_LITERAL_STRING("")); - - nsCOMPtr callbackProxy; - - nsCOMPtr proxyObjMgr = do_GetService("@mozilla.org/xpcomproxy;1"); - proxyObjMgr->GetProxyForObject(NS_PROXY_TO_MAIN_THREAD, - NS_GET_IID(nsIDOMGeoPositionErrorCallback), - mErrorCallback, - NS_PROXY_ASYNC | NS_PROXY_ALWAYS, - getter_AddRefs(callbackProxy)); - - - // Ensure that the proper context is on the stack (bug 452762) - nsCOMPtr stack(do_GetService("@mozilla.org/js/xpc/ContextStack;1")); - if (!stack || NS_FAILED(stack->Push(nsnull))) - return NS_OK; // silently fail - - callbackProxy->HandleEvent(positionError); - - // remove the stack - JSContext* cx; - stack->Pop(&cx); - - return NS_OK; // silently fail + PRUint32 timeout; + if (mOptions && NS_SUCCEEDED(mOptions->GetTimeout(&timeout)) && timeout > 0) { + mTimeoutTimer = do_CreateInstance("@mozilla.org/timer;1"); + mTimeoutTimer->InitWithCallback(this, timeout, nsITimer::TYPE_ONE_SHOT); } mAllowed = PR_TRUE; @@ -214,7 +251,7 @@ nsGeolocationRequest::MarkCleared() } void -nsGeolocationRequest::SendLocation(nsIDOMGeoPosition* position) +nsGeolocationRequest::SendLocation(nsIDOMGeoPosition* aPosition) { if (mCleared || !mAllowed) return; @@ -232,14 +269,14 @@ nsGeolocationRequest::SendLocation(nsIDOMGeoPosition* position) double lat, lon, alt, herror, verror, heading, velocity; DOMTimeStamp time; - position->GetLatitude(&lat); - position->GetLongitude(&lon); - position->GetAltitude(&alt); - position->GetAccuracy(&herror); - position->GetAltitudeAccuracy(&verror); - position->GetHeading(&heading); - position->GetVelocity(&velocity); - position->GetTimestamp(&time); + aPosition->GetLatitude(&lat); + aPosition->GetLongitude(&lon); + aPosition->GetAltitude(&alt); + aPosition->GetAccuracy(&herror); + aPosition->GetAltitudeAccuracy(&verror); + aPosition->GetHeading(&heading); + aPosition->GetVelocity(&velocity); + aPosition->GetTimestamp(&time); // Truncate ? // lat = floor(lat*10+.5)/10; @@ -266,12 +303,14 @@ nsGeolocationRequest::SendLocation(nsIDOMGeoPosition* position) } else { - mCallback->HandleEvent(position); + mCallback->HandleEvent(aPosition); } // remove the stack JSContext* cx; stack->Pop(&cx); + + mHasSentData = PR_TRUE; } void @@ -378,8 +417,9 @@ nsGeolocationService::~nsGeolocationService() } NS_IMETHODIMP -nsGeolocationService::Observe(nsISupports* aSubject, const char* aTopic, - const PRUnichar* aData) +nsGeolocationService::Observe(nsISupports* aSubject, + const char* aTopic, + const PRUnichar* aData) { if (!strcmp("quit-application", aTopic)) { @@ -434,10 +474,10 @@ nsGeolocationService::SetPrompt(nsIGeolocationPrompt * aPrompt) } NS_IMETHODIMP -nsGeolocationService::Update(nsIDOMGeoPosition *somewhere) +nsGeolocationService::Update(nsIDOMGeoPosition *aSomewhere) { for (PRUint32 i = 0; i< mGeolocators.Length(); i++) - mGeolocators[i]->Update(somewhere); + mGeolocators[i]->Update(aSomewhere); return NS_OK; } @@ -532,6 +572,7 @@ nsGeolocationService::GetInstance() { if (!nsGeolocationService::gService) { nsGeolocationService::gService = new nsGeolocationService(); + NS_ASSERTION(nsGeolocationService::gService, "null nsGeolocationService."); } return nsGeolocationService::gService; } @@ -545,15 +586,15 @@ nsGeolocationService::GetGeolocationService() } void -nsGeolocationService::AddLocator(nsGeolocation* locator) +nsGeolocationService::AddLocator(nsGeolocation* aLocator) { - mGeolocators.AppendElement(locator); + mGeolocators.AppendElement(aLocator); } void -nsGeolocationService::RemoveLocator(nsGeolocation* locator) +nsGeolocationService::RemoveLocator(nsGeolocation* aLocator) { - mGeolocators.RemoveElement(locator); + mGeolocators.RemoveElement(aLocator); } //////////////////////////////////////////////////// @@ -569,17 +610,17 @@ NS_INTERFACE_MAP_END NS_IMPL_ADDREF(nsGeolocation) NS_IMPL_RELEASE(nsGeolocation) -nsGeolocation::nsGeolocation(nsIDOMWindow* contentDom) +nsGeolocation::nsGeolocation(nsIDOMWindow* aContentDom) : mUpdateInProgress(PR_FALSE) { // Remember the window - nsCOMPtr window = do_QueryInterface(contentDom); + nsCOMPtr window = do_QueryInterface(aContentDom); if (window) mOwner = window->GetCurrentInnerWindow(); // Grab the uri of the document nsCOMPtr domdoc; - contentDom->GetDocument(getter_AddRefs(domdoc)); + aContentDom->GetDocument(getter_AddRefs(domdoc)); nsCOMPtr doc = do_QueryInterface(domdoc); if (doc) doc->NodePrincipal()->GetURI(getter_AddRefs(mURI)); @@ -597,11 +638,11 @@ void nsGeolocation::Shutdown() { // Shutdown and release all callbacks - for (PRInt32 i = 0; i< mPendingCallbacks.Count(); i++) + for (PRUint32 i = 0; i< mPendingCallbacks.Length(); i++) mPendingCallbacks[i]->Shutdown(); mPendingCallbacks.Clear(); - for (PRInt32 i = 0; i< mWatchingCallbacks.Count(); i++) + for (PRUint32 i = 0; i< mWatchingCallbacks.Length(); i++) mWatchingCallbacks[i]->Shutdown(); mWatchingCallbacks.Clear(); @@ -616,13 +657,13 @@ nsGeolocation::Shutdown() PRBool nsGeolocation::HasActiveCallbacks() { - return (PRBool) mWatchingCallbacks.Count(); + return mWatchingCallbacks.Length() != 0; } void -nsGeolocation::RemoveRequest(nsGeolocationRequest* request) +nsGeolocation::RemoveRequest(nsGeolocationRequest* aRequest) { - mPendingCallbacks.RemoveObject(request); + mPendingCallbacks.RemoveElement(aRequest); // if it is in the mWatchingCallbacks, we can't do much // since we passed back the position in the array to who @@ -630,11 +671,11 @@ nsGeolocation::RemoveRequest(nsGeolocationRequest* request) // around with the ordering of the array. Instead, just // mark the request as "cleared". - request->MarkCleared(); + aRequest->MarkCleared(); } void -nsGeolocation::Update(nsIDOMGeoPosition *somewhere) +nsGeolocation::Update(nsIDOMGeoPosition *aSomewhere) { // This method calls out to objects which may spin and // event loop which may add new location objects into @@ -653,13 +694,13 @@ nsGeolocation::Update(nsIDOMGeoPosition *somewhere) } // notify anyone that has been waiting - for (PRInt32 i = 0; i< mPendingCallbacks.Count(); i++) - mPendingCallbacks[i]->SendLocation(somewhere); + for (PRUint32 i = 0; i< mPendingCallbacks.Length(); i++) + mPendingCallbacks[i]->SendLocation(aSomewhere); mPendingCallbacks.Clear(); // notify everyone that is watching - for (PRInt32 i = 0; i< mWatchingCallbacks.Count(); i++) - mWatchingCallbacks[i]->SendLocation(somewhere); + for (PRUint32 i = 0; i< mWatchingCallbacks.Length(); i++) + mWatchingCallbacks[i]->SendLocation(aSomewhere); mUpdateInProgress = PR_FALSE; } @@ -682,37 +723,43 @@ nsGeolocation::GetCurrentPosition(nsIDOMGeoPositionCallback *callback, if (prompt == nsnull) return NS_ERROR_NOT_AVAILABLE; - nsRefPtr request = new nsGeolocationRequest(this, callback, errorCallback); + nsRefPtr request = new nsGeolocationRequest(this, callback, errorCallback, options); + if (!request) + return NS_ERROR_OUT_OF_MEMORY; + prompt->Prompt(request); // What if you have a location provider that only sends a location once, then stops.? fix. - mPendingCallbacks.AppendObject(request); + mPendingCallbacks.AppendElement(request); return NS_OK; } NS_IMETHODIMP -nsGeolocation::WatchPosition(nsIDOMGeoPositionCallback *callback, - nsIDOMGeoPositionErrorCallback *errorCallback, - nsIDOMGeoPositionOptions *options, +nsGeolocation::WatchPosition(nsIDOMGeoPositionCallback *aCallback, + nsIDOMGeoPositionErrorCallback *aErrorCallback, + nsIDOMGeoPositionOptions *aOptions, PRUint16 *_retval NS_OUTPARAM) { nsIGeolocationPrompt* prompt = mService->GetPrompt(); if (prompt == nsnull) return NS_ERROR_NOT_AVAILABLE; - nsRefPtr request = new nsGeolocationRequest(this, callback, errorCallback); + nsRefPtr request = new nsGeolocationRequest(this, aCallback, aErrorCallback, aOptions); + if (!request) + return NS_ERROR_OUT_OF_MEMORY; + prompt->Prompt(request); // need to hand back an index/reference. - mWatchingCallbacks.AppendObject(request); - *_retval = mWatchingCallbacks.Count() - 1; + mWatchingCallbacks.AppendElement(request); + *_retval = mWatchingCallbacks.Length() - 1; return NS_OK; } NS_IMETHODIMP -nsGeolocation::ClearWatch(PRUint16 watchId) +nsGeolocation::ClearWatch(PRUint16 aWatchId) { - mWatchingCallbacks[watchId]->MarkCleared(); + mWatchingCallbacks[aWatchId]->MarkCleared(); return NS_OK; } diff --git a/dom/src/geolocation/nsGeolocation.h b/dom/src/geolocation/nsGeolocation.h index f12334a215ab..2267688bf3de 100644 --- a/dom/src/geolocation/nsGeolocation.h +++ b/dom/src/geolocation/nsGeolocation.h @@ -55,18 +55,25 @@ #include "nsIGeolocationProvider.h" +#define NS_GEO_ERROR_CODE_PERMISSION_ERROR 1 +#define NS_GEO_ERROR_CODE_LOCATION_PROVIDER_ERROR 2 +#define NS_GEO_ERROR_CODE_POSITION_NOT_FOUND 3 +#define NS_GEO_ERROR_CODE_TIMEOUT 4 + class nsGeolocationService; class nsGeolocation; -class nsGeolocationRequest : public nsIGeolocationRequest +class nsGeolocationRequest : public nsIGeolocationRequest, public nsITimerCallback { public: NS_DECL_ISUPPORTS NS_DECL_NSIGEOLOCATIONREQUEST - + NS_DECL_NSITIMERCALLBACK + nsGeolocationRequest(nsGeolocation* locator, nsIDOMGeoPositionCallback* callback, - nsIDOMGeoPositionErrorCallback* errorCallback); + nsIDOMGeoPositionErrorCallback* errorCallback, + nsIDOMGeoPositionOptions* options); void Shutdown(); void SendLocation(nsIDOMGeoPosition* location); @@ -76,14 +83,20 @@ class nsGeolocationRequest : public nsIGeolocationRequest ~nsGeolocationRequest(); private: - PRBool mAllowed; - PRBool mCleared; - PRBool mFuzzLocation; + void NotifyError(PRInt16 errorCode); + PRPackedBool mAllowed; + PRPackedBool mCleared; + PRPackedBool mFuzzLocation; + PRPackedBool mHasSentData; + + nsCOMPtr mTimeoutTimer; nsCOMPtr mCallback; nsCOMPtr mErrorCallback; + nsCOMPtr mOptions; + + nsGeolocation* mLocator; // The locator exists longer than this object. - nsGeolocation* mLocator; // The locator exists alonger than this object. }; /** @@ -186,13 +199,13 @@ public: void Update(nsIDOMGeoPosition* aPosition); // Returns true if any of the callbacks are repeating - PRBool HasActiveCallbacks(); + PRBool HasActiveCallbacks(); // Remove request from all callbacks arrays - void RemoveRequest(nsGeolocationRequest* request); + void RemoveRequest(nsGeolocationRequest* request); // Shutting down. - void Shutdown(); + void Shutdown(); // Setter and Getter of the URI that this nsGeolocation was loaded from nsIURI* GetURI() { return mURI; } @@ -212,8 +225,8 @@ private: // |mWatchingCallbacks| holds objects until the object is explictly removed or // there is a page change. - nsCOMArray mPendingCallbacks; - nsCOMArray mWatchingCallbacks; + nsTArray > mPendingCallbacks; + nsTArray > mWatchingCallbacks; PRBool mUpdateInProgress; diff --git a/dom/tests/mochitest/geolocation/Makefile.in b/dom/tests/mochitest/geolocation/Makefile.in index 66ed9cf4d877..90623bd3ecd7 100644 --- a/dom/tests/mochitest/geolocation/Makefile.in +++ b/dom/tests/mochitest/geolocation/Makefile.in @@ -53,6 +53,7 @@ _TEST_FILES = \ test_cancelWatch.html \ test_clearWatch.html \ test_geoPrompt.html \ + test_timeoutWatch.html \ prompt_common.js \ geolocation_common.js \ geolocation.html \ diff --git a/dom/tests/mochitest/geolocation/geolocation_common.js b/dom/tests/mochitest/geolocation/geolocation_common.js index 9c00f1ef4df3..f1b58b8bee97 100644 --- a/dom/tests/mochitest/geolocation/geolocation_common.js +++ b/dom/tests/mochitest/geolocation/geolocation_common.js @@ -113,7 +113,7 @@ function attachPrompt() { .getService(Components.interfaces.nsIGeolocationService); old_prompt = geolocationService.prompt; - if(DELAYED_PROMPT) + if(DELAYED_PROMPT) geolocationService.prompt = delayed_prompt; else geolocationService.prompt = geolocation_prompt; diff --git a/dom/tests/mochitest/geolocation/testLocationProvider.js b/dom/tests/mochitest/geolocation/testLocationProvider.js index 69ed05e7b764..733dc0023541 100644 --- a/dom/tests/mochitest/geolocation/testLocationProvider.js +++ b/dom/tests/mochitest/geolocation/testLocationProvider.js @@ -3,15 +3,15 @@ Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); const Ci = Components.interfaces; const Cc = Components.classes; -function GeolocationObject() {}; -GeolocationObject.prototype = { +function GeopositionObject() {}; +GeopositionObject.prototype = { - QueryInterface: XPCOMUtils.generateQI([Ci.nsIDOMGeolocation, Ci.nsIClassInfo, Ci.nsIGeolocationPrompt]), + QueryInterface: XPCOMUtils.generateQI([Ci.nsIDOMGeoPosition, Ci.nsIClassInfo]), // Class Info is required to be able to pass objects back into the DOM. getInterfaces: function(countRef) { - var interfaces = [Ci.nsIDOMGeolocation, Ci.nsIClassInfo, Ci.nsISupports, Ci.nsIGeolocationPrompt]; + var interfaces = [Ci.nsIDOMGeoPosition, Ci.nsIClassInfo, Ci.nsISupports]; countRef.value = interfaces.length; return interfaces; }, @@ -25,11 +25,11 @@ GeolocationObject.prototype = { latitude: 1, longitude: 1, altitude: 1, - horizontalAccuracy: 1, - verticalAccuracy: 1, + accuracy: 1, + altitudeAccuracy: 1, + heading: 1, + velocity: 1, timestamp: 1, - - prompt: function(uri) {return 1;}, }; function dump(msg) { @@ -64,7 +64,7 @@ MyLocation.prototype = { Ci.nsITimer.TYPE_REPEATING_SLACK); }, - currentLocation: new GeolocationObject(), + currentLocation: new GeopositionObject(), shutdown: function() { dump("shutdown"); if(this.timer) diff --git a/dom/tests/mochitest/geolocation/test_timeoutWatch.html b/dom/tests/mochitest/geolocation/test_timeoutWatch.html new file mode 100644 index 000000000000..066e6cd2dd3e --- /dev/null +++ b/dom/tests/mochitest/geolocation/test_timeoutWatch.html @@ -0,0 +1,65 @@ + + + + + Test for timeout option + + + + + + + + +Mozilla Bug +

+ +
+
+
+ + diff --git a/gfx/thebes/src/gfxWindowsPlatform.cpp b/gfx/thebes/src/gfxWindowsPlatform.cpp index 8d431dcdcb24..898f60223f3c 100644 --- a/gfx/thebes/src/gfxWindowsPlatform.cpp +++ b/gfx/thebes/src/gfxWindowsPlatform.cpp @@ -575,7 +575,7 @@ FindFullNameForFace(const ENUMLOGFONTEXW *lpelfe, // callback called for each family name, based on the assumption that the // first part of the full name is the family name -static PLDHashOperator PR_CALLBACK +static PLDHashOperator FindFullName(nsStringHashKey::KeyType aKey, nsRefPtr& aFontFamily, void* userArg) diff --git a/layout/base/nsDocumentViewer.cpp b/layout/base/nsDocumentViewer.cpp index 438e985a93ea..76b4638aa14c 100644 --- a/layout/base/nsDocumentViewer.cpp +++ b/layout/base/nsDocumentViewer.cpp @@ -2708,7 +2708,7 @@ SetChildFullZoom(nsIMarkupDocumentViewer* aChild, void* aClosure) aChild->SetFullZoom(ZoomInfo->mZoom); } -PR_STATIC_CALLBACK(PRBool) +static PRBool SetExtResourceTextZoom(nsIDocument* aDocument, void* aClosure) { // Would it be better to enumerate external resource viewers instead? @@ -2724,7 +2724,7 @@ SetExtResourceTextZoom(nsIDocument* aDocument, void* aClosure) return PR_TRUE; } -PR_STATIC_CALLBACK(PRBool) +static PRBool SetExtResourceFullZoom(nsIDocument* aDocument, void* aClosure) { // Would it be better to enumerate external resource viewers instead? diff --git a/layout/generic/test/Makefile.in b/layout/generic/test/Makefile.in index 694af4445ba5..2e8eb3aabf84 100644 --- a/layout/generic/test/Makefile.in +++ b/layout/generic/test/Makefile.in @@ -63,7 +63,6 @@ _TEST_FILES = test_bug288789.html \ test_bug416168.html \ test_bug421436.html \ test_bug448860.html \ - test_bug460532.html \ test_character_movement.html \ test_word_movement.html \ test_backspace_delete.html \ diff --git a/layout/svg/base/src/nsSVGEffects.cpp b/layout/svg/base/src/nsSVGEffects.cpp index 3a4bc310dfd6..730495bac05e 100644 --- a/layout/svg/base/src/nsSVGEffects.cpp +++ b/layout/svg/base/src/nsSVGEffects.cpp @@ -398,7 +398,7 @@ nsSVGEffects::GetFilterProperty(nsIFrame *aFrame) return static_cast(aFrame->GetProperty(nsGkAtoms::filter)); } -static PLDHashOperator PR_CALLBACK +static PLDHashOperator GatherEnumerator(nsVoidPtrHashKey* aEntry, void* aArg) { nsTArray* array = diff --git a/netwerk/cookie/src/nsCookieService.cpp b/netwerk/cookie/src/nsCookieService.cpp index 8aaa5dca5926..3b880c49a98b 100644 --- a/netwerk/cookie/src/nsCookieService.cpp +++ b/netwerk/cookie/src/nsCookieService.cpp @@ -661,7 +661,7 @@ nsCookieService::Observe(nsISupports *aSubject, if (mPrivateHostTable.IsInitialized() || mPrivateHostTable.Init()) { mHostTable = &mPrivateHostTable; mCookieCount = mHostTable->Count(); - NotifyChanged(nsnull, NS_LITERAL_STRING("cleared").get()); + NotifyChanged(nsnull, NS_LITERAL_STRING("reload").get()); } // close the connection to the on-disk DB mStmtInsert = nsnull; diff --git a/toolkit/components/passwordmgr/src/nsLoginManager.js b/toolkit/components/passwordmgr/src/nsLoginManager.js index be19a22991b9..486a5663282c 100644 --- a/toolkit/components/passwordmgr/src/nsLoginManager.js +++ b/toolkit/components/passwordmgr/src/nsLoginManager.js @@ -19,6 +19,7 @@ * * Contributor(s): * Justin Dolske (original author) + * Ehsan Akhgari * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or @@ -122,6 +123,31 @@ LoginManager.prototype = { return this.__storage; }, + + // Private Browsing Service + // If the service is not available, null will be returned. + __privateBrowsingService : undefined, + get _privateBrowsingService() { + if (this.__privateBrowsingService == undefined) { + if ("@mozilla.org/privatebrowsing;1" in Cc) + this.__privateBrowsingService = Cc["@mozilla.org/privatebrowsing;1"]. + getService(Ci.nsIPrivateBrowsingService); + else + this.__privateBrowsingService = null; + } + return this.__privateBrowsingService; + }, + + + // Whether we are in private browsing mode + get _inPrivateBrowsing() { + var pbSvc = this._privateBrowsingService; + if (pbSvc) + return pbSvc.privateBrowsingEnabled; + else + return false; + }, + _prefBranch : null, // Preferences service _nsLoginInfo : null, // Constructor for nsILoginInfo implementation @@ -764,6 +790,13 @@ LoginManager.prototype = { return prompterSvc; } + if (this._inPrivateBrowsing) { + // We won't do anything in private browsing mode anyway, + // so there's no need to perform further checks. + this.log("(form submission ignored in private browsing mode)"); + return; + } + var doc = form.ownerDocument; var win = doc.defaultView; @@ -953,7 +986,8 @@ LoginManager.prototype = { this.log("fillDocument processing " + forms.length + " forms on " + doc.documentURI); - var autofillForm = this._prefBranch.getBoolPref("autofillForms"); + var autofillForm = !this._inPrivateBrowsing && + this._prefBranch.getBoolPref("autofillForms"); var previousActionOrigin = null; var foundLogins = null; diff --git a/toolkit/components/passwordmgr/src/nsLoginManagerPrompter.js b/toolkit/components/passwordmgr/src/nsLoginManagerPrompter.js index 24791c066012..acc30825913f 100644 --- a/toolkit/components/passwordmgr/src/nsLoginManagerPrompter.js +++ b/toolkit/components/passwordmgr/src/nsLoginManagerPrompter.js @@ -166,6 +166,19 @@ LoginManagerPrompter.prototype = { }, + // Whether we are in private browsing mode + get _inPrivateBrowsing() { + // The Private Browsing service might not be available. + try { + var pbs = Cc["@mozilla.org/privatebrowsing;1"]. + getService(Ci.nsIPrivateBrowsingService); + return pbs.privateBrowsingEnabled; + } catch (e) { + return false; + } + }, + + /* * log * @@ -227,7 +240,11 @@ LoginManagerPrompter.prototype = { // If hostname is null, we can't save this login. if (hostname) { - var canRememberLogin = (aSavePassword == + var canRememberLogin; + if (this._inPrivateBrowsing) + canRememberLogin = false; + else + canRememberLogin = (aSavePassword == Ci.nsIAuthPrompt.SAVE_PASSWORD_PERMANENTLY) && this._pwmgr.getLoginSavingEnabled(hostname); @@ -323,7 +340,7 @@ LoginManagerPrompter.prototype = { var [hostname, realm, username] = this._getRealmInfo(aPasswordRealm); // If hostname is null, we can't save this login. - if (hostname) { + if (hostname && !this._inPrivateBrowsing) { var canRememberLogin = (aSavePassword == Ci.nsIAuthPrompt.SAVE_PASSWORD_PERMANENTLY) && this._pwmgr.getLoginSavingEnabled(hostname); @@ -448,6 +465,8 @@ LoginManagerPrompter.prototype = { } var canRememberLogin = this._pwmgr.getLoginSavingEnabled(hostname); + if (this._inPrivateBrowsing) + canRememberLogin = false; // if checkboxLabel is null, the checkbox won't be shown at all. if (canRememberLogin && !notifyBox) diff --git a/toolkit/components/passwordmgr/test/Makefile.in b/toolkit/components/passwordmgr/test/Makefile.in index b6db1c122408..f03894d737fc 100644 --- a/toolkit/components/passwordmgr/test/Makefile.in +++ b/toolkit/components/passwordmgr/test/Makefile.in @@ -63,6 +63,7 @@ MOCHI_TESTS = \ test_basic_form_pwonly.html \ test_bug_227640.html \ test_bug_242956.html \ + test_privbrowsing.html \ test_bug_360493_1.html \ test_bug_360493_2.html \ test_bug_391514.html \ @@ -80,6 +81,10 @@ MOCHI_CONTENT = \ notification_common.js \ authenticate.sjs \ formsubmit.sjs \ + subtst_privbrowsing_1.html \ + subtst_privbrowsing_2.html \ + subtst_privbrowsing_3.html \ + subtst_privbrowsing_4.html \ subtst_notifications_1.html \ subtst_notifications_2.html \ subtst_notifications_3.html \ diff --git a/toolkit/components/passwordmgr/test/pwmgr_common.js b/toolkit/components/passwordmgr/test/pwmgr_common.js index c51958164553..93e7a661b2b0 100644 --- a/toolkit/components/passwordmgr/test/pwmgr_common.js +++ b/toolkit/components/passwordmgr/test/pwmgr_common.js @@ -104,3 +104,26 @@ function checkUnmodifiedForm(formNum) { ele.name + " in form " + formNum); } } + + +// Mochitest gives us a sendKey(), but it's targeted to a specific element. +// This basically sends an untargeted key event, to whatever's focused. +function doKey(aKey, modifier) { + // Seems we need to enable this again, or sendKeyEvent() complaints. + netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect'); + + var keyName = "DOM_VK_" + aKey.toUpperCase(); + var key = Components.interfaces.nsIDOMKeyEvent[keyName]; + + // undefined --> null + if (!modifier) + modifier = null; + + // Window utils for sending fake sey events. + var wutils = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor). + getInterface(Components.interfaces.nsIDOMWindowUtils); + + wutils.sendKeyEvent("keydown", key, 0, modifier); + wutils.sendKeyEvent("keypress", key, 0, modifier); + wutils.sendKeyEvent("keyup", key, 0, modifier); +} diff --git a/toolkit/components/passwordmgr/test/subtst_privbrowsing_1.html b/toolkit/components/passwordmgr/test/subtst_privbrowsing_1.html new file mode 100644 index 000000000000..df25d255b1d9 --- /dev/null +++ b/toolkit/components/passwordmgr/test/subtst_privbrowsing_1.html @@ -0,0 +1,31 @@ + + + Subtest for Login Manager notifications (private browsing) + + +

Subtest 1

+ +
+ + + +
+ + + + diff --git a/toolkit/components/passwordmgr/test/subtst_privbrowsing_2.html b/toolkit/components/passwordmgr/test/subtst_privbrowsing_2.html new file mode 100644 index 000000000000..d357bb6b5274 --- /dev/null +++ b/toolkit/components/passwordmgr/test/subtst_privbrowsing_2.html @@ -0,0 +1,31 @@ + + + Subtest for Login Manager notifications (private browsing) + + +

Subtest 2

+ +
+ + + +
+ + + + diff --git a/toolkit/components/passwordmgr/test/subtst_privbrowsing_3.html b/toolkit/components/passwordmgr/test/subtst_privbrowsing_3.html new file mode 100644 index 000000000000..f9df9d283162 --- /dev/null +++ b/toolkit/components/passwordmgr/test/subtst_privbrowsing_3.html @@ -0,0 +1,27 @@ + + + Subtest for Login Manager notifications (private browsing) + + +

Subtest 3

+ +
+ + + +
+ + + + diff --git a/toolkit/components/passwordmgr/test/subtst_privbrowsing_4.html b/toolkit/components/passwordmgr/test/subtst_privbrowsing_4.html new file mode 100644 index 000000000000..328720ea2bdc --- /dev/null +++ b/toolkit/components/passwordmgr/test/subtst_privbrowsing_4.html @@ -0,0 +1,34 @@ + + + Subtest for Login Manager notifications (private browsing) + + + +

Subtest 4

+ +
+ + + +
+ + + + diff --git a/toolkit/components/passwordmgr/test/test_basic_form_autocomplete.html b/toolkit/components/passwordmgr/test/test_basic_form_autocomplete.html index 8638ad780efc..9ff17282ec42 100644 --- a/toolkit/components/passwordmgr/test/test_basic_form_autocomplete.html +++ b/toolkit/components/passwordmgr/test/test_basic_form_autocomplete.html @@ -73,10 +73,6 @@ var uname = $_(1, "uname"); var pword = $_(1, "pword"); const shiftModifier = Components.interfaces.nsIDOMNSEvent.SHIFT_MASK; -// Window utils for sending fake sey events. -var wutils = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor). - getInterface(Components.interfaces.nsIDOMWindowUtils); - // Get the pwmgr service var pwmgr = Components.classes["@mozilla.org/login-manager;1"] .getService(Components.interfaces.nsILoginManager); @@ -147,25 +143,6 @@ function checkACForm(expectedUsername, expectedPassword) { } -// Mochitest gives us a sendKey(), but it's targeted to a specific element. -// This basically sends an untargeted key event, to whatever's focused. -function doKey(aKey, modifier) { - // Seems we need to enable this again, or sendKeyEvent() complaints. - netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect'); - - var keyName = "DOM_VK_" + aKey.toUpperCase(); - var key = Components.interfaces.nsIDOMKeyEvent[keyName]; - - // undefined --> null - if (!modifier) - modifier = null; - - wutils.sendKeyEvent("keydown", key, 0, modifier); - wutils.sendKeyEvent("keypress", key, 0, modifier); - wutils.sendKeyEvent("keyup", key, 0, modifier); -} - - /* * Main section of test... diff --git a/toolkit/components/passwordmgr/test/test_privbrowsing.html b/toolkit/components/passwordmgr/test/test_privbrowsing.html new file mode 100644 index 000000000000..869732d1a0c7 --- /dev/null +++ b/toolkit/components/passwordmgr/test/test_privbrowsing.html @@ -0,0 +1,324 @@ + + + + + Test for Bug 248970 + + + + + + +Mozilla Bug 248970 +

+ +
+
+
+ + + diff --git a/toolkit/mozapps/installer/packager.mk b/toolkit/mozapps/installer/packager.mk index aad58bc6c22f..201e79cf43bb 100644 --- a/toolkit/mozapps/installer/packager.mk +++ b/toolkit/mozapps/installer/packager.mk @@ -271,6 +271,8 @@ MOZ_PKG_REMOVALS_GEN = removed-files $(MOZ_PKG_REMOVALS_GEN): $(MOZ_PKG_REMOVALS) Makefile Makefile.in $(PYTHON) $(MOZILLA_DIR)/config/Preprocessor.py -Fsubstitution $(DEFINES) $(ACDEFINES) $(MOZ_PKG_REMOVALS) > $(MOZ_PKG_REMOVALS_GEN) + +GARBAGE += $(MOZ_PKG_REMOVALS_GEN) endif GARBAGE += $(DIST)/$(PACKAGE) $(PACKAGE) diff --git a/toolkit/mozapps/update/src/updater/updater.cpp b/toolkit/mozapps/update/src/updater/updater.cpp index d893d49a66f6..6a08eb3d2b44 100644 --- a/toolkit/mozapps/update/src/updater/updater.cpp +++ b/toolkit/mozapps/update/src/updater/updater.cpp @@ -118,7 +118,9 @@ void LaunchChild(int argc, char **argv); #endif #ifndef MAXPATHLEN -# ifdef MAX_PATH +# ifdef PATH_MAX +# define MAXPATHLEN PATH_MAX +# elif defined(_MAX_PATH) # define MAXPATHLEN MAX_PATH # elif defined(_MAX_PATH) # define MAXPATHLEN _MAX_PATH diff --git a/toolkit/xre/nsAppRunner.h b/toolkit/xre/nsAppRunner.h index 37f2ee2250db..33642b47279a 100644 --- a/toolkit/xre/nsAppRunner.h +++ b/toolkit/xre/nsAppRunner.h @@ -40,10 +40,14 @@ #ifdef XP_WIN #include +#else +#include #endif #ifndef MAXPATHLEN -#ifdef _MAX_PATH +#ifdef PATH_MAX +#define MAXPATHLEN PATH_MAX +#elif defined(_MAX_PATH) #define MAXPATHLEN _MAX_PATH #elif defined(CCHMAXPATH) #define MAXPATHLEN CCHMAXPATH diff --git a/widget/src/cocoa/nsChildView.h b/widget/src/cocoa/nsChildView.h index 37375329c489..77f5007a39b3 100644 --- a/widget/src/cocoa/nsChildView.h +++ b/widget/src/cocoa/nsChildView.h @@ -292,6 +292,7 @@ public: NS_IMETHOD Show(PRBool aState); NS_IMETHOD IsVisible(PRBool& outState); + NS_IMETHOD SetParent(nsIWidget* aNewParent); virtual nsIWidget* GetParent(void); NS_IMETHOD ModalEventFilter(PRBool aRealEvent, void *aEvent, diff --git a/widget/src/cocoa/nsChildView.mm b/widget/src/cocoa/nsChildView.mm index db917d604f26..bf19672e94bb 100644 --- a/widget/src/cocoa/nsChildView.mm +++ b/widget/src/cocoa/nsChildView.mm @@ -972,8 +972,38 @@ NS_IMETHODIMP nsChildView::Show(PRBool aState) } -nsIWidget* -nsChildView::GetParent(void) +//------------------------------------------------------------------------- +// +// Reset the parent of this widget +// +//------------------------------------------------------------------------- +NS_IMETHODIMP nsChildView::SetParent(nsIWidget* aNewParent) +{ + NS_ENSURE_ARG(aNewParent); + + // make sure we stay alive + nsCOMPtr kungFuDeathGrip(this); + + // remove us from our existing parent + if (mParentWidget) + mParentWidget->RemoveChild(this); + [mView removeFromSuperview]; // we hold a ref to mView, so this is OK + + // add us to the new parent + aNewParent->AddChild(this); + mParentWidget = aNewParent; + mParentView = (NSView*)aNewParent->GetNativeData(NS_NATIVE_WIDGET); + [mParentView addSubview:mView]; + + return NS_OK; +} + +//------------------------------------------------------------------------- +// +// Get this widget's parent +// +//------------------------------------------------------------------------- +nsIWidget* nsChildView::GetParent(void) { return mParentWidget; } diff --git a/xpcom/build/nsXPCOMPrivate.h b/xpcom/build/nsXPCOMPrivate.h index 0c18c3102752..2d84bc1c11c7 100644 --- a/xpcom/build/nsXPCOMPrivate.h +++ b/xpcom/build/nsXPCOMPrivate.h @@ -231,6 +231,7 @@ NS_GetFrozenFunctions(XPCOMFunctions *entryPoints, const char* libraryPath); #define XUL_DLL "libxul"MOZ_DLL_SUFFIX #else // Unix +#include // for PATH_MAX #define XPCOM_DLL "libxpcom"MOZ_DLL_SUFFIX diff --git a/xpcom/build/nsXPComInit.cpp b/xpcom/build/nsXPComInit.cpp index 629b520779fd..920f225c248c 100644 --- a/xpcom/build/nsXPComInit.cpp +++ b/xpcom/build/nsXPComInit.cpp @@ -289,6 +289,23 @@ RegisterGenericFactory(nsIComponentRegistrar* registrar, static PRBool CheckUpdateFile() { nsresult rv; + nsCOMPtr compregFile; + rv = nsDirectoryService::gService->Get(NS_XPCOM_COMPONENT_REGISTRY_FILE, + NS_GET_IID(nsIFile), + getter_AddRefs(compregFile)); + + if (NS_FAILED(rv)) { + NS_WARNING("Getting NS_XPCOM_COMPONENT_REGISTRY_FILE failed"); + return PR_FALSE; + } + + PRBool exists; + if (NS_FAILED(compregFile->Exists(&exists)) || !exists) + return PR_TRUE; + + PRInt64 compregModTime; + compregFile->GetLastModifiedTime(&compregModTime); + nsCOMPtr file; rv = nsDirectoryService::gService->Get(NS_XPCOM_CURRENT_PROCESS_DIR, NS_GET_IID(nsIFile), @@ -301,28 +318,39 @@ static PRBool CheckUpdateFile() file->AppendNative(nsDependentCString(".autoreg")); - PRBool exists; file->Exists(&exists); if (!exists) - return PR_FALSE; + goto next; - nsCOMPtr compregFile; - rv = nsDirectoryService::gService->Get(NS_XPCOM_COMPONENT_REGISTRY_FILE, + PRInt64 autoregModTime; + file->GetLastModifiedTime(&autoregModTime); + + if (LL_CMP(autoregModTime, >, compregModTime)) + return PR_TRUE; + +next: + nsCOMPtr greFile; + rv = nsDirectoryService::gService->Get(NS_GRE_DIR, NS_GET_IID(nsIFile), - getter_AddRefs(compregFile)); + getter_AddRefs(greFile)); - if (NS_FAILED(rv)) { - NS_WARNING("Getting NS_XPCOM_COMPONENT_REGISTRY_FILE failed"); + NS_WARNING("Getting NS_GRE_DIR failed"); return PR_FALSE; } - if (NS_FAILED(compregFile->Exists(&exists)) || !exists) - return PR_TRUE; + greFile->AppendNative(nsDependentCString(".autoreg")); - PRInt64 compregModTime, autoregModTime; - compregFile->GetLastModifiedTime(&compregModTime); - file->GetLastModifiedTime(&autoregModTime); + PRBool equals; + rv = greFile->Equals(file, &equals); + if (NS_SUCCEEDED(rv) && equals) + return PR_FALSE; + + greFile->Exists(&exists); + if (!exists) + return PR_FALSE; + + greFile->GetLastModifiedTime(&autoregModTime); return LL_CMP(autoregModTime, >, compregModTime); } diff --git a/xpcom/reflect/xptcall/src/md/unix/Makefile.in b/xpcom/reflect/xptcall/src/md/unix/Makefile.in index 559fd966bb96..8f29c8eea4f1 100644 --- a/xpcom/reflect/xptcall/src/md/unix/Makefile.in +++ b/xpcom/reflect/xptcall/src/md/unix/Makefile.in @@ -276,11 +276,7 @@ ifeq ($(OS_ARCH),Linux) ifneq (,$(findstring mips, $(OS_TEST))) CPPSRCS := xptcinvoke_mips.cpp xptcstubs_mips.cpp ASFILES := xptcinvoke_asm_mips.s xptcstubs_asm_mips.s -#xptcstubs_mips.cpp -# xptcstubs_asm_mips.s -ifdef GNU_CC -ASFLAGS += $(INCLUDES) -x assembler-with-cpp -D__GNUC__ -endif +ASFLAGS += -I$(PUBLIC) -x assembler-with-cpp endif endif @@ -466,10 +462,7 @@ LOCAL_INCLUDES += \ ifeq ($(OS_ARCH),Linux) ifneq (,$(findstring mips, $(OS_TEST))) -xptcstubs_asm_mips.o: xptcstubs_asm_mips.s.m4 $(PUBLIC)/xptcstubsdef.inc - m4 $(INCLUDES) $< > ./xptcstubs_asm_mips.s && \ - $(AS) -o $@ $(ASFLAGS) $(AS_DASH_C_FLAG) ./xptcstubs_asm_mips.s - $(RM) -f ./xptcstubs_asm_mips.s +xptcstubs_asm_mips.o: $(PUBLIC)/xptcstubsdef.inc endif endif diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips.s b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips.s index 87042472575f..6cf9deb11210 100644 --- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips.s +++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips.s @@ -24,6 +24,7 @@ * Contributor(s): * Brendan Eich * Stuart Parmenter + * Thiemo Seufer * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or @@ -44,139 +45,123 @@ #include #include -.text -.globl invoke_count_words -.globl invoke_copy_to_stack +# NARGSAVE is the argument space in the callers frame, including extra +# 'shadowed' space for the argument registers. The minimum of 4 +# argument slots is sometimes predefined in the header files. +#ifndef NARGSAVE +#define NARGSAVE 4 +#endif -# We need a variable number of words allocated from the stack for copies of -# the params, and this space must come between the high frame (where ra, gp, -# and s0 are saved) and the low frame (where a0-a3 are saved by the callee -# functions we invoke). +#define LOCALSZ 3 /* gp, fp, ra */ +#define FRAMESZ ((((NARGSAVE+LOCALSZ)*SZREG)+ALSZ)&ALMASK) -LOCALSZ=4 # s0, s1, ra, gp -NARGSAVE=4 # a0, a1, a2, a3 -HIFRAMESZ=(LOCALSZ*SZREG) -LOFRAMESZ=(NARGSAVE*SZREG) -FRAMESZ=(HIFRAMESZ+LOFRAMESZ+ALSZ)&ALMASK +#define RAOFF (FRAMESZ - (1*SZREG)) +#define FPOFF (FRAMESZ - (2*SZREG)) +#define GPOFF (FRAMESZ - (3*SZREG)) -# XXX these 2*SZREG, etc. are very magic -- we *know* that ALSZ&ALMASK cause -# FRAMESZ to be 0 mod 8, in this case to be 16 and not 12. -RAOFF=FRAMESZ - (2*SZREG) -GPOFF=FRAMESZ - (3*SZREG) -S0OFF=FRAMESZ - (4*SZREG) -S1OFF=FRAMESZ - (5*SZREG) +#define A0OFF (FRAMESZ + (0*SZREG)) +#define A1OFF (FRAMESZ + (1*SZREG)) +#define A2OFF (FRAMESZ + (2*SZREG)) +#define A3OFF (FRAMESZ + (3*SZREG)) -# These are not magic -- they are just our argsave slots in the caller frame. -A0OFF=FRAMESZ -A1OFF=FRAMESZ + (1*SZREG) -A2OFF=FRAMESZ + (2*SZREG) -A3OFF=FRAMESZ + (3*SZREG) + .text - # - # _XPTC_InvokeByIndex(that, methodIndex, paramCount, params) - # a0 a1 a2 a3 - -NESTED(_XPTC_InvokeByIndex, FRAMESZ, ra) - - .set noreorder - .cpload t9 - .set reorder +# +# _NS_InvokeByIndex_P(that, methodIndex, paramCount, params) +# a0 a1 a2 a3 + .globl _NS_InvokeByIndex_P + .align 2 + .type _NS_InvokeByIndex_P,@function + .ent _NS_InvokeByIndex_P,0 + .frame fp, FRAMESZ, ra +_NS_InvokeByIndex_P: + SETUP_GP subu sp, FRAMESZ - # specify the save register mask -- XXX do we want the a0-a3 here, given - # our "split" frame where the args are saved below a dynamicly allocated - # region under the high frame? - # - # 10010000000000010000000011110000 - .mask 0x900100F0, -((NARGSAVE+LOCALSZ)*SZREG) + # specify the save register mask for gp, fp, ra, a3 - a0 + .mask 0xD00000F0, RAOFF-FRAMESZ - # thou shalt not use .cprestore if yer frame has variable size... - # .cprestore GPOFF + sw ra, RAOFF(sp) + sw fp, FPOFF(sp) - REG_S ra, RAOFF(sp) + # we can't use .cprestore in a variable stack frame + sw gp, GPOFF(sp) - # this happens automatically with .cprestore, but we cannot use that op... - REG_S gp, GPOFF(sp) - REG_S s0, S0OFF(sp) - REG_S s1, S1OFF(sp) + sw a0, A0OFF(sp) + sw a1, A1OFF(sp) + sw a2, A2OFF(sp) + sw a3, A3OFF(sp) - REG_S a0, A0OFF(sp) - REG_S a1, A1OFF(sp) - REG_S a2, A2OFF(sp) - REG_S a3, A3OFF(sp) + # save bottom of fixed frame + move fp, sp - # invoke_count_words(paramCount, params) + # extern "C" uint32 + # invoke_count_words(PRUint32 paramCount, nsXPTCVariant* s); + la t9, invoke_count_words move a0, a2 move a1, a3 + jalr t9 + lw gp, GPOFF(fp) - jal invoke_count_words - lw gp, GPOFF(sp) + # allocate variable stack, with a size of: + # wordsize (of 4 bytes) * result (already aligned to dword) + # but a minimum of 16 byte + sll v0, 2 + slt t0, v0, 16 + beqz t0, 1f + li v0, 16 +1: subu sp, v0 - # save the old sp so we can pop the param area and any "low frame" - # needed as an argsave area below the param block for callees that - # we invoke. - move s0, sp - - REG_L a1, A2OFF(sp) # a1 = paramCount - REG_L a2, A3OFF(sp) # a2 = params - - # we define a word as 4 bytes, period end of story! - sll v0, 2 # 4 bytes * result of invoke_copy_words - subu v0, LOFRAMESZ # but we take back the argsave area built into - # our stack frame -- SWEET! - subu sp, sp, v0 # make room - move a0, sp # a0 = param stack address - move s1, a0 # save it for later -- it should be safe here - - # the old sp is still saved in s0, but we now need another argsave - # area ("low frame") for the invoke_copy_to_stack call. - subu sp, sp, LOFRAMESZ - - # copy the param into the stack areas + # let a0 point to the bottom of the variable stack, allocate + # another fixed stack for: + # extern "C" void # invoke_copy_to_stack(PRUint32* d, PRUint32 paramCount, - # nsXPTCVariant* s) - jal invoke_copy_to_stack - lw gp, GPOFF(s0) + # nsXPTCVariant* s); + la t9, invoke_copy_to_stack + move a0, sp + lw a1, A2OFF(fp) + lw a2, A3OFF(fp) + subu sp, 16 + jalr t9 + lw gp, GPOFF(fp) - move sp, s0 # get orig sp back, popping params and argsave + # back to the variable stack frame + addu sp, 16 - REG_L a0, A0OFF(sp) # a0 = set "that" to be "this" - REG_L a1, A1OFF(sp) # a1 = methodIndex - - # t1 = methodIndex * 4 - # (use shift instead of mult) - sll t1, a1, 2 - - # calculate the function we need to jump to, - # which must then be saved in t9 + # calculate the function we need to jump to, which must then be + # stored in t9 + lw a0, A0OFF(fp) # a0 = set "that" to be "this" + lw t0, A1OFF(fp) # a1 = methodIndex lw t9, 0(a0) - addu t9, t9, t1 - lw t9, 8(t9) + # t0 = methodIndex << PTRLOG + sll t0, t0, PTRLOG + addu t9, t0 +#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */ + lw t9, (t9) +#else /* not G++ V3 ABI */ + lw t9, 2*PTRSIZE(t9) +#endif /* G++ V3 ABI */ - # a1..a3 and f13..f14 should now be set to what - # invoke_copy_to_stack told us. skip a0 and f12 - # because that is the "this" pointer + # Set a1-a3 to what invoke_copy_to_stack told us. a0 is already + # the "this" pointer. We don't have to care about floating + # point arguments, the non-FP "this" pointer as first argument + # means they'll never be used. + lw a1, 1*SZREG(sp) + lw a2, 2*SZREG(sp) + lw a3, 3*SZREG(sp) - REG_L a1, 1*SZREG(s1) - REG_L a2, 2*SZREG(s1) - REG_L a3, 3*SZREG(s1) + jalr t9 + # Micro-optimization: There's no gp usage below this point, so + # we don't reload. + # lw gp, GPOFF(fp) - l.d $f13, 8(s1) - l.d $f14, 16(s1) + # leave variable stack frame + move sp, fp - # Create the stack pointer for the function, which must have 4 words - # of space for callee-saved args. invoke_count_words allocated space - # for a0 starting at s1, so we just move s1 into sp. - move sp, s1 + lw ra, RAOFF(sp) + lw fp, FPOFF(sp) - jalr ra, t9 - lw gp, GPOFF(s0) - - move sp, s0 - - REG_L ra, RAOFF(sp) - REG_L s0, S0OFF(sp) - addu sp, FRAMESZ + addiu sp, FRAMESZ j ra -.end _XPTC_InvokeByIndex +END(_NS_InvokeByIndex_P) diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_m68k.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_m68k.cpp index 67a644a438a6..7b0a5a04ad4d 100644 --- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_m68k.cpp +++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_m68k.cpp @@ -128,8 +128,8 @@ extern "C" { } } -XPTC_PUBLIC_API(nsresult) -XPTC_InvokeByIndex(nsISupports* that, PRUint32 methodIndex, +EXPORT_XPCOM_API(nsresult) +NS_InvokeByIndex_P(nsISupports* that, PRUint32 methodIndex, PRUint32 paramCount, nsXPTCVariant* params) { PRUint32 result, n; diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_mips.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_mips.cpp index a73e4327168d..2c27a262a0c2 100644 --- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_mips.cpp +++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_mips.cpp @@ -24,6 +24,7 @@ * Contributor(s): * Stuart Parmenter * Brendan Eich + * Thiemo Seufer * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), @@ -52,10 +53,8 @@ invoke_count_words(PRUint32 paramCount, nsXPTCVariant* s) // Count a word for a0 even though it's never stored or loaded // We do this only for alignment of register pairs. PRUint32 result = 1; - for (PRUint32 i = 0; i < paramCount; i++, s++) + for (PRUint32 i = 0; i < paramCount; i++, result++, s++) { - result++; - if (s->IsPtrData()) continue; @@ -68,6 +67,9 @@ invoke_count_words(PRUint32 paramCount, nsXPTCVariant* s) result++; result++; break; + + default: + break; } } return (result + 1) & ~(PRUint32)1; @@ -88,8 +90,6 @@ invoke_copy_to_stack(PRUint32* d, PRUint32 paramCount, continue; } - *((void**)d) = s->val.p; - switch(s->type) { case nsXPTType::T_I64 : @@ -104,19 +104,20 @@ invoke_copy_to_stack(PRUint32* d, PRUint32 paramCount, if ((PRWord)d & 4) d++; *((double*) d) = s->val.d; d++; break; + default: + *((void**)d) = s->val.p; + break; } } } -extern "C" nsresult _XPTC_InvokeByIndex(nsISupports* that, PRUint32 methodIndex, +extern "C" nsresult _NS_InvokeByIndex_P(nsISupports* that, PRUint32 methodIndex, PRUint32 paramCount, nsXPTCVariant* params); -extern "C" -XPTC_PUBLIC_API(nsresult) -XPTC_InvokeByIndex(nsISupports* that, PRUint32 methodIndex, +EXPORT_XPCOM_API(nsresult) +NS_InvokeByIndex_P(nsISupports* that, PRUint32 methodIndex, PRUint32 paramCount, nsXPTCVariant* params) { - return _XPTC_InvokeByIndex(that, methodIndex, paramCount, params); -} - + return _NS_InvokeByIndex_P(that, methodIndex, paramCount, params); +} diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_mips.s b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_mips.s new file mode 100644 index 000000000000..c2dc0c7cfb92 --- /dev/null +++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_mips.s @@ -0,0 +1,142 @@ +/* -*- Mode: asm; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * Version: MPL 1.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corp, Inc. + * Portions created by the Initial Developer are Copyright (C) 2001 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Stuart Parmenter + * Chris Waterson + * Thiemo Seufer + */ + +/* This code is for MIPS using the O32 ABI. */ + +#include +#include + +# NARGSAVE is the argument space in the callers frame, including extra +# 'shadowed' space for the argument registers. The minimum of 4 +# argument slots is sometimes predefined in the header files. +#ifndef NARGSAVE +#define NARGSAVE 4 +#endif + +#define LOCALSZ 2 /* gp, ra */ +#define FRAMESZ ((((NARGSAVE+LOCALSZ)*SZREG)+ALSZ)&ALMASK) + +#define RAOFF (FRAMESZ - (1*SZREG)) +#define GPOFF (FRAMESZ - (2*SZREG)) + +#define A0OFF (FRAMESZ + (0*SZREG)) +#define A1OFF (FRAMESZ + (1*SZREG)) +#define A2OFF (FRAMESZ + (2*SZREG)) +#define A3OFF (FRAMESZ + (3*SZREG)) + + .text + +#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */ +#define STUB_ENTRY(x) \ + .if x < 10; \ + .globl _ZN14nsXPTCStubBase5Stub ##x ##Ev; \ + .type _ZN14nsXPTCStubBase5Stub ##x ##Ev,@function; \ + .aent _ZN14nsXPTCStubBase5Stub ##x ##Ev,0; \ +_ZN14nsXPTCStubBase5Stub ##x ##Ev:; \ + SETUP_GP; \ + li t0,x; \ + b sharedstub; \ + .elseif x < 100; \ + .globl _ZN14nsXPTCStubBase6Stub ##x ##Ev; \ + .type _ZN14nsXPTCStubBase6Stub ##x ##Ev,@function; \ + .aent _ZN14nsXPTCStubBase6Stub ##x ##Ev,0; \ +_ZN14nsXPTCStubBase6Stub ##x ##Ev:; \ + SETUP_GP; \ + li t0,x; \ + b sharedstub; \ + .elseif x < 1000; \ + .globl _ZN14nsXPTCStubBase7Stub ##x ##Ev; \ + .type _ZN14nsXPTCStubBase7Stub ##x ##Ev,@function; \ + .aent _ZN14nsXPTCStubBase7Stub ##x ##Ev,0; \ +_ZN14nsXPTCStubBase7Stub ##x ##Ev:; \ + SETUP_GP; \ + li t0,x; \ + b sharedstub; \ + .else; \ + .err; \ + .endif +#else /* not G++ V3 ABI */ +#define STUB_ENTRY(x) \ + .globl Stub ##x ##__14nsXPTCStubBase; \ + .type Stub ##x ##__14nsXPTCStubBase,@function; \ + .aent Stub ##x ##__14nsXPTCStubBase,0; \ +Stub ##x ##__14nsXPTCStubBase:; \ + SETUP_GP; \ + li t0,x; \ + b sharedstub +#endif /* G++ V3 ABI */ + +# SENTINEL_ENTRY is handled in the cpp file. +#define SENTINEL_ENTRY(x) + +# +# open a dummy frame for the function entries +# + .align 2 + .type dummy,@function + .ent dummy, 0 + .frame sp, FRAMESZ, ra +dummy: + SETUP_GP + +#include "xptcstubsdef.inc" + +sharedstub: + subu sp, FRAMESZ + + # specify the save register mask for gp, ra, a0-a3 + .mask 0x900000F0, RAOFF-FRAMESZ + + sw ra, RAOFF(sp) + SAVE_GP(GPOFF) + + # Micro-optimization: a0 is already loaded, and its slot gets + # ignored by PrepareAndDispatch, so no need to save it here. + # sw a0, A0OFF(sp) + sw a1, A1OFF(sp) + sw a2, A2OFF(sp) + sw a3, A3OFF(sp) + + la t9, PrepareAndDispatch + + # t0 is methodIndex + move a1, t0 + # have a2 point to the begin of the argument space on stack + addiu a2, sp, FRAMESZ + + # PrepareAndDispatch(that, methodIndex, args) + jalr t9 + + # Micro-optimization: Using jalr explicitly has the side-effect + # of not triggering .cprestore. This is ok because we have no + # gp reference below this point. It also allows better + # instruction sscheduling. + # lw gp, GPOFF(fp) + + lw ra, RAOFF(sp) + addiu sp, FRAMESZ + j ra + END(dummy) diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_m68k.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_m68k.cpp index 46471d1371e7..7ecc77c863c0 100644 --- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_m68k.cpp +++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_m68k.cpp @@ -38,6 +38,7 @@ /* Implement shared vtbl methods. */ #include "xptcprivate.h" +#include "xptiprivate.h" extern "C" { nsresult @@ -47,7 +48,6 @@ extern "C" { nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT]; nsXPTCMiniVariant* dispatchParams = NULL; - nsIInterfaceInfo* iface_info = NULL; const nsXPTMethodInfo* info; PRUint8 paramCount; PRUint8 i; @@ -55,11 +55,8 @@ extern "C" { NS_ASSERTION(self,"no self"); - self->GetInterfaceInfo(&iface_info); - NS_ASSERTION(iface_info,"no interface info"); - - iface_info->GetMethodInfo(PRUint16(methodIndex), &info); - NS_ASSERTION(info,"no interface info"); + self->mEntry->GetMethodInfo(PRUint16(methodIndex), &info); + NS_ASSERTION(info,"no method info"); paramCount = info->GetParamCount(); @@ -107,9 +104,7 @@ extern "C" { } } - result = self->CallMethod((PRUint16)methodIndex, info, dispatchParams); - - NS_RELEASE(iface_info); + result = self->mOuter->CallMethod((PRUint16)methodIndex, info, dispatchParams); if(dispatchParams != paramBuffer) delete [] dispatchParams; diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_mips.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_mips.cpp index 4d60f7be04a3..bdce59c4f91b 100644 --- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_mips.cpp +++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_mips.cpp @@ -39,6 +39,7 @@ * ***** END LICENSE BLOCK ***** */ #include "xptcprivate.h" +#include "xptiprivate.h" /* * This is for MIPS O32 ABI @@ -54,7 +55,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, PRUint32 methodIndex, PRUint32* args) nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT]; nsXPTCMiniVariant* dispatchParams = NULL; - nsIInterfaceInfo* iface_info = NULL; const nsXPTMethodInfo* info; PRUint8 paramCount; PRUint8 i; @@ -62,11 +62,8 @@ PrepareAndDispatch(nsXPTCStubBase* self, PRUint32 methodIndex, PRUint32* args) NS_ASSERTION(self,"no self"); - self->GetInterfaceInfo(&iface_info); - NS_ASSERTION(iface_info,"no interface info"); - - iface_info->GetMethodInfo(PRUint16(methodIndex), &info); - NS_ASSERTION(info,"no interface info"); + self->mEntry->GetMethodInfo(PRUint16(methodIndex), &info); + NS_ASSERTION(info,"no method info"); paramCount = info->GetParamCount(); @@ -109,9 +106,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, PRUint32 methodIndex, PRUint32* args) } } - result = self->CallMethod((PRUint16)methodIndex, info, dispatchParams); - - NS_RELEASE(iface_info); + result = self->mOuter->CallMethod((PRUint16)methodIndex, info, dispatchParams); if(dispatchParams != paramBuffer) delete [] dispatchParams; diff --git a/xulrunner/installer/Makefile.in b/xulrunner/installer/Makefile.in index 87703e12b88d..e0b94a12264e 100644 --- a/xulrunner/installer/Makefile.in +++ b/xulrunner/installer/Makefile.in @@ -77,7 +77,7 @@ regdir = /etc/gre.d install:: $(MOZILLA_VERSION).system.conf $(NSINSTALL) -D $(DESTDIR)$(regdir) - $(SYSINSTALL) $^ $(DESTDIR)$(regdir) + $(SYSINSTALL) $(IFLAGS1) $^ $(DESTDIR)$(regdir) endif # Add pkg-config files to the install:: target @@ -118,6 +118,7 @@ endif -e "s|%sdkdir%|$(sdkdir)|" \ -e "s|%MOZ_APP_NAME%|$(MOZ_APP_NAME)|" \ -e "s|%MOZILLA_VERSION%|$(MOZ_APP_VERSION)|" \ + -e "s|%WCHAR_CFLAGS%|$(WCHAR_CFLAGS)|" \ -e "s|%FULL_NSPR_LIBS%|$(FULL_NSPR_LIBS)|" \ -e "s|%FULL_NSPR_CFLAGS%|$(FULL_NSPR_CFLAGS)|" \ -e "s|%NSPR_NAME%|$(NSPR_NAME)|" \ diff --git a/xulrunner/installer/libxul-embedding-unstable.pc.in b/xulrunner/installer/libxul-embedding-unstable.pc.in index 42de3246d49d..c9464ce0b0ca 100644 --- a/xulrunner/installer/libxul-embedding-unstable.pc.in +++ b/xulrunner/installer/libxul-embedding-unstable.pc.in @@ -8,4 +8,4 @@ Name: libxul-embedding-unstable Description: Static library for version-independent embedding of the Mozilla runtime (unstable API) Version: %MOZILLA_VERSION% Libs: -L${sdkdir}/lib -lxpcomglue -Cflags: -DXPCOM_GLUE -I${includedir}/${includetype} -fshort-wchar +Cflags: -DXPCOM_GLUE -I${includedir}/${includetype} %WCHAR_CFLAGS% diff --git a/xulrunner/installer/libxul-embedding.pc.in b/xulrunner/installer/libxul-embedding.pc.in index 3d8981021988..bb493998ae40 100644 --- a/xulrunner/installer/libxul-embedding.pc.in +++ b/xulrunner/installer/libxul-embedding.pc.in @@ -12,4 +12,4 @@ Name: libxul-embedding Description: Static library for version-independent embedding of the Mozilla runtime Version: %MOZILLA_VERSION% Libs: -L${sdkdir}/lib -lxpcomglue -Cflags: -DXPCOM_GLUE -I${includedir}/${includetype} -fshort-wchar +Cflags: -DXPCOM_GLUE -I${includedir}/${includetype} %WCHAR_CFLAGS% diff --git a/xulrunner/installer/libxul-unstable.pc.in b/xulrunner/installer/libxul-unstable.pc.in index f21189c23230..4489ef1dcfb7 100644 --- a/xulrunner/installer/libxul-unstable.pc.in +++ b/xulrunner/installer/libxul-unstable.pc.in @@ -9,4 +9,4 @@ Description: The Mozilla Runtime and Embedding Engine (unstable API) Version: %MOZILLA_VERSION% Requires: %NSPR_NAME% >= %NSPR_VERSION% Libs: -L${sdkdir}/lib -lxpcomglue_s -lxul -lxpcom -Cflags: -I${includedir}/${includetype} -fshort-wchar +Cflags: -I${includedir}/${includetype} %WCHAR_CFLAGS% diff --git a/xulrunner/installer/libxul.pc.in b/xulrunner/installer/libxul.pc.in index b05b291dc85f..3a69f1e07f30 100644 --- a/xulrunner/installer/libxul.pc.in +++ b/xulrunner/installer/libxul.pc.in @@ -13,4 +13,4 @@ Description: The Mozilla Runtime and Embedding Engine Version: %MOZILLA_VERSION% Requires: %NSPR_NAME% >= %NSPR_VERSION% Libs: -L${sdkdir}/lib -lxpcomglue_s -lxul -lxpcom -Cflags: -I${includedir}/${includetype} -fshort-wchar \ No newline at end of file +Cflags: -I${includedir}/${includetype} %WCHAR_CFLAGS%