Bug 1102048 (Part 18) - Make image/src files comply with the Mozilla Coding Style Guide. r=seth

This commit is contained in:
Glenn Randers-Pehrson 2014-12-04 11:43:00 -08:00
parent 8e15aaa375
commit 76319d4f5b
4 changed files with 34 additions and 17 deletions

View File

@ -38,7 +38,8 @@ public:
* @param aClip The rectangle to clip the image against.
*/
static already_AddRefed<Image> Clip(Image* aImage, nsIntRect aClip);
static already_AddRefed<imgIContainer> Clip(imgIContainer* aImage, nsIntRect aClip);
static already_AddRefed<imgIContainer> Clip(imgIContainer* aImage,
nsIntRect aClip);
/**
* Creates a version of an existing image which is rotated and/or flipped to
@ -47,15 +48,18 @@ public:
* @param aImage The existing image.
* @param aOrientation The desired orientation.
*/
static already_AddRefed<Image> Orient(Image* aImage, Orientation aOrientation);
static already_AddRefed<imgIContainer> Orient(imgIContainer* aImage, Orientation aOrientation);
static already_AddRefed<Image> Orient(Image* aImage,
Orientation aOrientation);
static already_AddRefed<imgIContainer> Orient(imgIContainer* aImage,
Orientation aOrientation);
/**
* Creates an image from a gfxDrawable.
*
* @param aDrawable The gfxDrawable.
*/
static already_AddRefed<imgIContainer> CreateFromDrawable(gfxDrawable* aDrawable);
static already_AddRefed<imgIContainer>
CreateFromDrawable(gfxDrawable* aDrawable);
private:
// This is a static utility class, so disallow instantiation.

View File

@ -28,7 +28,8 @@ namespace image {
class ImageURL
{
public:
explicit ImageURL(nsIURI* aURI) {
explicit ImageURL(nsIURI* aURI)
{
MOZ_ASSERT(NS_IsMainThread(), "Cannot use nsIURI off main thread!");
aURI->GetSpec(mSpec);
aURI->GetScheme(mScheme);
@ -37,17 +38,19 @@ public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(ImageURL)
nsresult GetSpec(nsACString &result) {
nsresult GetSpec(nsACString& result)
{
result = mSpec;
return NS_OK;
}
nsresult GetScheme(nsACString &result) {
nsresult GetScheme(nsACString& result)
{
result = mScheme;
return NS_OK;
}
nsresult SchemeIs(const char *scheme, bool *result)
nsresult SchemeIs(const char* scheme, bool* result)
{
NS_PRECONDITION(scheme, "scheme is null");
NS_PRECONDITION(result, "result is null");
@ -56,12 +59,14 @@ public:
return NS_OK;
}
nsresult GetRef(nsACString &result) {
nsresult GetRef(nsACString& result)
{
result = mRef;
return NS_OK;
}
already_AddRefed<nsIURI> ToIURI() {
already_AddRefed<nsIURI> ToIURI()
{
MOZ_ASSERT(NS_IsMainThread(),
"Convert to nsIURI on main thread only; it is not threadsafe.");
nsCOMPtr<nsIURI> newURI;
@ -79,7 +84,7 @@ private:
nsAutoCString mScheme;
nsAutoCString mRef;
~ImageURL() {}
~ImageURL() { }
};
} // namespace image

View File

@ -93,7 +93,8 @@ ImageWrapper::OnImageDataComplete(nsIRequest* aRequest,
nsresult aStatus,
bool aLastPart)
{
return mInnerImage->OnImageDataComplete(aRequest, aContext, aStatus, aLastPart);
return mInnerImage->OnImageDataComplete(aRequest, aContext, aStatus,
aLastPart);
}
nsresult
@ -204,7 +205,8 @@ ImageWrapper::IsOpaque()
}
NS_IMETHODIMP
ImageWrapper::GetImageContainer(LayerManager* aManager, ImageContainer** _retval)
ImageWrapper::GetImageContainer(LayerManager* aManager,
ImageContainer** _retval)
{
return mInnerImage->GetImageContainer(aManager, _retval);
}
@ -305,10 +307,12 @@ ImageWrapper::SetAnimationStartTime(const TimeStamp& aTime)
}
nsIntSize
ImageWrapper::OptimalImageSizeForDest(const gfxSize& aDest, uint32_t aWhichFrame,
ImageWrapper::OptimalImageSizeForDest(const gfxSize& aDest,
uint32_t aWhichFrame,
GraphicsFilter aFilter, uint32_t aFlags)
{
return mInnerImage->OptimalImageSizeForDest(aDest, aWhichFrame, aFilter, aFlags);
return mInnerImage->OptimalImageSizeForDest(aDest, aWhichFrame, aFilter,
aFlags);
}
NS_IMETHODIMP_(nsIntRect)

View File

@ -27,8 +27,12 @@ public:
virtual already_AddRefed<ProgressTracker> GetProgressTracker() MOZ_OVERRIDE;
virtual nsIntRect FrameRect(uint32_t aWhichFrame) MOZ_OVERRIDE;
virtual size_t SizeOfSourceWithComputedFallback(MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE;
virtual size_t SizeOfDecoded(gfxMemoryLocation aLocation, MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE;
virtual size_t
SizeOfSourceWithComputedFallback( MallocSizeOf aMallocSizeOf) const
MOZ_OVERRIDE;
virtual size_t
SizeOfDecoded(gfxMemoryLocation aLocation,
MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE;
virtual void IncrementAnimationConsumers() MOZ_OVERRIDE;
virtual void DecrementAnimationConsumers() MOZ_OVERRIDE;