aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla/MozDownload.cpp
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2005-04-06 22:29:55 +0800
committerChristian Persch <chpe@src.gnome.org>2005-04-06 22:29:55 +0800
commitd4c3f7dbac768d26ac755ed20cd0d6fe0d1e7be3 (patch)
treeaaa58108307c134edd4a2d19545c37d2252cb599 /embed/mozilla/MozDownload.cpp
parent7057c3852b199c8d523233c4e669acfae1246709 (diff)
downloadgsoc2013-epiphany-d4c3f7dbac768d26ac755ed20cd0d6fe0d1e7be3.tar
gsoc2013-epiphany-d4c3f7dbac768d26ac755ed20cd0d6fe0d1e7be3.tar.gz
gsoc2013-epiphany-d4c3f7dbac768d26ac755ed20cd0d6fe0d1e7be3.tar.bz2
gsoc2013-epiphany-d4c3f7dbac768d26ac755ed20cd0d6fe0d1e7be3.tar.lz
gsoc2013-epiphany-d4c3f7dbac768d26ac755ed20cd0d6fe0d1e7be3.tar.xz
gsoc2013-epiphany-d4c3f7dbac768d26ac755ed20cd0d6fe0d1e7be3.tar.zst
gsoc2013-epiphany-d4c3f7dbac768d26ac755ed20cd0d6fe0d1e7be3.zip
Fix for MOZILLA_INTERNAL_API change, and for 64bit downloader change.
2005-04-06 Christian Persch <chpe@cvs.gnome.org> * configure.ac: * embed/downloader-view.c: (update_download_row): * embed/ephy-download.c: * embed/ephy-download.h: * embed/ephy-embed-persist.c: (ephy_embed_persist_set_max_size), (ephy_embed_persist_set_property), (ephy_embed_persist_get_property), (ephy_embed_persist_class_init): * embed/ephy-embed-persist.h: * embed/mozilla/ContentHandler.h: * embed/mozilla/EphyBrowser.cpp: * embed/mozilla/EphyContentPolicy.cpp: * embed/mozilla/EphyHeaderSniffer.h: * embed/mozilla/EphyHistoryListener.cpp: * embed/mozilla/EphySidebar.cpp: * embed/mozilla/EphySingle.cpp: * embed/mozilla/EphyUtils.cpp: * embed/mozilla/EventContext.cpp: * embed/mozilla/FilePicker.cpp: * embed/mozilla/FilePicker.h: * embed/mozilla/GlobalHistory.cpp: * embed/mozilla/GtkNSSClientAuthDialogs.cpp: * embed/mozilla/GtkNSSDialogs.cpp: * embed/mozilla/MozDownload.cpp: * embed/mozilla/MozDownload.h: * embed/mozilla/mozilla-download.cpp: * embed/mozilla/mozilla-embed-single.cpp: * embed/mozilla/mozilla-embed.cpp: Fix for MOZILLA_INTERNAL_API change, and for 64bit downloader change.
Diffstat (limited to 'embed/mozilla/MozDownload.cpp')
-rw-r--r--embed/mozilla/MozDownload.cpp55
1 files changed, 45 insertions, 10 deletions
diff --git a/embed/mozilla/MozDownload.cpp b/embed/mozilla/MozDownload.cpp
index 669455615..f04b1f5d1 100644
--- a/embed/mozilla/MozDownload.cpp
+++ b/embed/mozilla/MozDownload.cpp
@@ -57,9 +57,9 @@
#include <glib/gi18n.h>
#include <nsIFileURL.h>
-#define MOZILLA_STRICT_API
+#undef MOZILLA_INTERNAL_API
#include <nsEmbedString.h>
-#undef MOZILLA_STRICT_API
+#define MOZILLA_INTERNAL_API 1
#include <nsMemory.h>
#include <errno.h>
@@ -68,6 +68,8 @@
const char* const persistContractID = "@mozilla.org/embedding/browser/nsWebBrowserPersist;1";
MozDownload::MozDownload() :
+ mTotalProgress(-1),
+ mCurrentProgress(0),
mMaxSize(-1),
mStatus(NS_OK),
mEmbedPersist(nsnull),
@@ -84,7 +86,7 @@ MozDownload::~MozDownload()
}
#ifdef HAVE_NSITRANSFER_H
-NS_IMPL_ISUPPORTS2(MozDownload, nsIWebProgressListener, nsITransfer)
+NS_IMPL_ISUPPORTS3(MozDownload, nsIWebProgressListener, nsIWebProgressListener2, nsITransfer)
#else
NS_IMPL_ISUPPORTS3(MozDownload, nsIWebProgressListener, nsIDownload, nsITransfer)
#endif
@@ -246,7 +248,7 @@ MozDownload::SetDisplayName(const PRUnichar * aDisplayName)
#endif /* !HAVE_NSITRANSFER_H */
NS_IMETHODIMP
-MozDownload::GetTotalProgress(PRInt32 *aTotalProgress)
+MozDownload::GetTotalProgress(PRInt64 *aTotalProgress)
{
NS_ENSURE_ARG_POINTER(aTotalProgress);
*aTotalProgress = mTotalProgress;
@@ -255,7 +257,7 @@ MozDownload::GetTotalProgress(PRInt32 *aTotalProgress)
}
NS_IMETHODIMP
-MozDownload::GetCurrentProgress(PRInt32 *aCurrentProgress)
+MozDownload::GetCurrentProgress(PRInt64 *aCurrentProgress)
{
NS_ENSURE_ARG_POINTER(aCurrentProgress);
*aCurrentProgress = mCurrentProgress;
@@ -290,6 +292,7 @@ MozDownload::GetMIMEInfo(nsIMIMEInfo **aMIMEInfo)
return NS_OK;
}
+#ifndef HAVE_NSITRANSFER_H
NS_IMETHODIMP
MozDownload::GetListener(nsIWebProgressListener **aListener)
{
@@ -303,11 +306,15 @@ MozDownload::SetListener(nsIWebProgressListener *aListener)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
+#endif
NS_IMETHODIMP
MozDownload::GetObserver(nsIObserver **aObserver)
{
- return NS_ERROR_NOT_IMPLEMENTED;
+ *aObserver = mObserver;
+ NS_IF_ADDREF (*aObserver);
+
+ return NS_OK;
}
NS_IMETHODIMP
@@ -430,10 +437,38 @@ MozDownload::OnStateChange (nsIWebProgress *aWebProgress, nsIRequest *aRequest,
return NS_OK;
}
-NS_IMETHODIMP
-MozDownload::OnProgressChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest,
- PRInt32 aCurSelfProgress, PRInt32 aMaxSelfProgress,
- PRInt32 aCurTotalProgress, PRInt32 aMaxTotalProgress)
+#ifdef HAVE_NSITRANSFER_H
+NS_IMETHODIMP
+MozDownload::OnProgressChange (nsIWebProgress *aWebProgress,
+ nsIRequest *aRequest,
+ PRInt32 aCurSelfProgress,
+ PRInt32 aMaxSelfProgress,
+ PRInt32 aCurTotalProgress,
+ PRInt32 aMaxTotalProgress)
+{
+ return OnProgressChange64 (aWebProgress, aRequest,
+ aCurSelfProgress, aMaxSelfProgress,
+ aCurTotalProgress, aMaxTotalProgress);
+}
+
+/* void onProgressChange64 (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long long aCurSelfProgress, in long long aMaxSelfProgress, in long long aCurTotalProgress,
+ in long long aMaxTotalProgress); */
+NS_IMETHODIMP
+MozDownload::OnProgressChange64 (nsIWebProgress *aWebProgress,
+ nsIRequest *aRequest,
+ PRInt64 aCurSelfProgress,
+ PRInt64 aMaxSelfProgress,
+ PRInt64 aCurTotalProgress,
+ PRInt64 aMaxTotalProgress)
+#else /* !HAVE_NSITRANSFER_H */
+NS_IMETHODIMP
+MozDownload::OnProgressChange (nsIWebProgress *aWebProgress,
+ nsIRequest *aRequest,
+ PRInt32 aCurSelfProgress,
+ PRInt32 aMaxSelfProgress,
+ PRInt32 aCurTotalProgress,
+ PRInt32 aMaxTotalProgress)
+#endif /* HAVE_NSITRANSFER_H */
{
if (mMaxSize >= 0 &&
((aMaxTotalProgress > 0 && mMaxSize < aMaxTotalProgress) ||