Added group stuff back for necko.

This commit is contained in:
warren%netscape.com 1999-06-28 22:34:20 +00:00
Родитель c052416e19
Коммит bc7c1d7503
5 изменённых файлов: 10 добавлений и 54 удалений

Просмотреть файл

@ -29,7 +29,9 @@
#include "il_util.h"
#include "nsIDeviceContext.h"
#include "nsIStreamListener.h"
#ifndef NECKO
#ifdef NECKO
#include "nsILoadGroup.h"
#else
#include "nsIURLGroup.h"
#endif
@ -42,11 +44,7 @@ public:
ImageGroupImpl(nsIImageManager *aManager);
virtual ~ImageGroupImpl();
#ifdef NECKO
nsresult Init(nsIDeviceContext *aDeviceContext);
#else
nsresult Init(nsIDeviceContext *aDeviceContext, nsILoadGroup* aLoadGroup);
#endif
NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW
@ -80,9 +78,7 @@ public:
nsIDeviceContext *mDeviceContext;
ilINetContext* mNetContext;
nsIStreamListener** mListenerRequest;
#ifndef NECKO
nsILoadGroup* mLoadGroup;
#endif
};
ImageGroupImpl::ImageGroupImpl(nsIImageManager *aManager)
@ -172,11 +168,7 @@ ReconnectHack(void* arg, nsIStreamListener* aListener)
}
nsresult
#ifdef NECKO
ImageGroupImpl::Init(nsIDeviceContext *aDeviceContext)
#else
ImageGroupImpl::Init(nsIDeviceContext *aDeviceContext, nsILoadGroup* aLoadGroup)
#endif
{
ilIImageRenderer *renderer;
nsresult result;
@ -191,17 +183,11 @@ ImageGroupImpl::Init(nsIDeviceContext *aDeviceContext, nsILoadGroup* aLoadGroup)
return NS_ERROR_OUT_OF_MEMORY;
}
#ifndef NECKO
mLoadGroup = aLoadGroup;
NS_IF_ADDREF(mLoadGroup);
#endif // NECKO
// Create an async net context
#ifdef NECKO
result = NS_NewImageNetContext(&mNetContext, ReconnectHack, this);
#else
result = NS_NewImageNetContext(&mNetContext, mLoadGroup, ReconnectHack, this);
#endif
if (NS_OK != result) {
return result;
}

Просмотреть файл

@ -23,26 +23,19 @@
#include "nscore.h"
class nsIStreamListener;
#ifndef NECKO
class nsILoadGroup;
#endif
typedef PRBool (*nsReconnectCB)(void* arg, nsIStreamListener* aListener);
extern "C" NS_GFX_(nsresult)
NS_NewImageNetContext(ilINetContext **aInstancePtrResult,
#ifndef NECKO
nsILoadGroup* aLoadGroup,
#endif
nsReconnectCB aReconnectCallback,
void* aReconnectArg);
extern "C" NS_GFX_(nsresult)
NS_NewImageURL(ilIURL **aInstancePtrResult,
const char *aURL
#ifndef NECKO
, nsILoadGroup* aLoadGroup
#endif
);
const char *aURL , nsILoadGroup* aLoadGroup);
extern "C" NS_GFX_(nsresult) NS_NewImageRenderer(ilIImageRenderer **aInstancePtrResult);

Просмотреть файл

@ -24,7 +24,9 @@
#include "nsIStreamListener.h"
#include "nsIInputStream.h"
#include "nsIURL.h"
#ifndef NECKO
#ifdef NECKO
#include "nsILoadGroup.h"
#else
#include "nsIURLGroup.h"
#endif
#include "nsITimer.h"
@ -58,9 +60,7 @@ class ImageConsumer;
class ImageNetContextImpl : public ilINetContext {
public:
ImageNetContextImpl(NET_ReloadMethod aReloadPolicy,
#ifndef NECKO
nsILoadGroup* aLoadGroup,
#endif
nsReconnectCB aReconnectCallback,
void* aReconnectArg);
virtual ~ImageNetContextImpl();
@ -96,9 +96,7 @@ public:
nsVoidArray *mRequests;
NET_ReloadMethod mReloadPolicy;
#ifndef NECKO
nsILoadGroup* mLoadGroup;
#endif
nsReconnectCB mReconnectCallback;
void* mReconnectArg;
};
@ -399,9 +397,7 @@ ImageConsumer::~ImageConsumer()
}
ImageNetContextImpl::ImageNetContextImpl(NET_ReloadMethod aReloadPolicy,
#ifndef NECKO
nsILoadGroup* aLoadGroup,
#endif
nsReconnectCB aReconnectCallback,
void* aReconnectArg)
{
@ -439,11 +435,7 @@ ImageNetContextImpl::Clone()
{
ilINetContext *cx;
#ifdef NECKO
if (NS_NewImageNetContext(&cx, mReconnectCallback, mReconnectArg) == NS_OK)
#else
if (NS_NewImageNetContext(&cx, mLoadGroup, mReconnectCallback, mReconnectArg) == NS_OK)
#endif
{
return cx;
}
@ -488,11 +480,7 @@ ImageNetContextImpl::CreateURL(const char *aURL,
{
ilIURL *url;
#ifdef NECKO
if (NS_NewImageURL(&url, aURL) == NS_OK)
#else
if (NS_NewImageURL(&url, aURL, mLoadGroup) == NS_OK)
#endif
{
return url;
}
@ -597,9 +585,7 @@ ImageNetContextImpl::RequestDone(ImageConsumer *aConsumer)
extern "C" NS_GFX_(nsresult)
NS_NewImageNetContext(ilINetContext **aInstancePtrResult,
#ifndef NECKO
nsILoadGroup* aLoadGroup,
#endif
nsReconnectCB aReconnectCallback,
void* aReconnectArg)
{
@ -609,9 +595,7 @@ NS_NewImageNetContext(ilINetContext **aInstancePtrResult,
}
ilINetContext *cx = new ImageNetContextImpl(NET_NORMAL_RELOAD,
#ifndef NECKO
aLoadGroup,
#endif
aReconnectCallback,
aReconnectArg);
if (cx == nsnull) {

Просмотреть файл

@ -128,11 +128,7 @@ ImageNetContextSyncImpl::CreateURL(const char* aURL,
{
ilIURL *url;
#ifdef NECKO
if (NS_NewImageURL(&url, aURL) == NS_OK)
#else
if (NS_NewImageURL(&url, aURL, nsnull) == NS_OK)
#endif
{
return url;
}

Просмотреть файл

@ -243,11 +243,8 @@ ImageURLImpl::SetOwnerId(int aOwnerId)
}
extern "C" NS_GFX_(nsresult)
NS_NewImageURL(ilIURL **aInstancePtrResult, const char *aURL
#ifndef NECKO
, nsILoadGroup* aLoadGroup
#endif
)
NS_NewImageURL(ilIURL **aInstancePtrResult, const char *aURL,
nsILoadGroup* aLoadGroup)
{
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
if (nsnull == aInstancePtrResult) {