Skip to content

Commit

Permalink
Replace RCT_DEV with RCT_PROFILE
Browse files Browse the repository at this point in the history
Reviewed By: javache

Differential Revision: D3462735

fbshipit-source-id: 44513a9540b3111e036c4b14e0fda2d34b43cdf6
  • Loading branch information
alexeylang authored and Morgan Pretty committed Aug 24, 2016
1 parent 4ea87fd commit 3805bf9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
6 changes: 4 additions & 2 deletions Libraries/Utilities/MessageQueue.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,10 @@ class MessageQueue {
this._callbacks[this._callbackID++] = onSucc;
}

global.nativeTraceBeginAsyncFlow &&
global.nativeTraceBeginAsyncFlow(TRACE_TAG_REACT_APPS, 'native', this._callID);
if (__DEV__) {
global.nativeTraceBeginAsyncFlow &&
global.nativeTraceBeginAsyncFlow(TRACE_TAG_REACT_APPS, 'native', this._callID);
}
this._callID++;

this._queue[MODULE_IDS].push(module);
Expand Down
18 changes: 9 additions & 9 deletions React/Executors/RCTJSCExecutor.mm
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,15 @@ - (void)setUp
}
}];

for (NSString *event in @[RCTProfileDidStartProfiling, RCTProfileDidEndProfiling]) {
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(toggleProfilingFlag:)
name:event
object:nil];
}
#endif

#if RCT_DEV
[self executeBlockOnJavaScriptQueue:^{
RCTJSCExecutor *strongSelf = weakSelf;
if (!strongSelf.valid) {
Expand All @@ -462,15 +471,6 @@ - (void)setUp
RCTInstallJSCProfiler(_bridge, context.JSGlobalContextRef);
}];

for (NSString *event in @[RCTProfileDidStartProfiling, RCTProfileDidEndProfiling]) {
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(toggleProfilingFlag:)
name:event
object:nil];
}
#endif

#if RCT_DEV
// Inject handler used by HMR
[self addSynchronousHookWithName:@"nativeInjectHMRUpdate" usingBlock:^(NSString *sourceCode, NSString *sourceCodeURL) {
RCTJSCExecutor *strongSelf = weakSelf;
Expand Down

0 comments on commit 3805bf9

Please sign in to comment.