summaryrefslogtreecommitdiff
path: root/netwerk/protocol/file/nsFileProtocolHandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'netwerk/protocol/file/nsFileProtocolHandler.cpp')
-rw-r--r--netwerk/protocol/file/nsFileProtocolHandler.cpp53
1 files changed, 1 insertions, 52 deletions
diff --git a/netwerk/protocol/file/nsFileProtocolHandler.cpp b/netwerk/protocol/file/nsFileProtocolHandler.cpp
index eab73befe..32853d3ea 100644
--- a/netwerk/protocol/file/nsFileProtocolHandler.cpp
+++ b/netwerk/protocol/file/nsFileProtocolHandler.cpp
@@ -26,13 +26,6 @@
#endif
#endif
-// URL file handling for OS/2
-#ifdef XP_OS2
-#include "prio.h"
-#include "nsIFileURL.h"
-#include "nsILocalFileOS2.h"
-#endif
-
// URL file handling for freedesktop.org
#ifdef XP_UNIX
#include "nsINIParser.h"
@@ -104,50 +97,6 @@ nsFileProtocolHandler::ReadURLFile(nsIFile* aFile, nsIURI** aURI)
return rv;
}
-#elif defined(XP_OS2)
-NS_IMETHODIMP
-nsFileProtocolHandler::ReadURLFile(nsIFile* aFile, nsIURI** aURI)
-{
- nsresult rv;
-
- nsCOMPtr<nsILocalFileOS2> os2File (do_QueryInterface(aFile, &rv));
- if (NS_FAILED(rv))
- return NS_ERROR_NOT_AVAILABLE;
-
- // see if this file is a WPS UrlObject
- bool isUrl;
- rv = os2File->IsFileType(NS_LITERAL_CSTRING("UniformResourceLocator"),
- &isUrl);
- if (NS_FAILED(rv) || !isUrl)
- return NS_ERROR_NOT_AVAILABLE;
-
- // if so, open it & get its size
- PRFileDesc *file;
- rv = os2File->OpenNSPRFileDesc(PR_RDONLY, 0, &file);
- if (NS_FAILED(rv))
- return NS_ERROR_NOT_AVAILABLE;
-
- int64_t fileSize;
- os2File->GetFileSize(&fileSize);
- rv = NS_ERROR_NOT_AVAILABLE;
-
- // get a buffer, read the entire file, then create
- // an nsURI; we assume the string is already escaped
- char * buffer = (char*)NS_Alloc(fileSize+1);
- if (buffer) {
- int32_t cnt = PR_Read(file, buffer, fileSize);
- if (cnt > 0) {
- buffer[cnt] = '\0';
- if (NS_SUCCEEDED(NS_NewURI(aURI, nsDependentCString(buffer))))
- rv = NS_OK;
- }
- NS_Free(buffer);
- }
- PR_Close(file);
-
- return rv;
-}
-
#elif defined(XP_UNIX)
NS_IMETHODIMP
nsFileProtocolHandler::ReadURLFile(nsIFile* aFile, nsIURI** aURI)
@@ -219,7 +168,7 @@ nsFileProtocolHandler::NewURI(const nsACString &spec,
const nsACString *specPtr = &spec;
-#if defined(XP_WIN) || defined(XP_OS2)
+#if defined(XP_WIN)
nsAutoCString buf;
if (net_NormalizeFileURL(spec, buf))
specPtr = &buf;