diff --git a/Libraries/Image/RCTImageLoader.mm b/Libraries/Image/RCTImageLoader.mm index 723b64dbe61..6ff74f17f15 100644 --- a/Libraries/Image/RCTImageLoader.mm +++ b/Libraries/Image/RCTImageLoader.mm @@ -38,6 +38,18 @@ void RCTEnableImageLoadingPerfInstrumentation(BOOL enabled) imagePerfInstrumentationEnabled = enabled; } +static BOOL (^getImagePerfInstrumentationForFabricEnabled)() = (^BOOL () { + return NO; +}); + +BOOL RCTGetImageLoadingPerfInstrumentationForFabricEnabled() { + return getImagePerfInstrumentationForFabricEnabled(); +} + +void RCTSetImageLoadingPerfInstrumentationForFabricEnabledBlock(BOOL (^getMobileConfigEnabled)()) { + getImagePerfInstrumentationForFabricEnabled = getMobileConfigEnabled; +} + static NSInteger RCTImageBytesForImage(UIImage *image) { NSInteger singleImageBytes = image.size.width * image.size.height * image.scale * image.scale * 4; diff --git a/Libraries/Image/RCTImageLoaderWithAttributionProtocol.h b/Libraries/Image/RCTImageLoaderWithAttributionProtocol.h index 44f4ee849a4..ee546a9b723 100644 --- a/Libraries/Image/RCTImageLoaderWithAttributionProtocol.h +++ b/Libraries/Image/RCTImageLoaderWithAttributionProtocol.h @@ -16,6 +16,9 @@ RCT_EXTERN BOOL RCTImageLoadingPerfInstrumentationEnabled(void); RCT_EXTERN void RCTEnableImageLoadingInstrumentation(BOOL enabled); RCT_EXTERN void RCTEnableImageLoadingPerfInstrumentation(BOOL enabled); +RCT_EXTERN BOOL RCTGetImageLoadingPerfInstrumentationForFabricEnabled(); +RCT_EXTERN void RCTSetImageLoadingPerfInstrumentationForFabricEnabledBlock(BOOL (^getEnabled)()); + @protocol RCTImageLoaderWithAttributionProtocol // TODO (T61325135): Remove C++ checks