Set MobileConfig for Fabric logging in FBReactModule

Summary: Changelog: [RN][iOS] Allow gate to be set for Fabric logging from the React Module

Reviewed By: fkgozali

Differential Revision: D24256546

fbshipit-source-id: 7b290efb9abd3035559f743e6e5b6701e02053e1
This commit is contained in:
Paige Sun 2020-10-14 03:12:50 -07:00 коммит произвёл Facebook GitHub Bot
Родитель ea93151f21
Коммит cd6ebcdd82
2 изменённых файлов: 15 добавлений и 0 удалений

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

@ -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;

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

@ -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<RCTImageLoaderProtocol, RCTImageLoaderInstrumentableProtocol>
// TODO (T61325135): Remove C++ checks