Permalink
Browse files

tag INITIALIZE_MODULE marker with the non-zero instance key

Reviewed By: javache

Differential Revision: D5255044

fbshipit-source-id: 9bd72970488cfba4271562e83416f6515b9e77b3
  • Loading branch information...
AaaChiuuu authored and facebook-github-bot committed Jun 15, 2017
1 parent 559805d commit e48ad9609c0566a2e8c50218f56b958d826d1524
Showing with 6 additions and 5 deletions.
  1. +6 −5 ReactAndroid/src/main/java/com/facebook/react/bridge/ModuleHolder.java
@@ -32,6 +32,8 @@
private static final AtomicInteger sInstanceKeyCounter = new AtomicInteger(1);
private final int mInstanceKey = sInstanceKeyCounter.getAndIncrement();
private final String mName;
private final boolean mCanOverrideExistingModule;
private final boolean mHasConstants;
@@ -149,8 +151,7 @@ public NativeModule getModule() {
private NativeModule create() {
SoftAssertions.assertCondition(mModule == null, "Creating an already created module.");
int instanceKey = sInstanceKeyCounter.getAndIncrement();
ReactMarker.logMarker(CREATE_MODULE_START, mName, instanceKey);
ReactMarker.logMarker(CREATE_MODULE_START, mName, mInstanceKey);
SystraceMessage.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "ModuleHolder.createModule")
.arg("name", mName)
.flush();
@@ -169,7 +170,7 @@ private NativeModule create() {
doInitialize(module);
}
} finally {
ReactMarker.logMarker(CREATE_MODULE_END, instanceKey);
ReactMarker.logMarker(CREATE_MODULE_END, mInstanceKey);
SystraceMessage.endSection(TRACE_TAG_REACT_JAVA_BRIDGE).flush();
}
return module;
@@ -179,7 +180,7 @@ private void doInitialize(NativeModule module) {
SystraceMessage.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "ModuleHolder.initialize")
.arg("name", mName)
.flush();
ReactMarker.logMarker(ReactMarkerConstants.INITIALIZE_MODULE_START, mName);
ReactMarker.logMarker(ReactMarkerConstants.INITIALIZE_MODULE_START, mName, mInstanceKey);
try {
boolean shouldInitialize = false;
// Check to see if another thread is initializing the object, if not claim the responsibility
@@ -198,7 +199,7 @@ private void doInitialize(NativeModule module) {
}
}
} finally {
ReactMarker.logMarker(ReactMarkerConstants.INITIALIZE_MODULE_END);
ReactMarker.logMarker(ReactMarkerConstants.INITIALIZE_MODULE_END, mInstanceKey);
SystraceMessage.endSection(TRACE_TAG_REACT_JAVA_BRIDGE).flush();
}
}

0 comments on commit e48ad96

Please sign in to comment.