Bug 1461940 - Rename two GetImageRequest() methods to ImageRequest(). r=emilio
authorXidorn Quan <me@upsuper.org>
Wed, 16 May 2018 22:28:50 +1000
changeset 472709 cd876c420775f0d39eb531464979c68683c32168
parent 472708 28dd89824e9b748d428c877fc9bf88aaf4356fb2
child 472710 ce7798f62689e38772e62ca85dc0b4e3d4e35781
push id9374
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:43:20 +0000
treeherdermozilla-beta@160e085dfb0b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1461940
milestone62.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 1461940 - Rename two GetImageRequest() methods to ImageRequest(). r=emilio MozReview-Commit-ID: 3eA86IOSLta
layout/style/ServoBindings.cpp
layout/style/nsStyleStruct.cpp
layout/style/nsStyleStruct.h
--- a/layout/style/ServoBindings.cpp
+++ b/layout/style/ServoBindings.cpp
@@ -1667,17 +1667,17 @@ Gecko_CreateGradient(uint8_t aShape,
 
   return result;
 }
 
 const nsStyleImageRequest*
 Gecko_GetImageRequest(const nsStyleImage* aImage)
 {
   MOZ_ASSERT(aImage);
-  return aImage->GetImageRequest();
+  return aImage->ImageRequest();
 }
 
 nsAtom*
 Gecko_GetImageElement(const nsStyleImage* aImage)
 {
   MOZ_ASSERT(aImage && aImage->GetType() == eStyleImageType_Element);
   return const_cast<nsAtom*>(aImage->GetElementId());
 }
--- a/layout/style/nsStyleStruct.cpp
+++ b/layout/style/nsStyleStruct.cpp
@@ -3711,17 +3711,17 @@ nsStyleDisplay::FinishStyle(
 
   if (mShapeOutside.GetType() == StyleShapeSourceType::Image) {
     const UniquePtr<nsStyleImage>& shapeImage = mShapeOutside.GetShapeImage();
     if (shapeImage) {
       // Bug 1434963: The CORS mode should instead be set when the
       // ImageValue is created, in both Gecko and Stylo. That will
       // avoid doing a mutation here.
       if (shapeImage->GetType() == eStyleImageType_Image) {
-        shapeImage->GetImageRequest()->GetImageValue()->SetCORSMode(
+        shapeImage->ImageRequest()->GetImageValue()->SetCORSMode(
           CORSMode::CORS_ANONYMOUS);
       }
       const nsStyleImage* oldShapeImage =
         (aOldStyle &&
          aOldStyle->mShapeOutside.GetType() == StyleShapeSourceType::Image)
           ?  &*aOldStyle->mShapeOutside.GetShapeImage() : nullptr;
       shapeImage->ResolveImage(aPresContext, oldShapeImage);
     }
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -377,38 +377,38 @@ struct nsStyleImage
   void SetCropRect(mozilla::UniquePtr<nsStyleSides> aCropRect);
   void SetURLValue(already_AddRefed<URLValue> aData);
 
   void ResolveImage(nsPresContext* aContext, const nsStyleImage* aOldImage) {
     MOZ_ASSERT(mType != eStyleImageType_Image || mImage);
     if (mType == eStyleImageType_Image && !mImage->IsResolved()) {
       const nsStyleImageRequest* oldRequest =
         (aOldImage && aOldImage->GetType() == eStyleImageType_Image)
-        ? aOldImage->GetImageRequest() : nullptr;
+        ? aOldImage->ImageRequest() : nullptr;
       mImage->Resolve(aContext, oldRequest);
     }
   }
 
   nsStyleImageType GetType() const {
     return mType;
   }
-  nsStyleImageRequest* GetImageRequest() const {
+  nsStyleImageRequest* ImageRequest() const {
     MOZ_ASSERT(mType == eStyleImageType_Image, "Data is not an image!");
     MOZ_ASSERT(mImage);
     return mImage;
   }
   imgRequestProxy* GetImageData() const {
-    return GetImageRequest()->get();
+    return ImageRequest()->get();
   }
   nsStyleGradient* GetGradientData() const {
     NS_ASSERTION(mType == eStyleImageType_Gradient, "Data is not a gradient!");
     return mGradient;
   }
   bool IsResolved() const {
-    return mType != eStyleImageType_Image || GetImageRequest()->IsResolved();
+    return mType != eStyleImageType_Image || ImageRequest()->IsResolved();
   }
   const nsAtom* GetElementId() const {
     NS_ASSERTION(mType == eStyleImageType_Element, "Data is not an element!");
     return mElementId;
   }
   const mozilla::UniquePtr<nsStyleSides>& GetCropRect() const {
     NS_ASSERTION(mType == eStyleImageType_Image,
                  "Only image data can have a crop rect");
@@ -2680,25 +2680,26 @@ public:
   {
     MOZ_ASSERT(mType == eStyleContentType_Counter ||
                mType == eStyleContentType_Counters);
     MOZ_ASSERT(mContent.mCounters->mCounterStyle.IsResolved(),
                "Counter style should have been resolved");
     return mContent.mCounters;
   }
 
-  nsStyleImageRequest* GetImageRequest() const
+  nsStyleImageRequest* ImageRequest() const
   {
     MOZ_ASSERT(mType == eStyleContentType_Image);
+    MOZ_ASSERT(mContent.mImage);
     return mContent.mImage;
   }
 
   imgRequestProxy* GetImage() const
   {
-    return GetImageRequest()->get();
+    return ImageRequest()->get();
   }
 
   void SetKeyword(nsStyleContentType aType)
   {
     MOZ_ASSERT(aType == eStyleContentType_OpenQuote ||
                aType == eStyleContentType_CloseQuote ||
                aType == eStyleContentType_NoOpenQuote ||
                aType == eStyleContentType_NoCloseQuote ||