Bug #43556 --> remove obsolete reference to old class id for the mime service. use the new one.

r=valeski
This commit is contained in:
mscott%netscape.com 2000-09-08 00:24:13 +00:00
parent 259e029521
commit 81b816da2e
14 changed files with 26 additions and 32 deletions

View File

@ -103,6 +103,7 @@ static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#include "nsIServiceManager.h"
#include "nsEscape.h"
#include "nsLinebreakConverter.h"
#include "nsCExternalHandlerService.h"
#include "nsIMIMEService.h"
#include "nsILocalFile.h" // Using nsILocalFile to get file size
@ -114,7 +115,6 @@ static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
static NS_DEFINE_CID(kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CID);
static NS_DEFINE_CID(kPlatformCharsetCID, NS_PLATFORMCHARSET_CID);
static NS_DEFINE_CID(kMIMEServiceCID, NS_MIMESERVICE_CID);
//----------------------------------------------------------------------
@ -1233,7 +1233,7 @@ nsFormFrame::GetContentType(char* aPathName, char** aContentType)
fileExt--;
}
if (fileExt) {
NS_WITH_SERVICE(nsIMIMEService, MIMEService, kMIMEServiceCID, &rv);
nsCOMPtr<nsIMIMEService> MIMEService (do_GetService(NS_MIMESERVICE_PROGID, &rv));
if (NS_FAILED(rv)) return rv;
if (NS_SUCCEEDED(MIMEService->GetTypeFromExtension(++fileExt, aContentType)))
return NS_OK;

View File

@ -35,11 +35,10 @@
#include "nsMsgAppleCodes.h"
#include "nsFileSpec.h"
#include "nsMsgCompUtils.h"
#include "nsCExternalHandlerService.h"
#include "nsIMIMEService.h"
#include "nsIMIMEInfo.h"
static NS_DEFINE_CID(kMimeServiceCID, NS_MIMESERVICE_CID);
#ifdef XP_MAC
#pragma warn_unusedarg off
@ -110,7 +109,7 @@ MacGetFileType(nsFileSpec *fs,
if (NS_SUCCEEDED(nsMsgNewURL(&tURI, tFileURL.GetURLString())) && tURI)
{
NS_WITH_SERVICE(nsIMIMEService, mimeFinder, kMimeServiceCID, &rv);
nsCOMPtr<nsIMIMEService> mimeFinder (do_GetService(NS_MIMESERVICE_PROGID, &rv));
if (NS_SUCCEEDED(rv) && mimeFinder)
{
char *mimeType = nsnull;

View File

@ -61,6 +61,7 @@
#include "nsIAddrDatabase.h"
#include "nsIAddrBookSession.h"
#include "nsIAddressBook.h"
#include "nsCExternalHandlerService.h"
#include "nsIMIMEService.h"
#include "nsIDocShellTreeItem.h"
#include "nsIDocShellTreeOwner.h"
@ -77,7 +78,6 @@ static NS_DEFINE_CID(kHeaderParserCID, NS_MSGHEADERPARSER_CID);
static NS_DEFINE_CID(kAddrBookCID, NS_ADDRESSBOOK_CID);
static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
static NS_DEFINE_CID(kMsgRecipientArrayCID, NS_MSGRECIPIENTARRAY_CID);
static NS_DEFINE_CID(kMimeServiceCID, NS_MIMESERVICE_CID);
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
static PRInt32 GetReplyOnTop()
@ -1969,7 +1969,7 @@ nsMsgCompose::ProcessSignature(nsIMsgIdentity *identity, nsString *aMsgBody)
// this signature...if we can't, we assume text
rv = NS_OK;
char *sigContentType = nsnull;
NS_WITH_SERVICE(nsIMIMEService, mimeFinder, kMimeServiceCID, &rv);
nsCOMPtr<nsIMIMEService> mimeFinder (do_GetService(NS_MIMESERVICE_PROGID, &rv));
if (NS_SUCCEEDED(rv) && mimeFinder && fileExt)
{
mimeFinder->GetTypeFromExtension(fileExt, &(sigContentType));

View File

@ -51,6 +51,7 @@
#include "nsIDOMHTMLImageElement.h"
#include "nsIDOMHTMLLinkElement.h"
#include "nsIDOMHTMLAnchorElement.h"
#include "nsCExternalHandlerService.h"
#include "nsIMIMEService.h"
#include "nsIDocument.h"
#include "nsIDOMDocument.h"
@ -87,7 +88,6 @@ static NS_DEFINE_CID(kMsgMailSessionCID, NS_MSGMAILSESSION_CID);
static NS_DEFINE_CID(kSmtpServiceCID, NS_SMTPSERVICE_CID);
static NS_DEFINE_CID(kNntpServiceCID, NS_NNTPSERVICE_CID);
static NS_DEFINE_CID(kPrefCID, NS_PREF_CID);
static NS_DEFINE_CID(kMimeServiceCID, NS_MIMESERVICE_CID);
static NS_DEFINE_CID(kCAddressCollecter, NS_ABADDRESSCOLLECTER_CID);
static NS_DEFINE_CID(kTXTToHTMLConvCID, MOZITXTTOHTMLCONV_CID);
static NS_DEFINE_CID(kCNetSupportDialogCID, NS_NETSUPPORTDIALOG_CID);
@ -1858,7 +1858,7 @@ nsMsgComposeAndSend::AddCompFieldLocalAttachments()
// Now, most importantly, we need to figure out what the content type is for
// this attachment...If we can't, then just make it application/octet-stream
nsresult rv = NS_OK;
NS_WITH_SERVICE(nsIMIMEService, mimeFinder, kMimeServiceCID, &rv);
nsCOMPtr<nsIMIMEService> mimeFinder (do_GetService(NS_MIMESERVICE_PROGID, &rv));
if (NS_SUCCEEDED(rv) && mimeFinder)
{
char *fileExt = nsMsgGetExtensionFromFileURL(NS_ConvertASCIItoUCS2(str));

View File

@ -56,6 +56,7 @@
#include "nsIMsgMessageService.h"
#include "nsMsgUtils.h"
#include "nsXPIDLString.h"
#include "nsCExternalHandlerService.h"
#include "nsIMIMEService.h"
#include "nsIMIMEInfo.h"
@ -82,7 +83,6 @@ static nsString& mime_decode_string(const char* str ,
// CID's
static NS_DEFINE_CID(kCMsgComposeServiceCID, NS_MSGCOMPOSESERVICE_CID);
static NS_DEFINE_CID(kMimeServiceCID, NS_MIMESERVICE_CID);
////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////
@ -1713,7 +1713,7 @@ mime_decompose_file_init_fn ( void *stream_closure, MimeHeaders *headers )
if (pos > 0)
contentType.Truncate(pos);
nsresult rv = NS_OK;
NS_WITH_SERVICE(nsIMIMEService, mimeFinder, kMimeServiceCID, &rv);
nsCOMPtr<nsIMIMEService> mimeFinder (do_GetService(NS_MIMESERVICE_PROGID, &rv));
if (NS_SUCCEEDED(rv) && mimeFinder)
{
nsCOMPtr<nsIMIMEInfo> mimeInfo = nsnull;

View File

@ -59,6 +59,7 @@
#include "nsIMsgMailNewsUrl.h"
#include "nsSpecialSystemDirectory.h"
#include "mozITXTToHTMLConv.h"
#include "nsCExternalHandlerService.h"
#include "nsIMIMEService.h"
#include "nsIImapUrl.h"
#include "nsMsgI18N.h"
@ -73,7 +74,6 @@
static NS_DEFINE_IID(kIPrefIID, NS_IPREF_IID);
static NS_DEFINE_CID(kPrefCID, NS_PREF_CID);
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
static NS_DEFINE_CID(kMimeServiceCID, NS_MIMESERVICE_CID);
#ifdef MOZ_SECURITY
#include HG01944
@ -252,7 +252,7 @@ ValidateRealName(nsMsgAttachmentData *aAttach, MimeHeaders *aHdrs)
if (pos > 0)
contentType.Truncate(pos);
NS_WITH_SERVICE(nsIMIMEService, mimeFinder, kMimeServiceCID, &rv);
nsCOMPtr<nsIMIMEService> mimeFinder (do_GetService(NS_MIMESERVICE_PROGID, &rv));
if (NS_SUCCEEDED(rv) && mimeFinder)
{
nsIMIMEInfo *mimeInfo = nsnull;
@ -592,7 +592,7 @@ mime_file_type (const char *filename, void *stream_closure)
if (ext)
{
ext++;
NS_WITH_SERVICE(nsIMIMEService, mimeFinder, kMimeServiceCID, &rv);
nsCOMPtr<nsIMIMEService> mimeFinder (do_GetService(NS_MIMESERVICE_PROGID, &rv));
if (NS_SUCCEEDED(rv) && mimeFinder)
mimeFinder->GetTypeFromExtension(ext, &retType);
}

View File

@ -25,6 +25,7 @@
#include "nsCRT.h"
#include "nsIFileTransportService.h"
#include "nsIURL.h"
#include "nsCExternalHandlerService.h"
#include "nsIMIMEService.h"
#include "nsAutoLock.h"
#include "nsIFileStreams.h"
@ -41,7 +42,6 @@
#endif
static NS_DEFINE_CID(kFileTransportServiceCID, NS_FILETRANSPORTSERVICE_CID);
static NS_DEFINE_CID(kMIMEServiceCID, NS_MIMESERVICE_CID);
static NS_DEFINE_CID(kZipReaderCID, NS_ZIPREADER_CID);
static NS_DEFINE_CID(kScriptSecurityManagerCID, NS_SCRIPTSECURITYMANAGER_CID);
@ -683,7 +683,7 @@ nsJARChannel::GetContentType(char* *aContentType)
}
if (ext) {
NS_WITH_SERVICE(nsIMIMEService, mimeServ, kMIMEServiceCID, &rv);
nsCOMPtr<nsIMIMEService> mimeServ (do_GetService(NS_MIMESERVICE_PROGID, &rv));
if (NS_SUCCEEDED(rv)) {
rv = mimeServ->GetTypeFromExtension(ext, &mContentType);
}
@ -925,6 +925,7 @@ nsJARChannel::OnStopRequest(nsIChannel* jarExtractionTransport, nsISupports* con
(const char*)jarURLStr, aStatus));
}
#endif
rv = mUserListener->OnStopRequest(this, mUserContext, aStatus, aStatusArg);
if (mLoadGroup) {

View File

@ -26,6 +26,7 @@
#include "prerror.h"
#include "nsCRT.h"
#include "nsInt64.h"
#include "nsCExternalHandlerService.h"
#include "nsIMIMEService.h"
#include "nsIFile.h"
#include "nsDirectoryIndexStream.h"
@ -49,8 +50,6 @@ PRLogModuleInfo* gFileIOLog = nsnull;
#endif /* PR_LOGGING */
static NS_DEFINE_CID(kMIMEServiceCID, NS_MIMESERVICE_CID);
////////////////////////////////////////////////////////////////////////////////
// nsFileIO
@ -153,7 +152,7 @@ nsFileIO::Open(char **contentType, PRInt32 *contentLength)
*contentLength = -1;
}
else {
NS_WITH_SERVICE(nsIMIMEService, mimeServ, kMIMEServiceCID, &rv);
nsCOMPtr<nsIMIMEService> mimeServ (do_GetService(NS_MIMESERVICE_PROGID, &rv));
if (NS_SUCCEEDED(rv)) {
rv = mimeServ->GetTypeFromFile(mFile, contentType);
}

View File

@ -24,13 +24,11 @@
#include "nsCOMPtr.h"
#include "nsIIOService.h"
#include "nsIServiceManager.h"
#include "nsIMIMEService.h"
#include "nsIFileTransportService.h"
#include "netCore.h"
#include "nsXPIDLString.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
static NS_DEFINE_CID(kMIMEServiceCID, NS_MIMESERVICE_CID);
static NS_DEFINE_CID(kFileTransportServiceCID, NS_FILETRANSPORTSERVICE_CID);
////////////////////////////////////////////////////////////////////////////////

View File

@ -32,6 +32,7 @@
#include "nsIURL.h"
#include "nsIOutputStream.h"
#include "netCore.h"
#include "nsCExternalHandlerService.h"
#include "nsIMIMEService.h"
#include "nsISupportsUtils.h"
#include "prio.h"
@ -39,7 +40,6 @@
//static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
static NS_DEFINE_CID(kFileTransportServiceCID, NS_FILETRANSPORTSERVICE_CID);
static NS_DEFINE_CID(kStandardURLCID, NS_STANDARDURL_CID);
static NS_DEFINE_CID(kMIMEServiceCID, NS_MIMESERVICE_CID);
// This is copied from nsMemCacheChannel, We should consolidate these two.
class WriteStreamWrapper : public nsIOutputStream
@ -500,8 +500,7 @@ nsDiskCacheRecordChannel::GetContentType(char * *aContentType)
rv = url->SetSpec((char*)urlStr);
if (NS_FAILED(rv))
return rv;
NS_WITH_SERVICE(nsIMIMEService, MIMEService, kMIMEServiceCID, &rv);
nsCOMPtr<nsIMIMEService> MIMEService (do_GetService(NS_MIMESERVICE_PROGID, &rv));
if (NS_FAILED(rv)) return rv;
rv = MIMEService->GetTypeFromURI(url, aContentType);

View File

@ -25,11 +25,11 @@
#include "nsFTPChannel.h"
#include "nsIStreamListener.h"
#include "nsIServiceManager.h"
#include "nsCExternalHandlerService.h"
#include "nsIMIMEService.h"
#include "nsNetUtil.h"
#include "nsMimeTypes.h"
static NS_DEFINE_CID(kMIMEServiceCID, NS_MIMESERVICE_CID);
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#if defined(PR_LOGGING)
@ -431,7 +431,8 @@ nsFTPChannel::GetContentType(char* *aContentType) {
nsAutoLock lock(mLock);
*aContentType = nsnull;
if (mContentType.IsEmpty()) {
NS_WITH_SERVICE(nsIMIMEService, MIMEService, kMIMEServiceCID, &rv);
nsCOMPtr<nsIMIMEService> MIMEService (do_GetService(NS_MIMESERVICE_PROGID, &rv));
if (NS_FAILED(rv)) return rv;
rv = MIMEService->GetTypeFromURI(mURL, aContentType);
if (NS_SUCCEEDED(rv)) {

View File

@ -22,7 +22,6 @@
#include "nsFtpConnectionThread.h"
#include "nsISocketTransport.h"
#include "nsIMIMEService.h"
#include "nsIStreamConverterService.h"
#include "prprf.h"
#include "prlog.h"
@ -43,7 +42,6 @@
static NS_DEFINE_CID(kWalletServiceCID, NS_WALLETSERVICE_CID);
static NS_DEFINE_CID(kStreamConverterServiceCID, NS_STREAMCONVERTERSERVICE_CID);
static NS_DEFINE_CID(kMIMEServiceCID, NS_MIMESERVICE_CID);
static NS_DEFINE_CID(kProxyObjectManagerCID, NS_PROXYEVENT_MANAGER_CID);
static NS_DEFINE_CID(kSocketTransportServiceCID, NS_SOCKETTRANSPORTSERVICE_CID);
static NS_DEFINE_CID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID);

View File

@ -25,6 +25,7 @@
#include "nsCRT.h"
#include "nsIFileTransportService.h"
#include "nsIURL.h"
#include "nsCExternalHandlerService.h"
#include "nsIMIMEService.h"
#include "nsAutoLock.h"
#include "nsIFileStreams.h"
@ -41,7 +42,6 @@
#endif
static NS_DEFINE_CID(kFileTransportServiceCID, NS_FILETRANSPORTSERVICE_CID);
static NS_DEFINE_CID(kMIMEServiceCID, NS_MIMESERVICE_CID);
static NS_DEFINE_CID(kZipReaderCID, NS_ZIPREADER_CID);
static NS_DEFINE_CID(kScriptSecurityManagerCID, NS_SCRIPTSECURITYMANAGER_CID);
@ -683,7 +683,7 @@ nsJARChannel::GetContentType(char* *aContentType)
}
if (ext) {
NS_WITH_SERVICE(nsIMIMEService, mimeServ, kMIMEServiceCID, &rv);
nsCOMPtr<nsIMIMEService> mimeServ (do_GetService(NS_MIMESERVICE_PROGID, &rv));
if (NS_SUCCEEDED(rv)) {
rv = mimeServ->GetTypeFromExtension(ext, &mContentType);
}
@ -925,6 +925,7 @@ nsJARChannel::OnStopRequest(nsIChannel* jarExtractionTransport, nsISupports* con
(const char*)jarURLStr, aStatus));
}
#endif
rv = mUserListener->OnStopRequest(this, mUserContext, aStatus, aStatusArg);
if (mLoadGroup) {

View File

@ -25,14 +25,12 @@
#include "netCore.h"
#include "nsIServiceManager.h"
#include "nsIFileTransportService.h"
#include "nsIMIMEService.h"
#include "nsIComponentManager.h"
#include "nsIURL.h"
#include "nsIIOService.h"
#include "nsXPIDLString.h"
static NS_DEFINE_CID(kFileTransportServiceCID, NS_FILETRANSPORTSERVICE_CID);
static NS_DEFINE_CID(kMIMEServiceCID, NS_MIMESERVICE_CID);
static NS_DEFINE_CID(kStandardURLCID, NS_STANDARDURL_CID);
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);