diff --git a/image/DecodePool.cpp b/image/DecodePool.cpp index b3bb83af0347..3a968902e06d 100644 --- a/image/DecodePool.cpp +++ b/image/DecodePool.cpp @@ -36,8 +36,10 @@ namespace image { // DecodePool implementation. /////////////////////////////////////////////////////////////////////////////// -/* static */ StaticRefPtr DecodePool::sSingleton; -/* static */ uint32_t DecodePool::sNumCores = 0; +/* static */ +StaticRefPtr 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(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. diff --git a/image/DecoderFactory.cpp b/image/DecoderFactory.cpp index ba6f86f892f3..7ad0f39b8654 100644 --- a/image/DecoderFactory.cpp +++ b/image/DecoderFactory.cpp @@ -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 DecoderFactory::GetDecoder( - DecoderType aType, RasterImage* aImage, bool aIsRedecode) { +/* static */ +already_AddRefed DecoderFactory::GetDecoder(DecoderType aType, + RasterImage* aImage, + bool aIsRedecode) { RefPtr decoder; switch (aType) { @@ -119,7 +122,8 @@ namespace image { return decoder.forget(); } -/* static */ nsresult DecoderFactory::CreateDecoder( +/* static */ +nsresult DecoderFactory::CreateDecoder( DecoderType aType, NotNull aImage, NotNull 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 aImage, NotNull aSourceBuffer, const IntSize& aIntrinsicSize, DecoderFlags aDecoderFlags, SurfaceFlags aSurfaceFlags, @@ -227,7 +232,8 @@ namespace image { return NS_OK; } -/* static */ already_AddRefed DecoderFactory::CloneAnimationDecoder( +/* static */ +already_AddRefed DecoderFactory::CloneAnimationDecoder( Decoder* aDecoder) { MOZ_ASSERT(aDecoder); @@ -257,10 +263,10 @@ namespace image { return decoder.forget(); } -/* static */ already_AddRefed -DecoderFactory::CreateMetadataDecoder(DecoderType aType, - NotNull aImage, - NotNull aSourceBuffer) { +/* static */ +already_AddRefed DecoderFactory::CreateMetadataDecoder( + DecoderType aType, NotNull aImage, + NotNull aSourceBuffer) { if (aType == DecoderType::UNKNOWN) { return nullptr; } @@ -281,14 +287,12 @@ DecoderFactory::CreateMetadataDecoder(DecoderType aType, return task.forget(); } -/* static */ already_AddRefed -DecoderFactory::CreateDecoderForICOResource(DecoderType aType, - SourceBufferIterator&& aIterator, - NotNull aICODecoder, - bool aIsMetadataDecode, - const Maybe& aExpectedSize, - const Maybe& aDataOffset - /* = Nothing() */) { +/* static */ +already_AddRefed DecoderFactory::CreateDecoderForICOResource( + DecoderType aType, SourceBufferIterator&& aIterator, + NotNull aICODecoder, bool aIsMetadataDecode, + const Maybe& aExpectedSize, const Maybe& aDataOffset + /* = Nothing() */) { // Create the decoder. RefPtr decoder; switch (aType) { @@ -330,7 +334,8 @@ DecoderFactory::CreateDecoderForICOResource(DecoderType aType, return decoder.forget(); } -/* static */ already_AddRefed DecoderFactory::CreateAnonymousDecoder( +/* static */ +already_AddRefed DecoderFactory::CreateAnonymousDecoder( DecoderType aType, NotNull aSourceBuffer, const Maybe& aOutputSize, DecoderFlags aDecoderFlags, SurfaceFlags aSurfaceFlags) { @@ -365,8 +370,8 @@ DecoderFactory::CreateDecoderForICOResource(DecoderType aType, return decoder.forget(); } -/* static */ already_AddRefed -DecoderFactory::CreateAnonymousMetadataDecoder( +/* static */ +already_AddRefed DecoderFactory::CreateAnonymousMetadataDecoder( DecoderType aType, NotNull aSourceBuffer) { if (aType == DecoderType::UNKNOWN) { return nullptr; diff --git a/image/ImageCacheKey.cpp b/image/ImageCacheKey.cpp index 747684b26ccf..5524c4ac61df 100644 --- a/image/ImageCacheKey.cpp +++ b/image/ImageCacheKey.cpp @@ -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. diff --git a/image/ImageFactory.cpp b/image/ImageFactory.cpp index f88667ac6b8a..dfda640e1dd8 100644 --- a/image/ImageFactory.cpp +++ b/image/ImageFactory.cpp @@ -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 ImageFactory::CreateImage( +/* static */ +already_AddRefed ImageFactory::CreateImage( nsIRequest* aRequest, ProgressTracker* aProgressTracker, const nsCString& aMimeType, nsIURI* aURI, bool aIsMultiPart, uint32_t aInnerWindowId) { @@ -141,7 +143,8 @@ static already_AddRefed BadImage(const char* aMessage, return aImage.forget(); } -/* static */ already_AddRefed ImageFactory::CreateAnonymousImage( +/* static */ +already_AddRefed ImageFactory::CreateAnonymousImage( const nsCString& aMimeType, uint32_t aSizeHint /* = 0 */) { nsresult rv; @@ -164,9 +167,9 @@ static already_AddRefed BadImage(const char* aMessage, return newImage.forget(); } -/* static */ already_AddRefed -ImageFactory::CreateMultipartImage(Image* aFirstPart, - ProgressTracker* aProgressTracker) { +/* static */ +already_AddRefed 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 ImageFactory::CreateRasterImage( +/* static */ +already_AddRefed 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 ImageFactory::CreateVectorImage( +/* static */ +already_AddRefed ImageFactory::CreateVectorImage( nsIRequest* aRequest, ProgressTracker* aProgressTracker, const nsCString& aMimeType, nsIURI* aURI, uint32_t aImageFlags, uint32_t aInnerWindowId) { diff --git a/image/ImageMemoryReporter.cpp b/image/ImageMemoryReporter.cpp index 5f42b222ed15..5792b0cee5ca 100644 --- a/image/ImageMemoryReporter.cpp +++ b/image/ImageMemoryReporter.cpp @@ -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()) { diff --git a/image/ImageOps.cpp b/image/ImageOps.cpp index a7c474a90399..1235e4d52207 100644 --- a/image/ImageOps.cpp +++ b/image/ImageOps.cpp @@ -26,26 +26,29 @@ using namespace mozilla::gfx; namespace mozilla { namespace image { -/* static */ already_AddRefed ImageOps::Freeze(Image* aImage) { +/* static */ +already_AddRefed ImageOps::Freeze(Image* aImage) { RefPtr frozenImage = new FrozenImage(aImage); return frozenImage.forget(); } -/* static */ already_AddRefed ImageOps::Freeze( - imgIContainer* aImage) { +/* static */ +already_AddRefed ImageOps::Freeze(imgIContainer* aImage) { nsCOMPtr frozenImage = new FrozenImage(static_cast(aImage)); return frozenImage.forget(); } -/* static */ already_AddRefed ImageOps::Clip( - Image* aImage, nsIntRect aClip, const Maybe& aSVGViewportSize) { +/* static */ +already_AddRefed ImageOps::Clip(Image* aImage, nsIntRect aClip, + const Maybe& aSVGViewportSize) { RefPtr clippedImage = new ClippedImage(aImage, aClip, aSVGViewportSize); return clippedImage.forget(); } -/* static */ already_AddRefed ImageOps::Clip( +/* static */ +already_AddRefed ImageOps::Clip( imgIContainer* aImage, nsIntRect aClip, const Maybe& aSVGViewportSize) { nsCOMPtr clippedImage = @@ -53,20 +56,23 @@ namespace image { return clippedImage.forget(); } -/* static */ already_AddRefed ImageOps::Orient( - Image* aImage, Orientation aOrientation) { +/* static */ +already_AddRefed ImageOps::Orient(Image* aImage, + Orientation aOrientation) { RefPtr orientedImage = new OrientedImage(aImage, aOrientation); return orientedImage.forget(); } -/* static */ already_AddRefed ImageOps::Orient( - imgIContainer* aImage, Orientation aOrientation) { +/* static */ +already_AddRefed ImageOps::Orient(imgIContainer* aImage, + Orientation aOrientation) { nsCOMPtr orientedImage = new OrientedImage(static_cast(aImage), aOrientation); return orientedImage.forget(); } -/* static */ already_AddRefed ImageOps::CreateFromDrawable( +/* static */ +already_AddRefed ImageOps::CreateFromDrawable( gfxDrawable* aDrawable) { nsCOMPtr drawableImage = new DynamicImage(aDrawable); return drawableImage.forget(); @@ -134,17 +140,19 @@ ImageOps::CreateImageBuffer(already_AddRefed aInputStream) { return imageBuffer.forget(); } -/* static */ nsresult ImageOps::DecodeMetadata( - already_AddRefed aInputStream, const nsACString& aMimeType, - ImageMetadata& aMetadata) { +/* static */ +nsresult ImageOps::DecodeMetadata(already_AddRefed aInputStream, + const nsACString& aMimeType, + ImageMetadata& aMetadata) { nsCOMPtr inputStream = std::move(aInputStream); RefPtr 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; } diff --git a/image/RasterImage.cpp b/image/RasterImage.cpp index 35de98374d20..4c6b37510f72 100644 --- a/image/RasterImage.cpp +++ b/image/RasterImage.cpp @@ -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 worker = new HandleErrorWorker(aImage); NS_DispatchToMainThread(worker); } diff --git a/image/ShutdownTracker.cpp b/image/ShutdownTracker.cpp index 1185f0190f29..4eef66e52e66 100644 --- a/image/ShutdownTracker.cpp +++ b/image/ShutdownTracker.cpp @@ -53,16 +53,16 @@ NS_IMPL_ISUPPORTS(ShutdownObserver, nsIObserver) // Public API /////////////////////////////////////////////////////////////////////////////// -/* static */ void ShutdownTracker::Initialize() { +/* static */ +void ShutdownTracker::Initialize() { nsCOMPtr 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 diff --git a/image/SourceBuffer.cpp b/image/SourceBuffer.cpp index ac32c92b5882..128a7f4b3e32 100644 --- a/image/SourceBuffer.cpp +++ b/image/SourceBuffer.cpp @@ -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; diff --git a/image/SurfaceCache.cpp b/image/SurfaceCache.cpp index 097add657c7b..0acd8689a95f 100644 --- a/image/SurfaceCache.cpp +++ b/image/SurfaceCache.cpp @@ -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 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> 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> discard; LookupResult rv(MatchType::NOT_FOUND); @@ -1483,8 +1488,8 @@ NS_IMPL_ISUPPORTS(SurfaceCacheImpl::MemoryPressureObserver, nsIObserver) return rv; } -/* static */ InsertOutcome SurfaceCache::Insert( - NotNull aProvider) { +/* static */ +InsertOutcome SurfaceCache::Insert(NotNull aProvider) { nsTArray> 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 aProvider) { +/* static */ +void SurfaceCache::SurfaceAvailable(NotNull 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 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> discard; { StaticMutexAutoLock lock(sInstanceMutex); @@ -1573,7 +1585,8 @@ NS_IMPL_ISUPPORTS(SurfaceCacheImpl::MemoryPressureObserver, nsIObserver) } } -/* static */ void SurfaceCache::DiscardAll() { +/* static */ +void SurfaceCache::DiscardAll() { nsTArray> 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& aCounters, MallocSizeOf aMallocSizeOf) { nsTArray> 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)) { diff --git a/image/SurfaceCacheUtils.cpp b/image/SurfaceCacheUtils.cpp index f569e0fb42db..e92197ca7c90 100644 --- a/image/SurfaceCacheUtils.cpp +++ b/image/SurfaceCacheUtils.cpp @@ -10,9 +10,8 @@ namespace mozilla { namespace image { -/* static */ void SurfaceCacheUtils::DiscardAll() { - SurfaceCache::DiscardAll(); -} +/* static */ +void SurfaceCacheUtils::DiscardAll() { SurfaceCache::DiscardAll(); } } // namespace image } // namespace mozilla diff --git a/image/encoders/jpeg/nsJPEGEncoder.cpp b/image/encoders/jpeg/nsJPEGEncoder.cpp index 459eebfc618c..aa86186fb667 100644 --- a/image/encoders/jpeg/nsJPEGEncoder.cpp +++ b/image/encoders/jpeg/nsJPEGEncoder.cpp @@ -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(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(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(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; diff --git a/image/imgLoader.cpp b/image/imgLoader.cpp index 63f426c41620..fa968c9d9cc7 100644 --- a/image/imgLoader.cpp +++ b/image/imgLoader.cpp @@ -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::CreateImageLoader() { +/* static */ +already_AddRefed 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.