Bug 1626449 - Remove nsAutoPtr usage from dom/system. r=baku

Differential Revision: https://phabricator.services.mozilla.com/D69120
This commit is contained in:
Eric Rahm
2020-04-03 21:05:24 +00:00
parent 274904a42d
commit e74f0330ba

View File

@@ -4,7 +4,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsAutoPtr.h"
#include "nsCOMPtr.h" #include "nsCOMPtr.h"
#include "GeolocationPosition.h" #include "GeolocationPosition.h"
#include "nsIConsoleService.h" #include "nsIConsoleService.h"
@@ -14,6 +13,7 @@
#include "prtime.h" #include "prtime.h"
#include "mozilla/FloatingPoint.h" #include "mozilla/FloatingPoint.h"
#include "mozilla/Telemetry.h" #include "mozilla/Telemetry.h"
#include "mozilla/UniquePtr.h"
#include "mozilla/dom/GeolocationPositionErrorBinding.h" #include "mozilla/dom/GeolocationPositionErrorBinding.h"
#include "MLSFallback.h" #include "MLSFallback.h"
@@ -168,12 +168,12 @@ CoreLocationLocationProvider::CoreLocationLocationProvider()
NS_IMETHODIMP NS_IMETHODIMP
CoreLocationLocationProvider::Startup() { CoreLocationLocationProvider::Startup() {
if (!mCLObjects) { if (!mCLObjects) {
nsAutoPtr<CoreLocationObjects> clObjs(new CoreLocationObjects()); auto clObjs = MakeUnique<CoreLocationObjects>();
nsresult rv = clObjs->Init(this); nsresult rv = clObjs->Init(this);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
mCLObjects = clObjs.forget(); mCLObjects = clObjs.release();
} }
// Must be stopped before starting or response (success or failure) is not guaranteed // Must be stopped before starting or response (success or failure) is not guaranteed