mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-23 03:50:11 +08:00
Remove unused JS Sampling Profiler code
Reviewed By: cwdick Differential Revision: D7803915 fbshipit-source-id: 3edb42d449ff7b272f7d25ac8f16a646839f8c20
This commit is contained in:
committed by
Facebook Github Bot
parent
ef258b0106
commit
d1d09c208a
@@ -4,7 +4,6 @@ rn_android_library(
|
||||
name = "packagerconnection",
|
||||
srcs = glob(
|
||||
["**/*.java"],
|
||||
excludes = ["SamplingProfilerPackagerMethod.java"] if IS_OSS_BUILD else [],
|
||||
),
|
||||
visibility = [
|
||||
"PUBLIC",
|
||||
@@ -19,5 +18,5 @@ rn_android_library(
|
||||
react_native_dep("third-party/java/okhttp:okhttp3"),
|
||||
react_native_dep("third-party/java/okio:okio"),
|
||||
react_native_target("java/com/facebook/react/modules/systeminfo:systeminfo-moduleless"),
|
||||
] + ([react_native_target("jni/packagerconnection:jni")] if not IS_OSS_BUILD else []),
|
||||
],
|
||||
)
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2015-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
package com.facebook.react.packagerconnection;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import android.os.Looper;
|
||||
|
||||
import com.facebook.jni.HybridData;
|
||||
import com.facebook.proguard.annotations.DoNotStrip;
|
||||
import com.facebook.soloader.SoLoader;
|
||||
|
||||
public class SamplingProfilerPackagerMethod extends RequestOnlyHandler {
|
||||
static {
|
||||
SoLoader.loadLibrary("packagerconnectionjnifb");
|
||||
}
|
||||
|
||||
final private static class SamplingProfilerJniMethod {
|
||||
|
||||
@DoNotStrip
|
||||
private final HybridData mHybridData;
|
||||
|
||||
public SamplingProfilerJniMethod(long javaScriptContext) {
|
||||
if (Looper.myLooper() == null) {
|
||||
Looper.prepare();
|
||||
}
|
||||
|
||||
mHybridData = initHybrid(javaScriptContext);
|
||||
}
|
||||
|
||||
@DoNotStrip
|
||||
private native void poke(Responder responder);
|
||||
|
||||
@DoNotStrip
|
||||
private static native HybridData initHybrid(long javaScriptContext);
|
||||
}
|
||||
|
||||
private SamplingProfilerJniMethod mJniMethod;
|
||||
|
||||
public SamplingProfilerPackagerMethod(long javaScriptContext) {
|
||||
mJniMethod = new SamplingProfilerJniMethod(javaScriptContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequest(@Nullable Object params, Responder responder) {
|
||||
mJniMethod.poke(responder);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user