aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla/MozDownload.cpp
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2005-01-06 04:48:47 +0800
committerChristian Persch <chpe@src.gnome.org>2005-01-06 04:48:47 +0800
commit1bb2458bbd832096bb10d850524c560129224b46 (patch)
tree88fc19b5bacfe02b7de2be652d7d265dc9f7c2c8 /embed/mozilla/MozDownload.cpp
parenta5d0e720fade615d0009a42d38b195a2db57b959 (diff)
downloadgsoc2013-epiphany-1bb2458bbd832096bb10d850524c560129224b46.tar
gsoc2013-epiphany-1bb2458bbd832096bb10d850524c560129224b46.tar.gz
gsoc2013-epiphany-1bb2458bbd832096bb10d850524c560129224b46.tar.bz2
gsoc2013-epiphany-1bb2458bbd832096bb10d850524c560129224b46.tar.lz
gsoc2013-epiphany-1bb2458bbd832096bb10d850524c560129224b46.tar.xz
gsoc2013-epiphany-1bb2458bbd832096bb10d850524c560129224b46.tar.zst
gsoc2013-epiphany-1bb2458bbd832096bb10d850524c560129224b46.zip
Only implement nsITransfer if possible.
2005-01-05 Christian Persch <chpe@cvs.gnome.org> * configure.ac: * embed/mozilla/MozDownload.cpp: * embed/mozilla/MozDownload.h: Only implement nsITransfer if possible.
Diffstat (limited to 'embed/mozilla/MozDownload.cpp')
-rw-r--r--embed/mozilla/MozDownload.cpp54
1 files changed, 32 insertions, 22 deletions
diff --git a/embed/mozilla/MozDownload.cpp b/embed/mozilla/MozDownload.cpp
index 23c48fcd7..e65974476 100644
--- a/embed/mozilla/MozDownload.cpp
+++ b/embed/mozilla/MozDownload.cpp
@@ -79,7 +79,11 @@ MozDownload::~MozDownload()
NS_ASSERTION (!mEphyDownload, "MozillaDownload still alive!");
}
+#ifdef HAVE_NSITRANSFER_H
+NS_IMPL_ISUPPORTS1(MozDownload, nsITransfer)
+#else
NS_IMPL_ISUPPORTS3(MozDownload, nsIDownload, nsITransfer, nsIWebProgressListener)
+#endif
NS_IMETHODIMP
MozDownload::InitForEmbed (nsIURI *aSource, nsIURI *aTarget, const PRUnichar *aDisplayName,
@@ -151,6 +155,7 @@ MozDownload::GetSource(nsIURI **aSource)
return NS_OK;
}
+#ifndef HAVE_NSITRANSFER_H
NS_IMETHODIMP
MozDownload::GetTarget(nsIURI **aTarget)
{
@@ -159,6 +164,7 @@ MozDownload::GetTarget(nsIURI **aTarget)
return NS_OK;
}
+#endif
NS_IMETHODIMP
MozDownload::GetTargetFile (nsILocalFile** aTargetFile)
@@ -175,6 +181,7 @@ MozDownload::GetTargetFile (nsILocalFile** aTargetFile)
return rv;
}
+#ifndef HAVE_NSITRANSFER_H
NS_IMETHODIMP
MozDownload::GetPersist(nsIWebBrowserPersist **aPersist)
{
@@ -183,6 +190,7 @@ MozDownload::GetPersist(nsIWebBrowserPersist **aPersist)
return NS_OK;
}
+#endif
NS_IMETHODIMP
MozDownload::GetPercentComplete(PRInt32 *aPercentComplete)
@@ -193,6 +201,7 @@ MozDownload::GetPercentComplete(PRInt32 *aPercentComplete)
return NS_OK;
}
+#ifndef HAVE_NSITRANSFER_H
#ifdef MOZ_NSIDOWNLOAD_GETSIZE
/* readonly attribute PRUint64 amountTransferred; */
NS_IMETHODIMP
@@ -207,52 +216,53 @@ MozDownload::GetSize(PRUint64 *aSize)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
-#endif /* MOZ_NSIDOWNLOAD_GETSIZE */
NS_IMETHODIMP
-MozDownload::GetTotalProgress(PRInt32 *aTotalProgress)
+MozDownload::GetStartTime(PRInt64 *aStartTime)
{
- NS_ENSURE_ARG_POINTER(aTotalProgress);
- *aTotalProgress = mTotalProgress;
+ NS_ENSURE_ARG_POINTER(aStartTime);
+ *aStartTime = mStartTime;
return NS_OK;
}
+#endif /* MOZ_NSIDOWNLOAD_GETSIZE */
NS_IMETHODIMP
-MozDownload::GetCurrentProgress(PRInt32 *aCurrentProgress)
+MozDownload::GetDisplayName(PRUnichar * *aDisplayName)
{
- NS_ENSURE_ARG_POINTER(aCurrentProgress);
- *aCurrentProgress = mCurrentProgress;
-
- return NS_OK;
+ return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
-MozDownload::GetState(EphyDownloadState *aDownloadState)
+MozDownload::SetDisplayName(const PRUnichar * aDisplayName)
{
- NS_ENSURE_ARG_POINTER(aDownloadState);
- *aDownloadState = mDownloadState;
-
- return NS_OK;
+ return NS_ERROR_NOT_IMPLEMENTED;
}
+#endif /* !HAVE_NSITRANSFER_H */
NS_IMETHODIMP
-MozDownload::GetDisplayName(PRUnichar * *aDisplayName)
+MozDownload::GetTotalProgress(PRInt32 *aTotalProgress)
{
- return NS_ERROR_NOT_IMPLEMENTED;
+ NS_ENSURE_ARG_POINTER(aTotalProgress);
+ *aTotalProgress = mTotalProgress;
+
+ return NS_OK;
}
NS_IMETHODIMP
-MozDownload::SetDisplayName(const PRUnichar * aDisplayName)
+MozDownload::GetCurrentProgress(PRInt32 *aCurrentProgress)
{
- return NS_ERROR_NOT_IMPLEMENTED;
+ NS_ENSURE_ARG_POINTER(aCurrentProgress);
+ *aCurrentProgress = mCurrentProgress;
+
+ return NS_OK;
}
NS_IMETHODIMP
-MozDownload::GetStartTime(PRInt64 *aStartTime)
+MozDownload::GetState(EphyDownloadState *aDownloadState)
{
- NS_ENSURE_ARG_POINTER(aStartTime);
- *aStartTime = mStartTime;
+ NS_ENSURE_ARG_POINTER(aDownloadState);
+ *aDownloadState = mDownloadState;
return NS_OK;
}
@@ -326,7 +336,7 @@ MozDownload::OnStateChange (nsIWebProgress *aWebProgress, nsIRequest *aRequest,
if (aStateFlags & EPHY_EMBED_STATE_STOP)
{
/* Keep us alive */
- nsCOMPtr<nsIDownload> kungFuDeathGrip(this);
+ nsCOMPtr<nsITransfer> kungFuDeathGrip(this);
mDownloadState = NS_SUCCEEDED (aStatus) ? EPHY_DOWNLOAD_COMPLETED : EPHY_DOWNLOAD_FAILED;
if (mEphyDownload)