From ae2d382ff81b8862a699f5770cd07998dbaf080a Mon Sep 17 00:00:00 2001 From: "darin%netscape.com" Date: Tue, 27 Feb 2001 09:06:11 +0000 Subject: [PATCH] [not part of the build] Added a debug-only CID for nsMemoryCacheTransport to allow this class to be independently tested. --- netwerk/cache/src/Makefile.in | 1 + netwerk/cache/src/nsCacheModule.cpp | 33 +++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/netwerk/cache/src/Makefile.in b/netwerk/cache/src/Makefile.in index ffcc24a53153..a89da66defb0 100644 --- a/netwerk/cache/src/Makefile.in +++ b/netwerk/cache/src/Makefile.in @@ -45,6 +45,7 @@ CPPSRCS = \ nsCacheSession.cpp \ nsDiskCacheDevice.cpp \ nsMemoryCacheDevice.cpp \ + nsMemoryCacheTransport.cpp \ $(NULL) include $(topsrcdir)/config/config.mk diff --git a/netwerk/cache/src/nsCacheModule.cpp b/netwerk/cache/src/nsCacheModule.cpp index ccd23039c64a..22dd959ff2a7 100644 --- a/netwerk/cache/src/nsCacheModule.cpp +++ b/netwerk/cache/src/nsCacheModule.cpp @@ -29,6 +29,31 @@ // nsCacheService // + +#ifdef DEBUG + +// Provide factories for some internal classes (debug only) +// + +#include "nsMemoryCacheTransport.h" + +NS_GENERIC_FACTORY_CONSTRUCTOR(nsMemoryCacheTransport) + +#define NS_MEMORYCACHETRANSPORT_CLASSNAME \ + "Memory Cache Transport" +#define NS_MEMORYCACHETRANSPORT_CONTRACTID \ + "@mozilla.org/network/memory-cache-transport;1" +#define NS_MEMORYCACHETRANSPORT_CID \ +{ /* 31cb2052-d906-4b53-b3d2-6905c6c6d3b1 */ \ + 0x31cb2052, \ + 0xd906, \ + 0x4b53, \ + {0xb3, 0xd2, 0x69, 0x05, 0xc6, 0xc6, 0xd3, 0xb1} \ +} + +#endif + + static nsModuleComponentInfo gResComponents[] = { { NS_CACHESERVICE_CLASSNAME, @@ -36,6 +61,14 @@ static nsModuleComponentInfo gResComponents[] = { NS_CACHESERVICE_CONTRACTID, nsCacheService::Create } +#ifdef DEBUG + ,{ + NS_MEMORYCACHETRANSPORT_CLASSNAME, + NS_MEMORYCACHETRANSPORT_CID, + NS_MEMORYCACHETRANSPORT_CONTRACTID, + nsMemoryCacheTransportConstructor + } +#endif }; NS_IMPL_NSGETMODULE("cacheservice", gResComponents)