Call Systrace.setEnabled from CxxBridge

Reviewed By: alexeylang

Differential Revision: D5247016

fbshipit-source-id: 7e31e38d7adae8d432a11199a1de572d082169e3
This commit is contained in:
Pieter De Baets 2017-06-14 11:11:24 -07:00 committed by Facebook Github Bot
parent 383915caeb
commit 9250250364
1 changed files with 3 additions and 0 deletions

View File

@ -1196,6 +1196,8 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithBundleURL:(__unused NSURL *)bundleUR
[RCTFBSystrace registerCallbacks];
#endif
RCTProfileInit(self);
[self enqueueJSCall:@"Systrace" method:@"setEnabled" args:@[@YES] completion:NULL];
}];
}
@ -1204,6 +1206,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithBundleURL:(__unused NSURL *)bundleUR
RCTAssertMainQueue();
[self ensureOnJavaScriptThread:^{
[self enqueueJSCall:@"Systrace" method:@"setEnabled" args:@[@NO] completion:NULL];
RCTProfileEnd(self, ^(NSString *log) {
NSData *logData = [log dataUsingEncoding:NSUTF8StringEncoding];
callback(logData);