Bug 1288915 - Part 1: Make nsExternalAppHandler respect existing channel ApplyConversion flag. r=jdm, a=sledru
authorBen Kelly <ben@wanderview.com>
Thu, 28 Jul 2016 15:51:49 -0400
changeset 340147 bfb16f4837b7c239a181f317e79ed9ac79b31c87
parent 340146 b8fa569b3a324ba3f18be3ecf314029210aab3f4
child 340148 ef0e06a0e51afd014ba6f880f686dbb1c3a00272
push id6249
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 13:59:36 +0000
treeherdermozilla-beta@bad9d4f5bf7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdm, sledru
bugs1288915
milestone49.0a2
Bug 1288915 - Part 1: Make nsExternalAppHandler respect existing channel ApplyConversion flag. r=jdm, a=sledru
uriloader/exthandler/nsExternalHelperAppService.cpp
--- a/uriloader/exthandler/nsExternalHelperAppService.cpp
+++ b/uriloader/exthandler/nsExternalHelperAppService.cpp
@@ -1564,16 +1564,23 @@ nsExternalAppHandler::MaybeApplyDecoding
   nsCOMPtr<nsIEncodedChannel> encChannel = do_QueryInterface(aRequest);
   if (!encChannel) {
     return;
   }
 
   // Turn off content encoding conversions if needed
   bool applyConversion = true;
 
+  // First, check to see if conversion is already disabled.  If so, we
+  // have nothing to do here.
+  encChannel->GetApplyConversion(&applyConversion);
+  if (!applyConversion) {
+    return;
+  }
+
   nsCOMPtr<nsIURL> sourceURL(do_QueryInterface(mSourceUrl));
   if (sourceURL)
   {
     nsAutoCString extension;
     sourceURL->GetFileExtension(extension);
     if (!extension.IsEmpty())
     {
       nsCOMPtr<nsIUTF8StringEnumerator> encEnum;