Bug 1288915 P1 Make nsExternalAppHandler respect existing channel ApplyConversion flag. r=jdm
authorBen Kelly <ben@wanderview.com>
Thu, 28 Jul 2016 15:51:49 -0400
changeset 332239 d480d30a74c30a6dc94b02e5bc20dee10285b10d
parent 332238 ed4692732f03938009108bb32417ce189f5a3635
child 332240 80b2d8a0999e03ef669bff6ddf7e628a26355b60
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)
reviewersjdm
bugs1288915
milestone50.0a1
Bug 1288915 P1 Make nsExternalAppHandler respect existing channel ApplyConversion flag. r=jdm
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;