Changed URIDispatcher to URILoader throughout.

This commit is contained in:
tbogard%aol.net 1999-11-02 19:36:43 +00:00
parent 7463fbd7a6
commit f9e320efbe
7 changed files with 72 additions and 39 deletions

View File

@ -24,20 +24,17 @@ include <$(DEPTH)\config\config.mak>
## exports
EXPORTS= \
nsURIDispatcher.h \
$(NULL)
XPIDLSRCS= \
.\nsIURIContentListener.idl \
.\nsCURILoader.idl \
.\nsIContentHandler.idl \
.\nsIURIDispatcher.idl \
.\nsIURIContentListener.idl \
.\nsIURILoader.idl \
$(NULL)
LIBRARY_NAME=uriloaderbase_s
CPP_OBJS = \
.\$(OBJDIR)\nsURIDispatcher.obj \
.\$(OBJDIR)\nsURILoader.obj \
$(NULL)
INCS = $(INCS) \

View File

@ -0,0 +1,37 @@
/* -*- Mode: IDL; tab-width: 3; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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 the Mozilla browser.
*
* The Initial Developer of the Original Code is Netscape
* Communications, Inc. Portions created by Netscape are
* Copyright (C) 1999, Mozilla. All Rights Reserved.
*
* Contributor(s):
* Travis Bogard <travis@netscape.com>
*/
#include "nsIURILoader.idl"
/*
nsCURILoader implements:
-------------------------
nsIURILoader
*/
%{ C++
// {9F6D5D40-90E7-11d3-AF93-00A024FFC08C} -
#define NS_URI_LOADER_CID \
{ 0x9f6d5d40, 0x90e7, 0x11d3, { 0xaf, 0x80, 0x00, 0xa0, 0x24, 0xff, 0xc0, 0x8c } }
#define NS_URI_LOADER_PROGID \
"component://netscape/uriloader"
%}

View File

@ -43,7 +43,7 @@ interface nsIURI;
[scriptable, uuid(40AECB53-8B65-11d3-989D-001083010E9B)]
interface nsIURIDispatcher : nsISupports
interface nsIURILoader : nsISupports
{
/* as applications such as messenger and the browser are instantiated,
they register content listener's with the uri dispatcher corresponding
@ -67,5 +67,4 @@ interface nsIURIDispatcher : nsISupports
void openURI(in nsIURI aURI, in nsIStreamObserver aStreamObserver,
in nsIURIContentListener aContentListener, in nsISupports aContext,
in nsIURI aReferringURI);
};
};

View File

@ -16,26 +16,26 @@
* Reserved.
*/
#include "nsURIDispatcher.h"
#include "nsURILoader.h"
#include "nsVoidArray.h"
#include "nsXPIDLString.h"
#include "nsString.h"
nsURIDispatcher::nsURIDispatcher()
nsURILoader::nsURILoader()
{
NS_INIT_ISUPPORTS();
m_listeners = new nsVoidArray();
}
nsURIDispatcher::~nsURIDispatcher()
nsURILoader::~nsURILoader()
{
if (m_listeners)
delete m_listeners;
}
NS_IMPL_ISUPPORTS1(nsURIDispatcher, nsIURIDispatcher)
NS_IMPL_ISUPPORTS1(nsURILoader, nsIURILoader)
NS_IMETHODIMP nsURIDispatcher::RegisterContentListener(nsIURIContentListener * aContentListener)
NS_IMETHODIMP nsURILoader::RegisterContentListener(nsIURIContentListener * aContentListener)
{
nsresult rv = NS_OK;
if (m_listeners)
@ -46,7 +46,7 @@ NS_IMETHODIMP nsURIDispatcher::RegisterContentListener(nsIURIContentListener * a
return rv;
}
NS_IMETHODIMP nsURIDispatcher::UnRegisterContentListener(nsIURIContentListener * aContentListener)
NS_IMETHODIMP nsURILoader::UnRegisterContentListener(nsIURIContentListener * aContentListener)
{
if (m_listeners)
m_listeners->RemoveElement(aContentListener);
@ -54,7 +54,7 @@ NS_IMETHODIMP nsURIDispatcher::UnRegisterContentListener(nsIURIContentListener *
}
NS_IMETHODIMP nsURIDispatcher::OpenURI(nsIURI *aURI, nsIStreamObserver *aStreamObserver,
NS_IMETHODIMP nsURILoader::OpenURI(nsIURI *aURI, nsIStreamObserver *aStreamObserver,
nsIURIContentListener *aContentListener, nsISupports *aContext,
nsIURI *aReferringURI)
{

View File

@ -17,7 +17,7 @@
*/
/* In some regards this class is a temporary class. As the new web shell
re-architecture begins to fall into place, the URIDispatcher will also
re-architecture begins to fall into place, the URILoader will also
be the doc loader and this implementation will be grated onto the doc
loader.
@ -26,22 +26,22 @@
*/
#ifndef nsURIDispatcher_h__
#define nsURIDispatcher_h__
#ifndef nsURILoader_h__
#define nsURILoader_h__
#include "nsIURIDispatcher.h"
#include "nsCURILoader.h"
#include "nsCOMPtr.h"
class nsVoidArray;
class nsURIDispatcher : public nsIURIDispatcher
class nsURILoader : public nsIURILoader
{
public:
NS_DECL_NSIURIDISPATCHER
NS_DECL_NSIURILOADER
NS_DECL_ISUPPORTS
nsURIDispatcher();
virtual ~nsURIDispatcher();
nsURILoader();
virtual ~nsURILoader();
protected:
// we shouldn't need to have an owning ref count on registered
@ -51,5 +51,5 @@ protected:
};
#endif /* nsURIDispatcher_h__ */
#endif /* nsURILoader_h__ */

View File

@ -29,6 +29,8 @@ EXPORTS = \
################################################################################
## library
LINCS=-I..\base
CPP_OBJS= \
.\$(OBJDIR)\nsURILoaderModule.obj \
$(NULL)

View File

@ -22,14 +22,12 @@
#include "nsIGenericFactory.h"
#include "nsIComponentManager.h"
#include "nsIServiceManager.h"
#include "nsURILoaderCIDs.h"
#include "nsURILoader.h"
#include "nsCOMPtr.h"
#include "nsURIDispatcher.h"
static NS_DEFINE_CID(kURILoaderCID, NS_URI_LOADER_CID);
static NS_DEFINE_CID(kURIDispatcherCID, NS_URIDISPATCHER_CID);
NS_GENERIC_FACTORY_CONSTRUCTOR(nsURIDispatcher)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsURILoader)
// Module implementation for the sample library
@ -50,7 +48,7 @@ protected:
PRBool mInitialized;
nsCOMPtr<nsIGenericFactory> mURIDispatcherFactory;
nsCOMPtr<nsIGenericFactory> mURILoaderFactory;
};
nsURILoaderModule::nsURILoaderModule()
@ -80,7 +78,7 @@ nsresult nsURILoaderModule::Initialize()
void nsURILoaderModule::Shutdown()
{
// Release the factory object
mURIDispatcherFactory = null_nsCOMPtr();
mURILoaderFactory = null_nsCOMPtr();
}
@ -109,11 +107,11 @@ NS_IMETHODIMP nsURILoaderModule::GetClassObject(nsIComponentManager *aCompMgr,
// class type (aClass).
nsCOMPtr<nsIGenericFactory> fact;
if (aClass.Equals(kURIDispatcherCID))
if (aClass.Equals(kURILoaderCID))
{
if (!mURIDispatcherFactory)
rv = NS_NewGenericFactory(getter_AddRefs(mURIDispatcherFactory), &nsURIDispatcherConstructor);
fact = mURIDispatcherFactory;
if (!mURILoaderFactory)
rv = NS_NewGenericFactory(getter_AddRefs(mURILoaderFactory), &nsURILoaderConstructor);
fact = mURILoaderFactory;
}
if (fact)
@ -130,8 +128,8 @@ struct Components {
// The list of components we register
static Components gComponents[] = {
{ "Netscape URI Dispatcher Service", &kURIDispatcherCID,
NS_URIDISPATCHER_PROGID }
{ "Netscape URI Loader Service", &kURILoaderCID,
NS_URI_LOADER_PROGID }
};
#define NUM_COMPONENTS (sizeof(gComponents) / sizeof(gComponents[0]))