diff --git a/image/DynamicImage.cpp b/image/DynamicImage.cpp index 83d17d83fe16..686a7561a362 100644 --- a/image/DynamicImage.cpp +++ b/image/DynamicImage.cpp @@ -128,6 +128,12 @@ DynamicImage::GetProducerId(uint32_t* aId) { return NS_OK; } +NS_IMETHODIMP +DynamicImage::GetProviderId(uint32_t* aId) { + *aId = 0; + return NS_OK; +} + NS_IMETHODIMP DynamicImage::GetAnimated(bool* aAnimated) { *aAnimated = false; diff --git a/image/ImageWrapper.cpp b/image/ImageWrapper.cpp index c404ff0c4f71..b8f49026cee8 100644 --- a/image/ImageWrapper.cpp +++ b/image/ImageWrapper.cpp @@ -145,6 +145,11 @@ ImageWrapper::GetProducerId(uint32_t* aId) { return mInnerImage->GetProducerId(aId); } +NS_IMETHODIMP +ImageWrapper::GetProviderId(uint32_t* aId) { + return mInnerImage->GetProviderId(aId); +} + NS_IMETHODIMP ImageWrapper::GetAnimated(bool* aAnimated) { return mInnerImage->GetAnimated(aAnimated); diff --git a/image/RasterImage.cpp b/image/RasterImage.cpp index 02a670e37bd0..87b65e41a436 100644 --- a/image/RasterImage.cpp +++ b/image/RasterImage.cpp @@ -280,6 +280,14 @@ RasterImage::GetProducerId(uint32_t* aId) { return NS_OK; } +NS_IMETHODIMP +RasterImage::GetProviderId(uint32_t* aId) { + NS_ENSURE_ARG_POINTER(aId); + + *aId = ImageResource::GetImageProviderId(); + return NS_OK; +} + LookupResult RasterImage::LookupFrameInternal(const OrientedIntSize& aSize, uint32_t aFlags, PlaybackType aPlaybackType, diff --git a/image/VectorImage.cpp b/image/VectorImage.cpp index 87e1d2c16097..c60e0d133d0d 100644 --- a/image/VectorImage.cpp +++ b/image/VectorImage.cpp @@ -627,6 +627,15 @@ VectorImage::GetProducerId(uint32_t* aId) { return NS_OK; } +//****************************************************************************** +NS_IMETHODIMP +VectorImage::GetProviderId(uint32_t* aId) { + NS_ENSURE_ARG_POINTER(aId); + + *aId = ImageResource::GetImageProviderId(); + return NS_OK; +} + //****************************************************************************** NS_IMETHODIMP VectorImage::GetAnimated(bool* aAnimated) { diff --git a/image/imgIContainer.idl b/image/imgIContainer.idl index ba203fab99cc..8f29ca356866 100644 --- a/image/imgIContainer.idl +++ b/image/imgIContainer.idl @@ -174,6 +174,11 @@ interface imgIContainer : nsISupports */ [infallible] readonly attribute unsigned long producerId; + /** + * Provider ID for image providers created by this image. + */ + [infallible] readonly attribute unsigned long providerId; + /** * Flags for imgIContainer operations. * diff --git a/image/imgIRequest.idl b/image/imgIRequest.idl index e8c717600071..8dd4861a02cd 100644 --- a/image/imgIRequest.idl +++ b/image/imgIRequest.idl @@ -35,6 +35,11 @@ interface imgIRequest : nsIRequest */ [infallible] readonly attribute unsigned long producerId; + /** + * Provider ID for image providers created by this image. + */ + [infallible] readonly attribute unsigned long providerId; + /** * Bits set in the return value from imageStatus * @name statusflags diff --git a/image/imgRequestProxy.cpp b/image/imgRequestProxy.cpp index 0d7776082ceb..be32c0a47541 100644 --- a/image/imgRequestProxy.cpp +++ b/image/imgRequestProxy.cpp @@ -681,6 +681,21 @@ imgRequestProxy::GetProducerId(uint32_t* aId) { return NS_OK; } +NS_IMETHODIMP +imgRequestProxy::GetProviderId(uint32_t* aId) { + NS_ENSURE_TRUE(aId, NS_ERROR_NULL_POINTER); + + nsCOMPtr image; + nsresult rv = GetImage(getter_AddRefs(image)); + if (NS_SUCCEEDED(rv)) { + *aId = image->GetProviderId(); + } else { + *aId = 0; + } + + return NS_OK; +} + NS_IMETHODIMP imgRequestProxy::GetImageStatus(uint32_t* aStatus) { if (IsValidating()) {