author | Benoit Jacob <bjacob@mozilla.com> |
Tue, 24 Jun 2014 12:36:44 -0400 | |
changeset 190540 | ef6cb0f76224810fdaf44cd4c5164ff552e0ade0 |
parent 190539 | 236e0f562470a168fb21136e7ba799bde0d6b1c3 |
child 190541 | 831eb6e6ce071d354246116229dab72f87000a70 |
push id | 27009 |
push user | kwierso@gmail.com |
push date | Wed, 25 Jun 2014 01:13:54 +0000 |
treeherder | mozilla-central@a19e0434ea52 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | mcmanus |
bugs | 1028588 |
milestone | 33.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
|
--- a/netwerk/base/src/ArrayBufferInputStream.h +++ b/netwerk/base/src/ArrayBufferInputStream.h @@ -17,22 +17,22 @@ 0xaa1c, \ 0x41db, \ {0x87, 0xd0, 0x48, 0x76, 0x4a, 0x37, 0x10, 0xf6} \ } class ArrayBufferInputStream : public nsIArrayBufferInputStream { public: ArrayBufferInputStream(); - virtual ~ArrayBufferInputStream() {} NS_DECL_ISUPPORTS NS_DECL_NSIARRAYBUFFERINPUTSTREAM NS_DECL_NSIINPUTSTREAM private: + virtual ~ArrayBufferInputStream() {} mozilla::Maybe<JS::PersistentRooted<JS::Value> > mArrayBuffer; uint8_t* mBuffer; // start of actual buffer uint32_t mBufferLength; // length of slice uint32_t mOffset; // permanent offset from start of actual buffer uint32_t mPos; // offset from start of slice bool mClosed; };
--- a/netwerk/base/src/BackgroundFileSaver.h +++ b/netwerk/base/src/BackgroundFileSaver.h @@ -393,22 +393,23 @@ private: class DigestOutputStream : public nsNSSShutDownObject, public nsIOutputStream { public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIOUTPUTSTREAM // Constructor. Neither parameter may be null. The caller owns both. DigestOutputStream(nsIOutputStream* outputStream, PK11Context* aContext); - ~DigestOutputStream(); // We don't own any NSS objects here, so no need to clean up void virtualDestroyNSSReference() { } private: + ~DigestOutputStream(); + // Calls to write are passed to this stream. nsCOMPtr<nsIOutputStream> mOutputStream; // Digest context used to compute the hash, owned by the caller. PK11Context* mDigestContext; // Don't accidentally copy construct. DigestOutputStream(const DigestOutputStream& d); };
--- a/netwerk/base/src/Dashboard.cpp +++ b/netwerk/base/src/Dashboard.cpp @@ -34,123 +34,124 @@ public: SocketData() { mTotalSent = 0; mTotalRecv = 0; mThread = nullptr; } - virtual ~SocketData() - { - } - uint64_t mTotalSent; uint64_t mTotalRecv; nsTArray<SocketInfo> mData; nsMainThreadPtrHandle<NetDashboardCallback> mCallback; nsIThread *mThread; + +private: + virtual ~SocketData() + { + } }; NS_IMPL_ISUPPORTS0(SocketData) class HttpData : public nsISupports { + virtual ~HttpData() + { + } + public: NS_DECL_THREADSAFE_ISUPPORTS HttpData() { mThread = nullptr; } - virtual ~HttpData() - { - } - nsTArray<HttpRetParams> mData; nsMainThreadPtrHandle<NetDashboardCallback> mCallback; nsIThread *mThread; }; NS_IMPL_ISUPPORTS0(HttpData) class WebSocketRequest : public nsISupports { + virtual ~WebSocketRequest() + { + } + public: NS_DECL_THREADSAFE_ISUPPORTS WebSocketRequest() { mThread = nullptr; } - virtual ~WebSocketRequest() - { - } - nsMainThreadPtrHandle<NetDashboardCallback> mCallback; nsIThread *mThread; }; NS_IMPL_ISUPPORTS0(WebSocketRequest) class DnsData : public nsISupports { + virtual ~DnsData() + { + } + public: NS_DECL_THREADSAFE_ISUPPORTS DnsData() { mThread = nullptr; } - virtual ~DnsData() - { - } - nsTArray<DNSCacheEntries> mData; nsMainThreadPtrHandle<NetDashboardCallback> mCallback; nsIThread *mThread; }; NS_IMPL_ISUPPORTS0(DnsData) class ConnectionData : public nsITransportEventSink , public nsITimerCallback { + virtual ~ConnectionData() + { + if (mTimer) { + mTimer->Cancel(); + } + } + public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSITRANSPORTEVENTSINK NS_DECL_NSITIMERCALLBACK void StartTimer(uint32_t aTimeout); void StopTimer(); ConnectionData(Dashboard *target) { mThread = nullptr; mDashboard = target; } - virtual ~ConnectionData() - { - if (mTimer) { - mTimer->Cancel(); - } - } - nsCOMPtr<nsISocketTransport> mSocket; nsCOMPtr<nsIInputStream> mStreamIn; nsCOMPtr<nsITimer> mTimer; nsMainThreadPtrHandle<NetDashboardCallback> mCallback; nsIThread *mThread; Dashboard *mDashboard; nsCString mHost; @@ -223,53 +224,53 @@ ConnectionData::StopTimer() } class LookupHelper; class LookupArgument : public nsISupports { + virtual ~LookupArgument() + { + } + public: NS_DECL_THREADSAFE_ISUPPORTS LookupArgument(nsIDNSRecord *aRecord, LookupHelper *aHelper) { mRecord = aRecord; mHelper = aHelper; } - virtual ~LookupArgument() - { - } - nsCOMPtr<nsIDNSRecord> mRecord; nsRefPtr<LookupHelper> mHelper; }; NS_IMPL_ISUPPORTS0(LookupArgument) class LookupHelper : public nsIDNSListener { + virtual ~LookupHelper() + { + if (mCancel) { + mCancel->Cancel(NS_ERROR_ABORT); + } + } + public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIDNSLISTENER LookupHelper() { } - virtual ~LookupHelper() - { - if (mCancel) { - mCancel->Cancel(NS_ERROR_ABORT); - } - } - nsresult ConstructAnswer(LookupArgument *aArgument); public: nsCOMPtr<nsICancelable> mCancel; nsMainThreadPtrHandle<NetDashboardCallback> mCallback; nsIThread *mThread; nsresult mStatus; };
--- a/netwerk/base/src/EventTokenBucket.cpp +++ b/netwerk/base/src/EventTokenBucket.cpp @@ -30,20 +30,21 @@ namespace net { class TokenBucketCancelable : public nsICancelable { public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSICANCELABLE TokenBucketCancelable(class ATokenBucketEvent *event); - virtual ~TokenBucketCancelable() {} void Fire(); private: + virtual ~TokenBucketCancelable() {} + friend class EventTokenBucket; ATokenBucketEvent *mEvent; }; NS_IMPL_ISUPPORTS(TokenBucketCancelable, nsICancelable) TokenBucketCancelable::TokenBucketCancelable(ATokenBucketEvent *event) : mEvent(event)
--- a/netwerk/base/src/EventTokenBucket.h +++ b/netwerk/base/src/EventTokenBucket.h @@ -64,23 +64,24 @@ class ATokenBucketEvent public: virtual void OnTokenBucketAdmitted() = 0; }; class TokenBucketCancelable; class EventTokenBucket : public nsITimerCallback { + virtual ~EventTokenBucket(); + public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSITIMERCALLBACK // This should be constructed on the main thread EventTokenBucket(uint32_t eventsPerSecond, uint32_t burstSize); - virtual ~EventTokenBucket(); // These public methods are all meant to be called from the socket thread void ClearCredits(); uint32_t BurstEventsAvailable(); uint32_t QueuedEvents(); // a paused token bucket will not process any events, but it will accumulate // credits. ClearCredits can be used before unpausing if desired.
--- a/netwerk/base/src/Predictor.cpp +++ b/netwerk/base/src/Predictor.cpp @@ -145,16 +145,17 @@ class PredictorDNSListener : public nsID { public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIDNSLISTENER PredictorDNSListener() { } +private: virtual ~PredictorDNSListener() { } }; NS_IMPL_ISUPPORTS(PredictorDNSListener, nsIDNSListener); NS_IMETHODIMP PredictorDNSListener::OnLookupComplete(nsICancelable *request,
--- a/netwerk/base/src/Predictor.h +++ b/netwerk/base/src/Predictor.h @@ -44,23 +44,24 @@ class Predictor : public nsINetworkPredi public: NS_DECL_ISUPPORTS NS_DECL_NSINETWORKPREDICTOR NS_DECL_NSIOBSERVER NS_DECL_NSISPECULATIVECONNECTIONOVERRIDER NS_DECL_NSIINTERFACEREQUESTOR Predictor(); - virtual ~Predictor(); nsresult Init(); void Shutdown(); static nsresult Create(nsISupports *outer, const nsIID& iid, void **result); private: + virtual ~Predictor(); + friend class PredictionEvent; friend class LearnEvent; friend class PredictorResetEvent; friend class PredictionRunner; friend class PredictorDBShutdownRunner; friend class PredictorCommitTimerInitEvent; friend class PredictorNewTransactionEvent; friend class PredictorCleanupEvent;
--- a/netwerk/base/src/ProxyAutoConfig.cpp +++ b/netwerk/base/src/ProxyAutoConfig.cpp @@ -282,16 +282,19 @@ public: mTimer = nullptr; return NS_OK; } nsresult mStatus; nsCOMPtr<nsICancelable> mRequest; nsCOMPtr<nsIDNSRecord> mResponse; nsCOMPtr<nsITimer> mTimer; + +private: + ~PACResolver() {} }; NS_IMPL_ISUPPORTS(PACResolver, nsIDNSListener, nsITimerCallback) static void PACLogToConsole(nsString &aMessage) { nsCOMPtr<nsIConsoleService> consoleService = do_GetService(NS_CONSOLESERVICE_CONTRACTID);
--- a/netwerk/base/src/RedirectChannelRegistrar.h +++ b/netwerk/base/src/RedirectChannelRegistrar.h @@ -17,16 +17,19 @@ namespace net { class RedirectChannelRegistrar MOZ_FINAL : public nsIRedirectChannelRegistrar { NS_DECL_ISUPPORTS NS_DECL_NSIREDIRECTCHANNELREGISTRAR RedirectChannelRegistrar(); +private: + ~RedirectChannelRegistrar() {} + protected: typedef nsInterfaceHashtable<nsUint32HashKey, nsIChannel> ChannelHashtable; typedef nsInterfaceHashtable<nsUint32HashKey, nsIParentChannel> ParentChannelHashtable; ChannelHashtable mRealChannels; ParentChannelHashtable mParentChannels;
--- a/netwerk/base/src/StreamingProtocolService.h +++ b/netwerk/base/src/StreamingProtocolService.h @@ -14,20 +14,22 @@ namespace mozilla { namespace net { /** * This class implements a service to help to create streaming protocol controller. */ class StreamingProtocolControllerService : public nsIStreamingProtocolControllerService { +private: + virtual ~StreamingProtocolControllerService() {}; + public: NS_DECL_ISUPPORTS NS_DECL_NSISTREAMINGPROTOCOLCONTROLLERSERVICE StreamingProtocolControllerService() {}; - virtual ~StreamingProtocolControllerService() {}; static already_AddRefed<StreamingProtocolControllerService> GetInstance(); }; } // namespace dom } // namespace mozilla #endif //mozilla_net_StreamingProtocolControllerService_h
--- a/netwerk/base/src/Tickler.h +++ b/netwerk/base/src/Tickler.h @@ -61,27 +61,28 @@ namespace net { class Tickler MOZ_FINAL : public nsSupportsWeakReference { public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECLARE_STATIC_IID_ACCESSOR(NS_TICKLER_IID) // These methods are main thread only Tickler(); - ~Tickler(); void Cancel(); nsresult Init(); void SetIPV4Address(uint32_t address); void SetIPV4Port(uint16_t port); // Tickle the tickler to (re-)start the activity. // May call from any thread void Tickle(); private: + ~Tickler(); + friend class TicklerTimer; Mutex mLock; nsCOMPtr<nsIThread> mThread; nsCOMPtr<nsITimer> mTimer; nsCOMPtr<nsIPrefBranch> mPrefs; bool mActive; bool mCanceled; @@ -105,21 +106,21 @@ private: }; NS_DEFINE_STATIC_IID_ACCESSOR(Tickler, NS_TICKLER_IID) #else // not defined MOZ_USE_WIFI_TICKLER class Tickler MOZ_FINAL : public nsISupports { + ~Tickler() { } public: NS_DECL_THREADSAFE_ISUPPORTS Tickler() { } - ~Tickler() { } nsresult Init() { return NS_ERROR_NOT_IMPLEMENTED; } void Cancel() { } void SetIPV4Address(uint32_t) { }; void SetIPV4Port(uint16_t) { } void Tickle() { } }; #endif // defined MOZ_USE_WIFI_TICKLER
--- a/netwerk/base/src/nsAsyncStreamCopier.h +++ b/netwerk/base/src/nsAsyncStreamCopier.h @@ -28,25 +28,26 @@ public: NS_IMETHOD Init(nsIInputStream *aSource, nsIOutputStream *aSink, nsIEventTarget *aTarget, uint32_t aChunkSize, bool aCloseSource, bool aCloseSink); nsAsyncStreamCopier(); - virtual ~nsAsyncStreamCopier(); //------------------------------------------------------------------------- // these methods may be called on any thread bool IsComplete(nsresult *status = nullptr); void Complete(nsresult status); private: + virtual ~nsAsyncStreamCopier(); + nsresult InitInternal(nsIInputStream *source, nsIOutputStream *sink, nsIEventTarget *target, uint32_t chunkSize, bool closeSource, bool closeSink); static void OnAsyncCopyComplete(void *, nsresult);
--- a/netwerk/base/src/nsAuthInformationHolder.h +++ b/netwerk/base/src/nsAuthInformationHolder.h @@ -5,24 +5,26 @@ #ifndef NSAUTHINFORMATIONHOLDER_H_ #define NSAUTHINFORMATIONHOLDER_H_ #include "nsIAuthInformation.h" #include "nsString.h" class nsAuthInformationHolder : public nsIAuthInformation { + +protected: + virtual ~nsAuthInformationHolder() {} + public: // aAuthType must be ASCII nsAuthInformationHolder(uint32_t aFlags, const nsString& aRealm, const nsCString& aAuthType) : mFlags(aFlags), mRealm(aRealm), mAuthType(aAuthType) {} - virtual ~nsAuthInformationHolder() {} - NS_DECL_ISUPPORTS NS_DECL_NSIAUTHINFORMATION const nsString& User() const { return mUser; } const nsString& Password() const { return mPassword; } const nsString& Domain() const { return mDomain; } /**
--- a/netwerk/base/src/nsBufferedStreams.h +++ b/netwerk/base/src/nsBufferedStreams.h @@ -19,21 +19,22 @@ class nsBufferedStream : public nsISeekableStream { public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSISEEKABLESTREAM nsBufferedStream(); - virtual ~nsBufferedStream(); nsresult Close(); protected: + virtual ~nsBufferedStream(); + nsresult Init(nsISupports* stream, uint32_t bufferSize); NS_IMETHOD Fill() = 0; NS_IMETHOD Flush() = 0; uint32_t mBufferSize; char* mBuffer; // mBufferStartOffset is the offset relative to the start of mStream.
--- a/netwerk/base/src/nsDNSPrefetch.h +++ b/netwerk/base/src/nsDNSPrefetch.h @@ -13,16 +13,18 @@ #include "nsIDNSListener.h" class nsIURI; class nsIDNSService; class nsDNSPrefetch MOZ_FINAL : public nsIDNSListener { + ~nsDNSPrefetch() {} + public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIDNSLISTENER nsDNSPrefetch(nsIURI *aURI, nsIDNSListener *aListener, bool storeTiming); bool TimingsValid() const { return !mStartTimestamp.IsNull() && !mEndTimestamp.IsNull(); }
--- a/netwerk/base/src/nsFileStreams.h +++ b/netwerk/base/src/nsFileStreams.h @@ -1,9 +1,9 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +// /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * 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/. */ #ifndef nsFileStreams_h__ #define nsFileStreams_h__ #include "nsAutoPtr.h" @@ -26,19 +26,20 @@ class nsFileStreamBase : public nsISeeka public nsIFileMetadata { public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSISEEKABLESTREAM NS_DECL_NSIFILEMETADATA nsFileStreamBase(); + +protected: virtual ~nsFileStreamBase(); -protected: nsresult Close(); nsresult Available(uint64_t* _retval); nsresult Read(char* aBuf, uint32_t aCount, uint32_t* _retval); nsresult ReadSegments(nsWriteSegmentFun aWriter, void* aClosure, uint32_t aCount, uint32_t* _retval); nsresult IsNonBlocking(bool* _retval); nsresult Flush(); nsresult Write(const char* aBuf, uint32_t aCount, uint32_t* _retval);
--- a/netwerk/base/src/nsIOService.cpp +++ b/netwerk/base/src/nsIOService.cpp @@ -1174,16 +1174,18 @@ nsIOService::ExtractCharsetFromContentTy *aHadCharset = false; } return NS_OK; } // nsISpeculativeConnect class IOServiceProxyCallback MOZ_FINAL : public nsIProtocolProxyCallback { + ~IOServiceProxyCallback() {} + public: NS_DECL_ISUPPORTS NS_DECL_NSIPROTOCOLPROXYCALLBACK IOServiceProxyCallback(nsIInterfaceRequestor *aCallbacks, nsIOService *aIOService) : mCallbacks(aCallbacks) , mIOService(aIOService)
--- a/netwerk/base/src/nsInputStreamPump.h +++ b/netwerk/base/src/nsInputStreamPump.h @@ -16,26 +16,27 @@ class nsIInputStream; class nsILoadGroup; class nsIStreamListener; class nsInputStreamPump MOZ_FINAL : public nsIInputStreamPump , public nsIInputStreamCallback , public nsIThreadRetargetableRequest { + ~nsInputStreamPump(); + public: typedef mozilla::ReentrantMonitorAutoEnter ReentrantMonitorAutoEnter; NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIREQUEST NS_DECL_NSIINPUTSTREAMPUMP NS_DECL_NSIINPUTSTREAMCALLBACK NS_DECL_NSITHREADRETARGETABLEREQUEST nsInputStreamPump(); - ~nsInputStreamPump(); static nsresult Create(nsInputStreamPump **result, nsIInputStream *stream, int64_t streamPos = -1, int64_t streamLen = -1, uint32_t segsize = 0, uint32_t segcount = 0,
--- a/netwerk/base/src/nsLoadGroup.cpp +++ b/netwerk/base/src/nsLoadGroup.cpp @@ -1093,16 +1093,18 @@ nsresult nsLoadGroup::MergeLoadFlags(nsI outFlags = flags; return rv; } // nsLoadGroupConnectionInfo class nsLoadGroupConnectionInfo MOZ_FINAL : public nsILoadGroupConnectionInfo { + ~nsLoadGroupConnectionInfo() {} + public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSILOADGROUPCONNECTIONINFO nsLoadGroupConnectionInfo(); private: Atomic<uint32_t> mBlockingTransactionCount; nsAutoPtr<mozilla::net::SpdyPushCache> mSpdyCache;
--- a/netwerk/base/src/nsMIMEInputStream.cpp +++ b/netwerk/base/src/nsMIMEInputStream.cpp @@ -23,19 +23,20 @@ #include "mozilla/ipc/InputStreamUtils.h" using namespace mozilla::ipc; class nsMIMEInputStream : public nsIMIMEInputStream, public nsISeekableStream, public nsIIPCSerializableInputStream { + virtual ~nsMIMEInputStream(); + public: nsMIMEInputStream(); - virtual ~nsMIMEInputStream(); NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIINPUTSTREAM NS_DECL_NSIMIMEINPUTSTREAM NS_DECL_NSISEEKABLESTREAM NS_DECL_NSIIPCSERIALIZABLEINPUTSTREAM NS_METHOD Init();
--- a/netwerk/base/src/nsNetAddr.h +++ b/netwerk/base/src/nsNetAddr.h @@ -8,16 +8,18 @@ #define nsNetAddr_h__ #include "nsINetAddr.h" #include "mozilla/net/DNS.h" #include "mozilla/Attributes.h" class nsNetAddr MOZ_FINAL : public nsINetAddr { + ~nsNetAddr() {} + public: NS_DECL_ISUPPORTS NS_DECL_NSINETADDR nsNetAddr(mozilla::net::NetAddr* addr); private: mozilla::net::NetAddr mAddr;
--- a/netwerk/base/src/nsProtocolProxyService.cpp +++ b/netwerk/base/src/nsProtocolProxyService.cpp @@ -86,16 +86,17 @@ public: , mPPS(pps) , mXPComPPS(pps) , mURI(uri) , mCallback(callback) { NS_ASSERTION(mCallback, "null callback"); } +private: ~nsAsyncResolveRequest() { if (!NS_IsMainThread()) { // these xpcom pointers might need to be proxied back to the // main thread to delete safely, but if this request had its // callbacks called normally they will all be null and this is a nop nsCOMPtr<nsIThread> mainThread; @@ -122,16 +123,17 @@ public: if (mXPComPPS) { nsIProtocolProxyService *forgettable; mXPComPPS.forget(&forgettable); NS_ProxyRelease(mainThread, forgettable, false); } } } +public: void SetResult(nsresult status, nsIProxyInfo *pi) { mStatus = status; mProxyInfo = pi; } NS_IMETHOD Run() {
--- a/netwerk/base/src/nsRequestObserverProxy.h +++ b/netwerk/base/src/nsRequestObserverProxy.h @@ -12,16 +12,18 @@ #include "nsThreadUtils.h" #include "nsCOMPtr.h" #include "nsProxyRelease.h" class nsARequestObserverEvent; class nsRequestObserverProxy MOZ_FINAL : public nsIRequestObserverProxy { + ~nsRequestObserverProxy() {} + public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIREQUESTOBSERVER NS_DECL_NSIREQUESTOBSERVERPROXY nsRequestObserverProxy() {} nsIRequestObserver *Observer() { return mObserver; }
--- a/netwerk/base/src/nsSerializationHelper.h +++ b/netwerk/base/src/nsSerializationHelper.h @@ -24,13 +24,15 @@ nsresult NS_SerializeToString(nsISeriali /** * Deserialize an object. */ nsresult NS_DeserializeObject(const nsCSubstring& str, nsISupports** obj); class nsSerializationHelper MOZ_FINAL : public nsISerializationHelper { + ~nsSerializationHelper() {} + NS_DECL_ISUPPORTS NS_DECL_NSISERIALIZATIONHELPER }; #endif
--- a/netwerk/base/src/nsServerSocket.cpp +++ b/netwerk/base/src/nsServerSocket.cpp @@ -402,16 +402,18 @@ nsServerSocket::Close() } return PostEvent(this, &nsServerSocket::OnMsgClose); } namespace { class ServerSocketListenerProxy MOZ_FINAL : public nsIServerSocketListener { + ~ServerSocketListenerProxy() {} + public: ServerSocketListenerProxy(nsIServerSocketListener* aListener) : mListener(new nsMainThreadPtrHolder<nsIServerSocketListener>(aListener)) , mTargetThread(do_GetCurrentThread()) { } NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSISERVERSOCKETLISTENER
--- a/netwerk/base/src/nsServerSocket.h +++ b/netwerk/base/src/nsServerSocket.h @@ -24,20 +24,19 @@ public: virtual void OnSocketDetached(PRFileDesc *fd); virtual void IsLocal(bool *aIsLocal); virtual void KeepWhenOffline(bool *aKeepWhenOffline); virtual uint64_t ByteCountSent() { return 0; } virtual uint64_t ByteCountReceived() { return 0; } nsServerSocket(); - // This must be public to support older compilers (xlC_r on AIX) +private: virtual ~nsServerSocket(); -private: void OnMsgClose(); void OnMsgAttach(); // try attaching our socket (mFD) to the STS's poll list. nsresult TryAttach(); // lock protects access to mListener; so it is not cleared while being used. mozilla::Mutex mLock;
--- a/netwerk/base/src/nsSimpleNestedURI.h +++ b/netwerk/base/src/nsSimpleNestedURI.h @@ -18,16 +18,19 @@ #include "nsCOMPtr.h" #include "nsSimpleURI.h" #include "nsINestedURI.h" class nsSimpleNestedURI : public nsSimpleURI, public nsINestedURI { +protected: + ~nsSimpleNestedURI() {} + public: // To be used by deserialization only. Leaves this object in an // uninitialized state that will throw on most accesses. nsSimpleNestedURI() { } // Constructor that should generally be used when constructing an object of
--- a/netwerk/base/src/nsSimpleStreamListener.h +++ b/netwerk/base/src/nsSimpleStreamListener.h @@ -11,14 +11,15 @@ class nsSimpleStreamListener : public ns { public: NS_DECL_ISUPPORTS NS_DECL_NSIREQUESTOBSERVER NS_DECL_NSISTREAMLISTENER NS_DECL_NSISIMPLESTREAMLISTENER nsSimpleStreamListener() { } + +protected: virtual ~nsSimpleStreamListener() {} -protected: nsCOMPtr<nsIOutputStream> mSink; nsCOMPtr<nsIRequestObserver> mObserver; };
--- a/netwerk/base/src/nsSimpleURI.h +++ b/netwerk/base/src/nsSimpleURI.h @@ -25,28 +25,30 @@ class nsSimpleURI : public nsIURI, public nsISerializable, public nsIClassInfo, public nsIMutable, public nsISizeOf, public nsIIPCSerializableURI { +protected: + virtual ~nsSimpleURI(); + public: NS_DECL_ISUPPORTS NS_DECL_NSIURI NS_DECL_NSISERIALIZABLE NS_DECL_NSICLASSINFO NS_DECL_NSIMUTABLE NS_DECL_NSIIPCSERIALIZABLEURI // nsSimpleURI methods: nsSimpleURI(); - virtual ~nsSimpleURI(); // nsISizeOf // Among the sub-classes that inherit (directly or indirectly) from // nsSimpleURI, measurement of the following members may be added later if // DMD finds it is worthwhile: // - nsJSURI: mBaseURI // - nsSimpleNestedURI: mInnerURI // - nsBlobURI: mPrincipal
--- a/netwerk/base/src/nsStandardURL.h +++ b/netwerk/base/src/nsStandardURL.h @@ -38,33 +38,35 @@ class nsIURLParser; class nsStandardURL : public nsIFileURL , public nsIStandardURL , public nsISerializable , public nsIClassInfo , public nsISizeOf , public nsIIPCSerializableURI { +protected: + virtual ~nsStandardURL(); + public: NS_DECL_ISUPPORTS NS_DECL_NSIURI NS_DECL_NSIURL NS_DECL_NSIFILEURL NS_DECL_NSISTANDARDURL NS_DECL_NSISERIALIZABLE NS_DECL_NSICLASSINFO NS_DECL_NSIMUTABLE NS_DECL_NSIIPCSERIALIZABLEURI // nsISizeOf virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const; virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const; nsStandardURL(bool aSupportsFileURL = false); - virtual ~nsStandardURL(); static void InitGlobalObjects(); static void ShutdownGlobalObjects(); public: /* internal -- HPUX compiler can't handle this being private */ // // location and length of an url segment relative to mSpec // @@ -88,16 +90,18 @@ public: /* internal -- HPUX compiler can } }; // // Pref observer // class nsPrefObserver MOZ_FINAL : public nsIObserver { + ~nsPrefObserver() {} + public: NS_DECL_ISUPPORTS NS_DECL_NSIOBSERVER nsPrefObserver() { } }; friend class nsPrefObserver;
--- a/netwerk/base/src/nsStreamListenerTee.h +++ b/netwerk/base/src/nsStreamListenerTee.h @@ -18,19 +18,20 @@ class nsStreamListenerTee : public nsISt public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIREQUESTOBSERVER NS_DECL_NSISTREAMLISTENER NS_DECL_NSITHREADRETARGETABLESTREAMLISTENER NS_DECL_NSISTREAMLISTENERTEE nsStreamListenerTee() { } + +private: virtual ~nsStreamListenerTee() { } -private: nsCOMPtr<nsIInputStreamTee> mInputTee; nsCOMPtr<nsIOutputStream> mSink; nsCOMPtr<nsIStreamListener> mListener; nsCOMPtr<nsIRequestObserver> mObserver; nsCOMPtr<nsIEventTarget> mEventTarget; }; #endif
--- a/netwerk/base/src/nsStreamLoader.h +++ b/netwerk/base/src/nsStreamLoader.h @@ -16,22 +16,23 @@ class nsStreamLoader MOZ_FINAL : public { public: NS_DECL_ISUPPORTS NS_DECL_NSISTREAMLOADER NS_DECL_NSIREQUESTOBSERVER NS_DECL_NSISTREAMLISTENER nsStreamLoader(); - ~nsStreamLoader(); static nsresult Create(nsISupports *aOuter, REFNSIID aIID, void **aResult); protected: + ~nsStreamLoader(); + static NS_METHOD WriteSegmentFun(nsIInputStream *, void *, const char *, uint32_t, uint32_t, uint32_t *); // Utility method to free mData, if present, and update other state to // reflect that no data has been allocated. void ReleaseData(); nsCOMPtr<nsIStreamLoaderObserver> mObserver;
--- a/netwerk/base/src/nsStreamTransportService.cpp +++ b/netwerk/base/src/nsStreamTransportService.cpp @@ -43,21 +43,21 @@ public: , mOffset(offset) , mLimit(limit) , mCloseWhenDone(closeWhenDone) , mFirstTime(true) , mInProgress(false) { } +private: virtual ~nsInputStreamTransport() { } -private: nsCOMPtr<nsIAsyncInputStream> mPipeIn; // while the copy is active, these members may only be accessed from the // nsIInputStream implementation. nsCOMPtr<nsITransportEventSink> mEventSink; nsCOMPtr<nsIInputStream> mSource; uint64_t mOffset; uint64_t mLimit; @@ -243,21 +243,21 @@ public: , mOffset(offset) , mLimit(limit) , mCloseWhenDone(closeWhenDone) , mFirstTime(true) , mInProgress(false) { } +private: virtual ~nsOutputStreamTransport() { } -private: nsCOMPtr<nsIAsyncOutputStream> mPipeOut; // while the copy is active, these members may only be accessed from the // nsIOutputStream implementation. nsCOMPtr<nsITransportEventSink> mEventSink; nsCOMPtr<nsIOutputStream> mSink; uint64_t mOffset; uint64_t mLimit;
--- a/netwerk/base/src/nsTemporaryFileInputStream.h +++ b/netwerk/base/src/nsTemporaryFileInputStream.h @@ -36,21 +36,21 @@ public: private: PRFileDesc* mFD; mozilla::Mutex mMutex; }; nsTemporaryFileInputStream(FileDescOwner* aFileDescOwner, uint64_t aStartPos, uint64_t aEndPos); - virtual ~nsTemporaryFileInputStream() { } - NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIINPUTSTREAM private: + virtual ~nsTemporaryFileInputStream() { } + nsRefPtr<FileDescOwner> mFileDescOwner; uint64_t mStartPos; uint64_t mEndPos; bool mClosed; }; #endif // nsTemporaryFileInputStream_h__
--- a/netwerk/base/src/nsTransportUtils.cpp +++ b/netwerk/base/src/nsTransportUtils.cpp @@ -29,23 +29,25 @@ public: , mTarget(target) , mLock("nsTransportEventSinkProxy.mLock") , mLastEvent(nullptr) , mCoalesceAll(coalesceAll) { NS_ADDREF(mSink); } +private: virtual ~nsTransportEventSinkProxy() { // our reference to mSink could be the last, so be sure to release // it on the target thread. otherwise, we could get into trouble. NS_ProxyRelease(mTarget, mSink); } +public: nsITransportEventSink *mSink; nsCOMPtr<nsIEventTarget> mTarget; Mutex mLock; nsTransportStatusEvent *mLastEvent; bool mCoalesceAll; }; class nsTransportStatusEvent : public nsRunnable
--- a/netwerk/base/src/nsUDPSocket.cpp +++ b/netwerk/base/src/nsUDPSocket.cpp @@ -381,16 +381,18 @@ public: memcpy(&mAddr, aAddr, sizeof(NetAddr)); aData.SwapElements(mData); } NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIUDPMESSAGE private: + ~UDPMessageProxy() {} + NetAddr mAddr; nsCOMPtr<nsIOutputStream> mOutputStream; FallibleTArray<uint8_t> mData; }; NS_IMPL_ISUPPORTS(UDPMessageProxy, nsIUDPMessage) /* readonly attribute nsINetAddr from; */ @@ -671,16 +673,18 @@ nsUDPSocket::GetAddress(NetAddr *aResult } namespace { //----------------------------------------------------------------------------- // SocketListenerProxy //----------------------------------------------------------------------------- class SocketListenerProxy MOZ_FINAL : public nsIUDPSocketListener { + ~SocketListenerProxy() {} + public: SocketListenerProxy(nsIUDPSocketListener* aListener) : mListener(new nsMainThreadPtrHolder<nsIUDPSocketListener>(aListener)) , mTargetThread(do_GetCurrentThread()) { } NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIUDPSOCKETLISTENER @@ -785,19 +789,19 @@ public: PendingSend(nsUDPSocket *aSocket, uint16_t aPort, FallibleTArray<uint8_t> &aData) : mSocket(aSocket) , mPort(aPort) { mData.SwapElements(aData); } +private: virtual ~PendingSend() {} -private: nsRefPtr<nsUDPSocket> mSocket; uint16_t mPort; FallibleTArray<uint8_t> mData; }; NS_IMPL_ISUPPORTS(PendingSend, nsIDNSListener) NS_IMETHODIMP
--- a/netwerk/base/src/nsUDPSocket.h +++ b/netwerk/base/src/nsUDPSocket.h @@ -28,20 +28,19 @@ public: uint64_t ByteCountSent() { return mByteWriteCount; } uint64_t ByteCountReceived() { return mByteReadCount; } void AddOutputBytes(uint64_t aBytes); nsUDPSocket(); - // This must be public to support older compilers (xlC_r on AIX) +private: virtual ~nsUDPSocket(); -private: void OnMsgClose(); void OnMsgAttach(); // try attaching our socket (mFD) to the STS's poll list. nsresult TryAttach(); friend class SetSocketOptionRunnable; nsresult SetSocketOption(const PRSocketOptionData& aOpt); @@ -94,18 +93,19 @@ class nsUDPOutputStream : public nsIOutp { public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIOUTPUTSTREAM nsUDPOutputStream(nsUDPSocket* aSocket, PRFileDesc* aFD, PRNetAddr& aPrClientAddr); + +private: virtual ~nsUDPOutputStream(); -private: nsRefPtr<nsUDPSocket> mSocket; PRFileDesc *mFD; PRNetAddr mPrClientAddr; bool mIsClosed; }; #endif // nsUDPSocket_h__
--- a/netwerk/base/src/nsURIChecker.h +++ b/netwerk/base/src/nsURIChecker.h @@ -15,19 +15,20 @@ //----------------------------------------------------------------------------- class nsURIChecker : public nsIURIChecker, public nsIStreamListener, public nsIChannelEventSink, public nsIInterfaceRequestor { + virtual ~nsURIChecker() {} + public: nsURIChecker(); - virtual ~nsURIChecker() {} NS_DECL_ISUPPORTS NS_DECL_NSIURICHECKER NS_DECL_NSIREQUEST NS_DECL_NSIREQUESTOBSERVER NS_DECL_NSISTREAMLISTENER NS_DECL_NSICHANNELEVENTSINK NS_DECL_NSIINTERFACEREQUESTOR
--- a/netwerk/base/src/nsURLParsers.h +++ b/netwerk/base/src/nsURLParsers.h @@ -37,16 +37,18 @@ protected: // eg. file:////foo/bar.txt (UNC-filepath = \\foo\bar.txt) // // XXX except in this case: // file://foo/bar.txt (the authority "foo" is ignored) //---------------------------------------------------------------------------- class nsNoAuthURLParser MOZ_FINAL : public nsBaseURLParser { + ~nsNoAuthURLParser() {} + public: NS_DECL_THREADSAFE_ISUPPORTS #if defined(XP_WIN) NS_IMETHOD ParseFilePath(const char *, int32_t, uint32_t *, int32_t *, uint32_t *, int32_t *, uint32_t *, int32_t *); @@ -69,21 +71,22 @@ public: // eg. http:www.foo.com/bar.html // http:/www.foo.com/bar.html // http://www.foo.com/bar.html (treated equivalently) // http:///www.foo.com/bar.html //---------------------------------------------------------------------------- class nsAuthURLParser : public nsBaseURLParser { +protected: + virtual ~nsAuthURLParser() {} + public: NS_DECL_THREADSAFE_ISUPPORTS - virtual ~nsAuthURLParser() {} - NS_IMETHOD ParseAuthority(const char *auth, int32_t authLen, uint32_t *usernamePos, int32_t *usernameLen, uint32_t *passwordPos, int32_t *passwordLen, uint32_t *hostnamePos, int32_t *hostnameLen, int32_t *port); NS_IMETHOD ParseUserInfo(const char *userinfo, int32_t userinfoLen, uint32_t *usernamePos, int32_t *usernameLen, @@ -105,15 +108,17 @@ public: // http:www.foo.com/bar.html (www.foo.com is authority) // http:/www.foo.com/bar.html (www.foo.com is part of file path) // http://www.foo.com/bar.html (www.foo.com is authority) // http:///www.foo.com/bar.html (www.foo.com is part of file path) //---------------------------------------------------------------------------- class nsStdURLParser : public nsAuthURLParser { + virtual ~nsStdURLParser() {} + public: void ParseAfterScheme(const char *spec, int32_t specLen, uint32_t *authPos, int32_t *authLen, uint32_t *pathPos, int32_t *pathLen); }; #endif // nsURLParsers_h__
--- a/netwerk/base/src/nsUnicharStreamLoader.h +++ b/netwerk/base/src/nsUnicharStreamLoader.h @@ -18,21 +18,22 @@ class nsUnicharStreamLoader : public nsI { public: NS_DECL_ISUPPORTS NS_DECL_NSIUNICHARSTREAMLOADER NS_DECL_NSIREQUESTOBSERVER NS_DECL_NSISTREAMLISTENER nsUnicharStreamLoader() {} - virtual ~nsUnicharStreamLoader() {} static nsresult Create(nsISupports *aOuter, REFNSIID aIID, void **aResult); protected: + virtual ~nsUnicharStreamLoader() {} + nsresult DetermineCharset(); /** * callback method used for ReadSegments */ static NS_METHOD WriteSegmentFun(nsIInputStream *, void *, const char *, uint32_t, uint32_t, uint32_t *);
--- a/netwerk/cache/nsApplicationCache.h +++ b/netwerk/cache/nsApplicationCache.h @@ -11,19 +11,19 @@ public: NS_DECL_NSIAPPLICATIONCACHE nsApplicationCache(nsOfflineCacheDevice *device, const nsACString &group, const nsACString &clientID); nsApplicationCache(); - virtual ~nsApplicationCache(); - void MarkInvalid(); private: + virtual ~nsApplicationCache(); + nsRefPtr<nsOfflineCacheDevice> mDevice; nsCString mGroup; nsCString mClientID; bool mValid; };
--- a/netwerk/cache/nsApplicationCacheService.cpp +++ b/netwerk/cache/nsApplicationCacheService.cpp @@ -22,16 +22,20 @@ static NS_DEFINE_CID(kCacheServiceCID, N NS_IMPL_ISUPPORTS(nsApplicationCacheService, nsIApplicationCacheService) nsApplicationCacheService::nsApplicationCacheService() { nsCOMPtr<nsICacheService> serv = do_GetService(kCacheServiceCID); mCacheService = nsCacheService::GlobalInstance(); } +nsApplicationCacheService::~nsApplicationCacheService() +{ +} + NS_IMETHODIMP nsApplicationCacheService::BuildGroupID(nsIURI *aManifestURL, nsILoadContextInfo *aLoadContextInfo, nsACString &_result) { nsresult rv; uint32_t appId = NECKO_NO_APP_ID; @@ -220,16 +224,19 @@ public: NS_ENSURE_SUCCESS(rv, rv); nsCOMPtr<nsIApplicationCacheService> cacheService = do_GetService(NS_APPLICATIONCACHESERVICE_CONTRACTID, &rv); NS_ENSURE_SUCCESS(rv, rv); return cacheService->DiscardByAppId(appId, browserOnly); } + +private: + ~AppCacheClearDataObserver() {} }; NS_IMPL_ISUPPORTS(AppCacheClearDataObserver, nsIObserver) } // anonymous namespace // Instantiates and registers AppCacheClearDataObserver for notifications void
--- a/netwerk/cache/nsApplicationCacheService.h +++ b/netwerk/cache/nsApplicationCacheService.h @@ -16,12 +16,13 @@ public: nsApplicationCacheService(); NS_DECL_ISUPPORTS NS_DECL_NSIAPPLICATIONCACHESERVICE static void AppClearDataObserverInit(); private: + ~nsApplicationCacheService(); nsRefPtr<nsCacheService> mCacheService; }; #endif // _nsApplicationCacheService_h_
--- a/netwerk/cache/nsCacheEntry.h +++ b/netwerk/cache/nsCacheEntry.h @@ -238,21 +238,22 @@ public: NS_DECL_ISUPPORTS NS_DECL_NSICACHEENTRYINFO nsCacheEntryInfo(nsCacheEntry* entry) : mCacheEntry(entry) { } - virtual ~nsCacheEntryInfo() {} void DetachEntry() { mCacheEntry = nullptr; } - + private: nsCacheEntry * mCacheEntry; + + virtual ~nsCacheEntryInfo() {} }; /****************************************************************************** * nsCacheEntryHashTable *******************************************************************************/ typedef struct { PLDHashNumber keyHash;
--- a/netwerk/cache/nsCacheEntryDescriptor.h +++ b/netwerk/cache/nsCacheEntryDescriptor.h @@ -28,17 +28,16 @@ public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSICACHEENTRYDESCRIPTOR NS_DECL_NSICACHEENTRYINFO friend class nsAsyncDoomEvent; friend class nsCacheService; nsCacheEntryDescriptor(nsCacheEntry * entry, nsCacheAccessMode mode); - virtual ~nsCacheEntryDescriptor(); /** * utility method to attempt changing data size of associated entry */ nsresult RequestDataSizeChange(int32_t deltaSize); /** * methods callbacks for nsCacheService @@ -61,16 +60,18 @@ public: mDoomedOnClose = true; } mCacheEntry = nullptr; return doomEntry; } private: + virtual ~nsCacheEntryDescriptor(); + /************************************************************************* * input stream wrapper class - * * The input stream wrapper references the descriptor, but the descriptor * doesn't need any references to the stream wrapper. *************************************************************************/ class nsInputStreamWrapper : public nsIInputStream { friend class nsCacheEntryDescriptor; @@ -88,22 +89,23 @@ private: nsInputStreamWrapper(nsCacheEntryDescriptor * desc, uint32_t off) : mDescriptor(desc) , mStartOffset(off) , mInitialized(false) , mLock("nsInputStreamWrapper.mLock") { NS_ADDREF(mDescriptor); } + + private: virtual ~nsInputStreamWrapper() { NS_IF_RELEASE(mDescriptor); } - private: nsresult LazyInit(); nsresult EnsureInit(); nsresult Read_Locked(char *buf, uint32_t count, uint32_t *countRead); nsresult Close_Locked(); void CloseInternal(); }; @@ -121,23 +123,23 @@ private: uint32_t off) : nsInputStreamWrapper(desc, off) , mReadBuffer(0) , mReadBufferLen(0) , mStreamInitialized(false) , mStreamEnded(false) { } + NS_IMETHOD Read(char* buf, uint32_t count, uint32_t * result); + NS_IMETHOD Close(); + private: virtual ~nsDecompressInputStreamWrapper() { Close(); } - NS_IMETHOD Read(char* buf, uint32_t count, uint32_t * result); - NS_IMETHOD Close(); - private: nsresult InitZstream(); nsresult EndZstream(); }; /************************************************************************* * output stream wrapper class - * @@ -160,25 +162,26 @@ private: nsOutputStreamWrapper(nsCacheEntryDescriptor * desc, uint32_t off) : mDescriptor(desc) , mStartOffset(off) , mInitialized(false) , mLock("nsOutputStreamWrapper.mLock") { NS_ADDREF(mDescriptor); // owning ref } + + private: virtual ~nsOutputStreamWrapper() { Close(); NS_ASSERTION(!mOutput, "Bad state"); NS_ASSERTION(!mDescriptor, "Bad state"); } - private: nsresult LazyInit(); nsresult EnsureInit(); nsresult OnWrite(uint32_t count); nsresult Write_Locked(const char * buf, uint32_t count, uint32_t * result); nsresult Close_Locked(); void CloseInternal(); @@ -201,23 +204,23 @@ private: : nsOutputStreamWrapper(desc, off) , mWriteBuffer(0) , mWriteBufferLen(0) , mStreamInitialized(false) , mStreamEnded(false) , mUncompressedCount(0) { } + NS_IMETHOD Write(const char* buf, uint32_t count, uint32_t * result); + NS_IMETHOD Close(); + private: virtual ~nsCompressOutputStreamWrapper() { Close(); } - NS_IMETHOD Write(const char* buf, uint32_t count, uint32_t * result); - NS_IMETHOD Close(); - private: nsresult InitZstream(); nsresult WriteBuffer(); }; private: /** * nsCacheEntryDescriptor data members */
--- a/netwerk/cache/nsCacheService.cpp +++ b/netwerk/cache/nsCacheService.cpp @@ -115,16 +115,18 @@ const int32_t OLD_MAX_CACHE_SIZE = 200 * const int32_t MAX_CACHE_SIZE = 350 * 1024; // 350 MB const int32_t OLD_MAX_CACHE_SIZE = 1024 * 1024; // 1 GB #endif // Default cache size was 50 MB for many years until FF 4: const int32_t PRE_GECKO_2_0_DEFAULT_CACHE_SIZE = 50 * 1024; class nsCacheProfilePrefObserver : public nsIObserver { + virtual ~nsCacheProfilePrefObserver() {} + public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIOBSERVER nsCacheProfilePrefObserver() : mHaveProfile(false) , mDiskCacheEnabled(false) , mDiskCacheCapacity(0) @@ -136,18 +138,16 @@ public: , mMemoryCacheEnabled(true) , mMemoryCacheCapacity(-1) , mMemoryCacheMaxEntrySize(-1) // -1 means "no limit" , mCacheCompressionLevel(CACHE_COMPRESSION_LEVEL) , mSanitizeOnShutdown(false) , mClearCacheOnShutdown(false) { } - - virtual ~nsCacheProfilePrefObserver() {} nsresult Install(); void Remove(); nsresult ReadPrefs(nsIPrefBranch* branch); bool DiskCacheEnabled(); int32_t DiskCacheCapacity() { return mDiskCacheCapacity; } void SetDiskCacheCapacity(int32_t); @@ -200,16 +200,18 @@ private: bool mSanitizeOnShutdown; bool mClearCacheOnShutdown; }; NS_IMPL_ISUPPORTS(nsCacheProfilePrefObserver, nsIObserver) class nsSetDiskSmartSizeCallback MOZ_FINAL : public nsITimerCallback { + ~nsSetDiskSmartSizeCallback() {} + public: NS_DECL_THREADSAFE_ISUPPORTS NS_IMETHOD Notify(nsITimer* aTimer) { if (nsCacheService::gService) { nsCacheServiceAutoLock autoLock(LOCK_TELEM(NSSETDISKSMARTSIZECALLBACK_NOTIFY)); nsCacheService::gService->SetDiskSmartSize_Locked(); nsCacheService::gService->mSmartSizeTimer = nullptr;
--- a/netwerk/cache/nsCacheService.h +++ b/netwerk/cache/nsCacheService.h @@ -60,24 +60,25 @@ private: /****************************************************************************** * nsCacheService ******************************************************************************/ class nsCacheService : public nsICacheServiceInternal, public nsIMemoryReporter { + virtual ~nsCacheService(); + public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSICACHESERVICE NS_DECL_NSICACHESERVICEINTERNAL NS_DECL_NSIMEMORYREPORTER nsCacheService(); - virtual ~nsCacheService(); // Define a Create method to be used with a factory: static nsresult Create(nsISupports* outer, const nsIID& iid, void* *result); /** * Methods called by nsCacheSession
--- a/netwerk/cache/nsCacheSession.h +++ b/netwerk/cache/nsCacheSession.h @@ -11,22 +11,23 @@ #include "nsError.h" #include "nsCOMPtr.h" #include "nsICacheSession.h" #include "nsIFile.h" #include "nsString.h" class nsCacheSession : public nsICacheSession { + virtual ~nsCacheSession(); + public: NS_DECL_ISUPPORTS NS_DECL_NSICACHESESSION nsCacheSession(const char * clientID, nsCacheStoragePolicy storagePolicy, bool streamBased); - virtual ~nsCacheSession(); nsCString * ClientID() { return &mClientID; } enum SessionInfo { eStoragePolicyMask = 0x000000FF, eStreamBasedMask = 0x00000100, eDoomEntriesIfExpiredMask = 0x00001000, ePrivateMask = 0x00010000
--- a/netwerk/cache/nsDiskCacheBinding.h +++ b/netwerk/cache/nsDiskCacheBinding.h @@ -26,21 +26,22 @@ * an nsISupports. Also stored in nsDiskCacheHashTable, with collisions * linked by the PRCList. * *****************************************************************************/ class nsDiskCacheDeviceDeactivateEntryEvent; class nsDiskCacheBinding : public nsISupports, public PRCList { + virtual ~nsDiskCacheBinding(); + public: NS_DECL_THREADSAFE_ISUPPORTS nsDiskCacheBinding(nsCacheEntry* entry, nsDiskCacheRecord * record); - virtual ~nsDiskCacheBinding(); nsresult EnsureStreamIO(); bool IsActive() { return mCacheEntry != nullptr;} // XXX make friends public: nsCacheEntry* mCacheEntry; // back pointer to parent nsCacheEntry nsDiskCacheRecord mRecord;
--- a/netwerk/cache/nsDiskCacheDevice.cpp +++ b/netwerk/cache/nsDiskCacheDevice.cpp @@ -182,19 +182,19 @@ public: NS_DECL_ISUPPORTS NS_DECL_NSICACHEDEVICEINFO nsDiskCacheDeviceInfo(nsDiskCacheDevice* device) : mDevice(device) { } +private: virtual ~nsDiskCacheDeviceInfo() {} - -private: + nsDiskCacheDevice* mDevice; }; NS_IMPL_ISUPPORTS(nsDiskCacheDeviceInfo, nsICacheDeviceInfo) /* readonly attribute string description; */ NS_IMETHODIMP nsDiskCacheDeviceInfo::GetDescription(char ** aDescription) {
--- a/netwerk/cache/nsDiskCacheDeviceSQL.cpp +++ b/netwerk/cache/nsDiskCacheDeviceSQL.cpp @@ -275,16 +275,18 @@ public: NS_DECL_ISUPPORTS NS_DECL_NSICACHEDEVICEINFO nsOfflineCacheDeviceInfo(nsOfflineCacheDevice* device) : mDevice(device) {} private: + ~nsOfflineCacheDeviceInfo() {} + nsOfflineCacheDevice* mDevice; }; NS_IMPL_ISUPPORTS(nsOfflineCacheDeviceInfo, nsICacheDeviceInfo) NS_IMETHODIMP nsOfflineCacheDeviceInfo::GetDescription(char **aDescription) { @@ -342,16 +344,18 @@ nsOfflineCacheDeviceInfo::GetMaximumSize } /****************************************************************************** * nsOfflineCacheBinding */ class nsOfflineCacheBinding MOZ_FINAL : public nsISupports { + ~nsOfflineCacheBinding() {} + public: NS_DECL_THREADSAFE_ISUPPORTS static nsOfflineCacheBinding * Create(nsIFile *cacheDir, const nsCString *key, int generation); enum { FLAG_NEW_ENTRY = 1 }; @@ -509,16 +513,18 @@ CreateCacheEntry(nsOfflineCacheDevice *d /****************************************************************************** * nsOfflineCacheEntryInfo */ class nsOfflineCacheEntryInfo MOZ_FINAL : public nsICacheEntryInfo { + ~nsOfflineCacheEntryInfo() {} + public: NS_DECL_ISUPPORTS NS_DECL_NSICACHEENTRYINFO nsOfflineCacheRecord *mRec; }; NS_IMPL_ISUPPORTS(nsOfflineCacheEntryInfo, nsICacheEntryInfo) @@ -887,16 +893,19 @@ nsOfflineCacheDevice::nsOfflineCacheDevi , mDeltaCounter(0) , mAutoShutdown(false) , mLock("nsOfflineCacheDevice.lock") , mActiveCaches(5) , mLockedEntries(64) { } +nsOfflineCacheDevice::~nsOfflineCacheDevice() +{} + /* static */ bool nsOfflineCacheDevice::GetStrictFileOriginPolicy() { nsCOMPtr<nsIPrefBranch> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID); bool retval; if (prefs && NS_SUCCEEDED(prefs->GetBoolPref("security.fileuri.strict_origin_policy", &retval)))
--- a/netwerk/cache/nsDiskCacheDeviceSQL.h +++ b/netwerk/cache/nsDiskCacheDeviceSQL.h @@ -30,16 +30,18 @@ class nsApplicationCacheNamespace MOZ_FI { public: NS_DECL_ISUPPORTS NS_DECL_NSIAPPLICATIONCACHENAMESPACE nsApplicationCacheNamespace() : mItemType(0) {} private: + ~nsApplicationCacheNamespace() {} + uint32_t mItemType; nsCString mNamespaceSpec; nsCString mData; }; class nsOfflineCacheEvictionFunction MOZ_FINAL : public mozIStorageFunction { public: NS_DECL_THREADSAFE_ISUPPORTS @@ -48,16 +50,18 @@ public: nsOfflineCacheEvictionFunction(nsOfflineCacheDevice *device) : mDevice(device) {} void Reset() { mItems.Clear(); } void Apply(); private: + ~nsOfflineCacheEvictionFunction() {} + nsOfflineCacheDevice *mDevice; nsCOMArray<nsIFile> mItems; }; class nsOfflineCacheDevice : public nsCacheDevice , public nsISupports { @@ -183,18 +187,20 @@ public: void SetAutoShutdown() { mAutoShutdown = true; } bool AutoShutdown(nsIApplicationCache * aAppCache); nsIFile * BaseDirectory() { return mBaseDirectory; } nsIFile * CacheDirectory() { return mCacheDirectory; } uint32_t CacheCapacity() { return mCacheCapacity; } uint32_t CacheSize(); uint32_t EntryCount(); - + private: + ~nsOfflineCacheDevice(); + friend class nsApplicationCache; static PLDHashOperator ShutdownApplicationCache(const nsACString &key, nsIWeakReference *weakRef, void *ctx); static bool GetStrictFileOriginPolicy();
--- a/netwerk/cache/nsDiskCacheEntry.h +++ b/netwerk/cache/nsDiskCacheEntry.h @@ -81,20 +81,20 @@ public: NS_DECL_ISUPPORTS NS_DECL_NSICACHEENTRYINFO nsDiskCacheEntryInfo(const char * deviceID, nsDiskCacheEntry * diskEntry) : mDeviceID(deviceID) , mDiskEntry(diskEntry) { } - - virtual ~nsDiskCacheEntryInfo() {} const char* Key() { return mDiskEntry->Key(); } private: + virtual ~nsDiskCacheEntryInfo() {} + const char * mDeviceID; nsDiskCacheEntry * mDiskEntry; }; #endif /* _nsDiskCacheEntry_h_ */
--- a/netwerk/cache/nsDiskCacheStreams.cpp +++ b/netwerk/cache/nsDiskCacheStreams.cpp @@ -37,22 +37,22 @@ class nsDiskCacheInputStream : public ns public: nsDiskCacheInputStream( nsDiskCacheStreamIO * parent, PRFileDesc * fileDesc, const char * buffer, uint32_t endOfStream); - virtual ~nsDiskCacheInputStream(); - NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIINPUTSTREAM private: + virtual ~nsDiskCacheInputStream(); + nsDiskCacheStreamIO * mStreamIO; // backpointer to parent PRFileDesc * mFD; const char * mBuffer; uint32_t mStreamEnd; uint32_t mPos; // stream position bool mClosed; };
--- a/netwerk/cache/nsDiskCacheStreams.h +++ b/netwerk/cache/nsDiskCacheStreams.h @@ -18,18 +18,17 @@ #include "mozilla/Atomics.h" class nsDiskCacheInputStream; class nsDiskCacheDevice; class nsDiskCacheStreamIO : public nsIOutputStream { public: - nsDiskCacheStreamIO(nsDiskCacheBinding * binding); - virtual ~nsDiskCacheStreamIO(); + nsDiskCacheStreamIO(nsDiskCacheBinding * binding); NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIOUTPUTSTREAM nsresult GetInputStream(uint32_t offset, nsIInputStream ** inputStream); nsresult GetOutputStream(uint32_t offset, nsIOutputStream ** outputStream); nsresult ClearBinding(); @@ -43,16 +42,18 @@ public: size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf); // GCC 2.95.2 requires this to be defined, although we never call it. // and OS/2 requires that it not be private nsDiskCacheStreamIO() { NS_NOTREACHED("oops"); } private: + virtual ~nsDiskCacheStreamIO(); + nsresult OpenCacheFile(int flags, PRFileDesc ** fd); nsresult ReadCacheBlocks(uint32_t bufferSize); nsresult FlushBufferToFile(); void UpdateFileSize(); void DeleteBuffer(); nsresult CloseOutputStream(); nsresult SeekAndTruncate(uint32_t offset);
--- a/netwerk/cache/nsMemoryCacheDevice.h +++ b/netwerk/cache/nsMemoryCacheDevice.h @@ -110,16 +110,15 @@ public: NS_DECL_ISUPPORTS NS_DECL_NSICACHEDEVICEINFO nsMemoryCacheDeviceInfo(nsMemoryCacheDevice* device) : mDevice(device) { } +private: virtual ~nsMemoryCacheDeviceInfo() {} - -private: nsMemoryCacheDevice* mDevice; }; #endif // _nsMemoryCacheDevice_h_
--- a/netwerk/cache2/CacheEntry.h +++ b/netwerk/cache2/CacheEntry.h @@ -346,22 +346,22 @@ private: nsCOMPtr<nsIThread> mReleaseThread; }; class CacheEntryHandle : public nsICacheEntry { public: CacheEntryHandle(CacheEntry* aEntry); - virtual ~CacheEntryHandle(); CacheEntry* Entry() const { return mEntry; } NS_DECL_THREADSAFE_ISUPPORTS NS_FORWARD_NSICACHEENTRY(mEntry->) private: + virtual ~CacheEntryHandle(); nsRefPtr<CacheEntry> mEntry; }; class CacheOutputCloseListener : public nsRunnable { public: void OnOutputClosed();
--- a/netwerk/cache2/CacheIOThread.h +++ b/netwerk/cache2/CacheIOThread.h @@ -14,22 +14,23 @@ class nsIRunnable; namespace mozilla { namespace net { class CacheIOThread : public nsIThreadObserver { + virtual ~CacheIOThread(); + public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSITHREADOBSERVER CacheIOThread(); - virtual ~CacheIOThread(); enum ELevel { OPEN_PRIORITY, READ_PRIORITY, OPEN, READ, MANAGEMENT, WRITE,
--- a/netwerk/cache2/CacheIndex.cpp +++ b/netwerk/cache2/CacheIndex.cpp @@ -166,24 +166,24 @@ class FileOpenHelper : public CacheFileI public: NS_DECL_THREADSAFE_ISUPPORTS FileOpenHelper(CacheIndex* aIndex) : mIndex(aIndex) , mCanceled(false) {} - virtual ~FileOpenHelper() {} - void Cancel() { mIndex->AssertOwnsLock(); mCanceled = true; } private: + virtual ~FileOpenHelper() {} + NS_IMETHOD OnFileOpened(CacheFileHandle *aHandle, nsresult aResult); NS_IMETHOD OnDataWritten(CacheFileHandle *aHandle, const char *aBuf, nsresult aResult) { MOZ_CRASH("FileOpenHelper::OnDataWritten should not be called!"); return NS_ERROR_UNEXPECTED; } NS_IMETHOD OnDataRead(CacheFileHandle *aHandle, char *aBuf, nsresult aResult) {
--- a/netwerk/cache2/CacheObserver.h +++ b/netwerk/cache2/CacheObserver.h @@ -12,21 +12,21 @@ #include <algorithm> namespace mozilla { namespace net { class CacheObserver : public nsIObserver , public nsSupportsWeakReference { + virtual ~CacheObserver() {} + NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIOBSERVER - virtual ~CacheObserver() {} - static nsresult Init(); static nsresult Shutdown(); static CacheObserver* Self() { return sSelf; } // Access to preferences static bool const UseNewCache(); static bool const UseDiskCache() { return sUseDiskCache; }
--- a/netwerk/cache2/CacheStorageService.cpp +++ b/netwerk/cache2/CacheStorageService.cpp @@ -1406,19 +1406,20 @@ namespace { // anon class CacheEntryDoomByKeyCallback : public CacheFileIOListener { public: NS_DECL_THREADSAFE_ISUPPORTS CacheEntryDoomByKeyCallback(nsICacheEntryDoomCallback* aCallback) : mCallback(aCallback) { } + +private: virtual ~CacheEntryDoomByKeyCallback(); -private: NS_IMETHOD OnFileOpened(CacheFileHandle *aHandle, nsresult aResult) { return NS_OK; } NS_IMETHOD OnDataWritten(CacheFileHandle *aHandle, const char *aBuf, nsresult aResult) { return NS_OK; } NS_IMETHOD OnDataRead(CacheFileHandle *aHandle, char *aBuf, nsresult aResult) { return NS_OK; } NS_IMETHOD OnFileDoomed(CacheFileHandle *aHandle, nsresult aResult); NS_IMETHOD OnEOFSet(CacheFileHandle *aHandle, nsresult aResult) { return NS_OK; } NS_IMETHOD OnFileRenamed(CacheFileHandle *aHandle, nsresult aResult) { return NS_OK; } nsCOMPtr<nsICacheEntryDoomCallback> mCallback;
--- a/netwerk/cache2/OldWrappers.cpp +++ b/netwerk/cache2/OldWrappers.cpp @@ -477,20 +477,21 @@ NS_IMETHODIMP _OldCacheEntryWrapper::Has return NS_OK; } namespace { // anon class MetaDataVisitorWrapper : public nsICacheMetaDataVisitor { + virtual ~MetaDataVisitorWrapper() {} + NS_DECL_ISUPPORTS NS_DECL_NSICACHEMETADATAVISITOR MetaDataVisitorWrapper(nsICacheEntryMetaDataVisitor* cb) : mCB(cb) {} - virtual ~MetaDataVisitorWrapper() {} nsCOMPtr<nsICacheEntryMetaDataVisitor> mCB; }; NS_IMPL_ISUPPORTS(MetaDataVisitorWrapper, nsICacheMetaDataVisitor) NS_IMETHODIMP MetaDataVisitorWrapper::VisitMetaDataElement(char const * key, char const * value,
--- a/netwerk/cache2/OldWrappers.h +++ b/netwerk/cache2/OldWrappers.h @@ -41,19 +41,19 @@ public: NS_IMETHOD OpenOutputStream(int64_t offset, nsIOutputStream * *_retval); NS_IMETHOD MaybeMarkValid(); NS_IMETHOD HasWriteAccess(bool aWriteOnly, bool *aWriteAccess); NS_IMETHOD VisitMetaData(nsICacheEntryMetaDataVisitor*); _OldCacheEntryWrapper(nsICacheEntryDescriptor* desc); _OldCacheEntryWrapper(nsICacheEntryInfo* info); +private: virtual ~_OldCacheEntryWrapper(); -private: _OldCacheEntryWrapper() MOZ_DELETE; nsICacheEntryDescriptor* mOldDesc; // ref holded in mOldInfo nsCOMPtr<nsICacheEntryInfo> mOldInfo; }; class _OldCacheLoad : public nsRunnable , public nsICacheListener
--- a/netwerk/cookie/CookieServiceChild.h +++ b/netwerk/cookie/CookieServiceChild.h @@ -22,21 +22,22 @@ class CookieServiceChild : public PCooki , public nsSupportsWeakReference { public: NS_DECL_ISUPPORTS NS_DECL_NSICOOKIESERVICE NS_DECL_NSIOBSERVER CookieServiceChild(); - virtual ~CookieServiceChild(); static CookieServiceChild* GetSingleton(); protected: + virtual ~CookieServiceChild(); + void SerializeURIs(nsIURI *aHostURI, nsIChannel *aChannel, nsCString &aHostSpec, nsCString &aHostCharset, nsCString &aOriginatingSpec, nsCString &aOriginatingCharset); nsresult GetCookieStringInternal(nsIURI *aHostURI,
--- a/netwerk/cookie/nsCookie.h +++ b/netwerk/cookie/nsCookie.h @@ -71,18 +71,16 @@ class nsCookie : public nsICookie2 const nsACString &aPath, int64_t aExpiry, int64_t aLastAccessed, int64_t aCreationTime, bool aIsSession, bool aIsSecure, bool aIsHttpOnly); - virtual ~nsCookie() {} - size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const; // fast (inline, non-xpcom) getters inline const nsDependentCString Name() const { return nsDependentCString(mName, mValue - 1); } inline const nsDependentCString Value() const { return nsDependentCString(mValue, mHost - 1); } inline const nsDependentCString Host() const { return nsDependentCString(mHost, mPath - 1); } inline const nsDependentCString RawHost() const { return nsDependentCString(IsDomain() ? mHost + 1 : mHost, mPath - 1); } inline const nsDependentCString Path() const { return nsDependentCString(mPath, mEnd); } @@ -98,16 +96,18 @@ class nsCookie : public nsICookie2 inline void SetExpiry(int64_t aExpiry) { mExpiry = aExpiry; } inline void SetLastAccessed(int64_t aTime) { mLastAccessed = aTime; } inline void SetIsSession(bool aIsSession) { mIsSession = (bool) aIsSession; } // Set the creation time manually, overriding the monotonicity checks in // Create(). Use with caution! inline void SetCreationTime(int64_t aTime) { mCreationTime = aTime; } protected: + virtual ~nsCookie() {} + // member variables // we use char* ptrs to store the strings in a contiguous block, // so we save on the overhead of using nsCStrings. However, we // store a terminating null for each string, so we can hand them // out as nsAFlatCStrings. // // Please update SizeOfIncludingThis if this strategy changes. const char *mName;
--- a/netwerk/cookie/nsCookieService.cpp +++ b/netwerk/cookie/nsCookieService.cpp @@ -384,19 +384,21 @@ public: }; /****************************************************************************** * InsertCookieDBListener impl: * mozIStorageStatementCallback used to track asynchronous insertion operations. ******************************************************************************/ class InsertCookieDBListener MOZ_FINAL : public DBListenerErrorHandler { -protected: +private: virtual const char *GetOpType() { return "INSERT"; } + ~InsertCookieDBListener() {} + public: NS_DECL_ISUPPORTS InsertCookieDBListener(DBState* dbState) : DBListenerErrorHandler(dbState) { } NS_IMETHOD HandleResult(mozIStorageResultSet*) { NS_NOTREACHED("Unexpected call to InsertCookieDBListener::HandleResult"); return NS_OK; @@ -418,19 +420,21 @@ public: NS_IMPL_ISUPPORTS(InsertCookieDBListener, mozIStorageStatementCallback) /****************************************************************************** * UpdateCookieDBListener impl: * mozIStorageStatementCallback used to track asynchronous update operations. ******************************************************************************/ class UpdateCookieDBListener MOZ_FINAL : public DBListenerErrorHandler { -protected: +private: virtual const char *GetOpType() { return "UPDATE"; } + ~UpdateCookieDBListener() {} + public: NS_DECL_ISUPPORTS UpdateCookieDBListener(DBState* dbState) : DBListenerErrorHandler(dbState) { } NS_IMETHOD HandleResult(mozIStorageResultSet*) { NS_NOTREACHED("Unexpected call to UpdateCookieDBListener::HandleResult"); return NS_OK; @@ -444,19 +448,21 @@ public: NS_IMPL_ISUPPORTS(UpdateCookieDBListener, mozIStorageStatementCallback) /****************************************************************************** * RemoveCookieDBListener impl: * mozIStorageStatementCallback used to track asynchronous removal operations. ******************************************************************************/ class RemoveCookieDBListener MOZ_FINAL : public DBListenerErrorHandler { -protected: +private: virtual const char *GetOpType() { return "REMOVE"; } + ~RemoveCookieDBListener() {} + public: NS_DECL_ISUPPORTS RemoveCookieDBListener(DBState* dbState) : DBListenerErrorHandler(dbState) { } NS_IMETHOD HandleResult(mozIStorageResultSet*) { NS_NOTREACHED("Unexpected call to RemoveCookieDBListener::HandleResult"); return NS_OK; @@ -470,20 +476,22 @@ public: NS_IMPL_ISUPPORTS(RemoveCookieDBListener, mozIStorageStatementCallback) /****************************************************************************** * ReadCookieDBListener impl: * mozIStorageStatementCallback used to track asynchronous removal operations. ******************************************************************************/ class ReadCookieDBListener MOZ_FINAL : public DBListenerErrorHandler { -protected: +private: virtual const char *GetOpType() { return "READ"; } bool mCanceled; + ~ReadCookieDBListener() {} + public: NS_DECL_ISUPPORTS ReadCookieDBListener(DBState* dbState) : DBListenerErrorHandler(dbState) , mCanceled(false) { } @@ -550,16 +558,18 @@ NS_IMPL_ISUPPORTS(ReadCookieDBListener, /****************************************************************************** * CloseCookieDBListener imp: * Static mozIStorageCompletionCallback used to notify when the database is * successfully closed. ******************************************************************************/ class CloseCookieDBListener MOZ_FINAL : public mozIStorageCompletionCallback { + ~CloseCookieDBListener() {} + public: CloseCookieDBListener(DBState* dbState) : mDBState(dbState) { } nsRefPtr<DBState> mDBState; NS_DECL_ISUPPORTS NS_IMETHOD Complete(nsresult, nsISupports*) { gCookieService->HandleDBClosed(mDBState); @@ -567,16 +577,19 @@ public: } }; NS_IMPL_ISUPPORTS(CloseCookieDBListener, mozIStorageCompletionCallback) namespace { class AppClearDataObserver MOZ_FINAL : public nsIObserver { + + ~AppClearDataObserver() {} + public: NS_DECL_ISUPPORTS // nsIObserver implementation. NS_IMETHODIMP Observe(nsISupports *aSubject, const char *aTopic, const char16_t *data) { MOZ_ASSERT(!nsCRT::strcmp(aTopic, TOPIC_WEB_APP_CLEAR_DATA));
--- a/netwerk/cookie/nsCookieService.h +++ b/netwerk/cookie/nsCookieService.h @@ -251,29 +251,30 @@ class nsCookieService : public nsICookie NS_DECL_ISUPPORTS NS_DECL_NSIOBSERVER NS_DECL_NSICOOKIESERVICE NS_DECL_NSICOOKIEMANAGER NS_DECL_NSICOOKIEMANAGER2 NS_DECL_NSIMEMORYREPORTER nsCookieService(); - virtual ~nsCookieService(); static nsICookieService* GetXPCOMSingleton(); nsresult Init(); /** * Start watching the observer service for messages indicating that an app has * been uninstalled. When an app is uninstalled, we get the cookie service * (thus instantiating it, if necessary) and clear all the cookies for that * app. */ static void AppClearDataObserverInit(); protected: + virtual ~nsCookieService(); + void PrefChanged(nsIPrefBranch *aPrefBranch); void InitDBStates(); OpenDBResult TryInitDB(bool aDeleteExistingDB); nsresult CreateTable(); void CloseDBStates(); void CleanupCachedStatements(); void CleanupDefaultDBConnection(); void HandleDBClosed(DBState* aDBState);
--- a/netwerk/dns/ChildDNSService.h +++ b/netwerk/dns/ChildDNSService.h @@ -22,21 +22,22 @@ class ChildDNSService MOZ_FINAL public: // AsyncResolve (and CancelAsyncResolve) can be called off-main NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSPIDNSSERVICE NS_DECL_NSIDNSSERVICE NS_DECL_NSIOBSERVER ChildDNSService(); - virtual ~ChildDNSService(); static ChildDNSService* GetSingleton(); private: + virtual ~ChildDNSService(); + bool mFirstTime; bool mOffline; bool mDisablePrefetch; }; } // namespace net } // namespace mozilla #endif // mozilla_net_ChildDNSService_h
--- a/netwerk/dns/DNSListenerProxy.h +++ b/netwerk/dns/DNSListenerProxy.h @@ -51,16 +51,18 @@ public: private: nsMainThreadPtrHandle<nsIDNSListener> mListener; nsCOMPtr<nsICancelable> mRequest; nsCOMPtr<nsIDNSRecord> mRecord; nsresult mStatus; }; private: + ~DNSListenerProxy() {} + nsMainThreadPtrHandle<nsIDNSListener> mListener; nsCOMPtr<nsIEventTarget> mTargetThread; }; } // namespace net } // namespace mozilla #endif // DNSListenerProxy_h__
--- a/netwerk/dns/DNSRequestChild.cpp +++ b/netwerk/dns/DNSRequestChild.cpp @@ -25,19 +25,20 @@ namespace net { class ChildDNSRecord : public nsIDNSRecord { public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIDNSRECORD ChildDNSRecord(const DNSRecord& reply, uint16_t flags); + +private: virtual ~ChildDNSRecord(); -private: nsCString mCanonicalName; nsTArray<NetAddr> mAddresses; uint32_t mCurrent; // addr iterator uint32_t mLength; // number of addrs uint16_t mFlags; }; NS_IMPL_ISUPPORTS(ChildDNSRecord, nsIDNSRecord)
--- a/netwerk/dns/DNSRequestChild.h +++ b/netwerk/dns/DNSRequestChild.h @@ -21,33 +21,34 @@ class DNSRequestChild , public nsICancelable { public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSICANCELABLE DNSRequestChild(const nsCString& aHost, const uint32_t& aFlags, nsIDNSListener *aListener, nsIEventTarget *target); - virtual ~DNSRequestChild() {} void AddIPDLReference() { AddRef(); } void ReleaseIPDLReference() { // we don't need an 'mIPCOpen' variable until/unless we add calls that might // try to send IPDL msgs to parent after ReleaseIPDLReference is called // (when IPDL channel torn down). Release(); } // Sends IPDL request to parent void StartRequest(); void CallOnLookupComplete(); private: + virtual ~DNSRequestChild() {} + virtual bool Recv__delete__(const DNSRequestResponse& reply) MOZ_OVERRIDE; nsCOMPtr<nsIDNSListener> mListener; nsCOMPtr<nsIEventTarget> mTarget; nsCOMPtr<nsIDNSRecord> mResultRecord; nsresult mResultStatus; nsCString mHost; uint16_t mFlags;
--- a/netwerk/dns/DNSRequestParent.h +++ b/netwerk/dns/DNSRequestParent.h @@ -18,22 +18,23 @@ class DNSRequestParent : public PDNSRequestParent , public nsIDNSListener { public: NS_DECL_ISUPPORTS NS_DECL_NSIDNSLISTENER DNSRequestParent(); - virtual ~DNSRequestParent(); void DoAsyncResolve(const nsACString &hostname, uint32_t flags); protected: virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE; private: + virtual ~DNSRequestParent(); + uint32_t mFlags; bool mIPCClosed; // true if IPDL channel has been closed (child crash) }; } // namespace net } // namespace mozilla #endif // mozilla_net_DNSRequestParent_h
--- a/netwerk/dns/nsDNSService2.cpp +++ b/netwerk/dns/nsDNSService2.cpp @@ -245,31 +245,32 @@ nsDNSRecord::ReportUnusable(uint16_t aPo return NS_OK; } //----------------------------------------------------------------------------- class nsDNSAsyncRequest MOZ_FINAL : public nsResolveHostCallback , public nsICancelable { + ~nsDNSAsyncRequest() {} + public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSICANCELABLE nsDNSAsyncRequest(nsHostResolver *res, const nsACString &host, nsIDNSListener *listener, uint16_t flags, uint16_t af) : mResolver(res) , mHost(host) , mListener(listener) , mFlags(flags) , mAF(af) {} - ~nsDNSAsyncRequest() {} void OnLookupComplete(nsHostResolver *, nsHostRecord *, nsresult); // Returns TRUE if the DNS listener arg is the same as the member listener // Used in Cancellations to remove DNS requests associated with a // particular hostname and nsIDNSListener bool EqualsAsyncListener(nsIDNSListener *aListener); size_t SizeOfIncludingThis(mozilla::MallocSizeOf) const;
--- a/netwerk/dns/nsDNSService2.h +++ b/netwerk/dns/nsDNSService2.h @@ -28,23 +28,24 @@ class nsDNSService MOZ_FINAL : public ns public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSPIDNSSERVICE NS_DECL_NSIDNSSERVICE NS_DECL_NSIOBSERVER NS_DECL_NSIMEMORYREPORTER nsDNSService(); - ~nsDNSService(); static nsIDNSService* GetXPCOMSingleton(); size_t SizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const; private: + ~nsDNSService(); + static nsDNSService* GetSingleton(); uint16_t GetAFForLookup(const nsACString &host, uint32_t flags); nsRefPtr<nsHostResolver> mResolver; nsCOMPtr<nsIIDNService> mIDN; // mLock protects access to mResolver and mIPv4OnlyDomains
--- a/netwerk/dns/nsIDNService.h +++ b/netwerk/dns/nsIDNService.h @@ -27,20 +27,22 @@ class nsIDNService : public nsIIDNServic public nsSupportsWeakReference { public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIIDNSERVICE NS_DECL_NSIOBSERVER nsIDNService(); - virtual ~nsIDNService(); nsresult Init(); +protected: + virtual ~nsIDNService(); + private: void normalizeFullStops(nsAString& s); nsresult stringPrepAndACE(const nsAString& in, nsACString& out, bool allowUnassigned, bool convertAllLabels); nsresult encodeToACE(const nsAString& in, nsACString& out); nsresult stringPrep(const nsAString& in, nsAString& out, bool allowUnassigned); nsresult decodeACE(const nsACString& in, nsACString& out,
--- a/netwerk/ipc/NeckoParent.h +++ b/netwerk/ipc/NeckoParent.h @@ -65,16 +65,18 @@ public: /* * This implementation of nsIAuthPrompt2 is used for nested remote iframes that * want an auth prompt. This class lives in the parent process and informs the * NeckoChild that we want an auth prompt, which forwards the request to the * TabParent in the remote iframe that contains the nested iframe */ class NestedFrameAuthPrompt MOZ_FINAL : public nsIAuthPrompt2 { + ~NestedFrameAuthPrompt() {} + public: NS_DECL_ISUPPORTS NestedFrameAuthPrompt(PNeckoParent* aParent, uint64_t aNestedFrameId); NS_IMETHOD PromptAuth(nsIChannel*, uint32_t, nsIAuthInformation*, bool*) { return NS_ERROR_NOT_IMPLEMENTED;
--- a/netwerk/ipc/RemoteOpenFileChild.h +++ b/netwerk/ipc/RemoteOpenFileChild.h @@ -47,25 +47,25 @@ class RemoteOpenFileChild MOZ_FINAL : public PRemoteOpenFileChild , public nsIFile , public nsIHashable , public nsICachedFileDescriptorListener { typedef mozilla::dom::TabChild TabChild; typedef mozilla::ipc::FileDescriptor FileDescriptor; + virtual ~RemoteOpenFileChild(); + public: RemoteOpenFileChild() : mNSPRFileDesc(nullptr) , mAsyncOpenCalled(false) , mNSPROpenCalled(false) {} - virtual ~RemoteOpenFileChild(); - NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIFILE NS_DECL_NSIHASHABLE // aRemoteOpenUri must be scheme 'remoteopenfile://': otherwise looks like // a file:// uri. nsresult Init(nsIURI* aRemoteOpenUri, nsIURI* aAppUri);
--- a/netwerk/mime/nsMIMEHeaderParamImpl.h +++ b/netwerk/mime/nsMIMEHeaderParamImpl.h @@ -9,18 +9,18 @@ #define __nsmimeheaderparamimpl_h___ class nsMIMEHeaderParamImpl : public nsIMIMEHeaderParam { public: NS_DECL_ISUPPORTS NS_DECL_NSIMIMEHEADERPARAM nsMIMEHeaderParamImpl() {} +private: virtual ~nsMIMEHeaderParamImpl() {} -private: enum ParamDecoding { MIME_FIELD_ENCODING = 1, HTTP_FIELD_ENCODING }; nsresult DoGetParameter(const nsACString& aHeaderVal, const char *aParamName, ParamDecoding aDecoding,
--- a/netwerk/protocol/about/nsAboutBlank.h +++ b/netwerk/protocol/about/nsAboutBlank.h @@ -11,22 +11,22 @@ class nsAboutBlank : public nsIAboutModule { public: NS_DECL_ISUPPORTS NS_DECL_NSIABOUTMODULE nsAboutBlank() {} - virtual ~nsAboutBlank() {} static nsresult Create(nsISupports *aOuter, REFNSIID aIID, void **aResult); -protected: +private: + virtual ~nsAboutBlank() {} }; #define NS_ABOUT_BLANK_MODULE_CID \ { /* 3decd6c8-30ef-11d3-8cd0-0060b0fc14a3 */ \ 0x3decd6c8, \ 0x30ef, \ 0x11d3, \ {0x8c, 0xd0, 0x00, 0x60, 0xb0, 0xfc, 0x14, 0xa3} \
--- a/netwerk/protocol/about/nsAboutBloat.h +++ b/netwerk/protocol/about/nsAboutBloat.h @@ -11,22 +11,22 @@ class nsAboutBloat : public nsIAboutModule { public: NS_DECL_ISUPPORTS NS_DECL_NSIABOUTMODULE nsAboutBloat() {} - virtual ~nsAboutBloat() {} static nsresult Create(nsISupports *aOuter, REFNSIID aIID, void **aResult); -protected: +private: + virtual ~nsAboutBloat() {} }; #define NS_ABOUT_BLOAT_MODULE_CID \ { /* f9666720-801f-11d3-9399-00104ba0fd40 */ \ 0xf9666720, \ 0x801f, \ 0x11d3, \ {0x93, 0x99, 0x00, 0x10, 0x4b, 0xa0, 0xfd, 0x40} \
--- a/netwerk/protocol/about/nsAboutCache.h +++ b/netwerk/protocol/about/nsAboutCache.h @@ -21,26 +21,27 @@ class nsAboutCache : public nsIAboutModu , public nsICacheStorageVisitor { public: NS_DECL_ISUPPORTS NS_DECL_NSIABOUTMODULE NS_DECL_NSICACHESTORAGEVISITOR nsAboutCache() {} - virtual ~nsAboutCache() {} static nsresult Create(nsISupports *aOuter, REFNSIID aIID, void **aResult); static nsresult GetStorage(nsACString const & storageName, nsILoadContextInfo* loadInfo, nsICacheStorage **storage); protected: + virtual ~nsAboutCache() {} + nsresult ParseURI(nsIURI * uri, nsACString & storage); // Finds a next storage we wish to visit (we use this method // even there is a specified storage name, which is the only // one in the list then.) Posts FireVisitStorage() when found. nsresult VisitNextStorage(); // Helper method that calls VisitStorage() for the current storage. // When it fails, OnCacheEntryVisitCompleted is simlated to close
--- a/netwerk/protocol/about/nsAboutCacheEntry.h +++ b/netwerk/protocol/about/nsAboutCacheEntry.h @@ -33,19 +33,19 @@ public: NS_DECL_NSISTREAMLISTENER nsAboutCacheEntry() : mBuffer(nullptr) , mWaitingForData(false) , mHexDumpState(0) {} +private: virtual ~nsAboutCacheEntry() {} -private: nsresult GetContentStream(nsIURI *, nsIInputStream **); nsresult OpenCacheEntry(nsIURI *); nsresult OpenCacheEntry(); nsresult WriteCacheEntryDescription(nsICacheEntry *); nsresult WriteCacheEntryUnavailable(); nsresult ParseURI(nsIURI *uri, nsACString &storageName, nsILoadContextInfo **loadInfo, nsCString &enahnceID, nsIURI **cacheUri);
--- a/netwerk/protocol/about/nsAboutProtocolHandler.h +++ b/netwerk/protocol/about/nsAboutProtocolHandler.h @@ -17,16 +17,18 @@ class nsAboutProtocolHandler : public ns public: NS_DECL_ISUPPORTS // nsIProtocolHandler methods: NS_DECL_NSIPROTOCOLHANDLER // nsAboutProtocolHandler methods: nsAboutProtocolHandler() {} + +private: virtual ~nsAboutProtocolHandler() {} }; class nsSafeAboutProtocolHandler MOZ_FINAL : public nsIProtocolHandler { public: NS_DECL_ISUPPORTS
--- a/netwerk/protocol/app/AppProtocolHandler.cpp +++ b/netwerk/protocol/app/AppProtocolHandler.cpp @@ -26,16 +26,18 @@ public: NS_DECL_NSICHANNEL NS_DECL_NSIJARCHANNEL DummyChannel(); NS_IMETHODIMP Run(); private: + ~DummyChannel() {} + bool mPending; uint32_t mSuspendCount; nsCOMPtr<nsISupports> mListenerContext; nsCOMPtr<nsIStreamListener> mListener; nsCOMPtr<nsILoadGroup> mLoadGroup; nsLoadFlags mLoadFlags; };
--- a/netwerk/protocol/app/AppProtocolHandler.h +++ b/netwerk/protocol/app/AppProtocolHandler.h @@ -16,20 +16,20 @@ class AppProtocolHandler : public nsIPro public: NS_DECL_ISUPPORTS // nsIProtocolHandler methods: NS_DECL_NSIPROTOCOLHANDLER // AppProtocolHandler methods: AppProtocolHandler(); - virtual ~AppProtocolHandler(); // Define a Create method to be used with a factory: static nsresult Create(nsISupports* aOuter, const nsIID& aIID, void* *aResult); private: + virtual ~AppProtocolHandler(); nsClassHashtable<nsCStringHashKey, mozilla::dom::AppInfo> mAppInfoCache; }; #endif /* AppProtocolHandler_ */
--- a/netwerk/protocol/data/nsDataHandler.h +++ b/netwerk/protocol/data/nsDataHandler.h @@ -5,25 +5,26 @@ #ifndef nsDataHandler_h___ #define nsDataHandler_h___ #include "nsIProtocolHandler.h" class nsDataHandler : public nsIProtocolHandler { + virtual ~nsDataHandler(); + public: NS_DECL_ISUPPORTS // nsIProtocolHandler methods: NS_DECL_NSIPROTOCOLHANDLER // nsDataHandler methods: nsDataHandler(); - virtual ~nsDataHandler(); // Define a Create method to be used with a factory: static nsresult Create(nsISupports* aOuter, const nsIID& aIID, void* *aResult); // Parse a data: URI and return the individual parts // (the given spec will temporarily be modified but will be returned // to the original before returning)
--- a/netwerk/protocol/device/nsDeviceProtocolHandler.h +++ b/netwerk/protocol/device/nsDeviceProtocolHandler.h @@ -10,19 +10,20 @@ #include "mozilla/Attributes.h" // {6b0ffe9e-d114-486b-aeb7-da62e7273ed5} #define NS_DEVICEPROTOCOLHANDLER_CID \ { 0x60ffe9e, 0xd114, 0x486b, \ {0xae, 0xb7, 0xda, 0x62, 0xe7, 0x27, 0x3e, 0xd5} } class nsDeviceProtocolHandler MOZ_FINAL : public nsIProtocolHandler { + ~nsDeviceProtocolHandler() {} + public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIPROTOCOLHANDLER nsDeviceProtocolHandler() {} - ~nsDeviceProtocolHandler() {} nsresult Init(); }; #endif
--- a/netwerk/protocol/file/nsFileProtocolHandler.h +++ b/netwerk/protocol/file/nsFileProtocolHandler.h @@ -7,20 +7,21 @@ #define nsFileProtocolHandler_h__ #include "nsIFileProtocolHandler.h" #include "nsWeakReference.h" class nsFileProtocolHandler : public nsIFileProtocolHandler , public nsSupportsWeakReference { + virtual ~nsFileProtocolHandler() {} + public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIPROTOCOLHANDLER NS_DECL_NSIFILEPROTOCOLHANDLER nsFileProtocolHandler(); - virtual ~nsFileProtocolHandler() {} nsresult Init(); }; #endif // !nsFileProtocolHandler_h__
--- a/netwerk/protocol/ftp/FTPChannelParent.h +++ b/netwerk/protocol/ftp/FTPChannelParent.h @@ -28,17 +28,16 @@ class FTPChannelParent : public PFTPChan public: NS_DECL_ISUPPORTS NS_DECL_NSIREQUESTOBSERVER NS_DECL_NSISTREAMLISTENER NS_DECL_NSIPARENTCHANNEL NS_DECL_NSIINTERFACEREQUESTOR FTPChannelParent(nsILoadContext* aLoadContext, PBOverrideStatus aOverrideStatus); - virtual ~FTPChannelParent(); bool Init(const FTPChannelCreationArgs& aOpenArgs); // ADivertableParentChannel functions. void DivertTo(nsIStreamListener *aListener) MOZ_OVERRIDE; nsresult SuspendForDiversion() MOZ_OVERRIDE; // Calls OnStartRequest for "DivertTo" listener, then notifies child channel @@ -46,16 +45,18 @@ public: // parent channel. void StartDiversion(); // Handles calling OnStart/Stop if there are errors during diversion. // Called asynchronously from FailDiversion. void NotifyDiversionFailed(nsresult aErrorCode, bool aSkipResume = true); protected: + virtual ~FTPChannelParent(); + // private, supporting function for ADivertableParentChannel. nsresult ResumeForDiversion(); // Asynchronously calls NotifyDiversionFailed. void FailDiversion(nsresult aErrorCode, bool aSkipResume = true); bool DoAsyncOpen(const URIParams& aURI, const uint64_t& aStartPos, const nsCString& aEntityID,
--- a/netwerk/protocol/ftp/nsFTPChannel.cpp +++ b/netwerk/protocol/ftp/nsFTPChannel.cpp @@ -127,16 +127,18 @@ nsFtpChannel::OnCallbacksChanged() } //----------------------------------------------------------------------------- namespace { class FTPEventSinkProxy MOZ_FINAL : public nsIFTPEventSink { + ~FTPEventSinkProxy() {} + public: FTPEventSinkProxy(nsIFTPEventSink* aTarget) : mTarget(aTarget) , mTargetThread(do_GetCurrentThread()) { } NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIFTPEVENTSINK
--- a/netwerk/protocol/ftp/nsFtpControlConnection.h +++ b/netwerk/protocol/ftp/nsFtpControlConnection.h @@ -35,22 +35,23 @@ public: * @param status * A failure code providing more info about the error. */ virtual void OnControlError(nsresult status) = 0; }; class nsFtpControlConnection MOZ_FINAL : public nsIInputStreamCallback { + ~nsFtpControlConnection(); + public: NS_DECL_ISUPPORTS NS_DECL_NSIINPUTSTREAMCALLBACK nsFtpControlConnection(const nsCSubstring& host, uint32_t port); - ~nsFtpControlConnection(); nsresult Connect(nsIProxyInfo* proxyInfo, nsITransportEventSink* eventSink); nsresult Disconnect(nsresult status); nsresult Write(const nsCSubstring& command); bool IsAlive(); nsITransport *Transport() { return mSocket; }
--- a/netwerk/protocol/ftp/nsFtpProtocolHandler.h +++ b/netwerk/protocol/ftp/nsFtpProtocolHandler.h @@ -23,29 +23,30 @@ class nsFtpProtocolHandler : public nsIP { public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIPROTOCOLHANDLER NS_DECL_NSIPROXIEDPROTOCOLHANDLER NS_DECL_NSIOBSERVER nsFtpProtocolHandler(); - virtual ~nsFtpProtocolHandler(); nsresult Init(); // FTP Connection list access nsresult InsertConnection(nsIURI *aKey, nsFtpControlConnection *aConn); nsresult RemoveConnection(nsIURI *aKey, nsFtpControlConnection **aConn); uint32_t GetSessionId() { return mSessionId; } uint8_t GetDataQoSBits() { return mDataQoSBits; } uint8_t GetControlQoSBits() { return mControlQoSBits; } private: + virtual ~nsFtpProtocolHandler(); + // Stuff for the timer callback function struct timerStruct { nsCOMPtr<nsITimer> timer; nsFtpControlConnection *conn; char *key; timerStruct() : conn(nullptr), key(nullptr) {}
--- a/netwerk/protocol/http/Http2Push.h +++ b/netwerk/protocol/http/Http2Push.h @@ -70,22 +70,23 @@ private: class Http2PushTransactionBuffer MOZ_FINAL : public nsAHttpTransaction { public: NS_DECL_ISUPPORTS NS_DECL_NSAHTTPTRANSACTION Http2PushTransactionBuffer(); - virtual ~Http2PushTransactionBuffer(); nsresult GetBufferedData(char *buf, uint32_t count, uint32_t *countWritten); void SetPushStream(Http2PushedStream *stream) { mPushStream = stream; } private: + virtual ~Http2PushTransactionBuffer(); + const static uint32_t kDefaultBufferSize = 4096; nsresult mStatus; nsHttpRequestHead *mRequestHead; Http2PushedStream *mPushStream; bool mIsDone; nsAutoArrayPtr<char> mBufferedHTTP1;
--- a/netwerk/protocol/http/Http2Session.h +++ b/netwerk/protocol/http/Http2Session.h @@ -27,25 +27,26 @@ class Http2PushedStream; class Http2Stream; class nsHttpTransaction; class Http2Session MOZ_FINAL : public ASpdySession , public nsAHttpConnection , public nsAHttpSegmentReader , public nsAHttpSegmentWriter { + ~Http2Session(); + public: NS_DECL_ISUPPORTS NS_DECL_NSAHTTPTRANSACTION NS_DECL_NSAHTTPCONNECTION(mConnection) NS_DECL_NSAHTTPSEGMENTREADER NS_DECL_NSAHTTPSEGMENTWRITER - Http2Session(nsISocketTransport *); - ~Http2Session(); + Http2Session(nsISocketTransport *); bool AddStream(nsAHttpTransaction *, int32_t, bool, nsIInterfaceRequestor *); bool CanReuse() { return !mShouldGoAway && !mClosed; } bool RoomForMoreStreams(); // When the connection is active this is called up to once every 1 second // return the interval (in seconds) that the connection next wants to
--- a/netwerk/protocol/http/HttpBaseChannel.h +++ b/netwerk/protocol/http/HttpBaseChannel.h @@ -58,26 +58,28 @@ class HttpBaseChannel : public nsHashPro , public nsIUploadChannel , public nsIUploadChannel2 , public nsISupportsPriority , public nsIResumableChannel , public nsITraceableChannel , public PrivateBrowsingChannel<HttpBaseChannel> , public nsITimedChannel { +protected: + virtual ~HttpBaseChannel(); + public: NS_DECL_ISUPPORTS_INHERITED NS_DECL_NSIUPLOADCHANNEL NS_DECL_NSIUPLOADCHANNEL2 NS_DECL_NSITRACEABLECHANNEL NS_DECL_NSITIMEDCHANNEL NS_DECL_NSIREDIRECTHISTORY HttpBaseChannel(); - virtual ~HttpBaseChannel(); virtual nsresult Init(nsIURI *aURI, uint32_t aCaps, nsProxyInfo *aProxyInfo, uint32_t aProxyResolveFlags, nsIURI *aProxyURI); // nsIRequest NS_IMETHOD GetName(nsACString& aName); NS_IMETHOD IsPending(bool *aIsPending); @@ -184,19 +186,20 @@ public: class nsContentEncodings : public nsIUTF8StringEnumerator { public: NS_DECL_ISUPPORTS NS_DECL_NSIUTF8STRINGENUMERATOR nsContentEncodings(nsIHttpChannel* aChannel, const char* aEncodingHeader); + + private: virtual ~nsContentEncodings(); - private: nsresult PrepareForNext(void); // We do not own the buffer. The channel owns it. const char* mEncodingHeader; const char* mCurStart; // points to start of current header const char* mCurEnd; // points to end of current header // Hold a ref to our channel so that it can't go away and take the
--- a/netwerk/protocol/http/HttpChannelChild.h +++ b/netwerk/protocol/http/HttpChannelChild.h @@ -44,30 +44,30 @@ class HttpChannelChild : public PHttpCha , public nsIProxiedChannel , public nsIApplicationCacheChannel , public nsIAsyncVerifyRedirectCallback , public nsIAssociatedContentSecurity , public nsIChildChannel , public nsIHttpChannelChild , public nsIDivertableChannel { + virtual ~HttpChannelChild(); public: NS_DECL_ISUPPORTS_INHERITED NS_DECL_NSICACHEINFOCHANNEL NS_DECL_NSIPROXIEDCHANNEL NS_DECL_NSIAPPLICATIONCACHECONTAINER NS_DECL_NSIAPPLICATIONCACHECHANNEL NS_DECL_NSIASYNCVERIFYREDIRECTCALLBACK NS_DECL_NSIASSOCIATEDCONTENTSECURITY NS_DECL_NSICHILDCHANNEL NS_DECL_NSIHTTPCHANNELCHILD NS_DECL_NSIDIVERTABLECHANNEL HttpChannelChild(); - virtual ~HttpChannelChild(); // Methods HttpBaseChannel didn't implement for us or that we override. // // nsIRequest NS_IMETHOD Cancel(nsresult status); NS_IMETHOD Suspend(); NS_IMETHOD Resume(); // nsIChannel
--- a/netwerk/protocol/http/HttpChannelParent.h +++ b/netwerk/protocol/http/HttpChannelParent.h @@ -34,30 +34,31 @@ class PBrowserOrId; class HttpChannelParent : public PHttpChannelParent , public nsIParentRedirectingChannel , public nsIProgressEventSink , public nsIInterfaceRequestor , public ADivertableParentChannel , public nsIAuthPromptProvider { + virtual ~HttpChannelParent(); + public: NS_DECL_ISUPPORTS NS_DECL_NSIREQUESTOBSERVER NS_DECL_NSISTREAMLISTENER NS_DECL_NSIPARENTCHANNEL NS_DECL_NSIPARENTREDIRECTINGCHANNEL NS_DECL_NSIPROGRESSEVENTSINK NS_DECL_NSIINTERFACEREQUESTOR NS_DECL_NSIAUTHPROMPTPROVIDER HttpChannelParent(const PBrowserOrId& iframeEmbedding, nsILoadContext* aLoadContext, PBOverrideStatus aStatus); - virtual ~HttpChannelParent(); bool Init(const HttpChannelCreationArgs& aOpenArgs); // ADivertableParentChannel functions. void DivertTo(nsIStreamListener *aListener) MOZ_OVERRIDE; nsresult SuspendForDiversion() MOZ_OVERRIDE; // Calls OnStartRequest for "DivertTo" listener, then notifies child channel
--- a/netwerk/protocol/http/HttpChannelParentListener.h +++ b/netwerk/protocol/http/HttpChannelParentListener.h @@ -28,23 +28,24 @@ public: NS_DECL_ISUPPORTS NS_DECL_NSIINTERFACEREQUESTOR NS_DECL_NSICHANNELEVENTSINK NS_DECL_NSIREDIRECTRESULTLISTENER NS_DECL_NSIREQUESTOBSERVER NS_DECL_NSISTREAMLISTENER HttpChannelParentListener(HttpChannelParent* aInitialChannel); - virtual ~HttpChannelParentListener(); // For channel diversion from child to parent. nsresult DivertTo(nsIStreamListener *aListener); nsresult SuspendForDiversion(); private: + virtual ~HttpChannelParentListener(); + // Private partner function to SuspendForDiversion. nsresult ResumeForDiversion(); // Can be the original HttpChannelParent that created this object (normal // case), a different {HTTP|FTP}ChannelParent that we've been redirected to, // or some other listener that we have been diverted to via // nsIDivertableChannel. nsCOMPtr<nsIStreamListener> mNextListener;
--- a/netwerk/protocol/http/NullHttpTransaction.h +++ b/netwerk/protocol/http/NullHttpTransaction.h @@ -30,28 +30,29 @@ class NullHttpTransaction : public nsAHt public: NS_DECLARE_STATIC_IID_ACCESSOR(NS_NULLHTTPTRANSACTION_IID) NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSAHTTPTRANSACTION NullHttpTransaction(nsHttpConnectionInfo *ci, nsIInterfaceRequestor *callbacks, uint32_t caps); - virtual ~NullHttpTransaction(); // Overload of nsAHttpTransaction methods bool IsNullTransaction() MOZ_OVERRIDE MOZ_FINAL { return true; } bool ResponseTimeoutEnabled() const MOZ_OVERRIDE MOZ_FINAL {return true; } PRIntervalTime ResponseTimeout() MOZ_OVERRIDE MOZ_FINAL { return PR_SecondsToInterval(15); } +protected: + virtual ~NullHttpTransaction(); + private: - nsresult mStatus; uint32_t mCaps; // mCapsToClear holds flags that should be cleared in mCaps, e.g. unset // NS_HTTP_REFRESH_DNS when DNS refresh request has completed to avoid // redundant requests on the network. To deal with raciness, only unsetting // bitfields should be allowed: 'lost races' will thus err on the // conservative side, e.g. by going ahead with a 2nd DNS refresh. uint32_t mCapsToClear;
--- a/netwerk/protocol/http/SpdyPush3.h +++ b/netwerk/protocol/http/SpdyPush3.h @@ -71,22 +71,23 @@ private: class SpdyPush3TransactionBuffer MOZ_FINAL : public nsAHttpTransaction { public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSAHTTPTRANSACTION SpdyPush3TransactionBuffer(); - virtual ~SpdyPush3TransactionBuffer(); nsresult GetBufferedData(char *buf, uint32_t count, uint32_t *countWritten); void SetPushStream(SpdyPushedStream3 *stream) { mPushStream = stream; } private: + virtual ~SpdyPush3TransactionBuffer(); + const static uint32_t kDefaultBufferSize = 4096; nsresult mStatus; nsHttpRequestHead *mRequestHead; SpdyPushedStream3 *mPushStream; bool mIsDone; nsAutoArrayPtr<char> mBufferedHTTP1;
--- a/netwerk/protocol/http/SpdyPush31.h +++ b/netwerk/protocol/http/SpdyPush31.h @@ -71,22 +71,23 @@ private: class SpdyPush31TransactionBuffer MOZ_FINAL : public nsAHttpTransaction { public: NS_DECL_ISUPPORTS NS_DECL_NSAHTTPTRANSACTION SpdyPush31TransactionBuffer(); - virtual ~SpdyPush31TransactionBuffer(); nsresult GetBufferedData(char *buf, uint32_t count, uint32_t *countWritten); void SetPushStream(SpdyPushedStream31 *stream) { mPushStream = stream; } private: + virtual ~SpdyPush31TransactionBuffer(); + const static uint32_t kDefaultBufferSize = 4096; nsresult mStatus; nsHttpRequestHead *mRequestHead; SpdyPushedStream31 *mPushStream; bool mIsDone; nsAutoArrayPtr<char> mBufferedHTTP1;
--- a/netwerk/protocol/http/SpdySession3.h +++ b/netwerk/protocol/http/SpdySession3.h @@ -26,25 +26,26 @@ class SpdyPushedStream3; class SpdyStream3; class nsHttpTransaction; class SpdySession3 MOZ_FINAL : public ASpdySession , public nsAHttpConnection , public nsAHttpSegmentReader , public nsAHttpSegmentWriter { + ~SpdySession3(); + public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSAHTTPTRANSACTION NS_DECL_NSAHTTPCONNECTION(mConnection) NS_DECL_NSAHTTPSEGMENTREADER NS_DECL_NSAHTTPSEGMENTWRITER SpdySession3(nsISocketTransport *); - ~SpdySession3(); bool AddStream(nsAHttpTransaction *, int32_t, bool, nsIInterfaceRequestor *); bool CanReuse() { return !mShouldGoAway && !mClosed; } bool RoomForMoreStreams(); // When the connection is active this is called up to once every 1 second // return the interval (in seconds) that the connection next wants to
--- a/netwerk/protocol/http/SpdySession31.h +++ b/netwerk/protocol/http/SpdySession31.h @@ -25,25 +25,26 @@ class SpdyPushedStream31; class SpdyStream31; class nsHttpTransaction; class SpdySession31 MOZ_FINAL : public ASpdySession , public nsAHttpConnection , public nsAHttpSegmentReader , public nsAHttpSegmentWriter { + ~SpdySession31(); + public: NS_DECL_ISUPPORTS NS_DECL_NSAHTTPTRANSACTION NS_DECL_NSAHTTPCONNECTION(mConnection) NS_DECL_NSAHTTPSEGMENTREADER NS_DECL_NSAHTTPSEGMENTWRITER SpdySession31(nsISocketTransport *); - ~SpdySession31(); bool AddStream(nsAHttpTransaction *, int32_t, bool, nsIInterfaceRequestor *); bool CanReuse() { return !mShouldGoAway && !mClosed; } bool RoomForMoreStreams(); // When the connection is active this is called up to once every 1 second // return the interval (in seconds) that the connection next wants to
--- a/netwerk/protocol/http/SpdyZlibReporter.h +++ b/netwerk/protocol/http/SpdyZlibReporter.h @@ -11,16 +11,18 @@ #include "mozilla/Attributes.h" #include "nsIMemoryReporter.h" #include "zlib.h" namespace mozilla { class SpdyZlibReporter MOZ_FINAL : public nsIMemoryReporter { + ~SpdyZlibReporter() {} + public: NS_DECL_ISUPPORTS SpdyZlibReporter() { #ifdef DEBUG // There must be only one instance of this class, due to |sAmount| // being static.
--- a/netwerk/protocol/http/TunnelUtils.cpp +++ b/netwerk/protocol/http/TunnelUtils.cpp @@ -763,19 +763,19 @@ public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSITRANSPORT NS_DECL_NSISOCKETTRANSPORT SocketTransportShim(nsISocketTransport *aWrapped) : mWrapped(aWrapped) {}; +private: virtual ~SocketTransportShim() {}; -private: nsCOMPtr<nsISocketTransport> mWrapped; }; class OutputStreamShim : public nsIAsyncOutputStream { public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIOUTPUTSTREAM @@ -785,19 +785,19 @@ public: OutputStreamShim(SpdyConnectTransaction *aTrans) : mCallback(nullptr) , mStatus(NS_OK) { mWeakTrans = do_GetWeakReference(aTrans); } +private: virtual ~OutputStreamShim() {}; -private: nsWeakPtr mWeakTrans; // SpdyConnectTransaction * nsIOutputStreamCallback *mCallback; nsresult mStatus; }; class InputStreamShim : public nsIAsyncInputStream { public: @@ -809,19 +809,19 @@ public: InputStreamShim(SpdyConnectTransaction *aTrans) : mCallback(nullptr) , mStatus(NS_OK) { mWeakTrans = do_GetWeakReference(aTrans); } +private: virtual ~InputStreamShim() {}; -private: nsWeakPtr mWeakTrans; // SpdyConnectTransaction * nsIInputStreamCallback *mCallback; nsresult mStatus; }; SpdyConnectTransaction::SpdyConnectTransaction(nsHttpConnectionInfo *ci, nsIInterfaceRequestor *callbacks, uint32_t caps,
--- a/netwerk/protocol/http/TunnelUtils.h +++ b/netwerk/protocol/http/TunnelUtils.h @@ -95,28 +95,28 @@ public: #define NS_DECL_NUDGETUNNELCALLBACK void OnTunnelNudged(TLSFilterTransaction *); class TLSFilterTransaction MOZ_FINAL : public nsAHttpTransaction , public nsAHttpSegmentReader , public nsAHttpSegmentWriter , public nsITimerCallback { + ~TLSFilterTransaction(); public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSAHTTPTRANSACTION NS_DECL_NSAHTTPSEGMENTREADER NS_DECL_NSAHTTPSEGMENTWRITER NS_DECL_NSITIMERCALLBACK TLSFilterTransaction(nsAHttpTransaction *aWrappedTransaction, const char *tlsHost, int32_t tlsPort, nsAHttpSegmentReader *reader, nsAHttpSegmentWriter *writer); - ~TLSFilterTransaction(); const nsAHttpTransaction *Transaction() const { return mTransaction.get(); } nsresult CommitToSegmentSize(uint32_t size, bool forceCommitment); nsresult GetTransactionSecurityInfo(nsISupports **); nsresult NudgeTunnel(NudgeTunnelCallback *callback); nsresult SetProxiedTransaction(nsAHttpTransaction *aTrans); // nsAHttpTransaction overloads
--- a/netwerk/protocol/http/nsHttpActivityDistributor.h +++ b/netwerk/protocol/http/nsHttpActivityDistributor.h @@ -16,18 +16,19 @@ class nsHttpActivityDistributor : public { public: typedef nsTArray<nsMainThreadPtrHandle<nsIHttpActivityObserver> > ObserverArray; NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIHTTPACTIVITYOBSERVER NS_DECL_NSIHTTPACTIVITYDISTRIBUTOR nsHttpActivityDistributor(); + +protected: virtual ~nsHttpActivityDistributor(); -protected: ObserverArray mObservers; Mutex mLock; }; }} // namespace mozilla::net #endif // nsHttpActivityDistributor_h__
--- a/netwerk/protocol/http/nsHttpAuthCache.h +++ b/netwerk/protocol/http/nsHttpAuthCache.h @@ -235,21 +235,21 @@ private: static void* AllocTable(void *, size_t size); static void FreeTable(void *, void *item); static PLHashEntry* AllocEntry(void *, const void *key); static void FreeEntry(void *, PLHashEntry *he, unsigned flag); static PLHashAllocOps gHashAllocOps; class AppDataClearObserver : public nsIObserver { + virtual ~AppDataClearObserver() {} public: NS_DECL_ISUPPORTS NS_DECL_NSIOBSERVER AppDataClearObserver(nsHttpAuthCache* aOwner) : mOwner(aOwner) {} - virtual ~AppDataClearObserver() {} nsHttpAuthCache* mOwner; }; void ClearAppData(uint32_t appId, bool browserOnly); private: PLHashTable *mDB; // "host:port" --> nsHttpAuthNode nsRefPtr<AppDataClearObserver> mObserver;
--- a/netwerk/protocol/http/nsHttpAuthManager.h +++ b/netwerk/protocol/http/nsHttpAuthManager.h @@ -15,19 +15,20 @@ class nsHttpAuthCache; class nsHttpAuthManager : public nsIHttpAuthManager { public: NS_DECL_ISUPPORTS NS_DECL_NSIHTTPAUTHMANAGER nsHttpAuthManager(); - virtual ~nsHttpAuthManager(); nsresult Init(); protected: + virtual ~nsHttpAuthManager(); + nsHttpAuthCache *mAuthCache; nsHttpAuthCache *mPrivateAuthCache; }; }} // namespace mozilla::net #endif // nsHttpAuthManager_h__
--- a/netwerk/protocol/http/nsHttpBasicAuth.h +++ b/netwerk/protocol/http/nsHttpBasicAuth.h @@ -17,14 +17,15 @@ namespace mozilla { namespace net { class nsHttpBasicAuth : public nsIHttpAuthenticator { public: NS_DECL_ISUPPORTS NS_DECL_NSIHTTPAUTHENTICATOR nsHttpBasicAuth(); +private: virtual ~nsHttpBasicAuth(); }; }} // namespace mozilla::net #endif // !nsHttpBasicAuth_h__
--- a/netwerk/protocol/http/nsHttpChannel.cpp +++ b/netwerk/protocol/http/nsHttpChannel.cpp @@ -5576,16 +5576,18 @@ class nsHttpChannelCacheKey MOZ_FINAL : { return mSupportsCString->SetData(aData); } public: nsresult SetData(uint32_t aPostID, const nsACString& aKey); protected: + ~nsHttpChannelCacheKey() {} + nsCOMPtr<nsISupportsPRUint32> mSupportsPRUint32; nsCOMPtr<nsISupportsCString> mSupportsCString; }; NS_IMPL_ADDREF(nsHttpChannelCacheKey) NS_IMPL_RELEASE(nsHttpChannelCacheKey) NS_INTERFACE_TABLE_HEAD(nsHttpChannelCacheKey) NS_INTERFACE_TABLE_BEGIN
--- a/netwerk/protocol/http/nsHttpChannelAuthProvider.h +++ b/netwerk/protocol/http/nsHttpChannelAuthProvider.h @@ -28,19 +28,20 @@ class nsHttpChannelAuthProvider : public { public: NS_DECL_ISUPPORTS NS_DECL_NSICANCELABLE NS_DECL_NSIHTTPCHANNELAUTHPROVIDER NS_DECL_NSIAUTHPROMPTCALLBACK nsHttpChannelAuthProvider(); + +private: virtual ~nsHttpChannelAuthProvider(); -private: const char *ProxyHost() const { return mProxyInfo ? mProxyInfo->Host().get() : nullptr; } int32_t ProxyPort() const { return mProxyInfo ? mProxyInfo->Port() : -1; } const char *Host() const { return mHost.get(); } int32_t Port() const { return mPort; }
--- a/netwerk/protocol/http/nsHttpConnection.h +++ b/netwerk/protocol/http/nsHttpConnection.h @@ -38,28 +38,29 @@ class ASpdySession; class nsHttpConnection : public nsAHttpSegmentReader , public nsAHttpSegmentWriter , public nsIInputStreamCallback , public nsIOutputStreamCallback , public nsITransportEventSink , public nsIInterfaceRequestor , public NudgeTunnelCallback { + virtual ~nsHttpConnection(); + public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSAHTTPSEGMENTREADER NS_DECL_NSAHTTPSEGMENTWRITER NS_DECL_NSIINPUTSTREAMCALLBACK NS_DECL_NSIOUTPUTSTREAMCALLBACK NS_DECL_NSITRANSPORTEVENTSINK NS_DECL_NSIINTERFACEREQUESTOR NS_DECL_NUDGETUNNELCALLBACK nsHttpConnection(); - virtual ~nsHttpConnection(); // Initialize the connection: // info - specifies the connection parameters. // maxHangTime - limits the amount of time this connection can spend on a // single transaction before it should no longer be kept // alive. a value of 0xffff indicates no limit. nsresult Init(nsHttpConnectionInfo *info, uint16_t maxHangTime, nsISocketTransport *, nsIAsyncInputStream *,
--- a/netwerk/protocol/http/nsHttpConnectionMgr.cpp +++ b/netwerk/protocol/http/nsHttpConnectionMgr.cpp @@ -337,19 +337,20 @@ nsHttpConnectionMgr::DoShiftReloadConnec 0, connInfo); if (NS_SUCCEEDED(rv)) unused << connInfo.forget(); return rv; } class SpeculativeConnectArgs { + virtual ~SpeculativeConnectArgs() {} + public: SpeculativeConnectArgs() { mOverridesOK = false; } - virtual ~SpeculativeConnectArgs() {} // Added manually so we can use nsRefPtr without inheriting from // nsISupports NS_IMETHOD_(MozExternalRefCountType) AddRef(void); NS_IMETHOD_(MozExternalRefCountType) Release(void); public: // intentional! nsRefPtr<NullHttpTransaction> mTrans;
--- a/netwerk/protocol/http/nsHttpConnectionMgr.h +++ b/netwerk/protocol/http/nsHttpConnectionMgr.h @@ -390,45 +390,47 @@ private: // to the connection to determine when the connection may be reused. the // transaction (or pipeline) owns a reference to this handle. this extra // layer of indirection greatly simplifies consumer code, avoiding the // need for consumer code to know when to give the connection back to the // connection manager. // class nsConnectionHandle : public nsAHttpConnection { + virtual ~nsConnectionHandle(); + public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSAHTTPCONNECTION(mConn) nsConnectionHandle(nsHttpConnection *conn) { NS_ADDREF(mConn = conn); } - virtual ~nsConnectionHandle(); nsHttpConnection *mConn; }; // nsHalfOpenSocket is used to hold the state of an opening TCP socket // while we wait for it to establish and bind it to a connection class nsHalfOpenSocket MOZ_FINAL : public nsIOutputStreamCallback, public nsITransportEventSink, public nsIInterfaceRequestor, public nsITimerCallback { + ~nsHalfOpenSocket(); + public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIOUTPUTSTREAMCALLBACK NS_DECL_NSITRANSPORTEVENTSINK NS_DECL_NSIINTERFACEREQUESTOR NS_DECL_NSITIMERCALLBACK nsHalfOpenSocket(nsConnectionEntry *ent, nsAHttpTransaction *trans, uint32_t caps); - ~nsHalfOpenSocket(); nsresult SetupStreams(nsISocketTransport **, nsIAsyncInputStream **, nsIAsyncOutputStream **, bool isBackup); nsresult SetupPrimaryStreams(); nsresult SetupBackupStreams(); void SetupBackupTimer();
--- a/netwerk/protocol/http/nsHttpDigestAuth.h +++ b/netwerk/protocol/http/nsHttpDigestAuth.h @@ -32,19 +32,20 @@ namespace mozilla { namespace net { class nsHttpDigestAuth MOZ_FINAL : public nsIHttpAuthenticator { public: NS_DECL_ISUPPORTS NS_DECL_NSIHTTPAUTHENTICATOR nsHttpDigestAuth(); + + protected: ~nsHttpDigestAuth(); - protected: nsresult ExpandToHex(const char * digest, char * result); nsresult CalculateResponse(const char * ha1_digest, const char * ha2_digest, const nsAFlatCString & nonce, uint16_t qop, const char * nonce_count, const nsAFlatCString & cnonce,
--- a/netwerk/protocol/http/nsHttpHandler.h +++ b/netwerk/protocol/http/nsHttpHandler.h @@ -52,17 +52,16 @@ public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIPROTOCOLHANDLER NS_DECL_NSIPROXIEDPROTOCOLHANDLER NS_DECL_NSIHTTPPROTOCOLHANDLER NS_DECL_NSIOBSERVER NS_DECL_NSISPECULATIVECONNECT nsHttpHandler(); - virtual ~nsHttpHandler(); nsresult Init(); nsresult AddStandardRequestHeaders(nsHttpHeaderArray *); nsresult AddConnectionHeader(nsHttpHeaderArray *, uint32_t capabilities); bool IsAcceptableEncoding(const char *encoding); const nsAFlatCString &UserAgent(); @@ -307,16 +306,17 @@ public: // When the disk cache is responding slowly its use is suppressed // for 1 minute for most requests. Callable from main thread only. TimeStamp GetCacheSkippedUntil() { return mCacheSkippedUntil; } void SetCacheSkippedUntil(TimeStamp arg) { mCacheSkippedUntil = arg; } void ClearCacheSkippedUntil() { mCacheSkippedUntil = TimeStamp(); } private: + virtual ~nsHttpHandler(); // // Useragent/prefs helper methods // void BuildUserAgent(); void InitUserAgentComponents(); void PrefsChanged(nsIPrefBranch *prefs, const char *pref); @@ -540,27 +540,27 @@ extern nsHttpHandler *gHttpHandler; // nsHttpsHandler - thin wrapper to distinguish the HTTP handler from the // HTTPS handler (even though they share the same impl). //----------------------------------------------------------------------------- class nsHttpsHandler : public nsIHttpProtocolHandler , public nsSupportsWeakReference , public nsISpeculativeConnect { + virtual ~nsHttpsHandler() { } public: // we basically just want to override GetScheme and GetDefaultPort... // all other methods should be forwarded to the nsHttpHandler instance. NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIPROTOCOLHANDLER NS_FORWARD_NSIPROXIEDPROTOCOLHANDLER (gHttpHandler->) NS_FORWARD_NSIHTTPPROTOCOLHANDLER (gHttpHandler->) NS_FORWARD_NSISPECULATIVECONNECT (gHttpHandler->) nsHttpsHandler() { } - virtual ~nsHttpsHandler() { } nsresult Init(); }; }} // namespace mozilla::net #endif // nsHttpHandler_h__
--- a/netwerk/protocol/http/nsHttpNTLMAuth.cpp +++ b/netwerk/protocol/http/nsHttpNTLMAuth.cpp @@ -253,16 +253,17 @@ CanUseDefaultCredentials(nsIHttpAuthenti LOG(("Default credentials allowed for host: %d\n", isTrustedHost)); return isTrustedHost; } // Dummy class for session state object. This class doesn't hold any data. // Instead we use its existence as a flag. See ChallengeReceived. class nsNTLMSessionState MOZ_FINAL : public nsISupports { + ~nsNTLMSessionState() {} public: NS_DECL_ISUPPORTS }; NS_IMPL_ISUPPORTS0(nsNTLMSessionState) //----------------------------------------------------------------------------- NS_IMPL_ISUPPORTS(nsHttpNTLMAuth, nsIHttpAuthenticator)
--- a/netwerk/protocol/http/nsHttpNTLMAuth.h +++ b/netwerk/protocol/http/nsHttpNTLMAuth.h @@ -11,19 +11,20 @@ namespace mozilla { namespace net { class nsHttpNTLMAuth : public nsIHttpAuthenticator { public: NS_DECL_ISUPPORTS NS_DECL_NSIHTTPAUTHENTICATOR nsHttpNTLMAuth() {} + +private: virtual ~nsHttpNTLMAuth() {} -private: // This flag indicates whether we are using the native NTLM implementation // or the internal one. bool mUseNative; }; }} // namespace mozilla::net #endif // !nsHttpNTLMAuth_h__
--- a/netwerk/protocol/http/nsHttpPipeline.h +++ b/netwerk/protocol/http/nsHttpPipeline.h @@ -22,23 +22,24 @@ class nsHttpPipeline : public nsAHttpCon { public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSAHTTPCONNECTION(mConnection) NS_DECL_NSAHTTPTRANSACTION NS_DECL_NSAHTTPSEGMENTREADER nsHttpPipeline(); - virtual ~nsHttpPipeline(); bool ResponseTimeoutEnabled() const MOZ_OVERRIDE MOZ_FINAL { return true; } private: + virtual ~nsHttpPipeline(); + nsresult FillSendBuf(); static NS_METHOD ReadFromPipe(nsIInputStream *, void *, const char *, uint32_t, uint32_t, uint32_t *); // convenience functions nsAHttpTransaction *Request(int32_t i) {
--- a/netwerk/protocol/http/nsHttpTransaction.h +++ b/netwerk/protocol/http/nsHttpTransaction.h @@ -23,21 +23,34 @@ //----------------------------------------------------------------------------- class nsIHttpActivityObserver; class nsIEventTarget; class nsIInputStream; class nsIOutputStream; -namespace mozilla { namespace net { +namespace mozilla { + +namespace net { class nsHttpChunkedDecoder; class nsHttpRequestHead; class nsHttpResponseHead; +class nsHttpTransaction; + +} + +template<> +struct HasDangerousPublicDestructor<net::nsHttpTransaction> +{ + static const bool value = true; +}; + +namespace net { //----------------------------------------------------------------------------- // nsHttpTransaction represents a single HTTP transaction. It is thread-safe, // intended to run on the socket thread. //----------------------------------------------------------------------------- class nsHttpTransaction : public nsAHttpTransaction , public ATokenBucketEvent
--- a/netwerk/protocol/res/nsResProtocolHandler.h +++ b/netwerk/protocol/res/nsResProtocolHandler.h @@ -27,23 +27,24 @@ public: class nsResProtocolHandler : public nsIResProtocolHandler, public nsSupportsWeakReference { public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIPROTOCOLHANDLER NS_DECL_NSIRESPROTOCOLHANDLER nsResProtocolHandler(); - virtual ~nsResProtocolHandler(); nsresult Init(); void CollectSubstitutions(InfallibleTArray<ResourceMapping>& aResources); private: + virtual ~nsResProtocolHandler(); + nsresult Init(nsIFile *aOmniJar); nsresult AddSpecialDir(const char* aSpecialDir, const nsACString& aSubstitution); nsInterfaceHashtable<nsCStringHashKey,nsIURI> mSubstitutions; nsCOMPtr<nsIIOService> mIOService; friend class nsResURL; };
--- a/netwerk/protocol/viewsource/nsViewSourceChannel.h +++ b/netwerk/protocol/viewsource/nsViewSourceChannel.h @@ -48,16 +48,18 @@ public: , mOpened(false) {} nsresult Init(nsIURI* uri); nsresult InitSrcdoc(nsIURI* aURI, const nsAString &aSrcdoc, nsIURI* aBaseURI); protected: + ~nsViewSourceChannel() {} + nsCOMPtr<nsIChannel> mChannel; nsCOMPtr<nsIHttpChannel> mHttpChannel; nsCOMPtr<nsIHttpChannelInternal> mHttpChannelInternal; nsCOMPtr<nsICachingChannel> mCachingChannel; nsCOMPtr<nsIApplicationCacheChannel> mApplicationCacheChannel; nsCOMPtr<nsIUploadChannel> mUploadChannel; nsCOMPtr<nsIStreamListener> mListener; nsCOMPtr<nsIURI> mOriginalURI;
--- a/netwerk/protocol/viewsource/nsViewSourceHandler.h +++ b/netwerk/protocol/viewsource/nsViewSourceHandler.h @@ -12,23 +12,22 @@ class nsViewSourceHandler MOZ_FINAL : public nsIProtocolHandler { public: NS_DECL_ISUPPORTS NS_DECL_NSIPROTOCOLHANDLER nsViewSourceHandler(); - ~nsViewSourceHandler(); - // Creates a new nsViewSourceChannel to view the source of an about:srcdoc // URI with contents specified by srcdoc. nsresult NewSrcdocChannel(nsIURI* uri, const nsAString &srcdoc, nsIURI* baseURI, nsIChannel** result); static nsViewSourceHandler* GetInstance(); private: + ~nsViewSourceHandler(); + static nsViewSourceHandler* gInstance; - }; #endif /* !defined( nsViewSourceHandler_h___ ) */
--- a/netwerk/protocol/websocket/WebSocketChannelChild.h +++ b/netwerk/protocol/websocket/WebSocketChannelChild.h @@ -17,17 +17,16 @@ namespace net { class ChannelEvent; class ChannelEventQueue; class WebSocketChannelChild : public BaseWebSocketChannel, public PWebSocketChild { public: WebSocketChannelChild(bool aSecure); - ~WebSocketChannelChild(); NS_DECL_ISUPPORTS NS_DECL_NSITHREADRETARGETABLEREQUEST // nsIWebSocketChannel methods BaseWebSocketChannel didn't implement for us // NS_IMETHOD AsyncOpen(nsIURI *aURI, const nsACString &aOrigin, nsIWebSocketListener *aListener, nsISupports *aContext); @@ -37,16 +36,18 @@ class WebSocketChannelChild : public Bas NS_IMETHOD SendBinaryStream(nsIInputStream *aStream, uint32_t aLength); nsresult SendBinaryStream(OptionalInputStreamParams *aStream, uint32_t aLength); NS_IMETHOD GetSecurityInfo(nsISupports **aSecurityInfo); void AddIPDLReference(); void ReleaseIPDLReference(); private: + ~WebSocketChannelChild(); + bool RecvOnStart(const nsCString& aProtocol, const nsCString& aExtensions) MOZ_OVERRIDE; bool RecvOnStop(const nsresult& aStatusCode) MOZ_OVERRIDE; bool RecvOnMessageAvailable(const nsCString& aMsg) MOZ_OVERRIDE; bool RecvOnBinaryMessageAvailable(const nsCString& aMsg) MOZ_OVERRIDE; bool RecvOnAcknowledge(const uint32_t& aSize) MOZ_OVERRIDE; bool RecvOnServerClose(const uint16_t& aCode, const nsCString &aReason) MOZ_OVERRIDE; void OnStart(const nsCString& aProtocol, const nsCString& aExtensions);
--- a/netwerk/protocol/websocket/WebSocketChannelParent.h +++ b/netwerk/protocol/websocket/WebSocketChannelParent.h @@ -20,16 +20,18 @@ class nsIAuthPromptProvider; namespace mozilla { namespace net { class WebSocketChannelParent : public PWebSocketParent, public nsIWebSocketListener, public nsIInterfaceRequestor { + ~WebSocketChannelParent() {} + public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIWEBSOCKETLISTENER NS_DECL_NSIINTERFACEREQUESTOR WebSocketChannelParent(nsIAuthPromptProvider* aAuthProvider, nsILoadContext* aLoadContext, PBOverrideStatus aOverrideStatus);
--- a/netwerk/protocol/wyciwyg/WyciwygChannelChild.h +++ b/netwerk/protocol/wyciwyg/WyciwygChannelChild.h @@ -41,26 +41,27 @@ class WyciwygChannelChild : public PWyci { public: NS_DECL_ISUPPORTS NS_DECL_NSIREQUEST NS_DECL_NSICHANNEL NS_DECL_NSIWYCIWYGCHANNEL WyciwygChannelChild(); - virtual ~WyciwygChannelChild(); void AddIPDLReference(); void ReleaseIPDLReference(); nsresult Init(nsIURI *uri); bool IsSuspended(); protected: + virtual ~WyciwygChannelChild(); + bool RecvOnStartRequest(const nsresult& statusCode, const int64_t& contentLength, const int32_t& source, const nsCString& charset, const nsCString& securityInfo) MOZ_OVERRIDE; bool RecvOnDataAvailable(const nsCString& data, const uint64_t& offset) MOZ_OVERRIDE; bool RecvOnStopRequest(const nsresult& statusCode) MOZ_OVERRIDE;
--- a/netwerk/protocol/wyciwyg/WyciwygChannelParent.h +++ b/netwerk/protocol/wyciwyg/WyciwygChannelParent.h @@ -26,19 +26,20 @@ class WyciwygChannelParent : public PWyc { public: NS_DECL_ISUPPORTS NS_DECL_NSIREQUESTOBSERVER NS_DECL_NSISTREAMLISTENER NS_DECL_NSIINTERFACEREQUESTOR WyciwygChannelParent(); + +protected: virtual ~WyciwygChannelParent(); -protected: virtual bool RecvInit(const URIParams& uri) MOZ_OVERRIDE; virtual bool RecvAsyncOpen(const URIParams& original, const uint32_t& loadFlags, const IPC::SerializedLoadContext& loadContext, PBrowserParent* parent) MOZ_OVERRIDE; virtual bool RecvWriteToCacheEntry(const nsString& data) MOZ_OVERRIDE; virtual bool RecvCloseCacheEntry(const nsresult& reason) MOZ_OVERRIDE; virtual bool RecvSetCharsetAndSource(const int32_t& source,
--- a/netwerk/protocol/wyciwyg/nsWyciwygChannel.h +++ b/netwerk/protocol/wyciwyg/nsWyciwygChannel.h @@ -43,21 +43,22 @@ public: NS_DECL_NSICACHEENTRYOPENCALLBACK friend class nsWyciwygSetCharsetandSourceEvent; friend class nsWyciwygWriteEvent; friend class nsWyciwygCloseEvent; // nsWyciwygChannel methods: nsWyciwygChannel(); - virtual ~nsWyciwygChannel(); nsresult Init(nsIURI *uri); protected: + virtual ~nsWyciwygChannel(); + nsresult WriteToCacheEntryInternal(const nsAString& aData); void SetCharsetAndSourceInternal(); nsresult CloseCacheEntryInternal(nsresult reason); nsresult ReadFromCache(); nsresult EnsureWriteCacheEntry(); nsresult OpenCacheEntry(nsIURI *aURI, uint32_t aOpenFlags);
--- a/netwerk/protocol/wyciwyg/nsWyciwygProtocolHandler.h +++ b/netwerk/protocol/wyciwyg/nsWyciwygProtocolHandler.h @@ -6,17 +6,18 @@ #ifndef nsWyciwygProtocolHandler_h___ #define nsWyciwygProtocolHandler_h___ #include "nsIProtocolHandler.h" class nsWyciwygProtocolHandler : public nsIProtocolHandler { + virtual ~nsWyciwygProtocolHandler(); + public: NS_DECL_ISUPPORTS NS_DECL_NSIPROTOCOLHANDLER nsWyciwygProtocolHandler(); - virtual ~nsWyciwygProtocolHandler(); }; #endif /* nsWyciwygProtocolHandler_h___ */
--- a/netwerk/sctp/datachannel/DataChannel.cpp +++ b/netwerk/sctp/datachannel/DataChannel.cpp @@ -105,24 +105,26 @@ public: nsresult rv = observerService->AddObserver(this, "profile-change-net-teardown", false); MOZ_ASSERT(rv == NS_OK); (void) rv; } +private: virtual ~DataChannelShutdown() { nsCOMPtr<nsIObserverService> observerService = mozilla::services::GetObserverService(); if (observerService) observerService->RemoveObserver(this, "profile-change-net-teardown"); } +public: NS_IMETHODIMP Observe(nsISupports* aSubject, const char* aTopic, const char16_t* aData) { if (strcmp(aTopic, "profile-change-net-teardown") == 0) { LOG(("Shutting down SCTP")); if (sctp_initialized) { usrsctp_finish(); sctp_initialized = false; }
--- a/netwerk/sctp/datachannel/DataChannel.h +++ b/netwerk/sctp/datachannel/DataChannel.h @@ -93,32 +93,33 @@ public: }; // One per PeerConnection class DataChannelConnection: public nsITimerCallback #ifdef SCTP_DTLS_SUPPORTED , public sigslot::has_slots<> #endif { + virtual ~DataChannelConnection(); + public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSITIMERCALLBACK class DataConnectionListener : public SupportsWeakPtr<DataConnectionListener> { public: MOZ_DECLARE_REFCOUNTED_TYPENAME(DataChannelConnection::DataConnectionListener) virtual ~DataConnectionListener() {} // Called when a new DataChannel has been opened by the other side. virtual void NotifyDataChannel(already_AddRefed<DataChannel> channel) = 0; }; DataChannelConnection(DataConnectionListener *listener); - virtual ~DataChannelConnection(); bool Init(unsigned short aPort, uint16_t aNumStreams, bool aUsingDtls); void Destroy(); // So we can spawn refs tied to runnables in shutdown // Finish Destroy on STS to avoid SCTP race condition with ABORT from far end void DestroyOnSTS(struct socket *aMasterSocket, struct socket *aSocket); #ifdef ALLOW_DIRECT_SCTP_LISTEN_CONNECT
--- a/netwerk/socket/nsSOCKSIOLayer.cpp +++ b/netwerk/socket/nsSOCKSIOLayer.cpp @@ -59,17 +59,16 @@ class nsSOCKSSocketInfo : public nsISOCK // A buffer of 262 bytes should be enough for any request and response // in case of SOCKS4 as well as SOCKS5 static const uint32_t BUFFER_SIZE = 262; static const uint32_t MAX_HOSTNAME_LEN = 255; public: nsSOCKSSocketInfo(); - virtual ~nsSOCKSSocketInfo() { HandshakeFinished(); } NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSISOCKSSOCKETINFO NS_DECL_NSIDNSLISTENER void Init(int32_t version, int32_t family, const char *proxyHost, @@ -79,16 +78,18 @@ public: void SetConnectTimeout(PRIntervalTime to); PRStatus DoHandshake(PRFileDesc *fd, int16_t oflags = -1); int16_t GetPollFlags() const; bool IsConnected() const { return mState == SOCKS_CONNECTED; } void ForgetFD() { mFD = nullptr; } private: + virtual ~nsSOCKSSocketInfo() { HandshakeFinished(); } + void HandshakeFinished(PRErrorCode err = 0); PRStatus StartDNS(PRFileDesc *fd); PRStatus ConnectToProxy(PRFileDesc *fd); void FixupAddressFamily(PRFileDesc *fd, NetAddr *proxy); PRStatus ContinueConnectingToProxy(PRFileDesc *fd, int16_t oflags); PRStatus WriteV4ConnectRequest(); PRStatus ReadV4ConnectResponse(); PRStatus WriteV5AuthRequest();
--- a/netwerk/socket/nsSOCKSSocketProvider.h +++ b/netwerk/socket/nsSOCKSSocketProvider.h @@ -15,20 +15,21 @@ enum { NS_SOCKS_VERSION_5 = 5 }; class nsSOCKSSocketProvider : public nsISocketProvider { public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSISOCKETPROVIDER - + nsSOCKSSocketProvider(uint32_t version) : mVersion(version) {} - virtual ~nsSOCKSSocketProvider() {} - + static nsresult CreateV4(nsISupports *, REFNSIID aIID, void **aResult); static nsresult CreateV5(nsISupports *, REFNSIID aIID, void **aResult); - + private: + virtual ~nsSOCKSSocketProvider() {} + uint32_t mVersion; // NS_SOCKS_VERSION_4 or 5 }; #endif /* nsSOCKSSocketProvider_h__ */
--- a/netwerk/socket/nsSocketProviderService.h +++ b/netwerk/socket/nsSocketProviderService.h @@ -5,19 +5,20 @@ #ifndef nsSocketProviderService_h__ #define nsSocketProviderService_h__ #include "nsISocketProviderService.h" class nsSocketProviderService : public nsISocketProviderService { + virtual ~nsSocketProviderService() {} + public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSISOCKETPROVIDERSERVICE nsSocketProviderService() {} - virtual ~nsSocketProviderService() {} static nsresult Create(nsISupports *, REFNSIID aIID, void **aResult); }; #endif /* nsSocketProviderService_h__ */
--- a/netwerk/streamconv/converters/mozTXTToHTMLConv.h +++ b/netwerk/streamconv/converters/mozTXTToHTMLConv.h @@ -14,23 +14,23 @@ #include "nsString.h" #include "nsCOMPtr.h" class nsIIOService; class mozTXTToHTMLConv : public mozITXTToHTMLConv { + virtual ~mozTXTToHTMLConv(); ////////////////////////////////////////////////////////// public: ////////////////////////////////////////////////////////// mozTXTToHTMLConv(); - virtual ~mozTXTToHTMLConv(); NS_DECL_ISUPPORTS NS_DECL_MOZITXTTOHTMLCONV NS_DECL_NSIREQUESTOBSERVER NS_DECL_NSISTREAMLISTENER NS_DECL_NSISTREAMCONVERTER /**
--- a/netwerk/streamconv/converters/nsDirIndex.h +++ b/netwerk/streamconv/converters/nsDirIndex.h @@ -5,19 +5,22 @@ #include "nsIDirIndex.h" #include "nsString.h" #include "mozilla/Attributes.h" /* CID: {f6913e2e-1dd1-11b2-84be-f455dee342af} */ class nsDirIndex MOZ_FINAL : public nsIDirIndex { + +private: + ~nsDirIndex(); + public: nsDirIndex(); - ~nsDirIndex(); NS_DECL_ISUPPORTS NS_DECL_NSIDIRINDEX protected: uint32_t mType; nsXPIDLCString mContentType; nsXPIDLCString mLocation;
--- a/netwerk/streamconv/converters/nsDirIndexParser.h +++ b/netwerk/streamconv/converters/nsDirIndexParser.h @@ -11,24 +11,27 @@ #include "nsIDirIndexListener.h" class nsIDirIndex; class nsITextToSubURI; /* CID: {a0d6ad32-1dd1-11b2-aa55-a40187b54036} */ class nsDirIndexParser : public nsIDirIndexParser { + +private: + virtual ~nsDirIndexParser(); + public: NS_DECL_ISUPPORTS NS_DECL_NSISTREAMLISTENER NS_DECL_NSIREQUESTOBSERVER NS_DECL_NSIDIRINDEXPARSER nsDirIndexParser(); - virtual ~nsDirIndexParser(); nsresult Init(); enum fieldType { FIELD_UNKNOWN = 0, // MUST be 0 FIELD_FILENAME, FIELD_DESCRIPTION, FIELD_CONTENTLENGTH, FIELD_LASTMODIFIED,
--- a/netwerk/streamconv/converters/nsFTPDirListingConv.h +++ b/netwerk/streamconv/converters/nsFTPDirListingConv.h @@ -29,20 +29,21 @@ public: // nsIStreamListener methods NS_DECL_NSISTREAMLISTENER // nsIRequestObserver methods NS_DECL_NSIREQUESTOBSERVER // nsFTPDirListingConv methods nsFTPDirListingConv(); - virtual ~nsFTPDirListingConv(); nsresult Init(); private: + virtual ~nsFTPDirListingConv(); + // Get the application/http-index-format headers nsresult GetHeaders(nsACString& str, nsIURI* uri); char* DigestBufferLines(char *aBuffer, nsCString &aString); // member data nsCString mBuffer; // buffered data. bool mSentHeading; // have we sent 100, 101, 200, and 300 lines yet?
--- a/netwerk/streamconv/converters/nsHTTPCompressConv.h +++ b/netwerk/streamconv/converters/nsHTTPCompressConv.h @@ -46,20 +46,21 @@ public: NS_DECL_NSIREQUESTOBSERVER NS_DECL_NSISTREAMLISTENER // nsIStreamConverter methods NS_DECL_NSISTREAMCONVERTER nsHTTPCompressConv (); - virtual ~nsHTTPCompressConv (); private: + virtual ~nsHTTPCompressConv (); + nsIStreamListener *mListener; // this guy gets the converted data via his OnDataAvailable () CompressMode mMode; unsigned char *mOutBuffer; unsigned char *mInpBuffer; uint32_t mOutBufferLen; uint32_t mInpBufferLen;
--- a/netwerk/streamconv/converters/nsIndexedToHTML.h +++ b/netwerk/streamconv/converters/nsIndexedToHTML.h @@ -24,17 +24,16 @@ class nsIndexedToHTML : public nsIStream public: NS_DECL_ISUPPORTS NS_DECL_NSISTREAMCONVERTER NS_DECL_NSIREQUESTOBSERVER NS_DECL_NSISTREAMLISTENER NS_DECL_NSIDIRINDEXLISTENER nsIndexedToHTML(); - virtual ~nsIndexedToHTML(); nsresult Init(nsIStreamListener *aListener); static nsresult Create(nsISupports *aOuter, REFNSIID aIID, void **aResult); protected: @@ -51,12 +50,14 @@ protected: nsCOMPtr<nsIDateTimeFormat> mDateTime; nsCOMPtr<nsIStringBundle> mBundle; nsCOMPtr<nsITextToSubURI> mTextToSubURI; private: // Expecting absolute locations, given by 201 lines. bool mExpectAbsLoc; + + virtual ~nsIndexedToHTML(); }; #endif
--- a/netwerk/streamconv/converters/nsMultiMixedConv.h +++ b/netwerk/streamconv/converters/nsMultiMixedConv.h @@ -121,19 +121,20 @@ protected: class nsMultiMixedConv : public nsIStreamConverter { public: NS_DECL_ISUPPORTS NS_DECL_NSISTREAMCONVERTER NS_DECL_NSISTREAMLISTENER NS_DECL_NSIREQUESTOBSERVER nsMultiMixedConv(); + +protected: virtual ~nsMultiMixedConv(); -protected: nsresult SendStart(nsIChannel *aChannel); nsresult SendStop(nsresult aStatus); nsresult SendData(char *aBuffer, uint32_t aLen); nsresult ParseHeaders(nsIChannel *aChannel, char *&aPtr, uint32_t &aLen, bool *_retval); int32_t PushOverLine(char *&aPtr, uint32_t &aLen); char *FindToken(char *aCursor, uint32_t aLen); nsresult BufferData(char *aData, uint32_t aLen);
--- a/netwerk/streamconv/converters/nsTXTToHTMLConv.h +++ b/netwerk/streamconv/converters/nsTXTToHTMLConv.h @@ -23,16 +23,26 @@ typedef struct convToken { nsString token; // the actual string (i.e. "http://") nsString modText; // replacement text or href prepend text. bool prepend; // flag indicating how the modText should be used. } convToken; template<class T> class nsAutoPtr; +class nsTXTToHTMLConv; + +namespace mozilla { +template<> +struct HasDangerousPublicDestructor<nsTXTToHTMLConv> +{ + static const bool value = true; +}; +} + /** * Convert plain text to HTML. * * OVERVIEW OF HOW THIS CLASS WORKS: * * This class stores an array of tokens that should be replaced by something, * or something that should be prepended. * The "token" member of convToken is the text to search for. This is a @@ -86,16 +96,17 @@ public: } rv = _s->QueryInterface(aIID, aResult); NS_RELEASE(_s); return rv; } protected: + // return the token and it's location in the underlying buffer. int32_t FindToken(int32_t cursor, convToken* *_retval); // return the cursor location after munging HTML into the // underlying buffer, according to mToken int32_t CatHTML(int32_t front, int32_t back); nsCOMPtr<nsIStreamListener> mListener; // final listener (consumer)
--- a/netwerk/streamconv/src/nsStreamConverterService.h +++ b/netwerk/streamconv/src/nsStreamConverterService.h @@ -24,19 +24,20 @@ public: ///////////////////////////////////////////////////// // nsIStreamConverterService methods NS_DECL_NSISTREAMCONVERTERSERVICE ///////////////////////////////////////////////////// // nsStreamConverterService methods nsStreamConverterService(); + +private: virtual ~nsStreamConverterService(); -private: // Responsible for finding a converter for the given MIME-type. nsresult FindConverter(const char *aContractID, nsTArray<nsCString> **aEdgeList); nsresult BuildGraph(void); nsresult AddAdjacency(const char *aContractID); nsresult ParseFromTo(const char *aContractID, nsCString &aFromRes, nsCString &aToRes); // member variables nsClassHashtable<nsCStringHashKey, nsCOMArray<nsIAtom>> mAdjacencyList;
--- a/netwerk/streamconv/test/Converters.h +++ b/netwerk/streamconv/test/Converters.h @@ -14,23 +14,23 @@ */ /////////////////////////////////////////////// // TestConverter extern const nsCID kTestConverterCID; class TestConverter : public nsIStreamConverter { + virtual ~TestConverter() {} public: NS_DECL_ISUPPORTS NS_DECL_NSIREQUESTOBSERVER NS_DECL_NSISTREAMLISTENER TestConverter(); - virtual ~TestConverter() {} // nsIStreamConverter methods NS_IMETHOD Convert(nsIInputStream *aFromStream, const char *aFromType, const char *aToType, nsISupports *ctxt, nsIInputStream **_retval); NS_IMETHOD AsyncConvertData(const char *aFromType, const char *aToType, nsIStreamListener *aListener, nsISupports *ctxt);
--- a/netwerk/streamconv/test/TestStreamConv.cpp +++ b/netwerk/streamconv/test/TestStreamConv.cpp @@ -43,16 +43,17 @@ static int gKeepRunning = 0; static NS_DEFINE_CID(kStreamConverterServiceCID, NS_STREAMCONVERTERSERVICE_CID); //////////////////////////////////////////////////////////////////////// // EndListener - This listener is the final one in the chain. It // receives the fully converted data, although it doesn't do anything with // the data. //////////////////////////////////////////////////////////////////////// class EndListener MOZ_FINAL : public nsIStreamListener { + ~EndListener() {} public: // nsISupports declaration NS_DECL_ISUPPORTS EndListener() {} // nsIStreamListener method NS_IMETHOD OnDataAvailable(nsIRequest* request, nsISupports *ctxt, nsIInputStream *inStr,
--- a/netwerk/test/TestCallbacks.cpp +++ b/netwerk/test/TestCallbacks.cpp @@ -39,38 +39,43 @@ class nsIEquals : public nsISupports { public: NS_DECLARE_STATIC_IID_ACCESSOR(NS_IEQUALS_IID) NS_IMETHOD Equals(void *aPtr, bool *_retval) = 0; }; NS_DEFINE_STATIC_IID_ACCESSOR(nsIEquals, NS_IEQUALS_IID) class ConsumerContext MOZ_FINAL : public nsIEquals { + + ~ConsumerContext() {} + public: NS_DECL_THREADSAFE_ISUPPORTS ConsumerContext() { } NS_IMETHOD Equals(void *aPtr, bool *_retval) { *_retval = true; if (aPtr != this) *_retval = false; return NS_OK; } }; NS_IMPL_ISUPPORTS(ConsumerContext, nsIEquals) class Consumer : public nsIStreamListener { + + virtual ~Consumer(); + public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIREQUESTOBSERVER NS_DECL_NSISTREAMLISTENER Consumer(); - virtual ~Consumer(); nsresult Init(nsIURI *aURI, nsIChannel *aChannel, nsISupports *aContext); nsresult Validate(nsIRequest *request, nsISupports *aContext); // member data bool mOnStart; // have we received an OnStart? bool mOnStop; // have we received an onStop? int32_t mOnDataCount; // number of times OnData was called. nsCOMPtr<nsIURI> mURI;
--- a/netwerk/test/TestCommon.h +++ b/netwerk/test/TestCommon.h @@ -14,16 +14,17 @@ inline int test_common_init(int *argc, c return 0; } //----------------------------------------------------------------------------- static bool gKeepPumpingEvents = false; class nsQuitPumpingEvent MOZ_FINAL : public nsIRunnable { + ~nsQuitPumpingEvent() {} public: NS_DECL_THREADSAFE_ISUPPORTS NS_IMETHOD Run() { gKeepPumpingEvents = false; return NS_OK; } }; NS_IMPL_ISUPPORTS(nsQuitPumpingEvent, nsIRunnable)
--- a/netwerk/test/TestDNS.cpp +++ b/netwerk/test/TestDNS.cpp @@ -22,17 +22,16 @@ class myDNSListener : public nsIDNSListener { public: NS_DECL_THREADSAFE_ISUPPORTS myDNSListener(const char *host, int32_t index) : mHost(host) , mIndex(index) {} - virtual ~myDNSListener() {} NS_IMETHOD OnLookupComplete(nsICancelable *request, nsIDNSRecord *rec, nsresult status) { printf("%d: OnLookupComplete called [host=%s status=%x rec=%p]\n", mIndex, mHost.get(), static_cast<uint32_t>(status), (void*)rec); @@ -48,20 +47,23 @@ public: printf("%d: => %s\n", mIndex, buf.get()); } } return NS_OK; } private: + virtual ~myDNSListener() {} + nsCString mHost; int32_t mIndex; }; + NS_IMPL_ISUPPORTS(myDNSListener, nsIDNSListener) static bool IsAscii(const char *s) { for (; *s; ++s) { if (*s & 0x80) return false; }
--- a/netwerk/test/TestIncrementalDownload.cpp +++ b/netwerk/test/TestIncrementalDownload.cpp @@ -16,16 +16,17 @@ #include "prenv.h" #include "mozilla/Attributes.h" //----------------------------------------------------------------------------- class FetchObserver MOZ_FINAL : public nsIRequestObserver , public nsIProgressEventSink { + ~FetchObserver() {} public: NS_DECL_ISUPPORTS NS_DECL_NSIREQUESTOBSERVER NS_DECL_NSIPROGRESSEVENTSINK }; NS_IMPL_ISUPPORTS(FetchObserver, nsIRequestObserver, nsIProgressEventSink)
--- a/netwerk/test/TestPageLoad.cpp +++ b/netwerk/test/TestPageLoad.cpp @@ -123,23 +123,24 @@ static NS_METHOD streamParse (nsIInputSt } //----------------------------------------------------------------------------- // nsIStreamListener implementation //----------------------------------------------------------------------------- class MyListener : public nsIStreamListener { + virtual ~MyListener() {} + public: NS_DECL_ISUPPORTS NS_DECL_NSIREQUESTOBSERVER NS_DECL_NSISTREAMLISTENER MyListener() { } - virtual ~MyListener() {} }; NS_IMPL_ISUPPORTS(MyListener, nsIRequestObserver, nsIStreamListener) NS_IMETHODIMP MyListener::OnStartRequest(nsIRequest *req, nsISupports *ctxt) @@ -190,23 +191,24 @@ MyListener::OnDataAvailable(nsIRequest * //----------------------------------------------------------------------------- // NotificationCallbacks implementation //----------------------------------------------------------------------------- class MyNotifications : public nsIInterfaceRequestor , public nsIProgressEventSink { + virtual ~MyNotifications() {} + public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIINTERFACEREQUESTOR NS_DECL_NSIPROGRESSEVENTSINK MyNotifications() { } - virtual ~MyNotifications() {} }; NS_IMPL_ISUPPORTS(MyNotifications, nsIInterfaceRequestor, nsIProgressEventSink) NS_IMETHODIMP MyNotifications::GetInterface(const nsIID &iid, void **result)
--- a/netwerk/test/TestProtocols.cpp +++ b/netwerk/test/TestProtocols.cpp @@ -161,22 +161,22 @@ void PrintTimingInformation(nsITimedChan } //----------------------------------------------------------------------------- // HeaderVisitor //----------------------------------------------------------------------------- class HeaderVisitor : public nsIHttpHeaderVisitor { + virtual ~HeaderVisitor() {} public: NS_DECL_ISUPPORTS NS_DECL_NSIHTTPHEADERVISITOR HeaderVisitor() { } - virtual ~HeaderVisitor() {} }; NS_IMPL_ISUPPORTS(HeaderVisitor, nsIHttpHeaderVisitor) NS_IMETHODIMP HeaderVisitor::VisitHeader(const nsACString &header, const nsACString &value) { LOG((" %s: %s\n", PromiseFlatCString(header).get(), @@ -185,20 +185,21 @@ HeaderVisitor::VisitHeader(const nsACStr } //----------------------------------------------------------------------------- // URLLoadInfo //----------------------------------------------------------------------------- class URLLoadInfo : public nsISupports { + virtual ~URLLoadInfo(); + public: URLLoadInfo(const char* aUrl); - virtual ~URLLoadInfo(); // ISupports interface... NS_DECL_THREADSAFE_ISUPPORTS const char* Name() { return mURLString.get(); } int64_t mBytesRead; PRTime mTotalTime; PRTime mConnectTime; @@ -219,22 +220,23 @@ URLLoadInfo::~URLLoadInfo() NS_IMPL_ISUPPORTS0(URLLoadInfo) //----------------------------------------------------------------------------- // TestChannelEventSink //----------------------------------------------------------------------------- class TestChannelEventSink : public nsIChannelEventSink { + virtual ~TestChannelEventSink(); + public: NS_DECL_ISUPPORTS NS_DECL_NSICHANNELEVENTSINK TestChannelEventSink(); - virtual ~TestChannelEventSink(); }; TestChannelEventSink::TestChannelEventSink() { } TestChannelEventSink::~TestChannelEventSink() { @@ -256,22 +258,23 @@ TestChannelEventSink::AsyncOnChannelRedi } //----------------------------------------------------------------------------- // TestAuthPrompt //----------------------------------------------------------------------------- class TestAuthPrompt : public nsIAuthPrompt { + virtual ~TestAuthPrompt(); + public: NS_DECL_ISUPPORTS NS_DECL_NSIAUTHPROMPT TestAuthPrompt(); - virtual ~TestAuthPrompt(); }; NS_IMPL_ISUPPORTS(TestAuthPrompt, nsIAuthPrompt) TestAuthPrompt::TestAuthPrompt() { } @@ -347,20 +350,21 @@ TestAuthPrompt::PromptPassword(const cha } //----------------------------------------------------------------------------- // InputTestConsumer //----------------------------------------------------------------------------- class InputTestConsumer : public nsIStreamListener { + virtual ~InputTestConsumer(); + public: InputTestConsumer(); - virtual ~InputTestConsumer(); NS_DECL_ISUPPORTS NS_DECL_NSIREQUESTOBSERVER NS_DECL_NSISTREAMLISTENER }; InputTestConsumer::InputTestConsumer() { @@ -556,16 +560,19 @@ InputTestConsumer::OnStopRequest(nsIRequ return NS_OK; } //----------------------------------------------------------------------------- // NotificationCallbacks //----------------------------------------------------------------------------- class NotificationCallbacks MOZ_FINAL : public nsIInterfaceRequestor { + + ~NotificationCallbacks() {} + public: NS_DECL_ISUPPORTS NotificationCallbacks() { } NS_IMETHOD GetInterface(const nsIID& iid, void* *result) { nsresult rv = NS_ERROR_FAILURE;
--- a/netwerk/test/TestServ.cpp +++ b/netwerk/test/TestServ.cpp @@ -18,22 +18,24 @@ // set NSPR_LOG_MODULES=Test:5 // static PRLogModuleInfo *gTestLog = nullptr; #endif #define LOG(args) PR_LOG(gTestLog, PR_LOG_DEBUG, args) class MySocketListener : public nsIServerSocketListener { +protected: + virtual ~MySocketListener() {} + public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSISERVERSOCKETLISTENER MySocketListener() {} - virtual ~MySocketListener() {} }; NS_IMPL_ISUPPORTS(MySocketListener, nsIServerSocketListener) NS_IMETHODIMP MySocketListener::OnSocketAccepted(nsIServerSocket *serv, nsISocketTransport *trans) {
--- a/netwerk/test/TestStreamLoader.cpp +++ b/netwerk/test/TestStreamLoader.cpp @@ -10,16 +10,18 @@ // set NSPR_LOG_MODULES=Test:5 // static PRLogModuleInfo *gTestLog = nullptr; #endif #define LOG(args) PR_LOG(gTestLog, PR_LOG_DEBUG, args) class MyStreamLoaderObserver MOZ_FINAL : public nsIStreamLoaderObserver { + ~MyStreamLoaderObserver() {} + public: NS_DECL_ISUPPORTS NS_DECL_NSISTREAMLOADEROBSERVER }; NS_IMPL_ISUPPORTS(MyStreamLoaderObserver, nsIStreamLoaderObserver) NS_IMETHODIMP
--- a/netwerk/test/TestUDPSocket.cpp +++ b/netwerk/test/TestUDPSocket.cpp @@ -90,20 +90,22 @@ static bool CheckMessageContent(nsIUDPMe } } /* * UDPClientListener: listens for incomming UDP packets */ class UDPClientListener : public nsIUDPSocketListener { +protected: + virtual ~UDPClientListener(); + public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIUDPSOCKETLISTENER - virtual ~UDPClientListener(); nsresult mResult; }; NS_IMPL_ISUPPORTS(UDPClientListener, nsIUDPSocketListener) UDPClientListener::~UDPClientListener() { } @@ -149,22 +151,23 @@ UDPClientListener::OnStopListening(nsIUD return NS_OK; } /* * UDPServerListener: listens for incomming UDP packets */ class UDPServerListener : public nsIUDPSocketListener { +protected: + virtual ~UDPServerListener(); + public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIUDPSOCKETLISTENER - virtual ~UDPServerListener(); - nsresult mResult; }; NS_IMPL_ISUPPORTS(UDPServerListener, nsIUDPSocketListener) UDPServerListener::~UDPServerListener() { } @@ -216,22 +219,23 @@ UDPServerListener::OnStopListening(nsIUD return NS_OK; } /** * Multicast timer callback: detects delivery failure */ class MulticastTimerCallback : public nsITimerCallback { +protected: + virtual ~MulticastTimerCallback(); + public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSITIMERCALLBACK - virtual ~MulticastTimerCallback(); - nsresult mResult; }; NS_IMPL_ISUPPORTS(MulticastTimerCallback, nsITimerCallback) MulticastTimerCallback::~MulticastTimerCallback() { }
--- a/netwerk/test/TestUpload.cpp +++ b/netwerk/test/TestUpload.cpp @@ -28,20 +28,21 @@ static PRLogModuleInfo *gTestLog = nullp #define LOG(args) PR_LOG(gTestLog, PR_LOG_DEBUG, args) //----------------------------------------------------------------------------- // InputTestConsumer //----------------------------------------------------------------------------- class InputTestConsumer : public nsIStreamListener { + virtual ~InputTestConsumer(); + public: InputTestConsumer(); - virtual ~InputTestConsumer(); NS_DECL_ISUPPORTS NS_DECL_NSIREQUESTOBSERVER NS_DECL_NSISTREAMLISTENER }; InputTestConsumer::InputTestConsumer() {
--- a/netwerk/wifi/nsWifiAccessPoint.h +++ b/netwerk/wifi/nsWifiAccessPoint.h @@ -10,22 +10,23 @@ #include "mozilla/ArrayUtils.h" // ArrayLength #include "mozilla/Attributes.h" #ifndef __nsWifiAccessPoint__ #define __nsWifiAccessPoint__ class nsWifiAccessPoint MOZ_FINAL : public nsIWifiAccessPoint { + ~nsWifiAccessPoint(); + public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIWIFIACCESSPOINT nsWifiAccessPoint(); - ~nsWifiAccessPoint(); char mMac[18]; int mSignal; char mSsid[33]; int mSsidLen; void setSignal(int signal) {
--- a/netwerk/wifi/nsWifiMonitor.cpp +++ b/netwerk/wifi/nsWifiMonitor.cpp @@ -122,16 +122,17 @@ class nsPassErrorToWifiListeners MOZ_FIN nsPassErrorToWifiListeners(nsAutoPtr<WifiListenerArray> aListeners, nsresult aResult) : mListeners(aListeners), mResult(aResult) {} private: + ~nsPassErrorToWifiListeners() {} nsAutoPtr<WifiListenerArray> mListeners; nsresult mResult; }; NS_IMPL_ISUPPORTS(nsPassErrorToWifiListeners, nsIRunnable) NS_IMETHODIMP nsPassErrorToWifiListeners::Run() @@ -182,16 +183,17 @@ class nsCallWifiListeners MOZ_FINAL : pu nsCallWifiListeners(nsAutoPtr<WifiListenerArray> aListeners, nsAutoPtr<nsTArray<nsIWifiAccessPoint*> > aAccessPoints) : mListeners(aListeners), mAccessPoints(aAccessPoints) {} private: + ~nsCallWifiListeners() {} nsAutoPtr<WifiListenerArray> mListeners; nsAutoPtr<nsTArray<nsIWifiAccessPoint*> > mAccessPoints; }; NS_IMPL_ISUPPORTS(nsCallWifiListeners, nsIRunnable) NS_IMETHODIMP nsCallWifiListeners::Run()