From: =?UTF-8?q?Rafael=20=C3=81vila=20de=20Esp=C3=ADndola?= <respindola@mozilla.com>
Date: Fri, 9 Sep 2011 19:01:16 -0400
Subject: Bug 663899 - Use the win temp file handling code in all platforms.
 r=smichaud. a=LegNeato.

---
 .../exthandler/nsExternalHelperAppService.cpp      |   10 +---------
 1 files changed, 1 insertions(+), 9 deletions(-)

diff --git a/uriloader/exthandler/nsExternalHelperAppService.cpp b/uriloader/exthandler/nsExternalHelperAppService.cpp
index a233378..cb7496f 100644
--- a/uriloader/exthandler/nsExternalHelperAppService.cpp
+++ b/uriloader/exthandler/nsExternalHelperAppService.cpp
@@ -1338,8 +1338,7 @@ nsresult nsExternalAppHandler::SetUpTempFile(nsIChannel * aChannel)
     tempLeafName.Append(ext);
   }
 
-#ifdef XP_WIN
-  // On windows, we need to temporarily create a dummy file with the correct
+  // We need to temporarily create a dummy file with the correct
   // file extension to determine the executable-ness, so do this before adding
   // the extra .part extension.
   nsCOMPtr<nsIFile> dummyFile;
@@ -1355,7 +1354,6 @@ nsresult nsExternalAppHandler::SetUpTempFile(nsIChannel * aChannel)
   // Store executable-ness then delete
   dummyFile->IsExecutable(&mTempFileIsExecutable);
   dummyFile->Remove(PR_FALSE);
-#endif
 
   // Add an additional .part to prevent the OS from running this file in the
   // default application.
@@ -1367,12 +1365,6 @@ nsresult nsExternalAppHandler::SetUpTempFile(nsIChannel * aChannel)
   rv = mTempFile->CreateUnique(nsIFile::NORMAL_FILE_TYPE, 0600);
   NS_ENSURE_SUCCESS(rv, rv);
 
-#ifndef XP_WIN
-  // On other platforms, the file permission bits are used, so we can just call
-  // IsExecutable
-  mTempFile->IsExecutable(&mTempFileIsExecutable);
-#endif
-
 #ifdef XP_MACOSX
   // Now that the file exists set Mac type if the file has no extension
   // and we can determine a type.
