mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Replace folly::make_unique with std::make_unique (#26730)
Summary: There is a mixed usage of `folly::make_unique` and `std::make_unique`. Soon, `folly::make_unique` may be removed (see [this PR](https://github.com/facebook/folly/pull/1150)). Since `react-native` only supports C++14-compilers and later, switch to always using `std::make_unique`. ## Changelog [Internal] [Removed] - Replace folly::make_unique with std::make_unique Pull Request resolved: https://github.com/facebook/react-native/pull/26730 Test Plan: Running the existing test suite. No change in behavior is expected. Joshua Gross: buck install -r fb4a, make sure MP Home and forced teardown works okay on android Reviewed By: shergin Differential Revision: D18062400 Pulled By: JoshuaGross fbshipit-source-id: 978ca794c7e972db872a8dcc57c31bdec7451481
This commit is contained in:
committed by
Facebook Github Bot
parent
468d1a2d2e
commit
ba18ee9b87
@@ -8,7 +8,6 @@
|
||||
#include <../instrumentation/HermesMemoryDumper.h>
|
||||
#include <HermesExecutorFactory.h>
|
||||
#include <fb/fbjni.h>
|
||||
#include <folly/Memory.h>
|
||||
#include <hermes/Public/GCConfig.h>
|
||||
#include <hermes/Public/RuntimeConfig.h>
|
||||
#include <jni.h>
|
||||
@@ -16,6 +15,8 @@
|
||||
#include <react/jni/JSLogging.h>
|
||||
#include <react/jni/JavaScriptExecutorHolder.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
@@ -103,7 +104,7 @@ class HermesExecutorHolder
|
||||
JReactMarker::setLogPerfMarkerIfNeeded();
|
||||
|
||||
return makeCxxInstance(
|
||||
folly::make_unique<HermesExecutorFactory>(installBindings));
|
||||
std::make_unique<HermesExecutorFactory>(installBindings));
|
||||
}
|
||||
|
||||
static jni::local_ref<jhybriddata> initHybrid(
|
||||
@@ -124,7 +125,7 @@ class HermesExecutorHolder
|
||||
heapDumper,
|
||||
tripWireCooldownMS,
|
||||
tripWireLimitBytes);
|
||||
return makeCxxInstance(folly::make_unique<HermesExecutorFactory>(
|
||||
return makeCxxInstance(std::make_unique<HermesExecutorFactory>(
|
||||
installBindings, JSIExecutor::defaultTimeoutInvoker, runtimeConfig));
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
*/
|
||||
|
||||
#include <fb/fbjni.h>
|
||||
#include <folly/Memory.h>
|
||||
#include <jsi/JSCRuntime.h>
|
||||
#include <jsireact/JSIExecutor.h>
|
||||
#include <react/jni/JReactMarker.h>
|
||||
@@ -14,6 +13,8 @@
|
||||
#include <react/jni/JavaScriptExecutorHolder.h>
|
||||
#include <react/jni/ReadableNativeMap.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
@@ -30,7 +31,7 @@ class JSCExecutorFactory : public JSExecutorFactory {
|
||||
&reactAndroidLoggingHook);
|
||||
react::bindNativeLogger(runtime, androidLogger);
|
||||
};
|
||||
return folly::make_unique<JSIExecutor>(
|
||||
return std::make_unique<JSIExecutor>(
|
||||
jsc::makeJSCRuntime(),
|
||||
delegate,
|
||||
JSIExecutor::defaultTimeoutInvoker,
|
||||
@@ -56,7 +57,7 @@ class JSCExecutorHolder
|
||||
// Android.
|
||||
JReactMarker::setLogPerfMarkerIfNeeded();
|
||||
// TODO mhorowitz T28461666 fill in some missing nice to have glue
|
||||
return makeCxxInstance(folly::make_unique<JSCExecutorFactory>());
|
||||
return makeCxxInstance(std::make_unique<JSCExecutorFactory>());
|
||||
}
|
||||
|
||||
static void registerNatives() {
|
||||
|
||||
Reference in New Issue
Block a user