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 307175 d480d30a74c30a6dc94b02e5bc20dee10285b10d
parent 307174 ed4692732f03938009108bb32417ce189f5a3635
child 307176 80b2d8a0999e03ef669bff6ddf7e628a26355b60
push id30506
push usercbook@mozilla.com
push dateFri, 29 Jul 2016 09:56:58 +0000
treeherdermozilla-central@2ea3d51ba1bb [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;