Skip to content

Commit 3f2298c

Browse files
committed
Bug 1457411 - Update netwerk module to make use of newer methods introduced with c++11 and c++14. r=valentin
MozReview-Commit-ID: 666LNaHyiuQ --HG-- extra : rebase_source : f3a24e0342d8dcdf9020dd473bc6b1045cbc533b
1 parent 8de2cba commit 3f2298c

File tree

252 files changed

+587
-1012
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

252 files changed

+587
-1012
lines changed

netwerk/base/ARefBase.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ namespace mozilla { namespace net {
1919
class ARefBase
2020
{
2121
public:
22-
ARefBase() {}
23-
virtual ~ARefBase() {}
22+
ARefBase() = default;
23+
virtual ~ARefBase() = default;
2424

2525
NS_INLINE_DECL_PURE_VIRTUAL_REFCOUNTING
2626
};

netwerk/base/ArrayBufferInputStream.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class ArrayBufferInputStream : public nsIArrayBufferInputStream {
3030
NS_DECL_NSIINPUTSTREAM
3131

3232
private:
33-
virtual ~ArrayBufferInputStream() {}
33+
virtual ~ArrayBufferInputStream() = default;
3434
mozilla::UniquePtr<char[]> mArrayBuffer;
3535
uint32_t mBufferLength;
3636
uint32_t mPos;

netwerk/base/BackgroundFileSaver.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -918,10 +918,6 @@ BackgroundFileSaverOutputStream::BackgroundFileSaverOutputStream()
918918
{
919919
}
920920

921-
BackgroundFileSaverOutputStream::~BackgroundFileSaverOutputStream()
922-
{
923-
}
924-
925921
bool
926922
BackgroundFileSaverOutputStream::HasInfiniteBuffer()
927923
{
@@ -1023,10 +1019,6 @@ BackgroundFileSaverStreamListener::BackgroundFileSaverStreamListener()
10231019
{
10241020
}
10251021

1026-
BackgroundFileSaverStreamListener::~BackgroundFileSaverStreamListener()
1027-
{
1028-
}
1029-
10301022
bool
10311023
BackgroundFileSaverStreamListener::HasInfiniteBuffer()
10321024
{

netwerk/base/BackgroundFileSaver.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ class BackgroundFileSaverOutputStream : public BackgroundFileSaver
312312
virtual nsAsyncCopyProgressFun GetProgressCallback() override;
313313

314314
private:
315-
~BackgroundFileSaverOutputStream();
315+
~BackgroundFileSaverOutputStream() = default;
316316

317317
/**
318318
* Original callback provided to our AsyncWait wrapper.
@@ -339,7 +339,7 @@ class BackgroundFileSaverStreamListener final : public BackgroundFileSaver
339339
virtual nsAsyncCopyProgressFun GetProgressCallback() override;
340340

341341
private:
342-
~BackgroundFileSaverStreamListener();
342+
~BackgroundFileSaverStreamListener() = default;
343343

344344
/**
345345
* Protects the state related to whether the request should be suspended.
@@ -385,15 +385,15 @@ class DigestOutputStream : public nsIOutputStream
385385
DigestOutputStream(nsIOutputStream* outputStream, PK11Context* aContext);
386386

387387
private:
388-
virtual ~DigestOutputStream() {}
388+
virtual ~DigestOutputStream() = default;
389389

390390
// Calls to write are passed to this stream.
391391
nsCOMPtr<nsIOutputStream> mOutputStream;
392392
// Digest context used to compute the hash, owned by the caller.
393393
PK11Context* mDigestContext;
394394

395395
// Don't accidentally copy construct.
396-
DigestOutputStream(const DigestOutputStream& d);
396+
DigestOutputStream(const DigestOutputStream& d) = delete;
397397
};
398398

399399
} // namespace net

netwerk/base/ChannelDiverterChild.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,5 @@
1515
namespace mozilla {
1616
namespace net {
1717

18-
ChannelDiverterChild::ChannelDiverterChild()
19-
{
20-
}
21-
22-
ChannelDiverterChild::~ChannelDiverterChild()
23-
{
24-
}
25-
2618
} // namespace net
2719
} // namespace mozilla

netwerk/base/ChannelDiverterChild.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ class ChannelDiverterChild :
1616
public PChannelDiverterChild
1717
{
1818
public:
19-
ChannelDiverterChild();
20-
virtual ~ChannelDiverterChild();
19+
ChannelDiverterChild() = default;
20+
virtual ~ChannelDiverterChild() = default;
2121
};
2222

2323
} // namespace net

netwerk/base/ChannelDiverterParent.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,6 @@
1515
namespace mozilla {
1616
namespace net {
1717

18-
ChannelDiverterParent::ChannelDiverterParent()
19-
{
20-
}
21-
22-
ChannelDiverterParent::~ChannelDiverterParent()
23-
{
24-
}
25-
2618
bool
2719
ChannelDiverterParent::Init(const ChannelDiverterArgs& aArgs)
2820
{

netwerk/base/ChannelDiverterParent.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ class ChannelDiverterParent :
2121
public PChannelDiverterParent
2222
{
2323
public:
24-
ChannelDiverterParent();
25-
virtual ~ChannelDiverterParent();
24+
ChannelDiverterParent() = default;
25+
virtual ~ChannelDiverterParent() = default;
2626

2727
bool Init(const ChannelDiverterArgs& aArgs);
2828

netwerk/base/Dashboard.cpp

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ class SocketData
5050
nsIEventTarget *mEventTarget;
5151

5252
private:
53-
virtual ~SocketData()
54-
{
55-
}
53+
virtual ~SocketData() = default;
5654
};
5755

5856
static void GetErrorString(nsresult rv, nsAString& errorString);
@@ -63,9 +61,7 @@ NS_IMPL_ISUPPORTS0(SocketData)
6361
class HttpData
6462
: public nsISupports
6563
{
66-
virtual ~HttpData()
67-
{
68-
}
64+
virtual ~HttpData() = default;
6965

7066
public:
7167
NS_DECL_THREADSAFE_ISUPPORTS
@@ -86,9 +82,7 @@ NS_IMPL_ISUPPORTS0(HttpData)
8682
class WebSocketRequest
8783
: public nsISupports
8884
{
89-
virtual ~WebSocketRequest()
90-
{
91-
}
85+
virtual ~WebSocketRequest() = default;
9286

9387
public:
9488
NS_DECL_THREADSAFE_ISUPPORTS
@@ -108,9 +102,7 @@ NS_IMPL_ISUPPORTS0(WebSocketRequest)
108102
class DnsData
109103
: public nsISupports
110104
{
111-
virtual ~DnsData()
112-
{
113-
}
105+
virtual ~DnsData() = default;
114106

115107
public:
116108
NS_DECL_THREADSAFE_ISUPPORTS
@@ -182,9 +174,7 @@ NS_IMPL_ISUPPORTS(ConnectionData, nsITransportEventSink, nsITimerCallback, nsINa
182174
class RcwnData
183175
: public nsISupports
184176
{
185-
virtual ~RcwnData()
186-
{
187-
}
177+
virtual ~RcwnData() = default;
188178

189179
public:
190180
NS_DECL_THREADSAFE_ISUPPORTS
@@ -265,9 +255,7 @@ class LookupHelper;
265255
class LookupArgument
266256
: public nsISupports
267257
{
268-
virtual ~LookupArgument()
269-
{
270-
}
258+
virtual ~LookupArgument() = default;
271259

272260
public:
273261
NS_DECL_THREADSAFE_ISUPPORTS
@@ -299,8 +287,7 @@ class LookupHelper final
299287
NS_DECL_THREADSAFE_ISUPPORTS
300288
NS_DECL_NSIDNSLISTENER
301289

302-
LookupHelper() {
303-
}
290+
LookupHelper() = default;
304291

305292
nsresult ConstructAnswer(LookupArgument *aArgument);
306293
public:
@@ -377,10 +364,6 @@ Dashboard::Dashboard()
377364
mEnableLogging = false;
378365
}
379366

380-
Dashboard::~Dashboard()
381-
{
382-
}
383-
384367
NS_IMETHODIMP
385368
Dashboard::RequestSockets(NetDashboardCallback *aCallback)
386369
{
@@ -1021,9 +1004,9 @@ ErrorEntry socketTransportStatuses[] = {
10211004
static void
10221005
GetErrorString(nsresult rv, nsAString& errorString)
10231006
{
1024-
for (size_t i = 0; i < ArrayLength(socketTransportStatuses); ++i) {
1025-
if (socketTransportStatuses[i].key == rv) {
1026-
errorString.AssignASCII(socketTransportStatuses[i].error);
1007+
for (auto& socketTransportStatus : socketTransportStatuses) {
1008+
if (socketTransportStatus.key == rv) {
1009+
errorString.AssignASCII(socketTransportStatus.error);
10271010
return;
10281011
}
10291012
}

netwerk/base/Dashboard.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class Dashboard final
8484
WebSocketData mWs;
8585

8686
private:
87-
virtual ~Dashboard();
87+
virtual ~Dashboard() = default;
8888

8989
nsresult GetSocketsDispatch(SocketData *);
9090
nsresult GetHttpDispatch(HttpData *);

0 commit comments

Comments
 (0)