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 347205 d480d30a74c30a6dc94b02e5bc20dee10285b10d
parent 347204 ed4692732f03938009108bb32417ce189f5a3635
child 347206 80b2d8a0999e03ef669bff6ddf7e628a26355b60
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdm
bugs1288915
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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;