From c50a812859fd5ace811efae190259e25fc54fd14 Mon Sep 17 00:00:00 2001 From: "warren%netscape.com" Date: Fri, 5 May 2000 06:05:38 +0000 Subject: [PATCH] Obsolete git-svn-id: svn://10.0.0.236/trunk@68359 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/netwerk/protocol/resource/Makefile.in | 32 -- .../protocol/resource/macbuild/resource.mcp | Bin 63934 -> 0 bytes .../resource/macbuild/resourcePrefix.h | 24 -- .../resource/macbuild/resourcePrefix_debug.h | 24 -- .../netwerk/protocol/resource/makefile.win | 33 -- .../netwerk/protocol/resource/src/Makefile.in | 48 --- .../protocol/resource/src/makefile.win | 55 --- .../src/nsResourceProtocolHandler.cpp | 346 ------------------ .../resource/src/nsResourceProtocolHandler.h | 56 --- .../resource/src/nsResourceProtocolModule.cpp | 36 -- 10 files changed, 654 deletions(-) delete mode 100644 mozilla/netwerk/protocol/resource/Makefile.in delete mode 100644 mozilla/netwerk/protocol/resource/macbuild/resource.mcp delete mode 100644 mozilla/netwerk/protocol/resource/macbuild/resourcePrefix.h delete mode 100644 mozilla/netwerk/protocol/resource/macbuild/resourcePrefix_debug.h delete mode 100644 mozilla/netwerk/protocol/resource/makefile.win delete mode 100644 mozilla/netwerk/protocol/resource/src/Makefile.in delete mode 100644 mozilla/netwerk/protocol/resource/src/makefile.win delete mode 100644 mozilla/netwerk/protocol/resource/src/nsResourceProtocolHandler.cpp delete mode 100644 mozilla/netwerk/protocol/resource/src/nsResourceProtocolHandler.h delete mode 100644 mozilla/netwerk/protocol/resource/src/nsResourceProtocolModule.cpp diff --git a/mozilla/netwerk/protocol/resource/Makefile.in b/mozilla/netwerk/protocol/resource/Makefile.in deleted file mode 100644 index 0b4d2a90ab5..00000000000 --- a/mozilla/netwerk/protocol/resource/Makefile.in +++ /dev/null @@ -1,32 +0,0 @@ -# -# The contents of this file are subject to the Netscape 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/NPL/ -# -# 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 mozilla.org code. -# -# The Initial Developer of the Original Code is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All -# Rights Reserved. -# -# Contributor(s): -# - -DEPTH = ../../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -DIRS = src - -include $(topsrcdir)/config/rules.mk - diff --git a/mozilla/netwerk/protocol/resource/macbuild/resource.mcp b/mozilla/netwerk/protocol/resource/macbuild/resource.mcp deleted file mode 100644 index 39c300562a81c57634a4e6e13a352ea4cca7e041..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 63934 zcmeHQeRLevb)VgpELoOpW1COgVf_I%*vNd?#)uC~mMmLFvKC3kj`^@wtFgVd_9MHi zU|dR+{*jM1P+AVBNz*1hMWm#m!D&Jv2il|@!YQ<+gtR415B)f$Iiw_khUPSXv~_>K z_ukCT&d%(Pq_x4)yY_qc>b^U7-n;MKH*aU&yh&s-V}@Zw3?sDOFy495Fy8&CVKlx9 z-rb>a2uMO_X4Kpt&*hStTr`%;95WLIt7tA^%ODq{(P7o_O~A09fZfRJ6nzM|UeV*g z^A!CcaD$>B2X0jKp90TU^y|P)ivBt90!fEh-mK^k0k{~7QyMSlIH=V7Fm=O=$|25B}gN}wysw66~Jp0y$g7)q7MUK zrsxUa%N6}a;B|_A9vFU4i2Nfm>Hs}y}FaI2#41Ew6H z?zfTAE`YjckX<84qwY1}YZd*Uz}HE-p0?ktXzJdg=uTkvF`)h~WY-JQs6PR`P0Byf+S{~UOaqJIc{tE3yLzgN-hhdxEK zoPG~z%pmI*q|x|Wz%fNX1$>*LUj-ge^gFeNc2_u5`Boi zL!Y6q&_@{O96RW594oFt;@EH<62}6L0gV0Yk=Xwn8yWKrNR3F0i6*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/resource/macbuild/resourcePrefix.h b/mozilla/netwerk/protocol/resource/macbuild/resourcePrefix.h deleted file mode 100644 index 1629a1268a6..00000000000 --- a/mozilla/netwerk/protocol/resource/macbuild/resourcePrefix.h +++ /dev/null @@ -1,24 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape 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/NPL/ - * - * 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 mozilla.org code. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1999 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - */ - - -#include "MacSharedPrefix.h" diff --git a/mozilla/netwerk/protocol/resource/macbuild/resourcePrefix_debug.h b/mozilla/netwerk/protocol/resource/macbuild/resourcePrefix_debug.h deleted file mode 100644 index 756f68365d7..00000000000 --- a/mozilla/netwerk/protocol/resource/macbuild/resourcePrefix_debug.h +++ /dev/null @@ -1,24 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape 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/NPL/ - * - * 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 mozilla.org code. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1999 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - */ - - -#include "MacSharedPrefix_debug.h" diff --git a/mozilla/netwerk/protocol/resource/makefile.win b/mozilla/netwerk/protocol/resource/makefile.win deleted file mode 100644 index 1a8ba97da71..00000000000 --- a/mozilla/netwerk/protocol/resource/makefile.win +++ /dev/null @@ -1,33 +0,0 @@ -#!gmake -# -# The contents of this file are subject to the Netscape 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/NPL/ -# -# 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 mozilla.org code. -# -# The Initial Developer of the Original Code is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All -# Rights Reserved. -# -# Contributor(s): - -#------------------------------------------------------------------------ -# -# Makefile to build the pluggable HTTP -# -#------------------------------------------------------------------------ - -DEPTH=..\..\.. -DIRS= \ - src \ - $(NULL) - -include <$(DEPTH)\config\rules.mak> diff --git a/mozilla/netwerk/protocol/resource/src/Makefile.in b/mozilla/netwerk/protocol/resource/src/Makefile.in deleted file mode 100644 index 9509e0560d2..00000000000 --- a/mozilla/netwerk/protocol/resource/src/Makefile.in +++ /dev/null @@ -1,48 +0,0 @@ -# -# The contents of this file are subject to the Netscape 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/NPL/ -# -# 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 mozilla.org code. -# -# The Initial Developer of the Original Code is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All -# Rights Reserved. -# -# Contributor(s): -# - -DEPTH = ../../../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -MODULE = necko -LIBRARY_NAME = necko_resource -SHORT_LIBNAME = neckorsc -IS_COMPONENT = 1 - -REQUIRES = xpcom necko - -CPPSRCS = \ - nsResourceProtocolHandler.cpp \ - nsResourceProtocolModule.cpp \ - $(NULL) - -EXTRA_DSO_LDOPTS += $(MOZ_COMPONENT_LIBS) - -include $(topsrcdir)/config/rules.mk - -ifeq ($(OS_ARCH), Linux) -DEFINES += -D_BSD_SOURCE -endif - diff --git a/mozilla/netwerk/protocol/resource/src/makefile.win b/mozilla/netwerk/protocol/resource/src/makefile.win deleted file mode 100644 index f167dbfe095..00000000000 --- a/mozilla/netwerk/protocol/resource/src/makefile.win +++ /dev/null @@ -1,55 +0,0 @@ -#!gmake -# -# The contents of this file are subject to the Netscape 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/NPL/ -# -# 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 mozilla.org code. -# -# The Initial Developer of the Original Code is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All -# Rights Reserved. -# -# Contributor(s): - -DEPTH=..\..\..\.. -MODULE=necko - -IS_COMPONENT=1 -MAKE_OBJ_TYPE=DLL -DLLNAME=nkresrc -DLL=.\$(OBJDIR)\$(DLLNAME).dll - -LLIBS= $(LLIBS) \ - $(LIBNSPR) \ - $(DIST)\lib\xpcom.lib \ - $(NULL) - -CPP_OBJS= \ - .\$(OBJDIR)\nsResourceProtocolHandler.obj \ - .\$(OBJDIR)\nsResourceProtocolModule.obj \ - $(NULL) - -LOCAL_INCLUDES=-I. - -INCLUDES = $(LOCAL_INCLUDES) - -REQUIRES= necko - -INCS = $(INCS) \ - -I$(DEPTH)\dist\include \ - $(NULL) - -include <$(DEPTH)\config\rules.mak> - -install:: $(DLL) - $(MAKE_INSTALL) $(DLL) $(DIST)\bin\components - $(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).lib $(DIST)\lib - diff --git a/mozilla/netwerk/protocol/resource/src/nsResourceProtocolHandler.cpp b/mozilla/netwerk/protocol/resource/src/nsResourceProtocolHandler.cpp deleted file mode 100644 index 24b1992c042..00000000000 --- a/mozilla/netwerk/protocol/resource/src/nsResourceProtocolHandler.cpp +++ /dev/null @@ -1,346 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Netscape 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/NPL/ - * - * 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 mozilla.org code. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - */ - -#include "nsResourceProtocolHandler.h" -#include "nsCRT.h" -#include "nsIComponentManager.h" -#include "nsIServiceManager.h" -#include "nsIIOService.h" -#include "nsIChannel.h" -#include "nsIURL.h" -#include "prmem.h" -#include "prprf.h" -#include "prenv.h" -#include "nsSpecialSystemDirectory.h" - -#if defined (XP_PC) && !defined (XP_OS2) -#include -static HINSTANCE g_hInst = NULL; -#endif - -#ifdef XP_BEOS -#include -#include -#endif - -static NS_DEFINE_CID(kStandardURLCID, NS_STANDARDURL_CID); -static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID); - -//////////////////////////////////////////////////////////////////////////////// - -nsResourceProtocolHandler::nsResourceProtocolHandler() -{ - NS_INIT_REFCNT(); -} - -nsresult -nsResourceProtocolHandler::Init() -{ - return NS_OK; -} - -nsResourceProtocolHandler::~nsResourceProtocolHandler() -{ -} - -NS_IMPL_ISUPPORTS(nsResourceProtocolHandler, NS_GET_IID(nsIProtocolHandler)); - -NS_METHOD -nsResourceProtocolHandler::Create(nsISupports *aOuter, REFNSIID aIID, void **aResult) -{ - if (aOuter) - return NS_ERROR_NO_AGGREGATION; - - nsResourceProtocolHandler* ph = new nsResourceProtocolHandler(); - if (ph == nsnull) - return NS_ERROR_OUT_OF_MEMORY; - NS_ADDREF(ph); - nsresult rv = ph->Init(); - if (NS_SUCCEEDED(rv)) { - rv = ph->QueryInterface(aIID, aResult); - } - NS_RELEASE(ph); - return rv; -} - -//////////////////////////////////////////////////////////////////////////////// -// nsIProtocolHandler methods: - -NS_IMETHODIMP -nsResourceProtocolHandler::GetScheme(char* *result) -{ - *result = nsCRT::strdup("resource"); - if (*result == nsnull) - return NS_ERROR_OUT_OF_MEMORY; - return NS_OK; -} - -NS_IMETHODIMP -nsResourceProtocolHandler::GetDefaultPort(PRInt32 *result) -{ - *result = -1; // no port for resource: URLs - return NS_OK; -} - -NS_IMETHODIMP -nsResourceProtocolHandler::NewURI(const char *aSpec, nsIURI *aBaseURI, - nsIURI **result) -{ - nsresult rv; - - // Resource: URLs (currently) have no additional structure beyond that provided by standard - // URLs, so there is no "outer" given to CreateInstance - - nsIURI* url; - if (aBaseURI) { - rv = aBaseURI->Clone(&url); - if (NS_FAILED(rv)) return rv; - rv = url->SetRelativePath(aSpec); - } - else { - rv = nsComponentManager::CreateInstance(kStandardURLCID, nsnull, - NS_GET_IID(nsIURI), - (void**)&url); - if (NS_FAILED(rv)) return rv; - rv = url->SetSpec((char*)aSpec); - } - - if (NS_FAILED(rv)) { - NS_RELEASE(url); - return rv; - } - - *result = url; - return rv; -} - -/* - * Rewrite "resource:/" URLs into file: URLs with the path of the - * executable prepended to the file path... - */ -static char * -MangleResourceIntoFileURL(const char* aResourceFileName) -{ - // XXX For now, resources are not in jar files - // Find base path name to the resource file - char* resourceBase; - -#ifdef XP_PC - // XXX For now, all resources are relative to the .exe file - resourceBase = (char *)PR_Malloc(_MAX_PATH); - nsSpecialSystemDirectory *registryLocation = - new nsSpecialSystemDirectory(nsSpecialSystemDirectory::XPCOM_CurrentProcessComponentRegistry); - PL_strcpy(resourceBase, registryLocation->GetCString()); - // Truncate the executable name from the rest of the path... - char* cp = strrchr(resourceBase, '\\'); - if (nsnull != cp) { - *cp = '\0'; - } - // Change the first ':' into a '|' - cp = PL_strchr(resourceBase, ':'); - if (nsnull != cp) { - *cp = '|'; - } -#endif /* XP_PC */ - -#ifdef XP_UNIX - - // - // Obtain the resource: url base from the environment variable - // - // MOZILLA_FIVE_HOME - // - // Which is the standard place where mozilla stores global (ie, not - // user specific) data - // - -#ifndef MAXPATHLEN -#define MAXPATHLEN 1024 // A good guess, i suppose -#endif - -#define MOZILLA_FIVE_HOME "MOZILLA_FIVE_HOME" - - static char * nsUnixMozillaHomePath = nsnull; - - if (nsnull == nsUnixMozillaHomePath) - { - nsUnixMozillaHomePath = PR_GetEnv(MOZILLA_FIVE_HOME); - } - if (nsnull == nsUnixMozillaHomePath) - { - static char homepath[MAXPATHLEN]; - FILE* pp; - if (!(pp = popen("pwd", "r"))) { -#ifdef DEBUG - printf("RESOURCE protocol error in nsURL::mangeResourceIntoFileURL 1\n"); -#endif - return(nsnull); - } - if (fgets(homepath, MAXPATHLEN, pp)) { - homepath[PL_strlen(homepath)-1] = 0; - } - else { -#ifdef DEBUG - printf("RESOURCE protocol error in nsURL::mangeResourceIntoFileURL 2\n"); -#endif - pclose(pp); - return(nsnull); - } - pclose(pp); - nsUnixMozillaHomePath = homepath; - } - - resourceBase = nsCRT::strdup(nsUnixMozillaHomePath); -#ifdef DEBUG - { - static PRBool firstTime = PR_TRUE; - if (firstTime) { - firstTime = PR_FALSE; - printf("Using '%s' as the resource: base\n", resourceBase); - } - } -#endif - -#endif /* XP_UNIX */ - -#ifdef XP_BEOS - char *moz5 = getenv("MOZILLA_FIVE_HOME"); - if (moz5) - resourceBase = nsCRT::strdup(moz5); - else - { - static char buf[MAXPATHLEN]; - int32 cookie = 0; - image_info info; - char *p; - *buf = 0; - if(get_next_image_info(0, &cookie, &info) == B_OK) - { - strcpy(buf, info.name); - if((p = strrchr(buf, '/')) != 0) - { - *p = 0; - resourceBase = nsCRT::strdup(buf); - } - else - return nsnull; - } - else - return nsnull; - } -#endif - -#ifdef XP_MAC - // resourceBase = nsCRT::strdup("usr/local/netscape/bin"); - nsSpecialSystemDirectory netscapeDir(nsSpecialSystemDirectory::OS_CurrentProcessDirectory); - nsFilePath netscapePath(netscapeDir); - resourceBase = nsCRT::strdup(1+(const char *)netscapePath); - -#endif /* XP_MAC */ - - // Join base path to resource name - if (aResourceFileName[0] == '/') { - aResourceFileName++; - } - PRInt32 baseLen = PL_strlen(resourceBase); - PRInt32 resLen = PL_strlen(aResourceFileName); - PRInt32 totalLen = 8 + baseLen + 1 + resLen + 1; - char* fileName = (char *)PR_Malloc(totalLen); - PR_snprintf(fileName, totalLen, "file:///%s/%s", resourceBase, aResourceFileName); - -#ifdef XP_PC - // Change any backslashes into foreward slashes... - while ((cp = PL_strchr(fileName, '\\')) != 0) { - *cp = '/'; - cp++; - } - delete registryLocation; -#endif /* XP_PC */ - - PR_Free(resourceBase); - - return fileName; -} - -NS_IMETHODIMP -nsResourceProtocolHandler::NewChannel(const char* verb, nsIURI* uri, - nsILoadGroup* aLoadGroup, - nsIInterfaceRequestor* notificationCallbacks, - nsLoadFlags loadAttributes, - nsIURI* originalURI, - PRUint32 bufferSegmentSize, - PRUint32 bufferMaxSize, - nsIChannel* *result) -{ - nsresult rv; - - // XXX Later we're going to change resource URLs to do something - // else, like look in a jar file or something. - - NS_WITH_SERVICE(nsIIOService, serv, kIOServiceCID, &rv); - if (NS_FAILED(rv)) return rv; - - // Here's where we translate the resource: URL into a file: URL: - char* path; - rv = uri->GetPath(&path); - if (NS_FAILED(rv)) return rv; - - char* filePath; - filePath = MangleResourceIntoFileURL(path); - nsCRT::free(path); - if (filePath == nsnull) - return NS_ERROR_OUT_OF_MEMORY; - - nsIChannel* channel; - rv = serv->NewChannel(verb, filePath, uri, aLoadGroup, notificationCallbacks, - loadAttributes, originalURI ? originalURI : uri, - bufferSegmentSize, bufferMaxSize, &channel); - nsCRT::free(filePath); - if (NS_FAILED(rv)) return rv; - - nsIURL* url; - rv = uri->QueryInterface(NS_GET_IID(nsIURL), (void**)&url); - if (NS_SUCCEEDED(rv)) { - char* query; - rv = url->GetQuery(&query); - if (NS_SUCCEEDED(rv)) { - nsIURI* fileURI; - rv = channel->GetURI(&fileURI); - if (NS_SUCCEEDED(rv)) { - nsIURL* fileURL; - rv = fileURI->QueryInterface(NS_GET_IID(nsIURL), (void**)&fileURL); - if (NS_SUCCEEDED(rv)) { - (void)fileURL->SetQuery(query); - NS_RELEASE(fileURL); - } - NS_RELEASE(fileURI); - } - nsCRT::free(query); - } - NS_RELEASE(url); - } - - *result = channel; - return NS_OK; -} - -//////////////////////////////////////////////////////////////////////////////// diff --git a/mozilla/netwerk/protocol/resource/src/nsResourceProtocolHandler.h b/mozilla/netwerk/protocol/resource/src/nsResourceProtocolHandler.h deleted file mode 100644 index dd29b357cef..00000000000 --- a/mozilla/netwerk/protocol/resource/src/nsResourceProtocolHandler.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Netscape 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/NPL/ - * - * 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 mozilla.org code. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - */ - -#ifndef nsResourceProtocolHandler_h___ -#define nsResourceProtocolHandler_h___ - -#include "nsIProtocolHandler.h" - -#define NS_RESOURCEPROTOCOLHANDLER_CID \ -{ /* 3b61f0f0-2490-11d3-9349-00104ba0fd40 */ \ - 0x3b61f0f0, \ - 0x2490, \ - 0x11d3, \ - {0x93, 0x49, 0x00, 0x10, 0x4b, 0xa0, 0xfd, 0x40} \ -} - -class nsResourceProtocolHandler : public nsIProtocolHandler -{ -public: - NS_DECL_ISUPPORTS - - // nsIProtocolHandler methods: - NS_DECL_NSIPROTOCOLHANDLER - - // nsResourceProtocolHandler methods: - nsResourceProtocolHandler(); - virtual ~nsResourceProtocolHandler(); - - static NS_METHOD - Create(nsISupports *aOuter, REFNSIID aIID, void **aResult); - - nsresult Init(); - -protected: -}; - -#endif /* nsResourceProtocolHandler_h___ */ diff --git a/mozilla/netwerk/protocol/resource/src/nsResourceProtocolModule.cpp b/mozilla/netwerk/protocol/resource/src/nsResourceProtocolModule.cpp deleted file mode 100644 index d03d95cea68..00000000000 --- a/mozilla/netwerk/protocol/resource/src/nsResourceProtocolModule.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * The contents of this file are subject to the Netscape 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/NPL/ - * - * 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 mozilla.org code. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - */ -#include "nsIModule.h" -#include "nsIGenericFactory.h" -#include "nsResourceProtocolHandler.h" - -// The list of components we register -static nsModuleComponentInfo components[] = -{ - { "Resource Protocol Handler", - NS_RESOURCEPROTOCOLHANDLER_CID, - NS_NETWORK_PROTOCOL_PROGID_PREFIX "res", - nsResourceProtocolHandler::Create}, -}; - -NS_IMPL_NSGETMODULE("nsResourceProtocolModule", components); -