Skip to content

Commit cd6ebcd

Browse files
p-sunfacebook-github-bot
authored andcommitted
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
1 parent ea93151 commit cd6ebcd

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

Libraries/Image/RCTImageLoader.mm

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,18 @@ void RCTEnableImageLoadingPerfInstrumentation(BOOL enabled)
3838
imagePerfInstrumentationEnabled = enabled;
3939
}
4040

41+
static BOOL (^getImagePerfInstrumentationForFabricEnabled)() = (^BOOL () {
42+
return NO;
43+
});
44+
45+
BOOL RCTGetImageLoadingPerfInstrumentationForFabricEnabled() {
46+
return getImagePerfInstrumentationForFabricEnabled();
47+
}
48+
49+
void RCTSetImageLoadingPerfInstrumentationForFabricEnabledBlock(BOOL (^getMobileConfigEnabled)()) {
50+
getImagePerfInstrumentationForFabricEnabled = getMobileConfigEnabled;
51+
}
52+
4153
static NSInteger RCTImageBytesForImage(UIImage *image)
4254
{
4355
NSInteger singleImageBytes = image.size.width * image.size.height * image.scale * image.scale * 4;

Libraries/Image/RCTImageLoaderWithAttributionProtocol.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ RCT_EXTERN BOOL RCTImageLoadingPerfInstrumentationEnabled(void);
1616
RCT_EXTERN void RCTEnableImageLoadingInstrumentation(BOOL enabled);
1717
RCT_EXTERN void RCTEnableImageLoadingPerfInstrumentation(BOOL enabled);
1818

19+
RCT_EXTERN BOOL RCTGetImageLoadingPerfInstrumentationForFabricEnabled();
20+
RCT_EXTERN void RCTSetImageLoadingPerfInstrumentationForFabricEnabledBlock(BOOL (^getEnabled)());
21+
1922
@protocol RCTImageLoaderWithAttributionProtocol<RCTImageLoaderProtocol, RCTImageLoaderInstrumentableProtocol>
2023

2124
// TODO (T61325135): Remove C++ checks

0 commit comments

Comments
 (0)