firefox/firefox-1.0-imgloader-comarray.patch
Christopher Aillon 588a63d7b4 - Avoid a crash on 64bit platforms
- Use system NSPR
2005-07-17 15:32:51 +00:00

75 lines
2.4 KiB
Diff

Index: modules/libpr0n/src/imgLoader.cpp
===================================================================
RCS file: /cvsroot/mozilla/modules/libpr0n/src/imgLoader.cpp,v
retrieving revision 1.78.2.2
diff -d -u -p -r1.78.2.2 imgLoader.cpp
--- modules/libpr0n/src/imgLoader.cpp 16 Aug 2004 18:06:37 -0000 1.78.2.2
+++ modules/libpr0n/src/imgLoader.cpp 15 Jul 2005 04:31:06 -0000
@@ -896,7 +896,7 @@ void imgCacheValidator::AddProxy(imgRequ
// the network.
aProxy->AddToLoadGroup();
- mProxies.AppendElement(aProxy);
+ mProxies.AppendObject(aProxy);
}
/** nsIRequestObserver methods **/
@@ -909,13 +909,10 @@ NS_IMETHODIMP imgCacheValidator::OnStart
PRBool isFromCache;
if (NS_SUCCEEDED(cacheChan->IsFromCache(&isFromCache)) && isFromCache) {
- PRUint32 count;
- mProxies.Count(&count);
+ PRUint32 count = mProxies.Count();
for (PRInt32 i = count-1; i>=0; i--) {
- imgRequestProxy *proxy;
- mProxies.GetElementAt(i, (nsISupports**)&proxy);
+ imgRequestProxy *proxy = NS_STATIC_CAST(imgRequestProxy *, mProxies[i]);
mRequest->NotifyProxyListener(proxy);
- NS_RELEASE(proxy);
}
mRequest->SetLoadId(mContext);
@@ -964,14 +961,11 @@ NS_IMETHODIMP imgCacheValidator::OnStart
mDestListener = NS_STATIC_CAST(nsIStreamListener*, pl);
- PRUint32 count;
- mProxies.Count(&count);
+ PRUint32 count = mProxies.Count();
for (PRInt32 i = count-1; i>=0; i--) {
- imgRequestProxy *proxy;
- mProxies.GetElementAt(i, (nsISupports**)&proxy);
+ imgRequestProxy *proxy = NS_STATIC_CAST(imgRequestProxy *, mProxies[i]);
proxy->ChangeOwner(request);
request->NotifyProxyListener(proxy);
- NS_RELEASE(proxy);
}
NS_RELEASE(request);
Index: modules/libpr0n/src/imgLoader.h
===================================================================
RCS file: /cvsroot/mozilla/modules/libpr0n/src/imgLoader.h,v
retrieving revision 1.10.38.1
diff -d -u -p -r1.10.38.1 imgLoader.h
--- modules/libpr0n/src/imgLoader.h 16 Aug 2004 18:06:37 -0000 1.10.38.1
+++ modules/libpr0n/src/imgLoader.h 15 Jul 2005 04:31:06 -0000
@@ -90,7 +90,7 @@ private:
* validate checker
*/
-#include "nsSupportsArray.h"
+#include "nsCOMArray.h"
class imgCacheValidator : public nsIStreamListener
{
@@ -109,7 +109,7 @@ private:
nsCOMPtr<nsIStreamListener> mDestListener;
imgRequest *mRequest;
- nsSupportsArray mProxies;
+ nsCOMArray<imgIRequest> mProxies;
void *mContext;
};