Bug 1519902 - Use current document for imageCache.findEntryProperties(). r=IanN
authorFrank-Rainer Grahl <frgrahl@gmx.net>
Mon, 14 Jan 2019 23:49:44 +0100
changeset 34197 54b1c3f11deed0f6d3e0053e954dd346504de8a6
parent 34196 5efd0e02c927c51458e650d476bd7b4f4f42697c
child 34198 4c5966ac10c42244bb46dadbddf9135d5155edaf
push id389
push userclokep@gmail.com
push dateMon, 18 Mar 2019 19:01:53 +0000
reviewersIanN
bugs1519902, 1202085
Bug 1519902 - Use current document for imageCache.findEntryProperties(). r=IanN Port Bug 1202085 part 2 [Do not store images that have been synthesized by a service worker in the image cache].
suite/base/content/nsContextMenu.js
--- a/suite/base/content/nsContextMenu.js
+++ b/suite/base/content/nsContextMenu.js
@@ -84,17 +84,17 @@ nsContextMenu.prototype = {
 
     var contentType = null;
     var contentDisposition = null;
     if (this.onImage) {
       try {
         let imageCache = Cc["@mozilla.org/image/tools;1"]
                            .getService(Ci.imgITools)
                            .getImgCacheForDocument(doc);
-        let props = imageCache.findEntryProperties(popupNode.currentURI);
+        let props = imageCache.findEntryProperties(popupNode.currentURI, doc);
         if (props) {
           let nsISupportsCString = Ci.nsISupportsCString;
           contentType = props.get("type", nsISupportsCString).data;
           try {
             contentDisposition = props.get("content-disposition",
                                            nsISupportsCString).data;
           } catch (e) {}
         }