Back out 252703 due to Txul / Ts regression.

git-svn-id: svn://10.0.0.236/trunk@166118 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dbaron%dbaron.org
2004-12-02 01:26:20 +00:00
parent ecc7a81d50
commit 4bbdb86a7a
21 changed files with 192 additions and 295 deletions

View File

@@ -56,7 +56,6 @@
#include "nsRecyclingAllocator.h"
#include "nsXPTZipLoader.h"
#include "nsJARProtocolHandler.h"
#include "nsJARURI.h"
extern nsRecyclingAllocator *gZlibAllocator;
@@ -64,7 +63,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsXPTZipLoader)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsJAR)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsZipReaderCache)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsJARProtocolHandler, Init)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsJARURI)
// The list of components we register
static const nsModuleComponentInfo components[] =
@@ -88,11 +86,6 @@ static const nsModuleComponentInfo components[] =
NS_JARPROTOCOLHANDLER_CID,
NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "jar",
nsJARProtocolHandlerConstructor
},
{ NS_JARURI_CLASSNAME, // needed only for fastload
NS_JARURI_CID,
nsnull,
nsJARURIConstructor
}
};

View File

@@ -46,11 +46,6 @@
#include "nsIZipReader.h"
#include "nsReadableUtils.h"
#include "nsAutoPtr.h"
#include "nsNetCID.h"
#include "nsIObjectInputStream.h"
#include "nsIObjectOutputStream.h"
static NS_DEFINE_CID(kJARURICID, NS_JARURI_CID);
static NS_DEFINE_CID(kThisImplCID, NS_THIS_JARURI_IMPL_CID);
@@ -64,7 +59,6 @@ nsJARURI::~nsJARURI()
{
}
// XXX Why is this threadsafe?
NS_IMPL_THREADSAFE_ADDREF(nsJARURI)
NS_IMPL_THREADSAFE_RELEASE(nsJARURI)
NS_INTERFACE_MAP_BEGIN(nsJARURI)
@@ -73,7 +67,6 @@ NS_INTERFACE_MAP_BEGIN(nsJARURI)
NS_INTERFACE_MAP_ENTRY(nsIURL)
NS_INTERFACE_MAP_ENTRY(nsIJARURI)
NS_INTERFACE_MAP_ENTRY(nsISerializable)
NS_INTERFACE_MAP_ENTRY(nsIClassInfo)
// see nsJARURI::Equals
if (aIID.Equals(kThisImplCID))
foundInterface = NS_STATIC_CAST(nsIJARURI *, this);
@@ -142,98 +135,17 @@ nsJARURI::CreateEntryURL(const nsACString& entryFilename,
// nsISerializable methods:
NS_IMETHODIMP
nsJARURI::Read(nsIObjectInputStream* aInputStream)
nsJARURI::Read(nsIObjectInputStream* aStream)
{
nsresult rv;
rv = aInputStream->ReadObject(PR_TRUE, getter_AddRefs(mJARFile));
NS_ENSURE_SUCCESS(rv, rv);
rv = aInputStream->ReadObject(PR_TRUE, getter_AddRefs(mJAREntry));
NS_ENSURE_SUCCESS(rv, rv);
rv = aInputStream->ReadCString(mCharsetHint);
return rv;
NS_NOTREACHED("nsJARURI::Read");
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsJARURI::Write(nsIObjectOutputStream* aOutputStream)
nsJARURI::Write(nsIObjectOutputStream* aStream)
{
nsresult rv;
rv = aOutputStream->WriteCompoundObject(mJARFile, NS_GET_IID(nsIURI),
PR_TRUE);
NS_ENSURE_SUCCESS(rv, rv);
rv = aOutputStream->WriteCompoundObject(mJAREntry, NS_GET_IID(nsIURL),
PR_TRUE);
NS_ENSURE_SUCCESS(rv, rv);
rv = aOutputStream->WriteStringZ(mCharsetHint.get());
return rv;
}
////////////////////////////////////////////////////////////////////////////////
// nsIClassInfo methods:
NS_IMETHODIMP
nsJARURI::GetInterfaces(PRUint32 *count, nsIID * **array)
{
*count = 0;
*array = nsnull;
return NS_OK;
}
NS_IMETHODIMP
nsJARURI::GetHelperForLanguage(PRUint32 language, nsISupports **_retval)
{
*_retval = nsnull;
return NS_OK;
}
NS_IMETHODIMP
nsJARURI::GetContractID(char * *aContractID)
{
*aContractID = nsnull;
return NS_OK;
}
NS_IMETHODIMP
nsJARURI::GetClassDescription(char * *aClassDescription)
{
*aClassDescription = nsnull;
return NS_OK;
}
NS_IMETHODIMP
nsJARURI::GetClassID(nsCID * *aClassID)
{
*aClassID = (nsCID*) nsMemory::Alloc(sizeof(nsCID));
if (!*aClassID)
return NS_ERROR_OUT_OF_MEMORY;
return GetClassIDNoAlloc(*aClassID);
}
NS_IMETHODIMP
nsJARURI::GetImplementationLanguage(PRUint32 *aImplementationLanguage)
{
*aImplementationLanguage = nsIProgrammingLanguage::CPLUSPLUS;
return NS_OK;
}
NS_IMETHODIMP
nsJARURI::GetFlags(PRUint32 *aFlags)
{
// XXX We implement THREADSAFE addref/release, but probably shouldn't.
*aFlags = nsIClassInfo::MAIN_THREAD_ONLY;
return NS_OK;
}
NS_IMETHODIMP
nsJARURI::GetClassIDNoAlloc(nsCID *aClassIDNoAlloc)
{
*aClassIDNoAlloc = kJARURICID;
return NS_OK;
NS_NOTREACHED("nsJARURI::Write");
return NS_ERROR_NOT_IMPLEMENTED;
}
////////////////////////////////////////////////////////////////////////////////

View File

@@ -41,7 +41,6 @@
#include "nsIJARURI.h"
#include "nsISerializable.h"
#include "nsIClassInfo.h"
#include "nsCOMPtr.h"
#include "nsString.h"
@@ -53,18 +52,7 @@
{0xb7, 0x5b, 0xfa, 0x7d, 0x95, 0x70, 0xa6, 0x91} \
}
#define NS_JARURI_CLASSNAME \
"nsJARURI"
#define NS_JARURI_CID \
{ /* 245abae2-b947-4ded-a46d-9829d3cca462 */ \
0x245abae2, \
0xb947, \
0x4ded, \
{0xa4, 0x6d, 0x98, 0x29, 0xd3, 0xcc, 0xa4, 0x62} \
}
class nsJARURI : public nsIJARURI, nsISerializable, nsIClassInfo
class nsJARURI : public nsIJARURI, nsISerializable
{
public:
NS_DECL_ISUPPORTS
@@ -72,7 +60,6 @@ public:
NS_DECL_NSIURL
NS_DECL_NSIJARURI
NS_DECL_NSISERIALIZABLE
NS_DECL_NSICLASSINFO
// nsJARURI
nsJARURI();