Make nsStandardURL implement nsIClassInfo so that URIs can be serialized into the FastLoad File.
r=dougt, sr=darin
This commit is contained in:
ben%netscape.com 2002-05-03 03:01:32 +00:00
Родитель 7d003ba281
Коммит d5e1f0f0af
2 изменённых файлов: 68 добавлений и 0 удалений

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

@ -55,6 +55,7 @@
#include "prlog.h"
static NS_DEFINE_CID(kThisImplCID, NS_THIS_STANDARDURL_IMPL_CID);
static NS_DEFINE_CID(kStandardURLCID, NS_STANDARDURL_CID);
nsIURLParser *nsStandardURL::gNoAuthParser = nsnull;
nsIURLParser *nsStandardURL::gAuthParser = nsnull;
@ -835,6 +836,7 @@ NS_INTERFACE_MAP_BEGIN(nsStandardURL)
NS_INTERFACE_MAP_ENTRY(nsIFileURL)
NS_INTERFACE_MAP_ENTRY(nsIStandardURL)
NS_INTERFACE_MAP_ENTRY(nsISerializable)
NS_INTERFACE_MAP_ENTRY(nsIClassInfo)
// see nsStandardURL::Equals
if (aIID.Equals(kThisImplCID))
foundInterface = NS_STATIC_CAST(nsIURI *, this);
@ -2421,3 +2423,67 @@ nsStandardURL::Write(nsIObjectOutputStream *stream)
return NS_OK;
}
//----------------------------------------------------------------------------
// nsStandardURL::nsIClassInfo
//----------------------------------------------------------------------------
NS_IMETHODIMP
nsStandardURL::GetInterfaces(PRUint32 *count, nsIID * **array)
{
*count = 0;
*array = nsnull;
return NS_OK;
}
NS_IMETHODIMP
nsStandardURL::GetHelperForLanguage(PRUint32 language, nsISupports **_retval)
{
*_retval = nsnull;
return NS_OK;
}
NS_IMETHODIMP
nsStandardURL::GetContractID(char * *aContractID)
{
*aContractID = nsnull;
return NS_OK;
}
NS_IMETHODIMP
nsStandardURL::GetClassDescription(char * *aClassDescription)
{
*aClassDescription = nsnull;
return NS_OK;
}
NS_IMETHODIMP
nsStandardURL::GetClassID(nsCID * *aClassID)
{
*aClassID = (nsCID*) nsMemory::Alloc(sizeof(nsCID));
if (!*aClassID)
return NS_ERROR_OUT_OF_MEMORY;
return GetClassIDNoAlloc(*aClassID);
}
NS_IMETHODIMP
nsStandardURL::GetImplementationLanguage(PRUint32 *aImplementationLanguage)
{
*aImplementationLanguage = nsIProgrammingLanguage::CPLUSPLUS;
return NS_OK;
}
NS_IMETHODIMP
nsStandardURL::GetFlags(PRUint32 *aFlags)
{
*aFlags = nsIClassInfo::MAIN_THREAD_ONLY;
return NS_OK;
}
NS_IMETHODIMP
nsStandardURL::GetClassIDNoAlloc(nsCID *aClassIDNoAlloc)
{
*aClassIDNoAlloc = kStandardURLCID;
return NS_OK;
}

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

@ -63,6 +63,7 @@ class nsICharsetConverterManager2;
class nsStandardURL : public nsIFileURL
, public nsIStandardURL
, public nsISerializable
, public nsIClassInfo
{
public:
NS_DECL_ISUPPORTS
@ -71,6 +72,7 @@ public:
NS_DECL_NSIFILEURL
NS_DECL_NSISTANDARDURL
NS_DECL_NSISERIALIZABLE
NS_DECL_NSICLASSINFO
nsStandardURL();
virtual ~nsStandardURL();