aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-05-04 03:04:42 +0800
committerChristian Persch <chpe@src.gnome.org>2004-05-04 03:04:42 +0800
commit712581b3a006dbe65d2a5c6571960c82497fb4f2 (patch)
tree2b24316a9d20bcf6228e71927241aa73993fa0e9 /embed
parent85a16225477518004481d8ae8cb98b6d1b216c84 (diff)
downloadgsoc2013-epiphany-712581b3a006dbe65d2a5c6571960c82497fb4f2.tar
gsoc2013-epiphany-712581b3a006dbe65d2a5c6571960c82497fb4f2.tar.gz
gsoc2013-epiphany-712581b3a006dbe65d2a5c6571960c82497fb4f2.tar.bz2
gsoc2013-epiphany-712581b3a006dbe65d2a5c6571960c82497fb4f2.tar.lz
gsoc2013-epiphany-712581b3a006dbe65d2a5c6571960c82497fb4f2.tar.xz
gsoc2013-epiphany-712581b3a006dbe65d2a5c6571960c82497fb4f2.tar.zst
gsoc2013-epiphany-712581b3a006dbe65d2a5c6571960c82497fb4f2.zip
Whenever we have one, pass the cache key to the persist object. That way
2004-05-03 Christian Persch <chpe@cvs.gnome.org> * embed/mozilla/mozilla-embed-persist.cpp: Whenever we have one, pass the cache key to the persist object. That way we don't re-fetch the page on save. Fixes bug #141652.
Diffstat (limited to 'embed')
-rw-r--r--embed/mozilla/mozilla-embed-persist.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/embed/mozilla/mozilla-embed-persist.cpp b/embed/mozilla/mozilla-embed-persist.cpp
index 41b7ffd4b..87c8dc7ce 100644
--- a/embed/mozilla/mozilla-embed-persist.cpp
+++ b/embed/mozilla/mozilla-embed-persist.cpp
@@ -228,12 +228,17 @@ impl_save (EphyEmbedPersist *persist)
/* Get the current page descriptor */
nsCOMPtr<nsISupports> pageDescriptor;
- if (flags & EMBED_PERSIST_COPY_PAGE)
+ if (browser)
{
browser->GetPageDescriptor(getter_AddRefs(pageDescriptor));
- NS_ENSURE_TRUE (pageDescriptor, FALSE);
}
+ /* if we have COPY_PAGE, we *need* to have a page descriptor, else we'll re-fetch
+ * the page, which will possibly give a different page than the original which we
+ * need for view source
+ */
+ NS_ENSURE_TRUE (!(flags & EMBED_PERSIST_COPY_PAGE) || pageDescriptor, FALSE);
+
if (filename == NULL)
{
/* Create an header sniffer and do the save */
@@ -247,7 +252,7 @@ impl_save (EphyEmbedPersist *persist)
if (!sniffer) return FALSE;
webPersist->SetProgressListener(sniffer);
- rv = webPersist->SaveURI(inURI, nsnull, nsnull, nsnull, nsnull, tmpFile);
+ rv = webPersist->SaveURI(inURI, pageDescriptor, nsnull, nsnull, nsnull, tmpFile);
if (NS_FAILED (rv)) return FALSE;
}
else