Bug 1523969 part 10 - Move method definition inline comments to new line in 'image/'. r=aosmond

Differential Revision: https://phabricator.services.mozilla.com/D21110

--HG--
extra : rebase_source : 9898cccd7791d12b8ece17fa489b530fffd89ff6
This commit is contained in:
Ryan Hunt 2019-02-25 16:07:58 -06:00
Родитель c355a037bb
Коммит 1b0980842e
13 изменённых файлов: 152 добавлений и 102 удалений

Просмотреть файл

@ -36,8 +36,10 @@ namespace image {
// DecodePool implementation.
///////////////////////////////////////////////////////////////////////////////
/* static */ StaticRefPtr<DecodePool> DecodePool::sSingleton;
/* static */ uint32_t DecodePool::sNumCores = 0;
/* static */
StaticRefPtr<DecodePool> DecodePool::sSingleton;
/* static */
uint32_t DecodePool::sNumCores = 0;
NS_IMPL_ISUPPORTS(DecodePool, nsIObserver)
@ -309,13 +311,15 @@ bool DecodePoolImpl::CreateThread() {
return true;
}
/* static */ void DecodePool::Initialize() {
/* static */
void DecodePool::Initialize() {
MOZ_ASSERT(NS_IsMainThread());
sNumCores = max<int32_t>(PR_GetNumberOfProcessors(), 1);
DecodePool::Singleton();
}
/* static */ DecodePool* DecodePool::Singleton() {
/* static */
DecodePool* DecodePool::Singleton() {
if (!sSingleton) {
MOZ_ASSERT(NS_IsMainThread());
sSingleton = new DecodePool();
@ -325,7 +329,8 @@ bool DecodePoolImpl::CreateThread() {
return sSingleton;
}
/* static */ uint32_t DecodePool::NumberOfCores() { return sNumCores; }
/* static */
uint32_t DecodePool::NumberOfCores() { return sNumCores; }
DecodePool::DecodePool() : mMutex("image::DecodePool") {
// Determine the number of threads we want.

Просмотреть файл

@ -28,7 +28,8 @@ using namespace gfx;
namespace image {
/* static */ DecoderType DecoderFactory::GetDecoderType(const char* aMimeType) {
/* static */
DecoderType DecoderFactory::GetDecoderType(const char* aMimeType) {
// By default we don't know.
DecoderType type = DecoderType::UNKNOWN;
@ -80,8 +81,10 @@ namespace image {
return type;
}
/* static */ already_AddRefed<Decoder> DecoderFactory::GetDecoder(
DecoderType aType, RasterImage* aImage, bool aIsRedecode) {
/* static */
already_AddRefed<Decoder> DecoderFactory::GetDecoder(DecoderType aType,
RasterImage* aImage,
bool aIsRedecode) {
RefPtr<Decoder> decoder;
switch (aType) {
@ -119,7 +122,8 @@ namespace image {
return decoder.forget();
}
/* static */ nsresult DecoderFactory::CreateDecoder(
/* static */
nsresult DecoderFactory::CreateDecoder(
DecoderType aType, NotNull<RasterImage*> aImage,
NotNull<SourceBuffer*> aSourceBuffer, const IntSize& aIntrinsicSize,
const IntSize& aOutputSize, DecoderFlags aDecoderFlags,
@ -173,7 +177,8 @@ namespace image {
return NS_OK;
}
/* static */ nsresult DecoderFactory::CreateAnimationDecoder(
/* static */
nsresult DecoderFactory::CreateAnimationDecoder(
DecoderType aType, NotNull<RasterImage*> aImage,
NotNull<SourceBuffer*> aSourceBuffer, const IntSize& aIntrinsicSize,
DecoderFlags aDecoderFlags, SurfaceFlags aSurfaceFlags,
@ -227,7 +232,8 @@ namespace image {
return NS_OK;
}
/* static */ already_AddRefed<Decoder> DecoderFactory::CloneAnimationDecoder(
/* static */
already_AddRefed<Decoder> DecoderFactory::CloneAnimationDecoder(
Decoder* aDecoder) {
MOZ_ASSERT(aDecoder);
@ -257,10 +263,10 @@ namespace image {
return decoder.forget();
}
/* static */ already_AddRefed<IDecodingTask>
DecoderFactory::CreateMetadataDecoder(DecoderType aType,
NotNull<RasterImage*> aImage,
NotNull<SourceBuffer*> aSourceBuffer) {
/* static */
already_AddRefed<IDecodingTask> DecoderFactory::CreateMetadataDecoder(
DecoderType aType, NotNull<RasterImage*> aImage,
NotNull<SourceBuffer*> aSourceBuffer) {
if (aType == DecoderType::UNKNOWN) {
return nullptr;
}
@ -281,14 +287,12 @@ DecoderFactory::CreateMetadataDecoder(DecoderType aType,
return task.forget();
}
/* static */ already_AddRefed<Decoder>
DecoderFactory::CreateDecoderForICOResource(DecoderType aType,
SourceBufferIterator&& aIterator,
NotNull<nsICODecoder*> aICODecoder,
bool aIsMetadataDecode,
const Maybe<IntSize>& aExpectedSize,
const Maybe<uint32_t>& aDataOffset
/* = Nothing() */) {
/* static */
already_AddRefed<Decoder> DecoderFactory::CreateDecoderForICOResource(
DecoderType aType, SourceBufferIterator&& aIterator,
NotNull<nsICODecoder*> aICODecoder, bool aIsMetadataDecode,
const Maybe<IntSize>& aExpectedSize, const Maybe<uint32_t>& aDataOffset
/* = Nothing() */) {
// Create the decoder.
RefPtr<Decoder> decoder;
switch (aType) {
@ -330,7 +334,8 @@ DecoderFactory::CreateDecoderForICOResource(DecoderType aType,
return decoder.forget();
}
/* static */ already_AddRefed<Decoder> DecoderFactory::CreateAnonymousDecoder(
/* static */
already_AddRefed<Decoder> DecoderFactory::CreateAnonymousDecoder(
DecoderType aType, NotNull<SourceBuffer*> aSourceBuffer,
const Maybe<IntSize>& aOutputSize, DecoderFlags aDecoderFlags,
SurfaceFlags aSurfaceFlags) {
@ -365,8 +370,8 @@ DecoderFactory::CreateDecoderForICOResource(DecoderType aType,
return decoder.forget();
}
/* static */ already_AddRefed<Decoder>
DecoderFactory::CreateAnonymousMetadataDecoder(
/* static */
already_AddRefed<Decoder> DecoderFactory::CreateAnonymousMetadataDecoder(
DecoderType aType, NotNull<SourceBuffer*> aSourceBuffer) {
if (aType == DecoderType::UNKNOWN) {
return nullptr;

Просмотреть файл

@ -136,8 +136,9 @@ bool ImageCacheKey::SchemeIs(const char* aScheme) {
return NS_SUCCEEDED(mURI->SchemeIs(aScheme, &matches)) && matches;
}
/* static */ void* ImageCacheKey::GetSpecialCaseDocumentToken(
Document* aDocument, nsIURI* aURI) {
/* static */
void* ImageCacheKey::GetSpecialCaseDocumentToken(Document* aDocument,
nsIURI* aURI) {
// Cookie-averse documents can never have storage granted to them. Since they
// may not have inner windows, they would require special handling below, so
// just bail out early here.

Просмотреть файл

@ -29,7 +29,8 @@
namespace mozilla {
namespace image {
/*static*/ void ImageFactory::Initialize() {}
/*static*/
void ImageFactory::Initialize() {}
static uint32_t ComputeImageFlags(nsIURI* uri, const nsCString& aMimeType,
bool isMultiPart) {
@ -104,7 +105,8 @@ static void NotifyImageLoading(nsIURI* aURI) {
}
#endif
/* static */ already_AddRefed<Image> ImageFactory::CreateImage(
/* static */
already_AddRefed<Image> ImageFactory::CreateImage(
nsIRequest* aRequest, ProgressTracker* aProgressTracker,
const nsCString& aMimeType, nsIURI* aURI, bool aIsMultiPart,
uint32_t aInnerWindowId) {
@ -141,7 +143,8 @@ static already_AddRefed<Image> BadImage(const char* aMessage,
return aImage.forget();
}
/* static */ already_AddRefed<Image> ImageFactory::CreateAnonymousImage(
/* static */
already_AddRefed<Image> ImageFactory::CreateAnonymousImage(
const nsCString& aMimeType, uint32_t aSizeHint /* = 0 */) {
nsresult rv;
@ -164,9 +167,9 @@ static already_AddRefed<Image> BadImage(const char* aMessage,
return newImage.forget();
}
/* static */ already_AddRefed<MultipartImage>
ImageFactory::CreateMultipartImage(Image* aFirstPart,
ProgressTracker* aProgressTracker) {
/* static */
already_AddRefed<MultipartImage> ImageFactory::CreateMultipartImage(
Image* aFirstPart, ProgressTracker* aProgressTracker) {
MOZ_ASSERT(aFirstPart);
MOZ_ASSERT(aProgressTracker);
@ -218,7 +221,8 @@ uint32_t GetContentSize(nsIRequest* aRequest) {
return 0;
}
/* static */ already_AddRefed<Image> ImageFactory::CreateRasterImage(
/* static */
already_AddRefed<Image> ImageFactory::CreateRasterImage(
nsIRequest* aRequest, ProgressTracker* aProgressTracker,
const nsCString& aMimeType, nsIURI* aURI, uint32_t aImageFlags,
uint32_t aInnerWindowId) {
@ -245,7 +249,8 @@ uint32_t GetContentSize(nsIRequest* aRequest) {
return newImage.forget();
}
/* static */ already_AddRefed<Image> ImageFactory::CreateVectorImage(
/* static */
already_AddRefed<Image> ImageFactory::CreateVectorImage(
nsIRequest* aRequest, ProgressTracker* aProgressTracker,
const nsCString& aMimeType, nsIURI* aURI, uint32_t aImageFlags,
uint32_t aInnerWindowId) {

Просмотреть файл

@ -36,7 +36,8 @@ class ImageMemoryReporter::WebRenderReporter final : public nsIMemoryReporter {
NS_IMPL_ISUPPORTS(ImageMemoryReporter::WebRenderReporter, nsIMemoryReporter)
/* static */ void ImageMemoryReporter::InitForWebRender() {
/* static */
void ImageMemoryReporter::InitForWebRender() {
MOZ_ASSERT(XRE_IsParentProcess() || XRE_IsGPUProcess());
if (!sWrReporter) {
sWrReporter = new WebRenderReporter();
@ -44,7 +45,8 @@ NS_IMPL_ISUPPORTS(ImageMemoryReporter::WebRenderReporter, nsIMemoryReporter)
}
}
/* static */ void ImageMemoryReporter::ShutdownForWebRender() {
/* static */
void ImageMemoryReporter::ShutdownForWebRender() {
MOZ_ASSERT(XRE_IsParentProcess() || XRE_IsGPUProcess());
if (sWrReporter) {
UnregisterStrongMemoryReporter(sWrReporter);
@ -52,14 +54,16 @@ NS_IMPL_ISUPPORTS(ImageMemoryReporter::WebRenderReporter, nsIMemoryReporter)
}
}
/* static */ void ImageMemoryReporter::ReportSharedSurfaces(
/* static */
void ImageMemoryReporter::ReportSharedSurfaces(
nsIHandleReportCallback* aHandleReport, nsISupports* aData,
const layers::SharedSurfacesMemoryReport& aSharedSurfaces) {
ReportSharedSurfaces(aHandleReport, aData,
/* aIsForCompositor */ false, aSharedSurfaces);
}
/* static */ void ImageMemoryReporter::ReportSharedSurfaces(
/* static */
void ImageMemoryReporter::ReportSharedSurfaces(
nsIHandleReportCallback* aHandleReport, nsISupports* aData,
bool aIsForCompositor,
const layers::SharedSurfacesMemoryReport& aSharedSurfaces) {
@ -74,7 +78,8 @@ NS_IMPL_ISUPPORTS(ImageMemoryReporter::WebRenderReporter, nsIMemoryReporter)
}
}
/* static */ void ImageMemoryReporter::ReportSharedSurface(
/* static */
void ImageMemoryReporter::ReportSharedSurface(
nsIHandleReportCallback* aHandleReport, nsISupports* aData,
bool aIsForCompositor, uint64_t aExternalId,
const layers::SharedSurfacesMemoryReport::SurfaceEntry& aEntry) {
@ -123,7 +128,8 @@ NS_IMPL_ISUPPORTS(ImageMemoryReporter::WebRenderReporter, nsIMemoryReporter)
aData);
}
/* static */ void ImageMemoryReporter::AppendSharedSurfacePrefix(
/* static */
void ImageMemoryReporter::AppendSharedSurfacePrefix(
nsACString& aPathPrefix, const SurfaceMemoryCounter& aCounter,
layers::SharedSurfacesMemoryReport& aSharedSurfaces) {
uint64_t extId = aCounter.Values().ExternalId();
@ -148,7 +154,8 @@ NS_IMPL_ISUPPORTS(ImageMemoryReporter::WebRenderReporter, nsIMemoryReporter)
}
}
/* static */ void ImageMemoryReporter::TrimSharedSurfaces(
/* static */
void ImageMemoryReporter::TrimSharedSurfaces(
const ImageMemoryCounter& aCounter,
layers::SharedSurfacesMemoryReport& aSharedSurfaces) {
if (aSharedSurfaces.mSurfaces.empty()) {

Просмотреть файл

@ -26,26 +26,29 @@ using namespace mozilla::gfx;
namespace mozilla {
namespace image {
/* static */ already_AddRefed<Image> ImageOps::Freeze(Image* aImage) {
/* static */
already_AddRefed<Image> ImageOps::Freeze(Image* aImage) {
RefPtr<Image> frozenImage = new FrozenImage(aImage);
return frozenImage.forget();
}
/* static */ already_AddRefed<imgIContainer> ImageOps::Freeze(
imgIContainer* aImage) {
/* static */
already_AddRefed<imgIContainer> ImageOps::Freeze(imgIContainer* aImage) {
nsCOMPtr<imgIContainer> frozenImage =
new FrozenImage(static_cast<Image*>(aImage));
return frozenImage.forget();
}
/* static */ already_AddRefed<Image> ImageOps::Clip(
Image* aImage, nsIntRect aClip, const Maybe<nsSize>& aSVGViewportSize) {
/* static */
already_AddRefed<Image> ImageOps::Clip(Image* aImage, nsIntRect aClip,
const Maybe<nsSize>& aSVGViewportSize) {
RefPtr<Image> clippedImage =
new ClippedImage(aImage, aClip, aSVGViewportSize);
return clippedImage.forget();
}
/* static */ already_AddRefed<imgIContainer> ImageOps::Clip(
/* static */
already_AddRefed<imgIContainer> ImageOps::Clip(
imgIContainer* aImage, nsIntRect aClip,
const Maybe<nsSize>& aSVGViewportSize) {
nsCOMPtr<imgIContainer> clippedImage =
@ -53,20 +56,23 @@ namespace image {
return clippedImage.forget();
}
/* static */ already_AddRefed<Image> ImageOps::Orient(
Image* aImage, Orientation aOrientation) {
/* static */
already_AddRefed<Image> ImageOps::Orient(Image* aImage,
Orientation aOrientation) {
RefPtr<Image> orientedImage = new OrientedImage(aImage, aOrientation);
return orientedImage.forget();
}
/* static */ already_AddRefed<imgIContainer> ImageOps::Orient(
imgIContainer* aImage, Orientation aOrientation) {
/* static */
already_AddRefed<imgIContainer> ImageOps::Orient(imgIContainer* aImage,
Orientation aOrientation) {
nsCOMPtr<imgIContainer> orientedImage =
new OrientedImage(static_cast<Image*>(aImage), aOrientation);
return orientedImage.forget();
}
/* static */ already_AddRefed<imgIContainer> ImageOps::CreateFromDrawable(
/* static */
already_AddRefed<imgIContainer> ImageOps::CreateFromDrawable(
gfxDrawable* aDrawable) {
nsCOMPtr<imgIContainer> drawableImage = new DynamicImage(aDrawable);
return drawableImage.forget();
@ -134,17 +140,19 @@ ImageOps::CreateImageBuffer(already_AddRefed<nsIInputStream> aInputStream) {
return imageBuffer.forget();
}
/* static */ nsresult ImageOps::DecodeMetadata(
already_AddRefed<nsIInputStream> aInputStream, const nsACString& aMimeType,
ImageMetadata& aMetadata) {
/* static */
nsresult ImageOps::DecodeMetadata(already_AddRefed<nsIInputStream> aInputStream,
const nsACString& aMimeType,
ImageMetadata& aMetadata) {
nsCOMPtr<nsIInputStream> inputStream = std::move(aInputStream);
RefPtr<ImageBuffer> buffer = CreateImageBuffer(inputStream.forget());
return DecodeMetadata(buffer, aMimeType, aMetadata);
}
/* static */ nsresult ImageOps::DecodeMetadata(ImageBuffer* aBuffer,
const nsACString& aMimeType,
ImageMetadata& aMetadata) {
/* static */
nsresult ImageOps::DecodeMetadata(ImageBuffer* aBuffer,
const nsACString& aMimeType,
ImageMetadata& aMetadata) {
if (!aBuffer) {
return NS_ERROR_FAILURE;
}

Просмотреть файл

@ -1546,8 +1546,8 @@ void RasterImage::DoError() {
("RasterImage: [this=%p] Error detected for image\n", this));
}
/* static */ void RasterImage::HandleErrorWorker::DispatchIfNeeded(
RasterImage* aImage) {
/* static */
void RasterImage::HandleErrorWorker::DispatchIfNeeded(RasterImage* aImage) {
RefPtr<HandleErrorWorker> worker = new HandleErrorWorker(aImage);
NS_DispatchToMainThread(worker);
}

Просмотреть файл

@ -53,16 +53,16 @@ NS_IMPL_ISUPPORTS(ShutdownObserver, nsIObserver)
// Public API
///////////////////////////////////////////////////////////////////////////////
/* static */ void ShutdownTracker::Initialize() {
/* static */
void ShutdownTracker::Initialize() {
nsCOMPtr<nsIObserverService> os = services::GetObserverService();
if (os) {
os->AddObserver(new ShutdownObserver, "xpcom-will-shutdown", false);
}
}
/* static */ bool ShutdownTracker::ShutdownHasStarted() {
return sShutdownHasStarted;
}
/* static */
bool ShutdownTracker::ShutdownHasStarted() { return sShutdownHasStarted; }
} // namespace image
} // namespace mozilla

Просмотреть файл

@ -256,7 +256,8 @@ nsresult SourceBuffer::Compact() {
return NS_OK;
}
/* static */ size_t SourceBuffer::RoundedUpCapacity(size_t aCapacity) {
/* static */
size_t SourceBuffer::RoundedUpCapacity(size_t aCapacity) {
// Protect against overflow.
if (MOZ_UNLIKELY(SIZE_MAX - aCapacity < MIN_CHUNK_CAPACITY)) {
return aCapacity;

Просмотреть файл

@ -1382,7 +1382,8 @@ NS_IMPL_ISUPPORTS(SurfaceCacheImpl::MemoryPressureObserver, nsIObserver)
// Public API
///////////////////////////////////////////////////////////////////////////////
/* static */ void SurfaceCache::Initialize() {
/* static */
void SurfaceCache::Initialize() {
// Initialize preferences.
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(!sInstance, "Shouldn't initialize more than once");
@ -1436,7 +1437,8 @@ NS_IMPL_ISUPPORTS(SurfaceCacheImpl::MemoryPressureObserver, nsIObserver)
sInstance->InitMemoryReporter();
}
/* static */ void SurfaceCache::Shutdown() {
/* static */
void SurfaceCache::Shutdown() {
RefPtr<SurfaceCacheImpl> cache;
{
StaticMutexAutoLock lock(sInstanceMutex);
@ -1446,9 +1448,10 @@ NS_IMPL_ISUPPORTS(SurfaceCacheImpl::MemoryPressureObserver, nsIObserver)
}
}
/* static */ LookupResult SurfaceCache::Lookup(const ImageKey aImageKey,
const SurfaceKey& aSurfaceKey,
bool aMarkUsed) {
/* static */
LookupResult SurfaceCache::Lookup(const ImageKey aImageKey,
const SurfaceKey& aSurfaceKey,
bool aMarkUsed) {
nsTArray<RefPtr<CachedSurface>> discard;
LookupResult rv(MatchType::NOT_FOUND);
@ -1465,8 +1468,10 @@ NS_IMPL_ISUPPORTS(SurfaceCacheImpl::MemoryPressureObserver, nsIObserver)
return rv;
}
/* static */ LookupResult SurfaceCache::LookupBestMatch(
const ImageKey aImageKey, const SurfaceKey& aSurfaceKey, bool aMarkUsed) {
/* static */
LookupResult SurfaceCache::LookupBestMatch(const ImageKey aImageKey,
const SurfaceKey& aSurfaceKey,
bool aMarkUsed) {
nsTArray<RefPtr<CachedSurface>> discard;
LookupResult rv(MatchType::NOT_FOUND);
@ -1483,8 +1488,8 @@ NS_IMPL_ISUPPORTS(SurfaceCacheImpl::MemoryPressureObserver, nsIObserver)
return rv;
}
/* static */ InsertOutcome SurfaceCache::Insert(
NotNull<ISurfaceProvider*> aProvider) {
/* static */
InsertOutcome SurfaceCache::Insert(NotNull<ISurfaceProvider*> aProvider) {
nsTArray<RefPtr<CachedSurface>> discard;
InsertOutcome rv(InsertOutcome::FAILURE);
@ -1501,8 +1506,9 @@ NS_IMPL_ISUPPORTS(SurfaceCacheImpl::MemoryPressureObserver, nsIObserver)
return rv;
}
/* static */ bool SurfaceCache::CanHold(const IntSize& aSize,
uint32_t aBytesPerPixel /* = 4 */) {
/* static */
bool SurfaceCache::CanHold(const IntSize& aSize,
uint32_t aBytesPerPixel /* = 4 */) {
StaticMutexAutoLock lock(sInstanceMutex);
if (!sInstance) {
return false;
@ -1512,7 +1518,8 @@ NS_IMPL_ISUPPORTS(SurfaceCacheImpl::MemoryPressureObserver, nsIObserver)
return sInstance->CanHold(cost);
}
/* static */ bool SurfaceCache::CanHold(size_t aSize) {
/* static */
bool SurfaceCache::CanHold(size_t aSize) {
StaticMutexAutoLock lock(sInstanceMutex);
if (!sInstance) {
return false;
@ -1521,8 +1528,8 @@ NS_IMPL_ISUPPORTS(SurfaceCacheImpl::MemoryPressureObserver, nsIObserver)
return sInstance->CanHold(aSize);
}
/* static */ void SurfaceCache::SurfaceAvailable(
NotNull<ISurfaceProvider*> aProvider) {
/* static */
void SurfaceCache::SurfaceAvailable(NotNull<ISurfaceProvider*> aProvider) {
StaticMutexAutoLock lock(sInstanceMutex);
if (!sInstance) {
return;
@ -1531,28 +1538,32 @@ NS_IMPL_ISUPPORTS(SurfaceCacheImpl::MemoryPressureObserver, nsIObserver)
sInstance->SurfaceAvailable(aProvider, lock);
}
/* static */ void SurfaceCache::LockImage(const ImageKey aImageKey) {
/* static */
void SurfaceCache::LockImage(const ImageKey aImageKey) {
StaticMutexAutoLock lock(sInstanceMutex);
if (sInstance) {
return sInstance->LockImage(aImageKey);
}
}
/* static */ void SurfaceCache::UnlockImage(const ImageKey aImageKey) {
/* static */
void SurfaceCache::UnlockImage(const ImageKey aImageKey) {
StaticMutexAutoLock lock(sInstanceMutex);
if (sInstance) {
return sInstance->UnlockImage(aImageKey, lock);
}
}
/* static */ void SurfaceCache::UnlockEntries(const ImageKey aImageKey) {
/* static */
void SurfaceCache::UnlockEntries(const ImageKey aImageKey) {
StaticMutexAutoLock lock(sInstanceMutex);
if (sInstance) {
return sInstance->UnlockEntries(aImageKey, lock);
}
}
/* static */ void SurfaceCache::RemoveImage(const ImageKey aImageKey) {
/* static */
void SurfaceCache::RemoveImage(const ImageKey aImageKey) {
RefPtr<ImageSurfaceCache> discard;
{
StaticMutexAutoLock lock(sInstanceMutex);
@ -1562,7 +1573,8 @@ NS_IMPL_ISUPPORTS(SurfaceCacheImpl::MemoryPressureObserver, nsIObserver)
}
}
/* static */ void SurfaceCache::PruneImage(const ImageKey aImageKey) {
/* static */
void SurfaceCache::PruneImage(const ImageKey aImageKey) {
nsTArray<RefPtr<CachedSurface>> discard;
{
StaticMutexAutoLock lock(sInstanceMutex);
@ -1573,7 +1585,8 @@ NS_IMPL_ISUPPORTS(SurfaceCacheImpl::MemoryPressureObserver, nsIObserver)
}
}
/* static */ void SurfaceCache::DiscardAll() {
/* static */
void SurfaceCache::DiscardAll() {
nsTArray<RefPtr<CachedSurface>> discard;
{
StaticMutexAutoLock lock(sInstanceMutex);
@ -1584,7 +1597,8 @@ NS_IMPL_ISUPPORTS(SurfaceCacheImpl::MemoryPressureObserver, nsIObserver)
}
}
/* static */ void SurfaceCache::CollectSizeOfSurfaces(
/* static */
void SurfaceCache::CollectSizeOfSurfaces(
const ImageKey aImageKey, nsTArray<SurfaceMemoryCounter>& aCounters,
MallocSizeOf aMallocSizeOf) {
nsTArray<RefPtr<CachedSurface>> discard;
@ -1599,7 +1613,8 @@ NS_IMPL_ISUPPORTS(SurfaceCacheImpl::MemoryPressureObserver, nsIObserver)
}
}
/* static */ size_t SurfaceCache::MaximumCapacity() {
/* static */
size_t SurfaceCache::MaximumCapacity() {
StaticMutexAutoLock lock(sInstanceMutex);
if (!sInstance) {
return 0;
@ -1608,7 +1623,8 @@ NS_IMPL_ISUPPORTS(SurfaceCacheImpl::MemoryPressureObserver, nsIObserver)
return sInstance->MaximumCapacity();
}
/* static */ bool SurfaceCache::IsLegalSize(const IntSize& aSize) {
/* static */
bool SurfaceCache::IsLegalSize(const IntSize& aSize) {
// reject over-wide or over-tall images
const int32_t k64KLimit = 0x0000FFFF;
if (MOZ_UNLIKELY(aSize.width > k64KLimit || aSize.height > k64KLimit)) {

Просмотреть файл

@ -10,9 +10,8 @@
namespace mozilla {
namespace image {
/* static */ void SurfaceCacheUtils::DiscardAll() {
SurfaceCache::DiscardAll();
}
/* static */
void SurfaceCacheUtils::DiscardAll() { SurfaceCache::DiscardAll(); }
} // namespace image
} // namespace mozilla

Просмотреть файл

@ -418,8 +418,8 @@ void nsJPEGEncoder::NotifyListener() {
}
}
/* static */ void nsJPEGEncoderInternal::initDestination(
jpeg_compress_struct* cinfo) {
/* static */
void nsJPEGEncoderInternal::initDestination(jpeg_compress_struct* cinfo) {
nsJPEGEncoder* that = static_cast<nsJPEGEncoder*>(cinfo->client_data);
NS_ASSERTION(!that->mImageBuffer, "Image buffer already initialized");
@ -431,8 +431,8 @@ void nsJPEGEncoder::NotifyListener() {
cinfo->dest->free_in_buffer = that->mImageBufferSize;
}
/* static */ boolean nsJPEGEncoderInternal::emptyOutputBuffer(
jpeg_compress_struct* cinfo) {
/* static */
boolean nsJPEGEncoderInternal::emptyOutputBuffer(jpeg_compress_struct* cinfo) {
nsJPEGEncoder* that = static_cast<nsJPEGEncoder*>(cinfo->client_data);
NS_ASSERTION(that->mImageBuffer, "No buffer to empty!");
@ -467,8 +467,8 @@ void nsJPEGEncoder::NotifyListener() {
return 1;
}
/* static */ void nsJPEGEncoderInternal::termDestination(
jpeg_compress_struct* cinfo) {
/* static */
void nsJPEGEncoderInternal::termDestination(jpeg_compress_struct* cinfo) {
nsJPEGEncoder* that = static_cast<nsJPEGEncoder*>(cinfo->client_data);
if (!that->mImageBuffer) {
return;
@ -479,7 +479,8 @@ void nsJPEGEncoder::NotifyListener() {
that->NotifyListener();
}
/* static */ void nsJPEGEncoderInternal::errorExit(jpeg_common_struct* cinfo) {
/* static */
void nsJPEGEncoderInternal::errorExit(jpeg_common_struct* cinfo) {
nsresult error_code;
encoder_error_mgr* err = (encoder_error_mgr*)cinfo->err;

Просмотреть файл

@ -914,7 +914,8 @@ static nsresult NewImageChannel(
return NS_OK;
}
/* static */ uint32_t imgCacheEntry::SecondsFromPRTime(PRTime prTime) {
/* static */
uint32_t imgCacheEntry::SecondsFromPRTime(PRTime prTime) {
return uint32_t(int64_t(prTime) / int64_t(PR_USEC_PER_SEC));
}
@ -1158,7 +1159,8 @@ NS_IMPL_ISUPPORTS(imgLoader, imgILoader, nsIContentSniffer, imgICache,
static imgLoader* gNormalLoader = nullptr;
static imgLoader* gPrivateBrowsingLoader = nullptr;
/* static */ already_AddRefed<imgLoader> imgLoader::CreateImageLoader() {
/* static */
already_AddRefed<imgLoader> imgLoader::CreateImageLoader() {
// In some cases, such as xpctests, XPCOM modules are not automatically
// initialized. We need to make sure that our module is initialized before
// we hand out imgLoader instances and code starts using them.