Bug 1416174 - part 4 - OSFileConstants should use UniquePtr instead of nsAutoPtr, r=smaug
authorAndrea Marchesini <amarchesini@mozilla.com>
Fri, 10 Nov 2017 19:37:13 +0100
changeset 391225 05603dbb4dd866fd2c771bf7531251e9471b5b8c
parent 391224 a9246983376b7ed12da57765b3ad677342f9c234
child 391226 9ac3f44d3cc7b259904b9fce8d4291103856f0a1
push id97233
push useramarchesini@mozilla.com
push dateFri, 10 Nov 2017 18:37:29 +0000
treeherdermozilla-inbound@9ac3f44d3cc7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1416174
milestone58.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 1416174 - part 4 - OSFileConstants should use UniquePtr instead of nsAutoPtr, r=smaug
dom/system/OSFileConstants.cpp
dom/system/OSFileConstants.h
--- a/dom/system/OSFileConstants.cpp
+++ b/dom/system/OSFileConstants.cpp
@@ -58,24 +58,24 @@
 #include "nsIObserver.h"
 #include "nsDirectoryServiceUtils.h"
 #include "nsIXULRuntime.h"
 #include "nsIPropertyBag2.h"
 #include "nsXPCOMCIDInternal.h"
 #include "nsServiceManagerUtils.h"
 #include "nsString.h"
 #include "nsSystemInfo.h"
-#include "nsAutoPtr.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsXULAppAPI.h"
 #include "nsAppDirectoryServiceDefs.h"
 #include "mozJSComponentLoader.h"
 
 #include "mozilla/ClearOnShutdown.h"
 #include "mozilla/StaticPtr.h"
+#include "mozilla/UniquePtr.h"
 
 #include "OSFileConstants.h"
 #include "nsIOSFileConstantsService.h"
 #include "nsZipArchive.h"
 
 #if defined(__DragonFly__) || defined(__FreeBSD__) \
   || defined(__NetBSD__) || defined(__OpenBSD__)
 #define __dd_fd dd_fd
@@ -238,17 +238,17 @@ OSFileConstantsService::Observe(nsISuppo
 nsresult
 OSFileConstantsService::InitOSFileConstants()
 {
   MOZ_ASSERT(NS_IsMainThread());
   if (mInitialized) {
     return NS_OK;
   }
 
-  nsAutoPtr<Paths> paths(new Paths);
+  UniquePtr<Paths> paths(new Paths);
 
   // Initialize paths->libDir
   nsCOMPtr<nsIFile> file;
   nsresult rv = NS_GetSpecialDirectory(NS_XPCOM_LIBRARY_FILE, getter_AddRefs(file));
   if (NS_FAILED(rv)) {
     return rv;
   }
 
--- a/dom/system/OSFileConstants.h
+++ b/dom/system/OSFileConstants.h
@@ -39,17 +39,17 @@ private:
   InitOSFileConstants();
 
   OSFileConstantsService();
   ~OSFileConstantsService();
 
   bool mInitialized;
 
   struct Paths;
-  nsAutoPtr<Paths> mPaths;
+  UniquePtr<Paths> mPaths;
 
   /**
    * (Unix) the umask, which goes in OS.Constants.Sys but
    * can only be looked up (via the system-info service)
    * on the main thread.
    */
   uint32_t mUserUmask;
 };