bug 72528, remove old cache from build. sr=darin.

This commit is contained in:
gordon%netscape.com 2001-04-17 10:47:22 +00:00
Родитель 95411c87dd
Коммит 99a7277559
16 изменённых файлов: 78 добавлений и 101 удалений

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

@ -47,16 +47,13 @@
#include "nsIURL.h"
#include "nsIChannel.h"
#include "nsIHTTPChannel.h"
#include "nsIStreamAsFile.h"
#include "nsIFileStream.h" // for nsIRandomAccessStore
#include "nsNetUtil.h"
#include "nsIProgressEventSink.h"
#include "nsIDocument.h"
#include "nsIScriptablePlugin.h"
#if MOZ_NEW_CACHE
#include "nsICachingChannel.h"
#endif
// Friggin' X11 has to "#define None". Lame!
#ifdef None
#undef None
@ -1329,7 +1326,6 @@ nsPluginStreamListenerPeer::OnStartRequest(nsIRequest *request, nsISupports* aCo
if (!channel)
return NS_ERROR_FAILURE;
#if MOZ_NEW_CACHE
nsCOMPtr<nsICachingChannel> cacheChannel = do_QueryInterface(channel);
if (cacheChannel) {
rv = cacheChannel->SetCacheAsFile(PR_TRUE);
@ -1339,7 +1335,6 @@ nsPluginStreamListenerPeer::OnStartRequest(nsIRequest *request, nsISupports* aCo
NS_ASSERTION(PR_FALSE, "No Disk Cache Aval. Some plugins wont work.");
}
}
#endif
char* aContentType = nsnull;
rv = channel->GetContentType(&aContentType);
@ -1498,15 +1493,9 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnStopRequest(nsIRequest *request,
char* urlString;
nsCOMPtr<nsIFile> localFile;
#if MOZ_NEW_CACHE
nsCOMPtr<nsICachingChannel> cacheChannel = do_QueryInterface(channel);
if (cacheChannel)
rv = cacheChannel->GetCacheFile(getter_AddRefs(localFile));
#else
nsCOMPtr<nsIStreamAsFile> streamAsFile = do_QueryInterface(channel);
if (streamAsFile)
rv = streamAsFile->GetFile(getter_AddRefs(localFile));
#endif
if (NS_SUCCEEDED(rv) && localFile)
{
char* pathAndFilename;

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

@ -47,16 +47,13 @@
#include "nsIURL.h"
#include "nsIChannel.h"
#include "nsIHTTPChannel.h"
#include "nsIStreamAsFile.h"
#include "nsIFileStream.h" // for nsIRandomAccessStore
#include "nsNetUtil.h"
#include "nsIProgressEventSink.h"
#include "nsIDocument.h"
#include "nsIScriptablePlugin.h"
#if MOZ_NEW_CACHE
#include "nsICachingChannel.h"
#endif
// Friggin' X11 has to "#define None". Lame!
#ifdef None
#undef None
@ -1329,7 +1326,6 @@ nsPluginStreamListenerPeer::OnStartRequest(nsIRequest *request, nsISupports* aCo
if (!channel)
return NS_ERROR_FAILURE;
#if MOZ_NEW_CACHE
nsCOMPtr<nsICachingChannel> cacheChannel = do_QueryInterface(channel);
if (cacheChannel) {
rv = cacheChannel->SetCacheAsFile(PR_TRUE);
@ -1339,7 +1335,6 @@ nsPluginStreamListenerPeer::OnStartRequest(nsIRequest *request, nsISupports* aCo
NS_ASSERTION(PR_FALSE, "No Disk Cache Aval. Some plugins wont work.");
}
}
#endif
char* aContentType = nsnull;
rv = channel->GetContentType(&aContentType);
@ -1498,15 +1493,9 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnStopRequest(nsIRequest *request,
char* urlString;
nsCOMPtr<nsIFile> localFile;
#if MOZ_NEW_CACHE
nsCOMPtr<nsICachingChannel> cacheChannel = do_QueryInterface(channel);
if (cacheChannel)
rv = cacheChannel->GetCacheFile(getter_AddRefs(localFile));
#else
nsCOMPtr<nsIStreamAsFile> streamAsFile = do_QueryInterface(channel);
if (streamAsFile)
rv = streamAsFile->GetFile(getter_AddRefs(localFile));
#endif
if (NS_SUCCEEDED(rv) && localFile)
{
char* pathAndFilename;

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

@ -20,12 +20,10 @@
* Contributor(s):
*/
#include "nsISupports.idl"
#include "nsIChannel.idl"
#include "nsIRequest.idl"
interface nsIURI;
interface nsILoadGroup;
interface nsIStreamLoader;
interface nsIInterfaceRequestor;
interface nsIFile;
interface nsIDownloader;
@ -50,12 +48,3 @@ interface nsIDownloader : nsISupports
in nsIInterfaceRequestor notificationCallbacks,
in nsLoadFlags loadAttributes);
};
%{C++
#define NS_DOWNLOADER_CID \
{ /* 510a86bb-6019-4ed1-bb4f-965cffd23ece*/ \
0x510a86bb, 0x6019, 0x4ed1, { 0xbb, 0x4f, 0x96, 0x5c, 0xff, 0xd2, 0x3e, 0xce } \
}
%}

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

@ -26,16 +26,12 @@
#include "nsNetUtil.h"
#include "nsIChannel.h"
#include "nsIFileChannel.h"
#include "nsICachingChannel.h"
#include "nsProxiedService.h"
#include "nsIFile.h"
#include "nsXPIDLString.h"
#include "nsCacheManager.h"
#include "nsICachedNetData.h"
#include "nsIStreamAsFile.h"
static NS_DEFINE_CID(kProxyObjectManagerCID, NS_PROXYEVENT_MANAGER_CID);
static NS_DEFINE_CID(kNetworkCacheManagerCID, NS_CACHE_MANAGER_CID);
NS_IMETHODIMP
nsDownloader::Init(nsIURI* aURL,
@ -52,7 +48,6 @@ nsDownloader::Init(nsIURI* aURL,
nsCOMPtr<nsIFile> localFile;
nsCOMPtr<nsIChannel> channel;
aLoadAttributes |= nsIChannel::CACHE_AS_FILE;
rv = NS_OpenURI(getter_AddRefs(channel), aURL, nsnull, aGroup, aNotificationCallbacks,
aLoadAttributes);
if (NS_SUCCEEDED(rv) && channel)
@ -106,7 +101,12 @@ NS_IMPL_ISUPPORTS3(nsDownloader, nsIDownloader,
NS_IMETHODIMP
nsDownloader::OnStartRequest(nsIRequest *request, nsISupports *ctxt)
{
return NS_OK;
nsresult rv;
nsCOMPtr<nsICachingChannel> caching = do_QueryInterface(request, &rv);
if (caching)
rv = caching->SetCacheAsFile(PR_TRUE);
// Returning failure from here will cancel the load
return rv;
}
NS_IMETHODIMP
@ -116,34 +116,9 @@ nsDownloader::OnStopRequest(nsIRequest *request, nsISupports *ctxt,
nsCOMPtr<nsIFile> file;
if (NS_SUCCEEDED(aStatus))
{
nsresult rv;
nsCOMPtr<nsIURI> uri;
nsCOMPtr<nsIChannel> channel = do_QueryInterface(request, &rv);
if (NS_FAILED(rv)) return rv;
rv = channel->GetURI(getter_AddRefs(uri));
if (NS_FAILED(rv)) return rv;
nsXPIDLCString spec;
rv = uri->GetSpec(getter_Copies(spec));
if (NS_FAILED(rv)) return rv;
NS_WITH_SERVICE(nsINetDataCacheManager, cacheMgr, kNetworkCacheManagerCID, &rv);
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsICachedNetData> cachedData;
rv = cacheMgr->GetCachedNetData(spec, nsnull, 0, nsINetDataCacheManager::CACHE_AS_FILE,
getter_AddRefs(cachedData));
if (NS_SUCCEEDED(rv))
{
nsCOMPtr<nsIStreamAsFile> streamAsFile;
streamAsFile = do_QueryInterface(cachedData, &rv);
if (NS_FAILED(rv)) return rv;
rv = streamAsFile->GetFile(getter_AddRefs(file));
if (NS_FAILED(rv)) return rv;
}
nsCOMPtr<nsICachingChannel> caching = do_QueryInterface(request, &aStatus);
if (caching)
aStatus = caching->GetCacheFile(getter_AddRefs(file));
}
return mObserver->OnDownloadComplete(this, mContext, aStatus, file);

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

@ -47,7 +47,6 @@ public:
protected:
nsCOMPtr<nsIDownloadObserver> mObserver;
nsCOMPtr<nsISupports> mContext; // the observer's context
/// nsCOMPtr<nsILoadGroup> mLoadGroup;
};
#endif // nsDownloader_h__

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

@ -40,9 +40,6 @@ SHARED_LIBRARY_LIBS = \
$(DIST)/lib/libneckosocket_s.$(LIB_SUFFIX) \
$(DIST)/lib/libnkconv_s.$(LIB_SUFFIX) \
$(DIST)/lib/libnkcnvts_s.$(LIB_SUFFIX) \
$(DIST)/lib/libnkcachemgr_s.$(LIB_SUFFIX) \
$(DIST)/lib/libnkfilecache_s.$(LIB_SUFFIX) \
$(DIST)/lib/libnkmemcache_s.$(LIB_SUFFIX) \
$(DIST)/lib/libnkmime_s.$(LIB_SUFFIX) \
$(DIST)/lib/libnkhttp_s.$(LIB_SUFFIX) \
$(DIST)/lib/libnkfile_s.$(LIB_SUFFIX) \
@ -53,6 +50,14 @@ SHARED_LIBRARY_LIBS = \
$(DIST)/lib/libnkkwd_s.$(LIB_SUFFIX) \
$(NULL)
ifdef OLD_CACHE
SHARED_LIBRARY_LIBS += \
$(DIST)/lib/libnkcachemgr_s.$(LIB_SUFFIX) \
$(DIST)/lib/libnkfilecache_s.$(LIB_SUFFIX) \
$(DIST)/lib/libnkmemcache_s.$(LIB_SUFFIX) \
$(NULL)
endif
ifeq ($(MOZ_WIDGET_TOOLKIT),os2)
SHARED_LIBRARY_LIBS += $(DIST)/lib/libmozdbm_s.$(LIB_SUFFIX)
endif
@ -67,9 +72,6 @@ LOCAL_INCLUDES = \
-I$(srcdir)/../socket/base \
-I$(srcdir)/../streamconv/src \
-I$(srcdir)/../streamconv/converters \
-I$(srcdir)/../cache/memcache \
-I$(srcdir)/../cache/filecache \
-I$(srcdir)/../cache/mgr \
-I$(srcdir)/../mime/src \
-I$(srcdir)/../protocol/http/src \
-I$(srcdir)/../protocol/file/src \
@ -80,6 +82,15 @@ LOCAL_INCLUDES = \
-I$(srcdir)/../protocol/keyword/src \
$(NULL)
ifdef OLD_CACHE
LOCAL_INCLUDES += \
-I$(srcdir)/../cache/memcache \
-I$(srcdir)/../cache/filecache \
-I$(srcdir)/../cache/mgr \
$(NULL)
endif
EXTRA_DSO_LDOPTS = \
$(MOZ_COMPONENT_LIBS) \
$(ZLIB_LIBS) \

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

@ -44,11 +44,13 @@ LLIBS= \
$(DIST)\lib\neckosocket_s.lib \
$(DIST)\lib\nkconv_s.lib \
$(DIST)\lib\nkcnvts_s.lib \
$(DIST)\lib\xpcom.lib \
$(DIST)\lib\xpcom.lib \
!ifdef MOZ_OLD_CACHE
$(DIST)\lib\nkcachemgr_s.lib \
$(DIST)\lib\nkfilecache_s.lib \
$(DIST)\lib\nkmemcache_s.lib \
$(DIST)\lib\dbm32.lib \
$(DIST)\lib\dbm32.lib \
!endif
$(DIST)\lib\nkmime_s.lib \
$(DIST)\lib\nkhttp_s.lib \
$(DIST)\lib\nkfile_s.lib \
@ -69,10 +71,12 @@ INCS = $(INCS) \
-I$(DEPTH)\netwerk\dns\src \
-I$(DEPTH)\netwerk\socket\base \
-I$(DEPTH)\netwerk\streamconv\src \
-I$(DEPTH)\netwerk\streamconv\converters \
-I$(DEPTH)\netwerk\streamconv\converters \
!ifdef MOZ_OLD_CACHE
-I$(DEPTH)\netwerk\cache\memcache \
-I$(DEPTH)\netwerk\cache\filecache \
-I$(DEPTH)\netwerk\cache\mgr \
-I$(DEPTH)\netwerk\cache\mgr \
!endif
-I$(DEPTH)\netwerk\mime\src \
-I$(DEPTH)\netwerk\protocol\http\src \
-I$(DEPTH)\netwerk\protocol\file\src \

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

@ -185,6 +185,18 @@
{0x98, 0x6e, 0x00, 0xc0, 0x4f, 0xa0, 0xcf, 0x4a} \
}
#define NS_DOWNLOADER_CLASSNAME \
"File Downloader"
#define NS_DOWNLOADER_CONTRACTID \
"@mozilla.org/network/downloader;1"
#define NS_DOWNLOADER_CID \
{ /* 510a86bb-6019-4ed1-bb4f-965cffd23ece */ \
0x510a86bb, \
0x6019, \
0x4ed1, \
{0xbb, 0x4f, 0x96, 0x5c, 0xff, 0xd2, 0x3e, 0xce} \
}
/******************************************************************************
* netwerk/cache/ classes

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

@ -56,6 +56,7 @@
///////////////////////////////////////////////////////////////////////////////
#if defined(OLD_CACHE)
#include "nsINetDataCache.h"
#include "nsINetDataCacheManager.h"
#include "nsMemCacheCID.h"
@ -69,6 +70,7 @@
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsMemCache, Init)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsNetDiskCache, Init)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsCacheManager, Init)
#endif
///////////////////////////////////////////////////////////////////////////////
@ -569,9 +571,9 @@ static nsModuleComponentInfo gNetModuleInfo[] = {
NS_STREAMLOADER_CID,
"@mozilla.org/network/stream-loader;1",
nsStreamLoader::Create },
{ "Stream-As-File Downloader",
{ NS_DOWNLOADER_CLASSNAME,
NS_DOWNLOADER_CID,
"@mozilla.org/network/downloader;1",
NS_DOWNLOADER_CONTRACTID,
nsDownloader::Create },
{ NS_REQUESTOBSERVERPROXY_CLASSNAME,
NS_REQUESTOBSERVERPROXY_CID,
@ -750,12 +752,12 @@ static nsModuleComponentInfo gNetModuleInfo[] = {
NS_ISTREAMCONVERTER_KEY,
CreateNewTXTToHTMLConvFactory
},
#if defined(OLD_CACHE)
// from netwerk/cache:
{ "Memory Cache", NS_MEM_CACHE_FACTORY_CID, NS_NETWORK_MEMORY_CACHE_CONTRACTID, nsMemCacheConstructor },
{ "File Cache", NS_NETDISKCACHE_CID, NS_NETWORK_FILE_CACHE_CONTRACTID, nsNetDiskCacheConstructor },
{ "Cache Manager",NS_CACHE_MANAGER_CID, NS_NETWORK_CACHE_MANAGER_CONTRACTID,nsCacheManagerConstructor },
#endif
// from netwerk/mime:
{ "The MIME mapping service",
NS_MIMESERVICE_CID,

13
netwerk/cache/Makefile.in поставляемый
Просмотреть файл

@ -27,12 +27,17 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS = \
public \
memcache \
filecache \
mgr \
public \
$(NULL)
ifdef OLD_CACHE
DIRS += \
memcache \
filecache \
mgr \
$(NULL)
endif
ifdef MOZ_NEW_CACHE
DIRS += src
endif

4
netwerk/cache/Makefile.win поставляемый
Просмотреть файл

@ -24,10 +24,12 @@ DEPTH=..\..
include <$(DEPTH)/config/config.mak>
DIRS= \
public \
public \
!ifdef MOZ_OLD_CACHE
mgr \
memcache \
filecache \
!endif
!ifdef MOZ_NEW_CACHE
src \
!endif

6
netwerk/cache/public/Makefile.in поставляемый
Просмотреть файл

@ -29,7 +29,10 @@ XPIDL_MODULE = necko_cache
include $(DEPTH)/config/autoconf.mk
XPIDLSRCS = \
XPIDLSRCS = $(NULL)
ifdef OLD_CACHE
XPIDLSRCS += \
nsICachedNetData.idl \
nsINetDataCacheManager.idl \
nsINetDataCache.idl \
@ -37,6 +40,7 @@ XPIDLSRCS = \
nsINetDataDiskCache.idl \
nsIStreamAsFile.idl \
$(NULL)
endif
ifdef MOZ_NEW_CACHE

6
netwerk/cache/public/Makefile.win поставляемый
Просмотреть файл

@ -29,13 +29,15 @@ include <$(DEPTH)/config/config.mak>
EXPORTS = \
$(NULL)
XPIDLSRCS = \
XPIDLSRCS = \
!ifdef MOZ_OLD_CACHE
.\nsICachedNetData.idl \
.\nsINetDataCacheManager.idl \
.\nsINetDataCache.idl \
.\nsINetDataCacheRecord.idl \
.\nsINetDataDiskCache.idl \
.\nsIStreamAsFile.idl \
.\nsIStreamAsFile.idl \
!endif
!ifdef MOZ_NEW_CACHE
.\nsICache.idl \
.\nsICacheEntryDescriptor.idl \

Двоичные данные
netwerk/macbuild/netwerk.mcp

Двоичный файл не отображается.

Двоичные данные
netwerk/macbuild/netwerkIDL.mcp

Двоичный файл не отображается.

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

@ -31,14 +31,12 @@ PROG6 = .\$(OBJDIR)\urltest.exe
PROG7 = .\$(OBJDIR)\TestFileInput2.exe
PROG8 = .\$(OBJDIR)\TestFileTransport.exe
PROG9 = .\$(OBJDIR)\TestRes.exe
PROGA = .\$(OBJDIR)\TestRawCache.exe
PROGB = .\$(OBJDIR)\TestCacheMgr.exe
PROGC = .\$(OBJDIR)\TestWriteStream.exe
PROGD = .\$(OBJDIR)\TestWriteSpeed.exe
PROGE = .\$(OBJDIR)\TestCallbacks.exe
PROGRAMS = \
$(PROG1) $(PROG2) $(PROG3) $(PROG4) $(PROG5) $(PROG6) $(PROG7) $(PROG8) $(PROG9)\
$(PROGA) $(PROGB) $(PROGC) $(PROGD) $(PROGE)
$(PROGC) $(PROGD) $(PROGE)
LCFLAGS=-DUSE_NSREG -GX
@ -78,10 +76,6 @@ $(PROG8): $(OBJDIR) TestFileTransport.cpp
$(PROG9): $(OBJDIR) TestRes.cpp
$(PROGA): $(OBJDIR) TestRawCache.cpp
$(PROGB): $(OBJDIR) TestCacheMgr.cpp
$(PROGC): $(OBJDIR) TestWriteStream.cpp
$(PROGD): $(OBJDIR) TestWriteSpeed.cpp