Bug 1415085 - Make CachedSurface::GetSurfaceKey return a reference instead of a copy. r=decoder
authorAndrew Osmond <aosmond@mozilla.com>
Tue, 07 Nov 2017 08:10:01 -0500
changeset 443778 7dbef7d88601a8e85e27c020e1be4953c6af6385
parent 443777 7135395eacd612082cb3942b352209840daeffc5
child 443779 b7f758a76a87003ab42311742ef32eacdde02c91
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdecoder
bugs1415085
milestone58.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 1415085 - Make CachedSurface::GetSurfaceKey return a reference instead of a copy. r=decoder
image/SurfaceCache.cpp
--- a/image/SurfaceCache.cpp
+++ b/image/SurfaceCache.cpp
@@ -163,17 +163,17 @@ public:
 
   void SetCannotSubstitute() { mProvider->Availability().SetCannotSubstitute(); }
   bool CannotSubstitute() const { return mProvider->Availability().CannotSubstitute(); }
 
   bool IsPlaceholder() const { return mProvider->Availability().IsPlaceholder(); }
   bool IsDecoded() const { return !IsPlaceholder() && mProvider->IsFinished(); }
 
   ImageKey GetImageKey() const { return mProvider->GetImageKey(); }
-  SurfaceKey GetSurfaceKey() const { return mProvider->GetSurfaceKey(); }
+  const SurfaceKey& GetSurfaceKey() const { return mProvider->GetSurfaceKey(); }
   nsExpirationState* GetExpirationState() { return &mExpirationState; }
 
   CostEntry GetCostEntry()
   {
     return image::CostEntry(WrapNotNull(this), mProvider->LogicalSizeInBytes());
   }
 
   // A helper type used by SurfaceCacheImpl::CollectSizeOfSurfaces.