Bug 1463386: Remove dead nsStyleImageRequest constructor. r?heycam
MozReview-Commit-ID: 3mF3PPQbS5O
--- a/layout/style/nsStyleStruct.cpp
+++ b/layout/style/nsStyleStruct.cpp
@@ -2095,37 +2095,17 @@ private:
// Since we always dispatch this runnable to the main thread, these will be
// released on the main thread when the runnable itself is released.
RefPtr<imgRequestProxy> mRequestProxy;
RefPtr<css::ImageValue> mImageValue;
RefPtr<ImageTracker> mImageTracker;
};
nsStyleImageRequest::nsStyleImageRequest(Mode aModeFlags,
- imgRequestProxy* aRequestProxy,
- css::ImageValue* aImageValue,
- ImageTracker* aImageTracker)
- : mRequestProxy(aRequestProxy)
- , mImageValue(aImageValue)
- , mImageTracker(aImageTracker)
- , mModeFlags(aModeFlags)
- , mResolved(true)
-{
- MOZ_ASSERT(NS_IsMainThread());
- MOZ_ASSERT(aImageValue);
- MOZ_ASSERT(!!(aModeFlags & Mode::Track) == !!aImageTracker);
-
- if (mRequestProxy) {
- MaybeTrackAndLock();
- }
-}
-
-nsStyleImageRequest::nsStyleImageRequest(
- Mode aModeFlags,
- mozilla::css::ImageValue* aImageValue)
+ css::ImageValue* aImageValue)
: mImageValue(aImageValue)
, mModeFlags(aModeFlags)
, mResolved(false)
{
}
nsStyleImageRequest::~nsStyleImageRequest()
{
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -211,40 +211,31 @@ private:
nsStyleGradient(const nsStyleGradient& aOther) = delete;
nsStyleGradient& operator=(const nsStyleGradient& aOther) = delete;
};
/**
* A wrapper for an imgRequestProxy that supports off-main-thread creation
* and equality comparison.
*
- * An nsStyleImageRequest can be created in two ways:
- *
- * 1. Using the constructor that takes an imgRequestProxy. This must
- * be called from the main thread. The nsStyleImageRequest is
- * immediately considered "resolved", and the get() method that
- * returns the imgRequestProxy can be called.
+ * An nsStyleImageRequest can be created using the constructor that takes the
+ * URL, base URI, referrer and principal that can be used to initiate an image
+ * load and produce an imgRequestProxy later.
*
- * 2. Using the constructor that takes the URL, base URI, referrer
- * and principal that can be used to inititiate an image load and
- * produce an imgRequestProxy later. This can be called from
- * any thread. The nsStyleImageRequest is not considered "resolved"
- * at this point, and the Resolve() method must be called later
- * to initiate the image load and make calls to get() valid.
+ * This can be called from any thread. The nsStyleImageRequest is not
+ * considered "resolved" at this point, and the Resolve() method must be called
+ * later to initiate the image load and make calls to get() valid.
*
* Calls to TrackImage(), UntrackImage(), LockImage(), UnlockImage() and
* RequestDiscard() are made to the imgRequestProxy and ImageTracker as
* appropriate, according to the mode flags passed in to the constructor.
*
- * The main thread constructor takes a pointer to the css::ImageValue that
- * is the specified url() value, while the off-main-thread constructor
- * creates a new css::ImageValue to represent the url() information passed
- * to the constructor. This ImageValue is held on to for the comparisons done
- * in DefinitelyEquals(), so that we don't need to call into the non-OMT-safe
- * Equals() on the nsIURI objects returned from imgRequestProxy::GetURI().
+ * The constructor receives a css::ImageValue to represent the url()
+ * information, which is held on to for the comparisons done in
+ * DefinitelyEquals().
*/
class nsStyleImageRequest
{
public:
typedef mozilla::css::URLValueData URLValueData;
// Flags describing whether the imgRequestProxy must be tracked in the
// ImageTracker, whether LockImage/UnlockImage calls will be made
@@ -262,29 +253,19 @@ public:
// The imgRequestProxy will have its RequestDiscard method called when
// the nsStyleImageRequest is going away.
//
// This is currently used only for cursor images.
Discard = 0x2,
};
- // Must be called from the main thread.
- //
- // aImageTracker must be non-null iff aModeFlags contains Track.
- nsStyleImageRequest(Mode aModeFlags,
- imgRequestProxy* aRequestProxy,
- mozilla::css::ImageValue* aImageValue,
- mozilla::dom::ImageTracker* aImageTracker);
-
// Can be called from any thread, but Resolve() must be called later
// on the main thread before get() can be used.
- nsStyleImageRequest(
- Mode aModeFlags,
- mozilla::css::ImageValue* aImageValue);
+ nsStyleImageRequest(Mode aModeFlags, mozilla::css::ImageValue* aImageValue);
bool Resolve(nsPresContext*, const nsStyleImageRequest* aOldImageRequest);
bool IsResolved() const { return mResolved; }
imgRequestProxy* get() {
MOZ_ASSERT(IsResolved(), "Resolve() must be called first");
MOZ_ASSERT(NS_IsMainThread());
return mRequestProxy.get();