aboutsummaryrefslogtreecommitdiffstats
path: root/embed
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
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')
-rw-r--r--embed/downloader-view.c3
-rw-r--r--embed/ephy-download.c4
-rw-r--r--embed/ephy-download.h8
-rw-r--r--embed/ephy-embed-persist.c24
-rw-r--r--embed/ephy-embed-persist.h6
-rw-r--r--embed/mozilla/ContentHandler.h4
-rw-r--r--embed/mozilla/EphyBrowser.cpp4
-rw-r--r--embed/mozilla/EphyContentPolicy.cpp4
-rw-r--r--embed/mozilla/EphyHeaderSniffer.h4
-rw-r--r--embed/mozilla/EphyHistoryListener.cpp4
-rw-r--r--embed/mozilla/EphySidebar.cpp4
-rw-r--r--embed/mozilla/EphySingle.cpp4
-rw-r--r--embed/mozilla/EphyUtils.cpp4
-rw-r--r--embed/mozilla/EventContext.cpp4
-rw-r--r--embed/mozilla/FilePicker.cpp4
-rw-r--r--embed/mozilla/FilePicker.h4
-rw-r--r--embed/mozilla/GlobalHistory.cpp4
-rw-r--r--embed/mozilla/GtkNSSClientAuthDialogs.cpp4
-rw-r--r--embed/mozilla/GtkNSSDialogs.cpp4
-rw-r--r--embed/mozilla/MozDownload.cpp55
-rw-r--r--embed/mozilla/MozDownload.h13
-rw-r--r--embed/mozilla/mozilla-download.cpp12
-rw-r--r--embed/mozilla/mozilla-embed-single.cpp4
-rw-r--r--embed/mozilla/mozilla-embed.cpp4
24 files changed, 114 insertions, 75 deletions
diff --git a/embed/downloader-view.c b/embed/downloader-view.c
index ff8557ed5..83ae90e09 100644
--- a/embed/downloader-view.c
+++ b/embed/downloader-view.c
@@ -321,7 +321,8 @@ update_download_row (DownloaderView *dv, EphyDownload *download)
GtkTreePath *path;
GtkTreeIter iter;
EphyDownloadState state;
- long total, current, remaining_secs = 0;
+ long remaining_secs = 0;
+ gint64 total, current;
char *remaining, *file, *cur_progress, *name;
struct tm;
int percent = 0;
diff --git a/embed/ephy-download.c b/embed/ephy-download.c
index 359472d1e..cece472a5 100644
--- a/embed/ephy-download.c
+++ b/embed/ephy-download.c
@@ -185,14 +185,14 @@ ephy_download_get_target (EphyDownload *download)
return klass->get_target (download);
}
-long
+gint64
ephy_download_get_current_progress (EphyDownload *download)
{
EphyDownloadClass *klass = EPHY_DOWNLOAD_GET_CLASS (download);
return klass->get_current_progress (download);
}
-long
+gint64
ephy_download_get_total_progress (EphyDownload *download)
{
EphyDownloadClass *klass = EPHY_DOWNLOAD_GET_CLASS (download);
diff --git a/embed/ephy-download.h b/embed/ephy-download.h
index 2614f4e8e..4a3473e2b 100644
--- a/embed/ephy-download.h
+++ b/embed/ephy-download.h
@@ -62,8 +62,8 @@ struct _EphyDownloadClass
char * (* get_target) (EphyDownload *download);
char * (* get_mime) (EphyDownload *download);
int (* get_percent) (EphyDownload *download);
- long (* get_current_progress) (EphyDownload *download);
- long (* get_total_progress) (EphyDownload *download);
+ gint64 (* get_current_progress) (EphyDownload *download);
+ gint64 (* get_total_progress) (EphyDownload *download);
long (* get_elapsed_time) (EphyDownload *download);
void (* cancel) (EphyDownload *download);
void (* pause) (EphyDownload *download);
@@ -92,9 +92,9 @@ int ephy_download_get_percent (EphyDownload *download);
EphyDownloadState ephy_download_get_state (EphyDownload *download);
-long ephy_download_get_current_progress (EphyDownload *download);
+gint64 ephy_download_get_current_progress (EphyDownload *download);
-long ephy_download_get_total_progress (EphyDownload *download);
+gint64 ephy_download_get_total_progress (EphyDownload *download);
long ephy_download_get_elapsed_time (EphyDownload *download);
diff --git a/embed/ephy-embed-persist.c b/embed/ephy-embed-persist.c
index cd065d628..5af85be1b 100644
--- a/embed/ephy-embed-persist.c
+++ b/embed/ephy-embed-persist.c
@@ -23,6 +23,7 @@
#include "ephy-embed-persist.h"
#include "mozilla-embed-persist.h"
+#include "ephy-embed-type-builtins.h"
#include "ephy-debug.h"
#include <gtk/gtkmain.h>
@@ -51,7 +52,7 @@ struct _EphyEmbedPersistPrivate
char *fc_title;
char *persist_key;
EphyEmbed *embed;
- long max_size;
+ gint64 max_size;
EphyEmbedPersistFlags flags;
GtkWindow *fc_parent;
guint32 user_time;
@@ -201,7 +202,7 @@ ephy_embed_persist_set_flags (EphyEmbedPersist *persist,
**/
void
ephy_embed_persist_set_max_size (EphyEmbedPersist *persist,
- long value)
+ gint64 value)
{
g_return_if_fail (EPHY_IS_EMBED_PERSIST (persist));
@@ -351,7 +352,7 @@ ephy_embed_persist_get_flags (EphyEmbedPersist *persist)
*
* Return value: the maximum size of @persist's requested download, in bytes
**/
-long
+gint64
ephy_embed_persist_get_max_size (EphyEmbedPersist *persist)
{
g_return_val_if_fail (EPHY_IS_EMBED_PERSIST (persist), 0);
@@ -432,7 +433,7 @@ ephy_embed_persist_set_property (GObject *object,
ephy_embed_persist_set_fc_parent (persist, g_value_get_object (value));
break;
case PROP_FLAGS:
- ephy_embed_persist_set_flags (persist, g_value_get_int (value));
+ ephy_embed_persist_set_flags (persist, g_value_get_flags (value));
break;
case PROP_MAX_SIZE:
ephy_embed_persist_set_max_size (persist, g_value_get_long (value));
@@ -472,7 +473,7 @@ ephy_embed_persist_get_property (GObject *object,
g_value_set_object (value, ephy_embed_persist_get_fc_parent (persist));
break;
case PROP_FLAGS:
- g_value_set_int (value, ephy_embed_persist_get_flags (persist));
+ g_value_set_flags (value, ephy_embed_persist_get_flags (persist));
break;
case PROP_MAX_SIZE:
g_value_set_long (value, ephy_embed_persist_get_max_size (persist));
@@ -601,22 +602,21 @@ ephy_embed_persist_class_init (EphyEmbedPersistClass *klass)
g_object_class_install_property (object_class,
PROP_FLAGS,
- g_param_spec_int ("flags",
+ g_param_spec_flags ("flags",
"Flags",
"Flags",
- 0,
- G_MAXINT,
+ EPHY_TYPE_EMBED_PERSIST_FLAGS,
0,
G_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_MAX_SIZE,
- g_param_spec_long ("max_size",
+ g_param_spec_int64 ("max_size",
"Maxsize",
"Maximum size of the file",
- 0,
- G_MAXLONG,
- 0,
+ -1,
+ G_MAXINT64,
+ -1,
G_PARAM_READWRITE));
g_object_class_install_property (object_class,
diff --git a/embed/ephy-embed-persist.h b/embed/ephy-embed-persist.h
index a0ea180c8..dfccaa719 100644
--- a/embed/ephy-embed-persist.h
+++ b/embed/ephy-embed-persist.h
@@ -48,7 +48,7 @@ typedef enum
EPHY_EMBED_PERSIST_MAINDOC = 1 << 1,
EPHY_EMBED_PERSIST_NO_VIEW = 1 << 2,
EPHY_EMBED_PERSIST_ASK_DESTINATION = 1 << 3,
- EPHY_EMBED_PERSIST_DO_CONVERSION = 1 << 4
+ EPHY_EMBED_PERSIST_DO_CONVERSION = 1 << 4
} EphyEmbedPersistFlags;
struct _EphyEmbedPersist
@@ -98,7 +98,7 @@ void ephy_embed_persist_set_flags (EphyEmbedPersist *persist,
EphyEmbedPersistFlags value);
void ephy_embed_persist_set_max_size (EphyEmbedPersist *persist,
- long value);
+ gint64 value);
void ephy_embed_persist_set_persist_key (EphyEmbedPersist *persist,
const char *value);
@@ -118,7 +118,7 @@ GtkWindow *ephy_embed_persist_get_fc_parent (EphyEmbedPersist *persist);
EphyEmbedPersistFlags ephy_embed_persist_get_flags (EphyEmbedPersist *persist);
-long ephy_embed_persist_get_max_size (EphyEmbedPersist *persist);
+gint64 ephy_embed_persist_get_max_size (EphyEmbedPersist *persist);
const char *ephy_embed_persist_get_persist_key (EphyEmbedPersist *persist);
diff --git a/embed/mozilla/ContentHandler.h b/embed/mozilla/ContentHandler.h
index 6a8c58472..1df7e37cf 100644
--- a/embed/mozilla/ContentHandler.h
+++ b/embed/mozilla/ContentHandler.h
@@ -28,9 +28,9 @@
#include <libgnomevfs/gnome-vfs-mime-handlers.h>
-#define MOZILLA_STRICT_API
+#undef MOZILLA_INTERNAL_API
#include <nsEmbedString.h>
-#undef MOZILLA_STRICT_API
+#define MOZILLA_INTERNAL_API 1
#include <nsCOMPtr.h>
#include <nsISupports.h>
#include <nsIURI.h>
diff --git a/embed/mozilla/EphyBrowser.cpp b/embed/mozilla/EphyBrowser.cpp
index 21f6872ff..ac7771c89 100644
--- a/embed/mozilla/EphyBrowser.cpp
+++ b/embed/mozilla/EphyBrowser.cpp
@@ -70,9 +70,9 @@
#include "nsIDOMWindow2.h"
#include "nsIDOMDocumentView.h"
#include "nsIDOMAbstractView.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 "nsIChannel.h"
#include "nsIScriptSecurityManager.h"
diff --git a/embed/mozilla/EphyContentPolicy.cpp b/embed/mozilla/EphyContentPolicy.cpp
index 9679c0f2a..bbfa59814 100644
--- a/embed/mozilla/EphyContentPolicy.cpp
+++ b/embed/mozilla/EphyContentPolicy.cpp
@@ -32,9 +32,9 @@
#include <nsCOMPtr.h>
#include <nsIURI.h>
-#define MOZILLA_STRICT_API
+#undef MOZILLA_INTERNAL_API
#include <nsEmbedString.h>
-#undef MOZILLA_STRICT_API
+#define MOZILLA_INTERNAL_API 1
#define CONF_LOCKDOWN_DISABLE_UNSAFE_PROTOCOLS "/apps/epiphany/lockdown/disable_unsafe_protocols"
#define CONF_LOCKDOWN_ADDITIONAL_SAFE_PROTOCOLS "/apps/epiphany/lockdown/additional_safe_protocols"
diff --git a/embed/mozilla/EphyHeaderSniffer.h b/embed/mozilla/EphyHeaderSniffer.h
index 309bbaf41..2289156c8 100644
--- a/embed/mozilla/EphyHeaderSniffer.h
+++ b/embed/mozilla/EphyHeaderSniffer.h
@@ -50,9 +50,9 @@
#include <nsIDOMDocument.h>
#include <nsIAuthPrompt.h>
#include <nsIPromptService.h>
-#define MOZILLA_STRICT_API
+#undef MOZILLA_INTERNAL_API
#include <nsEmbedString.h>
-#undef MOZILLA_STRICT_API
+#define MOZILLA_INTERNAL_API 1
class EphyHeaderSniffer : public nsIWebProgressListener,
public nsIAuthPrompt
diff --git a/embed/mozilla/EphyHistoryListener.cpp b/embed/mozilla/EphyHistoryListener.cpp
index 1fcacd198..56f8c32a2 100644
--- a/embed/mozilla/EphyHistoryListener.cpp
+++ b/embed/mozilla/EphyHistoryListener.cpp
@@ -27,9 +27,9 @@
#include "ephy-debug.h"
-#define MOZILLA_STRICT_API
+#undef MOZILLA_INTERNAL_API
#include <nsEmbedString.h>
-#undef MOZILLA_STRICT_API
+#define MOZILLA_INTERNAL_API 1
#include <nsCOMPtr.h>
#include <nsIServiceManager.h>
#include <nsIDocumentLoader.h>
diff --git a/embed/mozilla/EphySidebar.cpp b/embed/mozilla/EphySidebar.cpp
index 953f8561c..479ae63ad 100644
--- a/embed/mozilla/EphySidebar.cpp
+++ b/embed/mozilla/EphySidebar.cpp
@@ -27,9 +27,9 @@
#include <nsCRT.h>
#include <nsIProgrammingLanguage.h>
-#define MOZILLA_STRICT_API
+#undef MOZILLA_INTERNAL_API
#include <nsEmbedString.h>
-#undef MOZILLA_STRICT_API
+#define MOZILLA_INTERNAL_API 1
#include "EphySidebar.h"
#include "ephy-embed-shell.h"
diff --git a/embed/mozilla/EphySingle.cpp b/embed/mozilla/EphySingle.cpp
index 2d17a6baf..4bd1915ea 100644
--- a/embed/mozilla/EphySingle.cpp
+++ b/embed/mozilla/EphySingle.cpp
@@ -27,9 +27,9 @@
#include "ephy-debug.h"
-#define MOZILLA_STRICT_API
+#undef MOZILLA_INTERNAL_API
#include <nsEmbedString.h>
-#undef MOZILLA_STRICT_API
+#define MOZILLA_INTERNAL_API 1
#include <nsIURI.h>
#include <nsIPermissionManager.h>
#include <nsICookieManager.h>
diff --git a/embed/mozilla/EphyUtils.cpp b/embed/mozilla/EphyUtils.cpp
index 3a5407cb8..0888ed674 100644
--- a/embed/mozilla/EphyUtils.cpp
+++ b/embed/mozilla/EphyUtils.cpp
@@ -28,9 +28,9 @@
#include "print-dialog.h"
#include <nsIServiceManager.h>
-#define MOZILLA_STRICT_API
+#undef MOZILLA_INTERNAL_API
#include <nsEmbedString.h>
-#undef MOZILLA_STRICT_API
+#define MOZILLA_INTERNAL_API 1
#include <nsIWindowWatcher.h>
#include <nsIEmbeddingSiteWindow.h>
#include <nsIWebBrowserChrome.h>
diff --git a/embed/mozilla/EventContext.cpp b/embed/mozilla/EventContext.cpp
index da746946d..21a4f5096 100644
--- a/embed/mozilla/EventContext.cpp
+++ b/embed/mozilla/EventContext.cpp
@@ -31,9 +31,9 @@
#include <nsIInterfaceRequestor.h>
#include <nsIServiceManager.h>
-#define MOZILLA_STRICT_API
+#undef MOZILLA_INTERNAL_API
#include <nsEmbedString.h>
-#undef MOZILLA_STRICT_API
+#define MOZILLA_INTERNAL_API 1
#include <nsIDOMEventTarget.h>
#include <nsIDOMHTMLInputElement.h>
#include <nsIDOMHTMLObjectElement.h>
diff --git a/embed/mozilla/FilePicker.cpp b/embed/mozilla/FilePicker.cpp
index e4b4e75fb..58559bc0d 100644
--- a/embed/mozilla/FilePicker.cpp
+++ b/embed/mozilla/FilePicker.cpp
@@ -27,9 +27,9 @@
#include "EphyUtils.h"
#include <nsCOMPtr.h>
-#define MOZILLA_STRICT_API
+#undef MOZILLA_INTERNAL_API
#include <nsEmbedString.h>
-#undef MOZILLA_STRICT_API
+#define MOZILLA_INTERNAL_API 1
#include <nsIServiceManager.h>
#include <nsIURI.h>
#include <nsIFileURL.h>
diff --git a/embed/mozilla/FilePicker.h b/embed/mozilla/FilePicker.h
index bc88d5b61..1c2283255 100644
--- a/embed/mozilla/FilePicker.h
+++ b/embed/mozilla/FilePicker.h
@@ -24,9 +24,9 @@
#include <nsIFilePicker.h>
#include <nsISupports.h>
-#define MOZILLA_STRICT_API
+#undef MOZILLA_INTERNAL_API
#include <nsEmbedString.h>
-#undef MOZILLA_STRICT_API
+#define MOZILLA_INTERNAL_API 1
#include "ephy-file-chooser.h"
diff --git a/embed/mozilla/GlobalHistory.cpp b/embed/mozilla/GlobalHistory.cpp
index b5bf2e3bb..4e4bc29b3 100644
--- a/embed/mozilla/GlobalHistory.cpp
+++ b/embed/mozilla/GlobalHistory.cpp
@@ -28,9 +28,9 @@
#include "GlobalHistory.h"
#include <nsIURI.h>
-#define MOZILLA_STRICT_API
+#undef MOZILLA_INTERNAL_API
#include <nsEmbedString.h>
-#undef MOZILLA_STRICT_API
+#define MOZILLA_INTERNAL_API 1
NS_IMPL_ISUPPORTS1 (MozGlobalHistory, nsIGlobalHistory2)
diff --git a/embed/mozilla/GtkNSSClientAuthDialogs.cpp b/embed/mozilla/GtkNSSClientAuthDialogs.cpp
index cbfa4b2c1..f047872be 100644
--- a/embed/mozilla/GtkNSSClientAuthDialogs.cpp
+++ b/embed/mozilla/GtkNSSClientAuthDialogs.cpp
@@ -29,9 +29,9 @@
#include <nsIServiceManager.h>
#include <nsIInterfaceRequestor.h>
#include <nsIInterfaceRequestorUtils.h>
-#define MOZILLA_STRICT_API
+#undef MOZILLA_INTERNAL_API
#include <nsEmbedString.h>
-#undef MOZILLA_STRICT_API
+#define MOZILLA_INTERNAL_API 1
#include <gtk/gtkdialog.h>
#include <gtk/gtkimage.h>
diff --git a/embed/mozilla/GtkNSSDialogs.cpp b/embed/mozilla/GtkNSSDialogs.cpp
index 092540fdd..e2a412014 100644
--- a/embed/mozilla/GtkNSSDialogs.cpp
+++ b/embed/mozilla/GtkNSSDialogs.cpp
@@ -45,9 +45,9 @@
#include <nsICRLInfo.h>
#include <nsISimpleEnumerator.h>
#include <nsIArray.h>
-#define MOZILLA_STRICT_API
+#undef MOZILLA_INTERNAL_API
#include <nsEmbedString.h>
-#undef MOZILLA_STRICT_API
+#define MOZILLA_INTERNAL_API 1
#include <gconf/gconf-client.h>
#include <gtk/gtkdialog.h>
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) ||
diff --git a/embed/mozilla/MozDownload.h b/embed/mozilla/MozDownload.h
index c4592ec5d..52c06c94f 100644
--- a/embed/mozilla/MozDownload.h
+++ b/embed/mozilla/MozDownload.h
@@ -108,6 +108,9 @@ public:
NS_DECL_ISUPPORTS
NS_DECL_NSIWEBPROGRESSLISTENER
+#ifdef HAVE_NSITRANSFER_H
+ NS_DECL_NSIWEBPROGRESSLISTENER2
+#endif
NS_DECL_NSITRANSFER
#ifndef HAVE_NSITRANSFER_H
NS_DECL_NSIDOWNLOAD
@@ -125,8 +128,8 @@ public:
virtual void Resume();
nsresult GetState (EphyDownloadState *aDownloadState);
- nsresult GetCurrentProgress (PRInt32 *aCurrentProgress);
- nsresult GetTotalProgress (PRInt32 *aTProgress);
+ nsresult GetCurrentProgress (PRInt64 *aCurrentProgress);
+ nsresult GetTotalProgress (PRInt64 *aTProgress);
nsresult GetElapsedTime (PRInt64 *aTProgress);
nsresult InitForEmbed (nsIURI *aSource, nsIURI *aTarget,
const PRUnichar *aDisplayName, nsIMIMEInfo *aMIMEInfo,
@@ -143,9 +146,9 @@ protected:
PRInt64 mElapsed;
PRInt32 mInterval;
PRInt32 mPercentComplete;
- PRInt32 mTotalProgress;
- PRInt32 mCurrentProgress;
- PRInt32 mMaxSize;
+ PRInt64 mTotalProgress;
+ PRInt64 mCurrentProgress;
+ PRInt64 mMaxSize;
nsresult mStatus;
diff --git a/embed/mozilla/mozilla-download.cpp b/embed/mozilla/mozilla-download.cpp
index f7e9cf78b..73a26a40c 100644
--- a/embed/mozilla/mozilla-download.cpp
+++ b/embed/mozilla/mozilla-download.cpp
@@ -26,9 +26,9 @@
#include "ephy-debug.h"
-#define MOZILLA_STRICT_API
+#undef MOZILLA_INTERNAL_API
#include <nsEmbedString.h>
-#undef MOZILLA_STRICT_API
+#define MOZILLA_INTERNAL_API 1
#include <nsMemory.h>
static void mozilla_download_class_init (MozillaDownloadClass *klass);
@@ -109,11 +109,11 @@ impl_get_source (EphyDownload *download)
return g_strdup (spec.get());
}
-static long
+static gint64
impl_get_current_progress (EphyDownload *download)
{
MozDownload *mozDownload;
- PRInt32 progress;
+ PRInt64 progress;
mozDownload = MOZILLA_DOWNLOAD (download)->priv->moz_download;
@@ -135,11 +135,11 @@ impl_get_state (EphyDownload *download)
return state;
}
-static long
+static gint64
impl_get_total_progress (EphyDownload *download)
{
MozDownload *mozDownload;
- PRInt32 progress;
+ PRInt64 progress;
mozDownload = MOZILLA_DOWNLOAD (download)->priv->moz_download;
diff --git a/embed/mozilla/mozilla-embed-single.cpp b/embed/mozilla/mozilla-embed-single.cpp
index d6bfbb061..c5b16c728 100644
--- a/embed/mozilla/mozilla-embed-single.cpp
+++ b/embed/mozilla/mozilla-embed-single.cpp
@@ -49,9 +49,9 @@
#include <nsCOMPtr.h>
#include <nsMemory.h>
-#define MOZILLA_STRICT_API
+#undef MOZILLA_INTERNAL_API
#include <nsEmbedString.h>
-#undef MOZILLA_STRICT_API
+#define MOZILLA_INTERNAL_API 1
#include <nsIPrefService.h>
#include <nsIServiceManager.h>
#include <nsIWindowWatcher.h>
diff --git a/embed/mozilla/mozilla-embed.cpp b/embed/mozilla/mozilla-embed.cpp
index 379e0f90f..016820e14 100644
--- a/embed/mozilla/mozilla-embed.cpp
+++ b/embed/mozilla/mozilla-embed.cpp
@@ -36,9 +36,9 @@
#include "EphyUtils.h"
#include <gtkmozembed.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 <nsIURI.h>
#include <nsIRequest.h>