1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
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;
};
|