Bug 1289944 - Remove now-unneeded blob URL hack for favicons. r=felipe
authorBlake Kaplan <mrbkap@gmail.com>
Wed, 27 Jul 2016 16:47:50 -0700
changeset 332226 ec1fa4b01b12b1dc30455057dba7d089df133954
parent 332225 03c7ee730909e99ec0b88c1ff41025a9e2b669c4
child 332227 0a1c5b06f3da3ef1e72ea5e82d6724521868fedb
push id9858
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 14:37:10 +0000
treeherdermozilla-aurora@203106ef6cb6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfelipe
bugs1289944
milestone50.0a1
Bug 1289944 - Remove now-unneeded blob URL hack for favicons. r=felipe
browser/modules/ContentLinkHandler.jsm
--- a/browser/modules/ContentLinkHandler.jsm
+++ b/browser/modules/ContentLinkHandler.jsm
@@ -103,47 +103,19 @@ this.ContentLinkHandler = {
                 }
               }
             }
           } else {
             sizesType = SIZES_TELEMETRY_ENUM.NO_SIZES;
           }
           sizeHistogramTypes.add(sizesType);
 
-	  if (uri.scheme == 'blob') {
-            // Blob URLs don't work cross process, work around this by sending as a data uri
-            let channel = NetUtil.newChannel({
-              uri: uri,
-              contentPolicyType: Ci.nsIContentPolicy.TYPE_INTERNAL_IMAGE,
-              loadUsingSystemPrincipal: true
-            });
-            let listener = {
-              encoded: "",
-              bis: null,
-              onStartRequest: function(aRequest, aContext) {
-                this.bis = Components.classes["@mozilla.org/binaryinputstream;1"]
-                    .createInstance(Components.interfaces.nsIBinaryInputStream);
-              },
-              onStopRequest: function(aRequest, aContext, aStatusCode) {
-                let spec = "data:" + channel.contentType + ";base64," + this.encoded;
-                chromeGlobal.sendAsyncMessage(
-                  "Link:SetIcon",
-                  {url: spec, loadingPrincipal: link.ownerDocument.nodePrincipal});
-              },
-              onDataAvailable: function(request, context, inputStream, offset, count) {
-                this.bis.setInputStream(inputStream);
-                this.encoded += btoa(this.bis.readBytes(this.bis.available()));
-              }
-            }
-            channel.asyncOpen2(listener);
-          } else {
-            chromeGlobal.sendAsyncMessage(
-              "Link:SetIcon",
-              {url: uri.spec, loadingPrincipal: link.ownerDocument.nodePrincipal});
-          }
+          chromeGlobal.sendAsyncMessage(
+            "Link:SetIcon",
+            {url: uri.spec, loadingPrincipal: link.ownerDocument.nodePrincipal});
           iconAdded = true;
           break;
         case "search":
           if (!searchAdded && event.type == "DOMLinkAdded") {
             var type = link.type && link.type.toLowerCase();
             type = type.replace(/^\s+|\s*(?:;.*)?$/g, "");
 
             let re = /^(?:https?|ftp):/i;