mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-28 20:25:33 +08:00
minor build cleanups
Summary: make DevSupportManager PUBLIC visibility, instead of adding to it more; put private parts of OnLoad into an anonymous namespace, and move NativeRunnable into it; don't make NativeArray depend on MethodCall which it does not use. public Reviewed By: astreet Differential Revision: D2651270 fb-gh-sync-id: d5262da79cbd60c4eb490d43d13cc625fa163cdf
This commit is contained in:
committed by
facebook-github-bot-6
parent
c8f3b43984
commit
facf8a56d2
@@ -3,7 +3,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <jni/fbjni.h>
|
#include <jni/fbjni.h>
|
||||||
#include <react/MethodCall.h>
|
#include <folly/dynamic.h>
|
||||||
|
|
||||||
namespace facebook {
|
namespace facebook {
|
||||||
namespace react {
|
namespace react {
|
||||||
|
|||||||
@@ -60,10 +60,6 @@ struct ReadableNativeMapKeySetIterator : public Countable {
|
|||||||
, mapRef(mapRef_) {}
|
, mapRef(mapRef_) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct NativeRunnable : public Countable {
|
|
||||||
std::function<void()> callable;
|
|
||||||
};
|
|
||||||
|
|
||||||
static jobject createReadableNativeMapWithContents(JNIEnv* env, folly::dynamic map) {
|
static jobject createReadableNativeMapWithContents(JNIEnv* env, folly::dynamic map) {
|
||||||
if (map.isNull()) {
|
if (map.isNull()) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@@ -515,8 +511,14 @@ static jstring getNextKey(JNIEnv* env, jobject obj) {
|
|||||||
} // namespace iterator
|
} // namespace iterator
|
||||||
} // namespace map
|
} // namespace map
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
namespace runnable {
|
namespace runnable {
|
||||||
|
|
||||||
|
struct NativeRunnable : public Countable {
|
||||||
|
std::function<void()> callable;
|
||||||
|
};
|
||||||
|
|
||||||
static jclass gNativeRunnableClass;
|
static jclass gNativeRunnableClass;
|
||||||
static jmethodID gNativeRunnableCtor;
|
static jmethodID gNativeRunnableCtor;
|
||||||
|
|
||||||
@@ -743,6 +745,8 @@ static void createProxyExecutor(JNIEnv *env, jobject obj, jobject executorInstan
|
|||||||
|
|
||||||
} // namespace executors
|
} // namespace executors
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
extern "C" JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
|
extern "C" JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
|
||||||
return initialize(vm, [] {
|
return initialize(vm, [] {
|
||||||
// get the current env
|
// get the current env
|
||||||
|
|||||||
Reference in New Issue
Block a user