Bug 1318000 - Use C++11's override and remove virtual where applicable in image/. r=jrmuizel
authorAndi-Bogdan Postelnicu <bpostelnicu@mozilla.com>
Wed, 16 Nov 2016 17:41:47 +0200
changeset 323123 21f52dfa70b9849080e061d1a5f4d5213e304a57
parent 323122 f6568e8ff9791f9c200afc6be5a33e1c829fce48
child 323124 7617a6069e428232291ad401c0043694707d829f
push id30970
push usercbook@mozilla.com
push dateFri, 18 Nov 2016 15:49:14 +0000
treeherdermozilla-central@6186126f502b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs1318000
milestone53.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 1318000 - Use C++11's override and remove virtual where applicable in image/. r=jrmuizel MozReview-Commit-ID: B0ZIwPnhAIT
image/imgLoader.cpp
image/imgRequestProxy.cpp
--- a/image/imgLoader.cpp
+++ b/image/imgLoader.cpp
@@ -1061,17 +1061,17 @@ imgLoader::CreateNewProxyForRequest(imgR
 class imgCacheExpirationTracker final
   : public nsExpirationTracker<imgCacheEntry, 3>
 {
   enum { TIMEOUT_SECONDS = 10 };
 public:
   imgCacheExpirationTracker();
 
 protected:
-  void NotifyExpired(imgCacheEntry* entry);
+  void NotifyExpired(imgCacheEntry* entry) override;
 };
 
 imgCacheExpirationTracker::imgCacheExpirationTracker()
  : nsExpirationTracker<imgCacheEntry, 3>(TIMEOUT_SECONDS * 1000,
                                          "imgCacheExpirationTracker")
 { }
 
 void
--- a/image/imgRequestProxy.cpp
+++ b/image/imgRequestProxy.cpp
@@ -32,25 +32,25 @@ class ProxyBehaviour
   virtual void SetOwner(imgRequest* aOwner) = 0;
 };
 
 class RequestBehaviour : public ProxyBehaviour
 {
  public:
   RequestBehaviour() : mOwner(nullptr), mOwnerHasImage(false) {}
 
-  virtual already_AddRefed<mozilla::image::Image>GetImage() const override;
-  virtual bool HasImage() const override;
-  virtual already_AddRefed<ProgressTracker> GetProgressTracker() const override;
+  already_AddRefed<mozilla::image::Image>GetImage() const override;
+  bool HasImage() const override;
+  already_AddRefed<ProgressTracker> GetProgressTracker() const override;
 
-  virtual imgRequest* GetOwner() const override {
+  imgRequest* GetOwner() const override {
     return mOwner;
   }
 
-  virtual void SetOwner(imgRequest* aOwner) override {
+  void SetOwner(imgRequest* aOwner) override {
     mOwner = aOwner;
 
     if (mOwner) {
       RefPtr<ProgressTracker> ownerProgressTracker = GetProgressTracker();
       mOwnerHasImage = ownerProgressTracker && ownerProgressTracker->HasImage();
     } else {
       mOwnerHasImage = false;
     }
@@ -1022,36 +1022,36 @@ imgRequestProxy::GetOwner() const
 
 ////////////////// imgRequestProxyStatic methods
 
 class StaticBehaviour : public ProxyBehaviour
 {
 public:
   explicit StaticBehaviour(mozilla::image::Image* aImage) : mImage(aImage) {}
 
-  virtual already_AddRefed<mozilla::image::Image>
+  already_AddRefed<mozilla::image::Image>
   GetImage() const override {
     RefPtr<mozilla::image::Image> image = mImage;
     return image.forget();
   }
 
-  virtual bool HasImage() const override {
+  bool HasImage() const override {
     return mImage;
   }
 
-  virtual already_AddRefed<ProgressTracker> GetProgressTracker()
+  already_AddRefed<ProgressTracker> GetProgressTracker()
     const override  {
     return mImage->GetProgressTracker();
   }
 
-  virtual imgRequest* GetOwner() const override {
+  imgRequest* GetOwner() const override {
     return nullptr;
   }
 
-  virtual void SetOwner(imgRequest* aOwner) override {
+  void SetOwner(imgRequest* aOwner) override {
     MOZ_ASSERT(!aOwner,
                "We shouldn't be giving static requests a non-null owner.");
   }
 
 private:
   // Our image. We have to hold a strong reference here, because that's normally
   // the job of the underlying request.
   RefPtr<mozilla::image::Image> mImage;