diff options
Diffstat (limited to 'embed/mozilla/MozDownload.cpp')
-rw-r--r-- | embed/mozilla/MozDownload.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/embed/mozilla/MozDownload.cpp b/embed/mozilla/MozDownload.cpp index 63901ee35..875d11e3b 100644 --- a/embed/mozilla/MozDownload.cpp +++ b/embed/mozilla/MozDownload.cpp @@ -385,10 +385,13 @@ MozDownload::Resume() nsresult InitiateMozillaDownload (nsIDOMDocument *domDocument, nsIURI *sourceURI, nsILocalFile* inDestFile, const char *contentType, nsIURI* inOriginalURI, MozillaEmbedPersist *embedPersist, - PRBool bypassCache, nsIInputStream *postData) + nsIInputStream *postData, nsISupports *aCacheKey) { nsresult rv = NS_OK; + EmbedPersistFlags ephy_flags; + ephy_flags = ephy_embed_persist_get_flags (EPHY_EMBED_PERSIST (embedPersist)); + PRBool isHTML = (domDocument && contentType && (strcmp (contentType, "text/html") == 0 || strcmp (contentType, "text/xml") == 0 || @@ -410,20 +413,15 @@ nsresult InitiateMozillaDownload (nsIDOMDocument *domDocument, nsIURI *sourceURI PRInt32 flags = nsIWebBrowserPersist::PERSIST_FLAGS_NO_CONVERSION | nsIWebBrowserPersist::PERSIST_FLAGS_REPLACE_EXISTING_FILES; - if (bypassCache) - { - flags |= nsIWebBrowserPersist::PERSIST_FLAGS_BYPASS_CACHE; - } - else + if (ephy_flags & EMBED_PERSIST_COPY_PAGE) { flags |= nsIWebBrowserPersist::PERSIST_FLAGS_FROM_CACHE; } - webPersist->SetPersistFlags(flags); - - if (!isHTML) + + if (!isHTML || ephy_flags & EMBED_PERSIST_COPY_PAGE) { - rv = webPersist->SaveURI (sourceURI, nsnull, nsnull, + rv = webPersist->SaveURI (sourceURI, aCacheKey, nsnull, postData, nsnull, inDestFile); } else |