Skip to content

Commit 3c1458d

Browse files
authored
Merge pull request #1226 from msgharpu/v8_performance_now_fix
Add NativePerformanceNow to V8 Global objects
2 parents eca2f62 + 9641994 commit 3c1458d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

android-patches/patches/V8/ReactAndroid/src/main/java/com/facebook/react/v8executor/V8ExecutorFactory.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ new file mode 100644
33
index 0000000000..16de96d215
44
--- /dev/null
55
+++ b/ReactAndroid/src/main/java/com/facebook/react/v8executor/V8ExecutorFactory.cpp
6-
@@ -0,0 +1,35 @@
6+
@@ -0,0 +1,40 @@
77
+#include <jsi/jsi.h>
88
+#include <V8Runtime.h>
99
+#include <jsireact/JSIExecutor.h>
1010
+#include <react/jni/JSLoader.h>
1111
+#include <react/jni/JSLogging.h>
12+
+#include <react/jni/NativeTime.h>
1213
+
1314
+#include "V8ExecutorFactory.h"
1415
+
@@ -30,6 +31,10 @@ index 0000000000..16de96d215
3031
+ static_cast<void (*)(const std::string &, unsigned int)>(
3132
+ &reactAndroidLoggingHook);
3233
+ react::bindNativeLogger(runtime, androidLogger);
34+
+ react::PerformanceNow androidNativePerformanceNow =
35+
+ static_cast<double (*)()>(&reactAndroidNativePerformanceNowHook);
36+
+ react::bindNativePerformanceNow(runtime, androidNativePerformanceNow);
37+
+
3338
+ };
3439
+
3540
+ return folly::make_unique<JSIExecutor>(

0 commit comments

Comments
 (0)