From 02203cdfb451f4d7359a1649dd21522ef24d2b09 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Thu, 8 Jan 2015 10:17:13 -0500 Subject: [PATCH] Bug 1119267 - Mark virtual overridden functions as MOZ_OVERRIDE in media; r=jesup --- media/mtransport/nr_socket_prsock.h | 46 +++++++++---------- media/mtransport/nriceresolver.h | 2 +- .../test/sockettransportservice_unittest.cpp | 10 ++-- media/mtransport/transportlayerprsock.h | 10 ++-- .../signaling/test/signaling_unittests.cpp | 38 +++++++-------- 5 files changed, 53 insertions(+), 53 deletions(-) diff --git a/media/mtransport/nr_socket_prsock.h b/media/mtransport/nr_socket_prsock.h index a4cfed7213ef..0da801435980 100644 --- a/media/mtransport/nr_socket_prsock.h +++ b/media/mtransport/nr_socket_prsock.h @@ -133,33 +133,33 @@ public: NrSocket() : fd_(nullptr) {} // Implement nsASocket - virtual void OnSocketReady(PRFileDesc *fd, int16_t outflags); - virtual void OnSocketDetached(PRFileDesc *fd); - virtual void IsLocal(bool *aIsLocal); - virtual uint64_t ByteCountSent() { return 0; } - virtual uint64_t ByteCountReceived() { return 0; } + virtual void OnSocketReady(PRFileDesc *fd, int16_t outflags) MOZ_OVERRIDE; + virtual void OnSocketDetached(PRFileDesc *fd) MOZ_OVERRIDE; + virtual void IsLocal(bool *aIsLocal) MOZ_OVERRIDE; + virtual uint64_t ByteCountSent() MOZ_OVERRIDE { return 0; } + virtual uint64_t ByteCountReceived() MOZ_OVERRIDE { return 0; } // nsISupports methods NS_DECL_THREADSAFE_ISUPPORTS // Implementations of the async_event APIs virtual int async_wait(int how, NR_async_cb cb, void *cb_arg, - char *function, int line); - virtual int cancel(int how); + char *function, int line) MOZ_OVERRIDE; + virtual int cancel(int how) MOZ_OVERRIDE; // Implementations of the nr_socket APIs - virtual int create(nr_transport_addr *addr); // (really init, but it's called create) + virtual int create(nr_transport_addr *addr) MOZ_OVERRIDE; // (really init, but it's called create) virtual int sendto(const void *msg, size_t len, - int flags, nr_transport_addr *to); + int flags, nr_transport_addr *to) MOZ_OVERRIDE; virtual int recvfrom(void * buf, size_t maxlen, size_t *len, int flags, - nr_transport_addr *from); - virtual int getaddr(nr_transport_addr *addrp); - virtual void close(); - virtual int connect(nr_transport_addr *addr); - virtual int write(const void *msg, size_t len, size_t *written); - virtual int read(void* buf, size_t maxlen, size_t *len); + nr_transport_addr *from) MOZ_OVERRIDE; + virtual int getaddr(nr_transport_addr *addrp) MOZ_OVERRIDE; + virtual void close() MOZ_OVERRIDE; + virtual int connect(nr_transport_addr *addr) MOZ_OVERRIDE; + virtual int write(const void *msg, size_t len, size_t *written) MOZ_OVERRIDE; + virtual int read(void* buf, size_t maxlen, size_t *len) MOZ_OVERRIDE; private: virtual ~NrSocket() { @@ -206,17 +206,17 @@ public: explicit NrSocketIpc(const nsCOMPtr &main_thread); // Implementations of the NrSocketBase APIs - virtual int create(nr_transport_addr *addr); + virtual int create(nr_transport_addr *addr) MOZ_OVERRIDE; virtual int sendto(const void *msg, size_t len, - int flags, nr_transport_addr *to); + int flags, nr_transport_addr *to) MOZ_OVERRIDE; virtual int recvfrom(void * buf, size_t maxlen, size_t *len, int flags, - nr_transport_addr *from); - virtual int getaddr(nr_transport_addr *addrp); - virtual void close(); - virtual int connect(nr_transport_addr *addr); - virtual int write(const void *msg, size_t len, size_t *written); - virtual int read(void* buf, size_t maxlen, size_t *len); + nr_transport_addr *from) MOZ_OVERRIDE; + virtual int getaddr(nr_transport_addr *addrp) MOZ_OVERRIDE; + virtual void close() MOZ_OVERRIDE; + virtual int connect(nr_transport_addr *addr) MOZ_OVERRIDE; + virtual int write(const void *msg, size_t len, size_t *written) MOZ_OVERRIDE; + virtual int read(void* buf, size_t maxlen, size_t *len) MOZ_OVERRIDE; private: virtual ~NrSocketIpc() {}; diff --git a/media/mtransport/nriceresolver.h b/media/mtransport/nriceresolver.h index 6a985ad06b24..471bf0871911 100644 --- a/media/mtransport/nriceresolver.h +++ b/media/mtransport/nriceresolver.h @@ -98,7 +98,7 @@ class NrIceResolver cb_(cb), cb_arg_(cb_arg), canceled_ (false) {} NS_IMETHOD OnLookupComplete(nsICancelable *request, nsIDNSRecord *record, - nsresult status); + nsresult status) MOZ_OVERRIDE; int cancel(); nsCOMPtr request_; NS_DECL_THREADSAFE_ISUPPORTS diff --git a/media/mtransport/test/sockettransportservice_unittest.cpp b/media/mtransport/test/sockettransportservice_unittest.cpp index 2ad7cf56c967..b235a160bb64 100644 --- a/media/mtransport/test/sockettransportservice_unittest.cpp +++ b/media/mtransport/test/sockettransportservice_unittest.cpp @@ -110,7 +110,7 @@ class SocketHandler : public nsASocketHandler { explicit SocketHandler(SocketTransportServiceTest *test) : test_(test) { } - void OnSocketReady(PRFileDesc *fd, int16_t outflags) { + void OnSocketReady(PRFileDesc *fd, int16_t outflags) MOZ_OVERRIDE { unsigned char buf[1600]; int32_t rv; @@ -121,15 +121,15 @@ class SocketHandler : public nsASocketHandler { } } - void OnSocketDetached(PRFileDesc *fd) {} + void OnSocketDetached(PRFileDesc *fd) MOZ_OVERRIDE {} - void IsLocal(bool *aIsLocal) { + void IsLocal(bool *aIsLocal) MOZ_OVERRIDE { // TODO(jesup): better check? Does it matter? (likely no) *aIsLocal = false; } - virtual uint64_t ByteCountSent() { return 0; } - virtual uint64_t ByteCountReceived() { return 0; } + virtual uint64_t ByteCountSent() MOZ_OVERRIDE { return 0; } + virtual uint64_t ByteCountReceived() MOZ_OVERRIDE { return 0; } NS_DECL_ISUPPORTS diff --git a/media/mtransport/transportlayerprsock.h b/media/mtransport/transportlayerprsock.h index 9f7ecc215f2c..69ed471f315f 100644 --- a/media/mtransport/transportlayerprsock.h +++ b/media/mtransport/transportlayerprsock.h @@ -63,26 +63,26 @@ class TransportLayerPrsock : public TransportLayer { } // Implement nsASocket - virtual void OnSocketReady(PRFileDesc *fd, int16_t outflags) { + virtual void OnSocketReady(PRFileDesc *fd, int16_t outflags) MOZ_OVERRIDE { if (prsock_) { prsock_->OnSocketReady(fd, outflags); } } - virtual void OnSocketDetached(PRFileDesc *fd) { + virtual void OnSocketDetached(PRFileDesc *fd) MOZ_OVERRIDE { if (prsock_) { prsock_->OnSocketDetached(fd); } PR_Close(fd_); } - virtual void IsLocal(bool *aIsLocal) { + virtual void IsLocal(bool *aIsLocal) MOZ_OVERRIDE { // TODO(jesup): better check? Does it matter? (likely no) *aIsLocal = false; } - virtual uint64_t ByteCountSent() { return 0; } - virtual uint64_t ByteCountReceived() { return 0; } + virtual uint64_t ByteCountSent() MOZ_OVERRIDE { return 0; } + virtual uint64_t ByteCountReceived() MOZ_OVERRIDE { return 0; } // nsISupports methods NS_DECL_THREADSAFE_ISUPPORTS diff --git a/media/webrtc/signaling/test/signaling_unittests.cpp b/media/webrtc/signaling/test/signaling_unittests.cpp index f7e018995239..71d11022d14e 100644 --- a/media/webrtc/signaling/test/signaling_unittests.cpp +++ b/media/webrtc/signaling/test/signaling_unittests.cpp @@ -270,25 +270,25 @@ public: } NS_DECL_THREADSAFE_ISUPPORTS - NS_IMETHODIMP OnCreateOfferSuccess(const char* offer, ER&); - NS_IMETHODIMP OnCreateOfferError(uint32_t code, const char *msg, ER&); - NS_IMETHODIMP OnCreateAnswerSuccess(const char* answer, ER&); - NS_IMETHODIMP OnCreateAnswerError(uint32_t code, const char *msg, ER&); - NS_IMETHODIMP OnSetLocalDescriptionSuccess(ER&); - NS_IMETHODIMP OnSetRemoteDescriptionSuccess(ER&); - NS_IMETHODIMP OnSetLocalDescriptionError(uint32_t code, const char *msg, ER&); - NS_IMETHODIMP OnSetRemoteDescriptionError(uint32_t code, const char *msg, ER&); - NS_IMETHODIMP NotifyDataChannel(nsIDOMDataChannel *channel, ER&); - NS_IMETHODIMP OnStateChange(PCObserverStateType state_type, ER&, void*); - NS_IMETHODIMP OnAddStream(DOMMediaStream *stream, ER&); - NS_IMETHODIMP OnRemoveStream(ER&); - NS_IMETHODIMP OnAddTrack(ER&); - NS_IMETHODIMP OnRemoveTrack(ER&); - NS_IMETHODIMP OnReplaceTrackSuccess(ER&); - NS_IMETHODIMP OnReplaceTrackError(uint32_t code, const char *msg, ER&); - NS_IMETHODIMP OnAddIceCandidateSuccess(ER&); - NS_IMETHODIMP OnAddIceCandidateError(uint32_t code, const char *msg, ER&); - NS_IMETHODIMP OnIceCandidate(uint16_t level, const char *mid, const char *cand, ER&); + NS_IMETHOD OnCreateOfferSuccess(const char* offer, ER&) MOZ_OVERRIDE; + NS_IMETHOD OnCreateOfferError(uint32_t code, const char *msg, ER&) MOZ_OVERRIDE; + NS_IMETHOD OnCreateAnswerSuccess(const char* answer, ER&) MOZ_OVERRIDE; + NS_IMETHOD OnCreateAnswerError(uint32_t code, const char *msg, ER&) MOZ_OVERRIDE; + NS_IMETHOD OnSetLocalDescriptionSuccess(ER&) MOZ_OVERRIDE; + NS_IMETHOD OnSetRemoteDescriptionSuccess(ER&) MOZ_OVERRIDE; + NS_IMETHOD OnSetLocalDescriptionError(uint32_t code, const char *msg, ER&) MOZ_OVERRIDE; + NS_IMETHOD OnSetRemoteDescriptionError(uint32_t code, const char *msg, ER&) MOZ_OVERRIDE; + NS_IMETHOD NotifyDataChannel(nsIDOMDataChannel *channel, ER&) MOZ_OVERRIDE; + NS_IMETHOD OnStateChange(PCObserverStateType state_type, ER&, void*) MOZ_OVERRIDE; + NS_IMETHOD OnAddStream(DOMMediaStream *stream, ER&) MOZ_OVERRIDE; + NS_IMETHOD OnRemoveStream(ER&) MOZ_OVERRIDE; + NS_IMETHOD OnAddTrack(ER&) MOZ_OVERRIDE; + NS_IMETHOD OnRemoveTrack(ER&) MOZ_OVERRIDE; + NS_IMETHOD OnReplaceTrackSuccess(ER&) MOZ_OVERRIDE; + NS_IMETHOD OnReplaceTrackError(uint32_t code, const char *msg, ER&) MOZ_OVERRIDE; + NS_IMETHOD OnAddIceCandidateSuccess(ER&) MOZ_OVERRIDE; + NS_IMETHOD OnAddIceCandidateError(uint32_t code, const char *msg, ER&) MOZ_OVERRIDE; + NS_IMETHOD OnIceCandidate(uint16_t level, const char *mid, const char *cand, ER&) MOZ_OVERRIDE; // Hack because add_ice_candidates can happen asynchronously with respect // to the API calls. The whole test suite needs a refactor.