Skip to content

Commit b224a74

Browse files
committed
Bug 1617334 - Remove nsAutoPtr usage from toolkit. r=gsvelto
Differential Revision: https://phabricator.services.mozilla.com/D63746 --HG-- extra : moz-landing-system : lando
1 parent f6f3900 commit b224a74

File tree

18 files changed

+25
-37
lines changed

18 files changed

+25
-37
lines changed

toolkit/components/autocomplete/nsAutoCompleteController.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#include "nsAutoCompleteController.h"
77
#include "nsAutoCompleteSimpleResult.h"
88

9-
#include "nsAutoPtr.h"
109
#include "nsNetCID.h"
1110
#include "nsIIOService.h"
1211
#include "nsReadableUtils.h"

toolkit/components/browser/nsWebBrowser.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include "nsDocShellTreeOwner.h"
1212

1313
// Core Includes
14-
#include "nsAutoPtr.h"
1514
#include "nsCOMPtr.h"
1615
#include "nsCycleCollectionParticipant.h"
1716

toolkit/components/downloads/DownloadPlatform.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

55
#include "DownloadPlatform.h"
6-
#include "nsAutoPtr.h"
76
#include "nsNetUtil.h"
87
#include "nsString.h"
98
#include "nsINestedURI.h"

toolkit/components/filewatcher/NativeFileWatcherWin.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
#include "mozilla/Services.h"
1313
#include "mozilla/UniquePtr.h"
14-
#include "nsAutoPtr.h"
1514
#include "nsClassHashtable.h"
1615
#include "nsComponentManagerUtils.h"
1716
#include "nsDataHashtable.h"
@@ -554,7 +553,7 @@ nsresult NativeFileWatcherIOTask::AddPathRunnableMethod(
554553
PathRunnablesParametersWrapper* aWrappedParameters) {
555554
MOZ_ASSERT(!NS_IsMainThread());
556555

557-
nsAutoPtr<PathRunnablesParametersWrapper> wrappedParameters(
556+
UniquePtr<PathRunnablesParametersWrapper> wrappedParameters(
558557
aWrappedParameters);
559558

560559
// We return immediately if |mShuttingDown| is true (see below for
@@ -725,7 +724,7 @@ nsresult NativeFileWatcherIOTask::RemovePathRunnableMethod(
725724
PathRunnablesParametersWrapper* aWrappedParameters) {
726725
MOZ_ASSERT(!NS_IsMainThread());
727726

728-
nsAutoPtr<PathRunnablesParametersWrapper> wrappedParameters(
727+
UniquePtr<PathRunnablesParametersWrapper> wrappedParameters(
729728
aWrappedParameters);
730729

731730
// We return immediately if |mShuttingDown| is true (see below for

toolkit/components/parentalcontrols/nsParentalControlsService.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
#include "nsIParentalControlsService.h"
1010
#include "nsCOMPtr.h"
11-
#include "nsAutoPtr.h"
1211
#include "nsIURI.h"
1312

1413
#if defined(XP_WIN)

toolkit/components/places/PlaceInfo.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include "mozIAsyncHistory.h"
99
#include "nsString.h"
1010
#include "nsTArray.h"
11-
#include "nsAutoPtr.h"
1211
#include "mozilla/Attributes.h"
1312

1413
class nsIURI;

toolkit/components/places/VisitInfo.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#define mozilla_places_VisitInfo_h__
77

88
#include "mozIAsyncHistory.h"
9-
#include "nsAutoPtr.h"
109
#include "mozilla/Attributes.h"
1110

1211
class nsIURI;

toolkit/components/remote/nsRemoteService.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@
2626
#endif
2727
#include "nsRemoteService.h"
2828

29-
#include "nsAutoPtr.h"
3029
#include "nsIObserverService.h"
3130
#include "nsString.h"
3231
#include "nsServiceManagerUtils.h"
3332
#include "mozilla/ModuleUtils.h"
3433
#include "SpecialSystemDirectory.h"
3534
#include "mozilla/CmdLineAndEnvUtils.h"
35+
#include "mozilla/UniquePtr.h"
3636

3737
// Time to wait for the remoting service to start
3838
#define START_TIMEOUT_SEC 5
@@ -99,23 +99,23 @@ RemoteResult nsRemoteService::StartClient(const char* aDesktopStartupID) {
9999
return REMOTE_NOT_FOUND;
100100
}
101101

102-
nsAutoPtr<nsRemoteClient> client;
102+
UniquePtr<nsRemoteClient> client;
103103

104104
#ifdef MOZ_WIDGET_GTK
105105
bool useX11Remote = GDK_IS_X11_DISPLAY(gdk_display_get_default());
106106

107107
# if defined(MOZ_ENABLE_DBUS)
108108
if (!useX11Remote || getenv(DBUS_REMOTE_ENV)) {
109-
client = new nsDBusRemoteClient();
109+
client = MakeUnique<nsDBusRemoteClient>();
110110
}
111111
# endif
112112
if (!client && useX11Remote) {
113-
client = new nsXRemoteClient();
113+
client = MakeUnique<nsXRemoteClient>();
114114
}
115115
#elif defined(XP_WIN)
116-
client = new nsWinRemoteClient();
116+
client = MakeUnique<nsWinRemoteClient>();
117117
#elif defined(XP_DARWIN)
118-
client = new nsMacRemoteClient();
118+
client = MakeUnique<nsMacRemoteClient>();
119119
#else
120120
return REMOTE_NOT_FOUND;
121121
#endif

toolkit/components/reputationservice/ApplicationReputation.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
#include "mozilla/TimeStamp.h"
3737
#include "mozilla/intl/LocaleService.h"
3838

39-
#include "nsAutoPtr.h"
4039
#include "nsCOMPtr.h"
4140
#include "nsDebug.h"
4241
#include "nsDependentSubstring.h"

toolkit/components/sessionstore/SessionStoreUtils.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "mozilla/dom/XPathResult.h"
1818
#include "mozilla/dom/XPathEvaluator.h"
1919
#include "mozilla/dom/XPathExpression.h"
20+
#include "mozilla/UniquePtr.h"
2021
#include "nsCharSeparatedTokenizer.h"
2122
#include "nsContentList.h"
2223
#include "nsContentUtils.h"
@@ -991,7 +992,7 @@ static Element* FindNodeByXPath(JSContext* aCx, Document& aDocument,
991992
const nsAString& aExpression) {
992993
FormDataParseContext parsingContext(aDocument.IsHTMLDocument());
993994
IgnoredErrorResult rv;
994-
nsAutoPtr<XPathExpression> expression(
995+
UniquePtr<XPathExpression> expression(
995996
aDocument.XPathEvaluator()->CreateExpression(aExpression, &parsingContext,
996997
&aDocument, rv));
997998
if (rv.Failed()) {

0 commit comments

Comments
 (0)