Bug 1119267 - Mark virtual overridden functions as MOZ_OVERRIDE in media; r=jesup
authorEhsan Akhgari <ehsan@mozilla.com>
Thu, 08 Jan 2015 10:17:13 -0500
changeset 248681 d644eb88d7b4b687bf060ca134ee1e66f41b9521
parent 248680 afaab9b353b741c1e5e904d5e3a3806fbf0dc2af
child 248682 292a269e6c01b7b0c8743b468b4569570a978392
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup
bugs1119267
milestone37.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
Bug 1119267 - Mark virtual overridden functions as MOZ_OVERRIDE in media; r=jesup
media/mtransport/nr_socket_prsock.h
media/mtransport/nriceresolver.h
media/mtransport/test/sockettransportservice_unittest.cpp
media/mtransport/transportlayerprsock.h
media/webrtc/signaling/test/signaling_unittests.cpp
--- a/media/mtransport/nr_socket_prsock.h
+++ b/media/mtransport/nr_socket_prsock.h
@@ -128,43 +128,43 @@ private:
 };
 
 class NrSocket : public NrSocketBase,
                  public nsASocketHandler {
 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() {
     if (fd_)
       PR_Close(fd_);
   }
 
   DISALLOW_COPY_ASSIGN(NrSocket);
@@ -201,27 +201,27 @@ public:
   };
 
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIUDPSOCKETINTERNAL
 
   explicit NrSocketIpc(const nsCOMPtr<nsIEventTarget> &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() {};
 
   DISALLOW_COPY_ASSIGN(NrSocketIpc);
 
   // Main thread executors of the NrSocketBase APIs
   void create_m(const nsACString &host, const uint16_t port);
--- a/media/mtransport/nriceresolver.h
+++ b/media/mtransport/nriceresolver.h
@@ -93,17 +93,17 @@ class NrIceResolver
                       int (*cb)(void *cb_arg, nr_transport_addr *addr),
                       void *cb_arg) :
         thread_(thread),
         port_(port),
         transport_(transport),
         cb_(cb), cb_arg_(cb_arg),
         canceled_ (false) {}
     NS_IMETHOD OnLookupComplete(nsICancelable *request, nsIDNSRecord *record,
-                                nsresult status);
+                                nsresult status) MOZ_OVERRIDE;
     int cancel();
     nsCOMPtr<nsICancelable> request_;
     NS_DECL_THREADSAFE_ISUPPORTS
 
    private:
     virtual ~PendingResolution(){};
     nsCOMPtr<nsIEventTarget> thread_;
     uint16_t port_;
--- a/media/mtransport/test/sockettransportservice_unittest.cpp
+++ b/media/mtransport/test/sockettransportservice_unittest.cpp
@@ -105,36 +105,36 @@ public:
 };
 
 
 class SocketHandler : public nsASocketHandler {
  public:
   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;
     rv = PR_Recv(fd, buf, sizeof(buf), 0, PR_INTERVAL_NO_WAIT);
     if (rv > 0) {
       std::cerr << "Read " << rv << " bytes" << std::endl;
       test_->ReceivePacket();
     }
   }
 
-  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
 
  protected:
   virtual ~SocketHandler() {}
 
  private:
   SocketTransportServiceTest *test_;
--- a/media/mtransport/transportlayerprsock.h
+++ b/media/mtransport/transportlayerprsock.h
@@ -58,36 +58,36 @@ class TransportLayerPrsock : public Tran
       }
 
       void Detach() {
         mCondition = NS_BASE_STREAM_CLOSED;
         prsock_ = nullptr;
       }
 
       // 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
 
       private:
       TransportLayerPrsock *prsock_;
       PRFileDesc *fd_;
    private:
--- a/media/webrtc/signaling/test/signaling_unittests.cpp
+++ b/media/webrtc/signaling/test/signaling_unittests.cpp
@@ -265,35 +265,35 @@ public:
       if (candidates[i].find(cand) != std::string::npos)
         ++count;
     }
 
     return count;
   }
 
   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.
   ResponseState addIceCandidateState;
   PeerConnectionImpl::Error lastAddIceStatusCode;
 
   SignalingAgent* peerAgent;
   bool trickleCandidates;