mirror of
https://github.com/react/react-native.git
synced 2026-10-15 11:26:31 +08:00
Create tracing name in C++ instead of Java
Reviewed By: mhorowitz Differential Revision: D3469140 fbshipit-source-id: 77a00a7150573e44f219972556cbb936a57d7054
This commit is contained in:
committed by
Facebook Github Bot 1
parent
af24e8001a
commit
95401aba72
-13
@@ -13,10 +13,8 @@ import javax.annotation.concurrent.Immutable;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import com.facebook.react.common.build.ReactBuildConfig;
|
||||
@@ -28,11 +26,9 @@ import com.facebook.react.common.build.ReactBuildConfig;
|
||||
public class JavaScriptModuleRegistration {
|
||||
|
||||
private final Class<? extends JavaScriptModule> mModuleInterface;
|
||||
private final Map<Method, String> mMethodsToTracingNames;
|
||||
|
||||
public JavaScriptModuleRegistration(Class<? extends JavaScriptModule> moduleInterface) {
|
||||
mModuleInterface = moduleInterface;
|
||||
mMethodsToTracingNames = new HashMap<>();
|
||||
|
||||
if (ReactBuildConfig.DEBUG) {
|
||||
Set<String> methodNames = new LinkedHashSet<>();
|
||||
@@ -46,15 +42,6 @@ public class JavaScriptModuleRegistration {
|
||||
}
|
||||
}
|
||||
|
||||
public String getTracingName(Method method) {
|
||||
String name = mMethodsToTracingNames.get(method);
|
||||
if (name == null) {
|
||||
name = "JSCall__" + getName() + "_" + method.getName();
|
||||
mMethodsToTracingNames.put(method, name);
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
public Class<? extends JavaScriptModule> getModuleInterface() {
|
||||
return mModuleInterface;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user