Skip to content

Commit

Permalink
Clean up traceSection calls
Browse files Browse the repository at this point in the history
Reviewed By: steelrooter

Differential Revision: D54301986

fbshipit-source-id: 493edbe80813f344ea2284bd1be44d96fd8aa915
  • Loading branch information
Artem Kholodnyi authored and facebook-github-bot committed Feb 29, 2024
1 parent 133629f commit 15b3398
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import com.facebook.common.memory.PooledByteStreams
import com.facebook.common.references.CloseableReference
import com.facebook.imagepipeline.image.EncodedImage
import com.facebook.imagepipeline.instrumentation.FrescoInstrumenter
import com.facebook.imagepipeline.systrace.FrescoSystrace
import com.facebook.imagepipeline.systrace.FrescoSystrace.traceSection
import java.io.IOException
import java.util.concurrent.Callable
Expand Down Expand Up @@ -113,7 +112,7 @@ class BufferedDiskCache(
* never rethrows any exception
*/
operator fun get(key: CacheKey, isCancelled: AtomicBoolean): Task<EncodedImage> =
FrescoSystrace.traceSection("BufferedDiskCache#get") {
traceSection("BufferedDiskCache#get") {
val pinnedImage = stagingArea[key]
pinnedImage?.let { foundPinnedImage(key, it) } ?: getAsync(key, isCancelled)
}
Expand Down Expand Up @@ -232,7 +231,7 @@ class BufferedDiskCache(
* thread, so the caller of this method is not blocked
*/
fun put(key: CacheKey, encodedImage: EncodedImage) =
FrescoSystrace.traceSection("BufferedDiskCache#put") {
traceSection("BufferedDiskCache#put") {
check(EncodedImage.isValid(encodedImage))

// Store encodedImage in staging area
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import com.facebook.imagepipeline.request.ImageRequest
import com.facebook.imagepipeline.request.ImageRequest.CacheChoice
import com.facebook.imagepipeline.request.ImageRequest.RequestLevel
import com.facebook.imagepipeline.request.ImageRequestBuilder
import com.facebook.imagepipeline.systrace.FrescoSystrace
import com.facebook.imagepipeline.systrace.FrescoSystrace.traceSection
import java.util.concurrent.CancellationException
import java.util.concurrent.atomic.AtomicLong
import javax.annotation.concurrent.ThreadSafe
Expand Down Expand Up @@ -415,7 +415,7 @@ class ImagePipeline(
callerContext: Any?,
requestListener: RequestListener?
): DataSource<Void?> =
FrescoSystrace.traceSection("ImagePipeline#prefetchToBitmapCache") {
traceSection("ImagePipeline#prefetchToBitmapCache") {
if (!isPrefetchEnabledSupplier.get()) {
return DataSources.immediateFailedDataSource(PREFETCH_EXCEPTION)
}
Expand Down Expand Up @@ -546,7 +546,7 @@ class ImagePipeline(
priority: Priority = Priority.MEDIUM,
requestListener: RequestListener? = null
): DataSource<Void?> =
FrescoSystrace.traceSection("ImagePipeline#prefetchToEncodedCache") {
traceSection("ImagePipeline#prefetchToEncodedCache") {
if (!isPrefetchEnabledSupplier.get()) {
return DataSources.immediateFailedDataSource(PREFETCH_EXCEPTION)
}
Expand Down Expand Up @@ -796,7 +796,7 @@ class ImagePipeline(

/** @return [CacheKey] for doing bitmap cache lookups in the pipeline. */
fun getCacheKey(imageRequest: ImageRequest?, callerContext: Any?): CacheKey? =
FrescoSystrace.traceSection("ImagePipeline#getCacheKey") {
traceSection("ImagePipeline#getCacheKey") {
var cacheKey: CacheKey? = null
if (imageRequest != null) {
cacheKey =
Expand Down Expand Up @@ -861,7 +861,7 @@ class ImagePipeline(
uiComponentId: String?,
extras: Map<String, *>?
): DataSource<CloseableReference<T>> =
FrescoSystrace.traceSection("ImagePipeline#submitFetchRequest") {
traceSection("ImagePipeline#submitFetchRequest") {
val requestListener2 =
InternalRequestListener(
getRequestListenerForRequest(imageRequest, requestListener), requestListener2)
Expand Down Expand Up @@ -899,7 +899,7 @@ class ImagePipeline(
requestListener: RequestListener?,
extras: Map<String, *>?
): DataSource<CloseableReference<T>> =
FrescoSystrace.traceSection("ImagePipeline#submitFetchRequest") {
traceSection("ImagePipeline#submitFetchRequest") {
val requestListener2 =
InternalRequestListener(
getRequestListenerForRequest(imageRequest, requestListener), requestListener2)
Expand Down Expand Up @@ -933,7 +933,7 @@ class ImagePipeline(
settableProducerContext: SettableProducerContext,
requestListener: RequestListener?
): DataSource<CloseableReference<T>> =
FrescoSystrace.traceSection("ImagePipeline#submitFetchRequest") {
traceSection("ImagePipeline#submitFetchRequest") {
return try {
val requestListener2 = InternalRequestListener(requestListener, requestListener2)
CloseableProducerToDataSourceAdapter.create(
Expand Down

0 comments on commit 15b3398

Please sign in to comment.