diff options
author | Marco Pesenti Gritti <marco@it.gnome.org> | 2003-03-16 02:27:14 +0800 |
---|---|---|
committer | Marco Pesenti Gritti <mpeseng@src.gnome.org> | 2003-03-16 02:27:14 +0800 |
commit | a49c85f4678d4b9edb19725b6c2168dc706d5b54 (patch) | |
tree | 954a5912f58deda747cce720e533349612def829 | |
parent | e460bd19de1c3856b1f066a84fc985014f07004f (diff) | |
download | gsoc2013-epiphany-a49c85f4678d4b9edb19725b6c2168dc706d5b54.tar gsoc2013-epiphany-a49c85f4678d4b9edb19725b6c2168dc706d5b54.tar.gz gsoc2013-epiphany-a49c85f4678d4b9edb19725b6c2168dc706d5b54.tar.bz2 gsoc2013-epiphany-a49c85f4678d4b9edb19725b6c2168dc706d5b54.tar.lz gsoc2013-epiphany-a49c85f4678d4b9edb19725b6c2168dc706d5b54.tar.xz gsoc2013-epiphany-a49c85f4678d4b9edb19725b6c2168dc706d5b54.tar.zst gsoc2013-epiphany-a49c85f4678d4b9edb19725b6c2168dc706d5b54.zip |
Keep a ref on EmbedPersist while save is in progress.
2003-03-15 Marco Pesenti Gritti <marco@it.gnome.org>
* embed/ephy-embed-persist.c: (ephy_embed_persist_init),
(ephy_embed_persist_finalize):
* embed/mozilla/ProgressListener.cpp:
* embed/mozilla/mozilla-embed-persist.cpp:
* embed/mozilla/mozilla-embed-persist.h:
Keep a ref on EmbedPersist while save is in progress.
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | embed/ephy-embed-persist.c | 6 | ||||
-rw-r--r-- | embed/mozilla/ProgressListener.cpp | 18 | ||||
-rw-r--r-- | embed/mozilla/mozilla-embed-persist.cpp | 11 | ||||
-rw-r--r-- | embed/mozilla/mozilla-embed-persist.h | 2 |
5 files changed, 42 insertions, 5 deletions
@@ -1,3 +1,13 @@ +2003-03-15 Marco Pesenti Gritti <marco@it.gnome.org> + + * embed/ephy-embed-persist.c: (ephy_embed_persist_init), + (ephy_embed_persist_finalize): + * embed/mozilla/ProgressListener.cpp: + * embed/mozilla/mozilla-embed-persist.cpp: + * embed/mozilla/mozilla-embed-persist.h: + + Keep a ref on EmbedPersist while save is in progress. + 2003-03-15 Christian Persch <christian@hpersch.de> * embed/ephy-embed-utils.c: (ephy_embed_utils_save): diff --git a/embed/ephy-embed-persist.c b/embed/ephy-embed-persist.c index 33b5b7eb7..08dfd025b 100644 --- a/embed/ephy-embed-persist.c +++ b/embed/ephy-embed-persist.c @@ -19,7 +19,7 @@ #include <config.h> #include "ephy-embed-persist.h" - +#include "ephy-debug.h" #include "mozilla-embed.h" #include "mozilla-embed-persist.h" @@ -281,6 +281,8 @@ ephy_embed_persist_init (EphyEmbedPersist *persist) persist->priv->src = NULL; persist->priv->dir = NULL; persist->priv->handler = NULL; + + LOG ("Embed persist init") } static void @@ -306,6 +308,8 @@ ephy_embed_persist_finalize (GObject *object) g_free (persist->priv); + LOG ("Embed persist finalize") + G_OBJECT_CLASS (parent_class)->finalize (object); } diff --git a/embed/mozilla/ProgressListener.cpp b/embed/mozilla/ProgressListener.cpp index 039e9af40..f0d719669 100644 --- a/embed/mozilla/ProgressListener.cpp +++ b/embed/mozilla/ProgressListener.cpp @@ -647,6 +647,9 @@ nsresult GProgressListener::Resume (void) nsresult GProgressListener::Abort (void) { + PRBool notify; + + notify = (mAction == ACTION_OBJECT_NOTIFY); mAction = ACTION_NONE; if (mIsPaused) @@ -666,17 +669,24 @@ nsresult GProgressListener::Abort (void) if (mPersist) { - return mPersist->CancelSave (); + mPersist->CancelSave (); } - - if (mLauncher) + else if (mLauncher) { - return mLauncher->Cancel (); + mLauncher->Cancel (); } else { return NS_ERROR_FAILURE; } + + if (notify) + { + mozilla_embed_persist_cancelled + (MOZILLA_EMBED_PERSIST (mEphyPersist)); + } + + return NS_OK; } NS_DEF_FACTORY (GProgressListener, GProgressListener); diff --git a/embed/mozilla/mozilla-embed-persist.cpp b/embed/mozilla/mozilla-embed-persist.cpp index a2db4ac4a..2b19bcc69 100644 --- a/embed/mozilla/mozilla-embed-persist.cpp +++ b/embed/mozilla/mozilla-embed-persist.cpp @@ -122,6 +122,13 @@ void mozilla_embed_persist_completed (MozillaEmbedPersist *persist) { g_signal_emit_by_name (persist, "completed"); + g_object_unref (persist); +} + +void +mozilla_embed_persist_cancelled (MozillaEmbedPersist *persist) +{ + g_object_unref (persist); } static gresult @@ -133,6 +140,8 @@ impl_cancel (EphyEmbedPersist *persist) bpersist->CancelSave (); + g_object_unref (persist); + return G_OK; } @@ -147,6 +156,8 @@ impl_save (EphyEmbedPersist *persist) EphyEmbed *embed; EmbedPersistFlags flags; EphyWrapper *wrapper = NULL; + + g_object_ref (persist); g_object_get (persist, "source", &uri, diff --git a/embed/mozilla/mozilla-embed-persist.h b/embed/mozilla/mozilla-embed-persist.h index d65170eda..7abd11e68 100644 --- a/embed/mozilla/mozilla-embed-persist.h +++ b/embed/mozilla/mozilla-embed-persist.h @@ -53,6 +53,8 @@ GType mozilla_embed_persist_get_type (void); void mozilla_embed_persist_completed (MozillaEmbedPersist *persist); +void mozilla_embed_persist_cancelled (MozillaEmbedPersist *persist); + G_END_DECLS #endif |