getting the rest of necko to use the mimetypes file. also added protection for UA string setup
git-svn-id: svn://10.0.0.236/trunk@60201 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
#include "nsAutoLock.h"
|
||||
#include "nsIFileStreams.h"
|
||||
#include "nsIPrincipal.h"
|
||||
#include "nsMimeTypes.h"
|
||||
|
||||
static NS_DEFINE_CID(kFileTransportServiceCID, NS_FILETRANSPORTSERVICE_CID);
|
||||
static NS_DEFINE_CID(kMIMEServiceCID, NS_MIMESERVICE_CID);
|
||||
@@ -499,7 +500,7 @@ nsJARChannel::GetContentType(char* *aContentType)
|
||||
}
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
mContentType = nsCRT::strdup(UNKNOWN_MIME);
|
||||
mContentType = nsCRT::strdup(UNKNOWN_CONTENT_TYPE);
|
||||
if (mContentType == nsnull)
|
||||
rv = NS_ERROR_OUT_OF_MEMORY;
|
||||
else
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include "nsIFileTransportService.h"
|
||||
#include "nsIFile.h"
|
||||
#include "nsInt64.h"
|
||||
|
||||
#include "nsMimeTypes.h"
|
||||
#include "prio.h" // Need to pick up def of PR_RDONLY
|
||||
|
||||
static NS_DEFINE_CID(kFileTransportServiceCID, NS_FILETRANSPORTSERVICE_CID);
|
||||
@@ -347,7 +347,7 @@ nsFileChannel::GetContentType(char * *aContentType)
|
||||
}
|
||||
|
||||
if (mContentType.IsEmpty()) {
|
||||
mContentType = UNKNOWN_MIME;
|
||||
mContentType = UNKNOWN_CONTENT_TYPE;
|
||||
}
|
||||
}
|
||||
*aContentType = mContentType.ToNewCString();
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "nsIMIMEService.h"
|
||||
#include "nsIPipe.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsMimeTypes.h"
|
||||
|
||||
static NS_DEFINE_CID(kMIMEServiceCID, NS_MIMESERVICE_CID);
|
||||
|
||||
@@ -420,7 +421,7 @@ nsFTPChannel::GetContentType(char* *aContentType) {
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
mContentType = *aContentType;
|
||||
} else {
|
||||
mContentType = UNKNOWN_MIME;
|
||||
mContentType = UNKNOWN_CONTENT_TYPE;
|
||||
rv = NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
#include "nsINetDataCacheManager.h"
|
||||
#include "nsINetDataCache.h"
|
||||
#include "nsIScriptSecurityManager.h"
|
||||
#include "nsMimeTypes.h"
|
||||
|
||||
#ifdef DEBUG_gagan
|
||||
#include "nsUnixColorPrintf.h"
|
||||
@@ -327,7 +328,7 @@ nsHTTPChannel::GetContentType(char * *aContentType)
|
||||
}
|
||||
|
||||
if (!*aContentType)
|
||||
*aContentType = nsCRT::strdup(UNKNOWN_MIME);
|
||||
*aContentType = nsCRT::strdup(UNKNOWN_CONTENT_TYPE);
|
||||
if (!*aContentType) {
|
||||
rv = NS_ERROR_OUT_OF_MEMORY;
|
||||
} else {
|
||||
|
||||
@@ -575,14 +575,16 @@ nsHTTPHandler::Init()
|
||||
nsXPIDLCString locale;
|
||||
rv = prefs->CopyCharPref("general.useragent.locale",
|
||||
getter_Copies(locale));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
mAppLanguage = locale;
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
mAppLanguage = locale;
|
||||
}
|
||||
|
||||
nsXPIDLCString milestone;
|
||||
rv = prefs->CopyCharPref("general.milestone",
|
||||
getter_Copies(milestone));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
mAppVersion += milestone;
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
mAppVersion += milestone;
|
||||
}
|
||||
|
||||
// Platform
|
||||
#if defined(XP_PC)
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "nsAutoLock.h"
|
||||
#include "nsIFileStreams.h"
|
||||
#include "nsIPrincipal.h"
|
||||
#include "nsMimeTypes.h"
|
||||
|
||||
static NS_DEFINE_CID(kFileTransportServiceCID, NS_FILETRANSPORTSERVICE_CID);
|
||||
static NS_DEFINE_CID(kMIMEServiceCID, NS_MIMESERVICE_CID);
|
||||
@@ -499,7 +500,7 @@ nsJARChannel::GetContentType(char* *aContentType)
|
||||
}
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
mContentType = nsCRT::strdup(UNKNOWN_MIME);
|
||||
mContentType = nsCRT::strdup(UNKNOWN_CONTENT_TYPE);
|
||||
if (mContentType == nsnull)
|
||||
rv = NS_ERROR_OUT_OF_MEMORY;
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user