mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
Bug 281130 rename NS_DOWNLOAD_CONTRACTID to NS_TRANSFER_CONTRACTID to better
reflects its purpose r=bz sr=darin
This commit is contained in:
parent
6b61696ec8
commit
40888bf15f
@ -304,7 +304,7 @@ function foundHeaderInfo(aSniffer, aData, aSkipPrompt)
|
||||
persist.persistFlags &= ~nsIWBP.PERSIST_FLAGS_NO_CONVERSION;
|
||||
|
||||
// Create download and initiate it (below)
|
||||
var tr = Components.classes["@mozilla.org/download;1"].createInstance(Components.interfaces.nsITransfer);
|
||||
var tr = Components.classes["@mozilla.org/transfer;1"].createInstance(Components.interfaces.nsITransfer);
|
||||
|
||||
if (isDocument && saveAsType != kSaveAsType_URL) {
|
||||
// Saving a Document, not a URI:
|
||||
|
@ -167,7 +167,7 @@ static const nsModuleComponentInfo gAppComponents[] = {
|
||||
{
|
||||
"Download",
|
||||
NS_DOWNLOAD_CID,
|
||||
NS_DOWNLOAD_CONTRACTID,
|
||||
NS_TRANSFER_CONTRACTID,
|
||||
nsDownloadListenerConstructor
|
||||
},
|
||||
{
|
||||
|
@ -365,7 +365,7 @@ nsresult nsHeaderSniffer::InitiateDownload(nsISupports* inSourceData, nsString&
|
||||
|
||||
PRInt64 timeNow = PR_Now();
|
||||
|
||||
nsCOMPtr<nsIDownload> downloader = do_CreateInstance(NS_DOWNLOAD_CONTRACTID);
|
||||
nsCOMPtr<nsIDownload> downloader = do_CreateInstance(NS_TRANSFER_CONTRACTID);
|
||||
// dlListener attaches to its progress dialog here, which gains ownership
|
||||
rv = downloader->Init(inOriginalURI, destURI, inFileName.get(), nsnull, timeNow, webPersist);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
@ -112,7 +112,7 @@ CHBrowserService::InitEmbedding()
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
static NS_DEFINE_CID(kDownloadCID, NS_DOWNLOAD_CID);
|
||||
rv = cr->RegisterFactory(kDownloadCID, "Download", NS_DOWNLOAD_CONTRACTID, downloadFactory);
|
||||
rv = cr->RegisterFactory(kDownloadCID, "Download", NS_TRANSFER_CONTRACTID, downloadFactory);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
@ -339,7 +339,7 @@ nsresult nsHeaderSniffer::InitiateDownload(nsISupports* inSourceData, nsString&
|
||||
|
||||
PRInt64 timeNow = PR_Now();
|
||||
|
||||
nsCOMPtr<nsIDownload> downloader = do_CreateInstance(NS_DOWNLOAD_CONTRACTID);
|
||||
nsCOMPtr<nsIDownload> downloader = do_CreateInstance(NS_TRANSFER_CONTRACTID);
|
||||
// dlListener attaches to its progress dialog here, which gains ownership
|
||||
rv = downloader->Init(inOriginalURI, destFile, inFileName.get(), nsnull, timeNow, webPersist);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
@ -60,7 +60,7 @@ static const nsModuleComponentInfo components[] = {
|
||||
{
|
||||
"Download",
|
||||
NS_DOWNLOAD_CID,
|
||||
NS_DOWNLOAD_CONTRACTID,
|
||||
NS_TRANSFER_CONTRACTID,
|
||||
CDownloadConstructor
|
||||
},
|
||||
{
|
||||
|
@ -393,7 +393,7 @@ nsresult CHeaderSniffer::InitiateDownload(nsISupports* inSourceData, nsILocalFil
|
||||
nsAutoString fileDisplayName;
|
||||
inDestFile->GetLeafName(fileDisplayName);
|
||||
|
||||
nsCOMPtr<nsIDownload> downloader = do_CreateInstance(NS_DOWNLOAD_CONTRACTID);
|
||||
nsCOMPtr<nsIDownload> downloader = do_CreateInstance(NS_TRANSFER_CONTRACTID);
|
||||
// dlListener attaches to its progress dialog here, which gains ownership
|
||||
rv = downloader->Init(inOriginalURI, inDestFile, fileDisplayName.get(), nsnull, timeNow, webPersist);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
@ -1793,7 +1793,7 @@ nsresult nsSaveMsgListener::InitializeDownload(nsIRequest * aRequest, PRInt32 aB
|
||||
// so make an arbitrary decision based on the content length of the attachment
|
||||
if (mContentLength != -1 && mContentLength > aBytesDownloaded * 2)
|
||||
{
|
||||
nsCOMPtr<nsITransfer> tr = do_CreateInstance("@mozilla.org/download;1", &rv);
|
||||
nsCOMPtr<nsITransfer> tr = do_CreateInstance(NS_TRANSFER_CONTRACTID, &rv);
|
||||
if (tr && outputFile)
|
||||
{
|
||||
PRTime timeDownloadStarted = PR_Now();
|
||||
|
@ -128,7 +128,7 @@ static const nsModuleComponentInfo components[] =
|
||||
|
||||
{ "Download",
|
||||
NS_DOWNLOAD_CID,
|
||||
NS_DOWNLOAD_CONTRACTID,
|
||||
NS_TRANSFER_CONTRACTID,
|
||||
nsDownloadProxyConstructor },
|
||||
|
||||
{ "HTML Form History",
|
||||
|
@ -108,5 +108,5 @@ interface nsITransfer : nsIWebProgressListener {
|
||||
* INTERFACES THAT MAY BE IMPLEMENTED:
|
||||
* nsIObserver
|
||||
*/
|
||||
#define NS_DOWNLOAD_CONTRACTID "@mozilla.org/download;1"
|
||||
#define NS_TRANSFER_CONTRACTID "@mozilla.org/transfer;1"
|
||||
%}
|
||||
|
@ -2121,7 +2121,7 @@ nsresult nsExternalAppHandler::CreateProgressListener()
|
||||
mDialog = nsnull;
|
||||
nsresult rv;
|
||||
|
||||
nsCOMPtr<nsITransfer> tr = do_CreateInstance("@mozilla.org/download;1", &rv);
|
||||
nsCOMPtr<nsITransfer> tr = do_CreateInstance(NS_TRANSFER_CONTRACTID, &rv);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
InitializeDownload(tr);
|
||||
|
||||
|
@ -339,7 +339,7 @@ function internalSave(aURL, aDocument, aDefaultFileName, aShouldBypassCache,
|
||||
persist.persistFlags |= nsIWBP.PERSIST_FLAGS_AUTODETECT_APPLY_CONVERSION;
|
||||
|
||||
// Create download and initiate it (below)
|
||||
var tr = Components.classes["@mozilla.org/download;1"].createInstance(Components.interfaces.nsITransfer);
|
||||
var tr = Components.classes["@mozilla.org/transfer;1"].createInstance(Components.interfaces.nsITransfer);
|
||||
|
||||
if (useSaveDocument) {
|
||||
// Saving a Document, not a URI:
|
||||
|
@ -166,7 +166,7 @@ static const nsModuleComponentInfo components[] = {
|
||||
nsBookmarksServiceConstructor },
|
||||
{ "Download Manager", NS_DOWNLOADMANAGER_CID, NS_DOWNLOADMANAGER_CONTRACTID,
|
||||
nsDownloadManagerConstructor },
|
||||
{ "Download", NS_DOWNLOAD_CID, NS_DOWNLOAD_CONTRACTID,
|
||||
{ "Download", NS_DOWNLOAD_CID, NS_TRANSFER_CONTRACTID,
|
||||
nsDownloadProxyConstructor },
|
||||
{ "AutoComplete Search Results", NS_AUTOCOMPLETERESULTS_CID, NS_AUTOCOMPLETERESULTS_CONTRACTID,
|
||||
nsAutoCompleteResultsConstructor},
|
||||
|
@ -83,7 +83,7 @@ static const nsModuleComponentInfo components[] = {
|
||||
|
||||
{ "Download Manager", NS_DOWNLOADMANAGER_CID, NS_DOWNLOADMANAGER_CONTRACTID,
|
||||
nsDownloadManagerConstructor },
|
||||
{ "Download", NS_DOWNLOAD_CID, NS_DOWNLOAD_CONTRACTID,
|
||||
{ "Download", NS_DOWNLOAD_CID, NS_TRANSFER_CONTRACTID,
|
||||
nsDownloadProxyConstructor },
|
||||
{ "AutoComplete Search Results", NS_AUTOCOMPLETERESULTS_CID, NS_AUTOCOMPLETERESULTS_CONTRACTID,
|
||||
nsAutoCompleteResultsConstructor},
|
||||
|
Loading…
Reference in New Issue
Block a user