Use C++17 namespace format everywhere (#36987)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36987

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D45130727

fbshipit-source-id: 66f9fbd2a3a5f4d637b59bee77d085a35117d69d
This commit is contained in:
Christoph Purrer
2023-04-20 14:19:50 -07:00
committed by Facebook GitHub Bot
parent da71c40f81
commit 65f5cd7995
184 changed files with 369 additions and 739 deletions
@@ -9,8 +9,7 @@
@class RCTBlobManager;
namespace facebook {
namespace react {
namespace facebook::react {
class JSI_EXPORT RCTBlobCollector : public jsi::HostObject {
public:
@@ -24,5 +23,4 @@ class JSI_EXPORT RCTBlobCollector : public jsi::HostObject {
RCTBlobManager *blobManager_;
};
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -10,8 +10,7 @@
#import <React/RCTBlobManager.h>
#import <React/RCTBridge+Private.h>
namespace facebook {
namespace react {
namespace facebook::react {
RCTBlobCollector::RCTBlobCollector(RCTBlobManager *blobManager, const std::string &blobId)
: blobId_(blobId), blobManager_(blobManager)
@@ -52,5 +51,4 @@ void RCTBlobCollector::install(RCTBlobManager *blobManager)
queue:RCTJSThread];
}
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -11,8 +11,7 @@
// TODO (T61325135): Remove C++ checks
#ifdef __cplusplus
namespace facebook {
namespace react {
namespace facebook::react {
struct ImageURLLoaderAttribution {
int32_t nativeViewTag = 0;
@@ -21,8 +20,7 @@ struct ImageURLLoaderAttribution {
NSString *analyticTag;
};
} // namespace react
} // namespace facebook
} // namespace facebook::react
#endif
@interface RCTImageURLLoaderRequest : NSObject
@@ -13,12 +13,10 @@
#import <FBLazyVector/FBLazyVector.h>
namespace facebook {
namespace react {
namespace facebook::react {
template <typename T>
using LazyVector = FB::LazyVector<T, id>;
}
}
} // namespace facebook::react
template <typename ContainerT>
NSArray *RCTConvertVecToArray(const ContainerT &vec, id (^convertor)(typename ContainerT::value_type element))
@@ -30,8 +30,7 @@
@end
namespace facebook {
namespace react {
namespace facebook::react {
// Objective-C doesn't allow arbitrary types in its lightweight generics, only object and block types. We can work
// around that by having the struct type we care about be a block-argument. The block never exists at runtime.
@@ -45,5 +44,4 @@ ModuleConstants<T> typedConstants(typename T::Builder::Input &&value)
return [_RCTTypedModuleConstants newWithUnsafeDictionary:builder.buildUnsafeRawValue()];
}
}
}
} // namespace facebook::react
@@ -24,8 +24,7 @@
@end
namespace facebook {
namespace react {
namespace facebook::react {
template <typename T, typename P>
RCTManagedPointer *managedPointer(P initializer)
@@ -34,7 +33,6 @@ RCTManagedPointer *managedPointer(P initializer)
return [[RCTManagedPointer alloc] initWithPointer:std::move(ptr)];
}
}
}
} // namespace facebook::react
#endif
@@ -9,8 +9,7 @@
#include <jsireact/JSIExecutor.h>
namespace facebook {
namespace react {
namespace facebook::react {
class JSCExecutorFactory : public JSExecutorFactory {
public:
@@ -25,5 +24,4 @@ class JSCExecutorFactory : public JSExecutorFactory {
JSIExecutor::RuntimeInstaller runtimeInstaller_;
};
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -11,8 +11,7 @@
#import <memory>
namespace facebook {
namespace react {
namespace facebook::react {
std::unique_ptr<JSExecutor> JSCExecutorFactory::createJSExecutor(
std::shared_ptr<ExecutorDelegate> delegate,
@@ -22,5 +21,4 @@ std::unique_ptr<JSExecutor> JSCExecutorFactory::createJSExecutor(
facebook::jsc::makeJSCRuntime(), delegate, JSIExecutor::defaultTimeoutInvoker, runtimeInstaller_);
}
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -9,8 +9,7 @@
#include <cxxreact/JSBigString.h>
namespace facebook {
namespace react {
namespace facebook::react {
class NSDataBigString : public JSBigString {
public:
@@ -38,5 +37,4 @@ class NSDataBigString : public JSBigString {
size_t m_length;
};
}
}
} // namespace facebook::react
@@ -7,8 +7,7 @@
#import "NSDataBigString.h"
namespace facebook {
namespace react {
namespace facebook::react {
static NSData *ensureNullTerminated(NSData *source)
{
@@ -39,5 +38,4 @@ NSDataBigString::NSDataBigString(NSData *data)
m_data = ensureNullTerminated(data);
}
}
}
} // namespace facebook::react
@@ -9,13 +9,11 @@
#import <React/RCTBridgeDelegate.h>
namespace facebook {
namespace react {
namespace facebook::react {
class JSExecutorFactory;
}
}
} // namespace facebook::react
// This is a separate class so non-C++ implementations don't need to
// take a C++ dependency.
@@ -9,8 +9,7 @@
#include <jsireact/JSIExecutor.h>
namespace facebook {
namespace react {
namespace facebook::react {
/**
* Creates a lambda used to bind a JSIRuntime in the context of
@@ -19,5 +18,4 @@ namespace react {
JSIExecutor::RuntimeInstaller RCTJSIExecutorRuntimeInstaller(
JSIExecutor::RuntimeInstaller runtimeInstallerToWrap);
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -10,8 +10,7 @@
#import <React/RCTLog.h>
#include <chrono>
namespace facebook {
namespace react {
namespace facebook::react {
JSIExecutor::RuntimeInstaller RCTJSIExecutorRuntimeInstaller(JSIExecutor::RuntimeInstaller runtimeInstallerToWrap)
{
@@ -29,5 +28,4 @@ JSIExecutor::RuntimeInstaller RCTJSIExecutorRuntimeInstaller(JSIExecutor::Runtim
};
}
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -13,8 +13,7 @@
#import <React/RCTJavaScriptExecutor.h>
#import <cxxreact/MessageQueueThread.h>
namespace facebook {
namespace react {
namespace facebook::react {
class RCTMessageThread : public MessageQueueThread,
public std::enable_shared_from_this<RCTMessageThread> {
@@ -36,5 +35,4 @@ class RCTMessageThread : public MessageQueueThread,
std::atomic_bool m_shutdown;
};
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -20,8 +20,7 @@
// particular, the sync functions are only used for bridge setup and
// teardown, and quitSynchronous is guaranteed to be called.
namespace facebook {
namespace react {
namespace facebook::react {
RCTMessageThread::RCTMessageThread(NSRunLoop *runLoop, RCTJavaScriptCompleteBlock errorBlock)
: m_cfRunLoop([runLoop getCFRunLoop]), m_errorBlock(errorBlock), m_shutdown(false)
@@ -110,5 +109,4 @@ void RCTMessageThread::setRunLoop(NSRunLoop *runLoop)
CFRetain(m_cfRunLoop);
}
}
}
} // namespace facebook::react
@@ -12,8 +12,7 @@
#import <React/RCTJavaScriptExecutor.h>
#import <cxxreact/JSExecutor.h>
namespace facebook {
namespace react {
namespace facebook::react {
class RCTObjcExecutorFactory : public JSExecutorFactory {
public:
@@ -29,5 +28,4 @@ class RCTObjcExecutorFactory : public JSExecutorFactory {
RCTJavaScriptCompleteBlock m_errorBlock;
};
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -20,8 +20,7 @@
#import <cxxreact/RAMBundleRegistry.h>
#import <folly/json.h>
namespace facebook {
namespace react {
namespace facebook::react {
namespace {
@@ -144,5 +143,4 @@ std::unique_ptr<JSExecutor> RCTObjcExecutorFactory::createJSExecutor(
return std::unique_ptr<JSExecutor>(new RCTObjcExecutor(m_jse, m_errorBlock, jsQueue, delegate));
}
}
}
} // namespace facebook::react
@@ -9,10 +9,8 @@
#import <logger/react_native_log.h>
namespace facebook {
namespace react {
namespace facebook::react {
void RCTDefaultCxxLogFunction(ReactNativeLogLevel level, const char *message);
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -9,8 +9,7 @@
#import <React/RCTLog.h>
#import <glog/logging.h>
namespace facebook {
namespace react {
namespace facebook::react {
void RCTDefaultCxxLogFunction(ReactNativeLogLevel level, const char *message)
{
@@ -35,5 +34,4 @@ void RCTDefaultCxxLogFunction(ReactNativeLogLevel level, const char *message)
}
}
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -10,8 +10,7 @@
#include <React/RCTLog.h>
#include <cxxreact/MessageQueueThread.h>
namespace facebook {
namespace react {
namespace facebook::react {
// RCTNativeModule arranges for native methods to be invoked on a queue which
// is not the JS thread. C++ modules don't use RCTNativeModule, so this little
@@ -43,5 +42,4 @@ class DispatchMessageQueueThread : public MessageQueueThread {
RCTModuleData *moduleData_;
};
}
}
} // namespace facebook::react
@@ -11,13 +11,9 @@
#import <React/RCTBridgeModule.h>
namespace facebook {
namespace xplat {
namespace module {
namespace facebook::xplat::module {
class CxxModule;
}
}
}
} // namespace facebook::react::module
/**
* Subclass RCTCxxModule to use cross-platform CxxModule on iOS.
@@ -13,8 +13,7 @@
@class RCTBridge;
@class RCTModuleData;
namespace facebook {
namespace react {
namespace facebook::react {
class Instance;
class NativeModule;
@@ -25,5 +24,4 @@ createNativeModules(NSArray<RCTModuleData *> *modules, RCTBridge *bridge, const
NSError *tryAndReturnError(const std::function<void()> &func);
NSString *deriveSourceURL(NSURL *url);
}
}
} // namespace facebook::react
@@ -17,8 +17,7 @@
#import "RCTCxxModule.h"
#import "RCTNativeModule.h"
namespace facebook {
namespace react {
namespace facebook::react {
using facebook::jsi::JSError;
@@ -101,5 +100,4 @@ NSString *deriveSourceURL(NSURL *url)
return sourceUrl ?: @"";
}
}
}
} // namespace facebook::react
@@ -8,8 +8,7 @@
#import <React/RCTModuleData.h>
#import <cxxreact/NativeModule.h>
namespace facebook {
namespace react {
namespace facebook::react {
class RCTNativeModule : public NativeModule {
public:
@@ -30,5 +29,4 @@ class RCTNativeModule : public NativeModule {
RCTModuleData *m_moduleData;
};
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -26,8 +26,7 @@ namespace {
enum SchedulingContext { Sync, Async };
}
namespace facebook {
namespace react {
namespace facebook::react {
static MethodCallResult invokeInner(
RCTBridge *bridge,
@@ -235,5 +234,4 @@ static MethodCallResult invokeInner(
return std::nullopt;
}
}
}
} // namespace facebook::react
@@ -9,11 +9,9 @@
#include <folly/dynamic.h>
namespace facebook {
namespace react {
namespace facebook::react {
folly::dynamic convertIdToFollyDynamic(id json);
id convertFollyDynamicToId(const folly::dynamic &dyn);
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -10,8 +10,7 @@
#import <Foundation/Foundation.h>
#import <objc/runtime.h>
namespace facebook {
namespace react {
namespace facebook::react {
id convertFollyDynamicToId(const folly::dynamic &dyn)
{
@@ -114,5 +113,4 @@ folly::dynamic convertIdToFollyDynamic(id json)
return nil;
}
}
}
} // namespace facebook::react
@@ -13,8 +13,7 @@
NS_ASSUME_NONNULL_BEGIN
namespace facebook {
namespace react {
namespace facebook::react {
class RCTImageResponseObserverProxy final : public ImageResponseObserver {
public:
@@ -28,7 +27,6 @@ class RCTImageResponseObserverProxy final : public ImageResponseObserver {
__weak id<RCTImageResponseDelegate> delegate_;
};
} // namespace react
} // namespace facebook
} // namespace facebook::react
NS_ASSUME_NONNULL_END
@@ -12,8 +12,7 @@
#import <react/renderer/imagemanager/ImageResponseObserver.h>
#import <react/utils/ManagedObjectWrapper.h>
namespace facebook {
namespace react {
namespace facebook::react {
RCTImageResponseObserverProxy::RCTImageResponseObserverProxy(id<RCTImageResponseDelegate> delegate)
: delegate_(delegate)
@@ -49,5 +48,4 @@ void RCTImageResponseObserverProxy::didReceiveFailure() const
});
}
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -12,8 +12,7 @@
#include <react/utils/RunLoopObserver.h>
namespace facebook {
namespace react {
namespace facebook::react {
/*
* Concrete iOS-specific implementation of `RunLoopObserver` using
@@ -50,5 +49,4 @@ class MainRunLoopObserver final : public PlatformRunLoopObserver {
: PlatformRunLoopObserver(activities, owner, CFRunLoopGetMain()) {}
};
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -9,8 +9,7 @@
#import <mutex>
namespace facebook {
namespace react {
namespace facebook::react {
static CFRunLoopActivity toCFRunLoopActivity(RunLoopObserver::Activity activity)
{
@@ -93,5 +92,4 @@ bool PlatformRunLoopObserver::isOnRunLoopThread() const noexcept
return CFRunLoopGetCurrent() == runLoop_;
}
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -9,8 +9,7 @@
#include <bitset>
namespace facebook {
namespace react {
namespace facebook::react {
template <size_t size>
class RCTIdentifierPool {
@@ -40,5 +39,4 @@ class RCTIdentifierPool {
int lastIndex;
};
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -33,8 +33,7 @@
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
#include <rncli.h>
namespace facebook {
namespace react {
namespace facebook::react {
void registerComponents(
std::shared_ptr<ComponentDescriptorProviderRegistry const> registry) {
@@ -72,8 +71,7 @@ std::shared_ptr<TurboModule> javaModuleProvider(
return rncli_ModuleProvider(name, params);
}
} // namespace react
} // namespace facebook
} // namespace facebook::react
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) {
return facebook::jni::initialize(vm, [] {
@@ -9,8 +9,7 @@
#include <fb/fbjni.h>
namespace facebook {
namespace react {
namespace facebook::react {
jni::local_ref<JHermesInstance::jhybriddata> JHermesInstance::initHybrid(
jni::alias_ref<jhybridobject>) {
@@ -28,5 +27,4 @@ std::unique_ptr<jsi::Runtime> JHermesInstance::createJSRuntime() noexcept {
return HermesInstance::createJSRuntime();
}
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -17,8 +17,7 @@
#include <react/bridgeless/hermes/HermesInstance.h>
#include "../../jni/JJSEngineInstance.h"
namespace facebook {
namespace react {
namespace facebook::react {
class JHermesInstance
: public jni::HybridClass<JHermesInstance, JJSEngineInstance> {
@@ -38,5 +37,4 @@ class JHermesInstance
friend HybridBase;
};
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -11,9 +11,7 @@
#include <jni.h>
#include <react/bridgeless/JSEngineInstance.h>
namespace facebook {
namespace react {
namespace facebook::react {
class JJSEngineInstance : public jni::HybridClass<JJSEngineInstance>,
public JSEngineInstance {
@@ -25,5 +23,4 @@ class JJSEngineInstance : public jni::HybridClass<JJSEngineInstance>,
friend HybridBase;
};
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -10,8 +10,7 @@
#include <fb/fbjni.h>
#include <jni.h>
namespace facebook {
namespace react {
namespace facebook::react {
void JJSTimerExecutor::setTimerManager(
std::weak_ptr<TimerManager> timerManager) {
@@ -33,5 +32,4 @@ void JJSTimerExecutor::registerNatives() {
});
}
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -13,8 +13,7 @@
#include <react/bridgeless/TimerManager.h>
#include <react/jni/WritableNativeArray.h>
namespace facebook {
namespace react {
namespace facebook::react {
class JJSTimerExecutor : public jni::HybridClass<JJSTimerExecutor> {
public:
@@ -35,5 +34,4 @@ class JJSTimerExecutor : public jni::HybridClass<JJSTimerExecutor> {
std::weak_ptr<TimerManager> timerManager_;
};
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -10,8 +10,7 @@
#include <fb/fbjni.h>
#include <jni.h>
namespace facebook {
namespace react {
namespace facebook::react {
void JJavaTimerManager::createTimer(
uint32_t timerID,
@@ -28,5 +27,4 @@ void JJavaTimerManager::deleteTimer(uint32_t timerID) {
method(self(), timerID);
}
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -12,8 +12,7 @@
#include <fb/fbjni.h>
#include <jni.h>
namespace facebook {
namespace react {
namespace facebook::react {
struct JJavaTimerManager : jni::JavaClass<JJavaTimerManager> {
static auto constexpr kJavaDescriptor =
@@ -24,5 +23,4 @@ struct JJavaTimerManager : jni::JavaClass<JJavaTimerManager> {
void deleteTimer(uint32_t timerID);
};
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -11,8 +11,7 @@
#include <jni.h>
#include <iostream>
namespace facebook {
namespace react {
namespace facebook::react {
void JReactExceptionManager::reportJsException(
const JReadableMapBuffer::javaobject errorMapBuffer) {
@@ -24,5 +23,4 @@ void JReactExceptionManager::reportJsException(
}
}
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -11,8 +11,7 @@
#include <jni.h>
#include <react/common/mapbuffer/JReadableMapBuffer.h>
namespace facebook {
namespace react {
namespace facebook::react {
class JReactExceptionManager
: public facebook::jni::JavaClass<JReactExceptionManager> {
@@ -23,5 +22,4 @@ class JReactExceptionManager
void reportJsException(const JReadableMapBuffer::javaobject errorMapBuffer);
};
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -26,8 +26,7 @@
#include <react/renderer/mapbuffer/MapBuffer.h>
#include "JavaTimerRegistry.h"
namespace facebook {
namespace react {
namespace facebook::react {
JReactInstance::JReactInstance(
jni::alias_ref<JJSEngineInstance::javaobject> jsEngineInstance,
@@ -232,5 +231,4 @@ void JReactInstance::registerNatives() {
});
}
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -27,8 +27,7 @@
#include "JJavaTimerManager.h"
#include "JReactExceptionManager.h"
namespace facebook {
namespace react {
namespace facebook::react {
class JReactInstance : public jni::HybridClass<JReactInstance> {
public:
@@ -105,5 +104,4 @@ class JReactInstance : public jni::HybridClass<JReactInstance> {
jni::global_ref<JBindingsInstaller::javaobject> jBindingsInstaller_;
};
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -7,8 +7,7 @@
#include "JavaTimerRegistry.h"
namespace facebook {
namespace react {
namespace facebook::react {
JavaTimerRegistry::JavaTimerRegistry(
jni::global_ref<JJavaTimerManager::javaobject> javaTimerManager)
@@ -26,5 +25,4 @@ void JavaTimerRegistry::deleteTimer(uint32_t timerID) {
javaTimerManager_->deleteTimer(timerID);
}
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -14,8 +14,7 @@
#include "JJavaTimerManager.h"
namespace facebook {
namespace react {
namespace facebook::react {
/**
* Call into JavaTimerManager.java to schedule and delete timers
@@ -36,5 +35,4 @@ class JavaTimerRegistry : public PlatformTimerRegistry {
jni::global_ref<JJavaTimerManager::javaobject> javaTimerManager_;
};
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -37,8 +37,7 @@
#include <react/renderer/uimanager/primitives.h>
#include <react/utils/ContextContainer.h>
namespace facebook {
namespace react {
namespace facebook::react {
jni::local_ref<Binding::jhybriddata> Binding::initHybrid(
jni::alias_ref<jclass>) {
@@ -586,5 +585,4 @@ void Binding::registerNatives() {
});
}
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -22,8 +22,7 @@
#include "EventEmitterWrapper.h"
#include "JFabricUIManager.h"
namespace facebook {
namespace react {
namespace facebook::react {
class ComponentFactory;
class EventBeatManager;
@@ -151,5 +150,4 @@ class Binding : public jni::HybridClass<Binding>,
bool enableFabricLogs_{false};
};
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -13,8 +13,7 @@
using namespace facebook::jsi;
namespace facebook {
namespace react {
namespace facebook::react {
jni::local_ref<ComponentFactory::jhybriddata> ComponentFactory::initHybrid(
jni::alias_ref<jclass>) {
@@ -27,5 +26,4 @@ void ComponentFactory::registerNatives() {
});
}
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -11,8 +11,7 @@
#include <react/renderer/componentregistry/ComponentDescriptorFactory.h>
#include <react/renderer/componentregistry/ComponentDescriptorRegistry.h>
namespace facebook {
namespace react {
namespace facebook::react {
class Instance;
@@ -29,5 +28,4 @@ class ComponentFactory : public jni::HybridClass<ComponentFactory> {
static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jclass>);
};
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -24,8 +24,7 @@
#include <react/renderer/components/text/TextComponentDescriptor.h>
#include <react/renderer/components/view/ViewComponentDescriptor.h>
namespace facebook {
namespace react {
namespace facebook::react {
CoreComponentsRegistry::CoreComponentsRegistry(ComponentFactory *delegate)
: delegate_(delegate) {}
@@ -109,5 +108,4 @@ void CoreComponentsRegistry::registerNatives() {
});
}
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -12,8 +12,7 @@
#include <react/renderer/componentregistry/ComponentDescriptorRegistry.h>
#include "ComponentFactory.h"
namespace facebook {
namespace react {
namespace facebook::react {
class CoreComponentsRegistry
: public facebook::jni::HybridClass<CoreComponentsRegistry> {
@@ -38,5 +37,4 @@ class CoreComponentsRegistry
ComponentFactory *delegate);
};
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -9,8 +9,7 @@
#include <fbjni/fbjni.h>
using namespace facebook::jni;
namespace facebook {
namespace react {
namespace facebook::react {
EventBeatManager::EventBeatManager(
jni::alias_ref<EventBeatManager::jhybriddata> jhybridobject)
@@ -48,5 +47,4 @@ void EventBeatManager::registerNatives() {
});
}
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -14,8 +14,7 @@
#include <fbjni/fbjni.h>
#include <react/renderer/core/EventBeat.h>
namespace facebook {
namespace react {
namespace facebook::react {
class EventBeatManagerObserver {
public:
@@ -63,5 +62,4 @@ class EventBeatManager : public jni::HybridClass<EventBeatManager> {
jni::alias_ref<EventBeatManager::jhybriddata> jhybridobject);
};
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -10,8 +10,7 @@
using namespace facebook::jni;
namespace facebook {
namespace react {
namespace facebook::react {
void EventEmitterWrapper::dispatchEvent(
std::string eventName,
@@ -51,5 +50,4 @@ void EventEmitterWrapper::registerNatives() {
});
}
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -11,8 +11,7 @@
#include <react/jni/ReadableNativeMap.h>
#include <react/renderer/core/EventEmitter.h>
namespace facebook {
namespace react {
namespace facebook::react {
class Instance;
@@ -35,5 +34,4 @@ class EventEmitterWrapper : public jni::HybridClass<EventEmitterWrapper> {
int customCoalesceKey);
};
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -26,8 +26,7 @@
#include <cmath>
#include <vector>
namespace facebook {
namespace react {
namespace facebook::react {
constexpr static auto kReactFeatureFlagsJavaDescriptor =
"com/facebook/react/config/ReactFeatureFlags";
@@ -959,5 +958,4 @@ void FabricMountingManager::onAllAnimationsComplete() {
allAnimationsCompleteJNI(javaUIManager_);
}
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -15,8 +15,7 @@
#include <react/renderer/mounting/MountingCoordinator.h>
#include <react/renderer/uimanager/primitives.h>
namespace facebook {
namespace react {
namespace facebook::react {
class ReactNativeConfig;
struct ShadowView;
@@ -68,5 +67,4 @@ class FabricMountingManager final {
ShadowView const &newShadowView);
};
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -10,8 +10,7 @@
#include <fbjni/NativeRunnable.h>
#include <fbjni/fbjni.h>
namespace facebook {
namespace react {
namespace facebook::react {
using namespace facebook::jni;
@@ -26,5 +25,4 @@ BackgroundExecutor JBackgroundExecutor::create(const std::string &name) {
};
}
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -10,8 +10,7 @@
#include <fbjni/fbjni.h>
#include <react/renderer/uimanager/primitives.h>
namespace facebook {
namespace react {
namespace facebook::react {
class JBackgroundExecutor : public jni::JavaClass<JBackgroundExecutor> {
public:
@@ -21,5 +20,4 @@ class JBackgroundExecutor : public jni::JavaClass<JBackgroundExecutor> {
static BackgroundExecutor create(const std::string &name);
};
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -7,8 +7,7 @@
#include "MountItem.h"
namespace facebook {
namespace react {
namespace facebook::react {
CppMountItem CppMountItem::CreateMountItem(ShadowView const &shadowView) {
return {CppMountItem::Type::Create, {}, {}, shadowView, -1};
@@ -62,5 +61,4 @@ CppMountItem CppMountItem::UpdateOverflowInsetMountItem(
return {CppMountItem::Type::UpdateOverflowInset, {}, {}, shadowView, -1};
}
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -10,8 +10,7 @@
#include <fbjni/fbjni.h>
#include <react/renderer/mounting/ShadowView.h>
namespace facebook {
namespace react {
namespace facebook::react {
struct JMountItem : public jni::JavaClass<JMountItem> {
static constexpr auto kJavaDescriptor =
@@ -84,5 +83,4 @@ struct CppMountItem final {
int index = {};
};
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -12,8 +12,7 @@
#include <react/jni/ReadableNativeMap.h>
#include <memory>
namespace facebook {
namespace react {
namespace facebook::react {
/**
* Implementation of ReactNativeConfig that wraps a FabricMobileConfig Java
@@ -33,5 +32,4 @@ class ReactNativeConfigHolder : public ReactNativeConfig {
jni::global_ref<jobject> reactNativeConfig_;
};
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -13,8 +13,7 @@
using namespace facebook::jni;
namespace facebook {
namespace react {
namespace facebook::react {
/**
* Called from Java constructor through the JNI.
@@ -64,5 +63,4 @@ void StateWrapperImpl::registerNatives() {
});
}
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -12,8 +12,7 @@
#include <react/jni/ReadableNativeMap.h>
#include <react/renderer/core/State.h>
namespace facebook {
namespace react {
namespace facebook::react {
class Instance;
@@ -38,5 +37,4 @@ class StateWrapperImpl : public jni::HybridClass<StateWrapperImpl> {
static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jclass>);
};
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -8,8 +8,7 @@
#include "SurfaceHandlerBinding.h"
#include <react/renderer/scheduler/Scheduler.h>
namespace facebook {
namespace react {
namespace facebook::react {
SurfaceHandlerBinding::SurfaceHandlerBinding(
SurfaceId surfaceId,
@@ -113,5 +112,4 @@ void SurfaceHandlerBinding::registerNatives() {
});
}
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -13,8 +13,7 @@
#include <react/jni/ReadableNativeMap.h>
#include <react/renderer/scheduler/SurfaceHandler.h>
namespace facebook {
namespace react {
namespace facebook::react {
class SurfaceHandlerBinding : public jni::HybridClass<SurfaceHandlerBinding> {
public:
@@ -63,5 +62,4 @@ class SurfaceHandlerBinding : public jni::HybridClass<SurfaceHandlerBinding> {
jni::alias_ref<jstring> moduleName);
};
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -16,8 +16,7 @@
#include <optional>
namespace facebook {
namespace react {
namespace facebook::react {
namespace {
static MapBuffer convertAccessibilityActions(
@@ -219,5 +218,4 @@ MapBuffer convertTransform(Transform const &transform) {
}
} // namespace
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -19,8 +19,7 @@
#include <memory>
namespace facebook {
namespace react {
namespace facebook::react {
static void hermesFatalHandler(const std::string &reason) {
LOG(ERROR) << "Hermes Fatal: " << reason << "\n";
@@ -110,8 +109,7 @@ class HermesExecutorHolder
using HybridBase::HybridBase;
};
} // namespace react
} // namespace facebook
} // namespace facebook::react
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) {
return facebook::jni::initialize(
@@ -43,8 +43,7 @@
using namespace facebook::jni;
namespace facebook {
namespace react {
namespace facebook::react {
namespace {
@@ -418,5 +417,4 @@ CatalystInstanceImpl::getRuntimeScheduler() {
return runtimeScheduler_;
}
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -20,8 +20,7 @@
#include "JavaModuleWrapper.h"
#include "ModuleRegistryBuilder.h"
namespace facebook {
namespace react {
namespace facebook::react {
class Instance;
class JavaScriptExecutorHolder;
@@ -117,5 +116,4 @@ class CatalystInstanceImpl : public jni::HybridClass<CatalystInstanceImpl> {
jni::global_ref<JRuntimeScheduler::javaobject> runtimeScheduler_;
};
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -16,8 +16,7 @@
using namespace facebook::jni;
using namespace facebook::xplat::module;
namespace facebook {
namespace react {
namespace facebook::react {
jni::local_ref<CxxModuleWrapper::javaobject> CxxModuleWrapper::makeDsoNative(
jni::alias_ref<jclass>,
@@ -55,5 +54,4 @@ jni::local_ref<CxxModuleWrapper::javaobject> CxxModuleWrapper::makeDsoNative(
std::unique_ptr<CxxModule>((*factory)()));
}
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -9,8 +9,7 @@
#include "CxxModuleWrapperBase.h"
namespace facebook {
namespace react {
namespace facebook::react {
class CxxModuleWrapper
: public jni::HybridClass<CxxModuleWrapper, CxxModuleWrapperBase> {
@@ -46,5 +45,4 @@ class CxxModuleWrapper
std::unique_ptr<xplat::module::CxxModule> module_;
};
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -13,8 +13,7 @@
#include <cxxreact/CxxModule.h>
#include <fbjni/fbjni.h>
namespace facebook {
namespace react {
namespace facebook::react {
struct JNativeModule : jni::JavaClass<JNativeModule> {
constexpr static const char *const kJavaDescriptor =
@@ -43,5 +42,4 @@ class CxxModuleWrapperBase
virtual std::unique_ptr<xplat::module::CxxModule> getModule() = 0;
};
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -11,8 +11,7 @@
#include "CxxModuleWrapperBase.h"
namespace facebook {
namespace react {
namespace facebook::react {
class CxxSharedModuleWrapper : public CxxModuleWrapperBase {
public:
@@ -35,5 +34,4 @@ class CxxSharedModuleWrapper : public CxxModuleWrapperBase {
std::shared_ptr<xplat::module::CxxModule> shared_;
};
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -14,8 +14,7 @@
#include "NativeArray.h"
namespace facebook {
namespace react {
namespace facebook::react {
class Instance;
@@ -55,5 +54,4 @@ class JCxxCallbackImpl : public jni::HybridClass<JCxxCallbackImpl, JCallback> {
Callback callback_;
};
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -11,8 +11,7 @@
#ifdef WITH_INSPECTOR
namespace facebook {
namespace react {
namespace facebook::react {
namespace {
@@ -108,7 +107,6 @@ void JInspector::registerNatives() {
});
}
} // namespace react
} // namespace facebook
} // namespace facebook::react
#endif
@@ -15,8 +15,7 @@
#include <memory>
namespace facebook {
namespace react {
namespace facebook::react {
class JPage : public jni::JavaClass<JPage> {
public:
@@ -75,7 +74,6 @@ class JInspector : public jni::HybridClass<JInspector> {
IInspector *inspector_;
};
} // namespace react
} // namespace facebook
} // namespace facebook::react
#endif
@@ -15,8 +15,7 @@
#include <fbjni/fbjni.h>
#include <jsi/jsi.h>
namespace facebook {
namespace react {
namespace facebook::react {
using namespace jni;
@@ -109,5 +108,4 @@ void JMessageQueueThread::quitSynchronous() {
method(m_jobj);
}
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -10,8 +10,7 @@
#include <fbjni/fbjni.h>
#include <string>
namespace facebook {
namespace react {
namespace facebook::react {
class JReactCxxErrorHandler : public jni::JavaClass<JReactCxxErrorHandler> {
public:
@@ -21,5 +20,4 @@ class JReactCxxErrorHandler : public jni::JavaClass<JReactCxxErrorHandler> {
static void handleError(std::string message);
};
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -11,8 +11,7 @@
#include <glog/logging.h>
#include <mutex>
namespace facebook {
namespace react {
namespace facebook::react {
void JReactMarker::setLogPerfMarkerIfNeeded() {
static std::once_flag flag{};
@@ -110,5 +109,4 @@ double JReactMarker::getAppStartTime() {
return meth(cls);
}
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -12,8 +12,7 @@
#include <cxxreact/ReactMarker.h>
namespace facebook {
namespace react {
namespace facebook::react {
class JReactMarker : public facebook::jni::JavaClass<JReactMarker> {
public:
@@ -41,5 +40,4 @@ class JReactMarker : public facebook::jni::JavaClass<JReactMarker> {
static double getAppStartTime();
};
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -10,8 +10,7 @@
#include <fbjni/fbjni.h>
#include <string>
namespace facebook {
namespace react {
namespace facebook::react {
class JReactSoftExceptionLogger
: public jni::JavaClass<JReactSoftExceptionLogger> {
@@ -24,5 +23,4 @@ class JReactSoftExceptionLogger
std::string message);
};
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -7,8 +7,7 @@
#include "JRuntimeExecutor.h"
namespace facebook {
namespace react {
namespace facebook::react {
JRuntimeExecutor::JRuntimeExecutor(RuntimeExecutor runtimeExecutor)
: runtimeExecutor_(runtimeExecutor) {}
@@ -17,5 +16,4 @@ RuntimeExecutor JRuntimeExecutor::get() {
return runtimeExecutor_;
}
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -10,8 +10,7 @@
#include <ReactCommon/RuntimeExecutor.h>
#include <fbjni/fbjni.h>
namespace facebook {
namespace react {
namespace facebook::react {
class JRuntimeExecutor : public jni::HybridClass<JRuntimeExecutor> {
public:
@@ -26,5 +25,4 @@ class JRuntimeExecutor : public jni::HybridClass<JRuntimeExecutor> {
RuntimeExecutor runtimeExecutor_;
};
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -7,8 +7,7 @@
#include "JRuntimeScheduler.h"
namespace facebook {
namespace react {
namespace facebook::react {
JRuntimeScheduler::JRuntimeScheduler(
std::weak_ptr<RuntimeScheduler> runtimeScheduler)
@@ -18,5 +17,4 @@ std::weak_ptr<RuntimeScheduler> JRuntimeScheduler::get() {
return runtimeScheduler_;
}
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -10,8 +10,7 @@
#include <fbjni/fbjni.h>
#include <react/renderer/runtimescheduler/RuntimeScheduler.h>
namespace facebook {
namespace react {
namespace facebook::react {
class JRuntimeScheduler : public jni::HybridClass<JRuntimeScheduler> {
public:
@@ -26,5 +25,4 @@ class JRuntimeScheduler : public jni::HybridClass<JRuntimeScheduler> {
std::weak_ptr<RuntimeScheduler> runtimeScheduler_;
};
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -20,8 +20,7 @@ using fbsystrace::FbSystraceSection;
using namespace facebook::jni;
namespace facebook {
namespace react {
namespace facebook::react {
class AssetManagerString : public JSBigString {
public:
@@ -95,5 +94,4 @@ loadScriptFromAssets(AAssetManager *manager, const std::string &assetName) {
"' is packaged correctly for release."));
}
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -13,8 +13,7 @@
#include <cxxreact/JSExecutor.h>
#include <fbjni/fbjni.h>
namespace facebook {
namespace react {
namespace facebook::react {
struct JAssetManager : jni::JavaClass<JAssetManager> {
static constexpr auto kJavaDescriptor = "Landroid/content/res/AssetManager;";
@@ -30,5 +29,4 @@ std::unique_ptr<const JSBigString> loadScriptFromAssets(
AAssetManager *assetManager,
const std::string &assetName);
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -9,8 +9,7 @@
#include <fb/log.h>
namespace facebook {
namespace react {
namespace facebook::react {
void reactAndroidLoggingHook(
const std::string &message,
@@ -25,5 +24,4 @@ void reactAndroidLoggingHook(
message, static_cast<android_LogPriority>(logLevel + ANDROID_LOG_DEBUG));
}
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -10,13 +10,11 @@
#include <android/log.h>
#include <string>
namespace facebook {
namespace react {
namespace facebook::react {
void reactAndroidLoggingHook(
const std::string &message,
android_LogPriority logLevel);
void reactAndroidLoggingHook(const std::string &message, unsigned int logLevel);
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -26,8 +26,7 @@
using facebook::xplat::module::CxxModule;
namespace facebook {
namespace react {
namespace facebook::react {
std::string JMethodDescriptor::getSignature() const {
static auto signature = javaClassStatic()->getField<jstring>("signature");
@@ -159,5 +158,4 @@ jni::local_ref<JReflectMethod::javaobject> JMethodDescriptor::getMethod()
return getFieldValue(method);
}
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -13,8 +13,7 @@
#include "MethodInvoker.h"
namespace facebook {
namespace react {
namespace facebook::react {
class Instance;
class MessageQueueThread;
@@ -85,5 +84,4 @@ class JavaNativeModule : public NativeModule {
std::vector<std::optional<MethodInvoker>> syncMethods_;
};
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -10,8 +10,7 @@
#include <cxxreact/JSExecutor.h>
#include <fbjni/fbjni.h>
namespace facebook {
namespace react {
namespace facebook::react {
class JavaScriptExecutorHolder
: public jni::HybridClass<JavaScriptExecutorHolder> {
@@ -31,5 +30,4 @@ class JavaScriptExecutorHolder
std::shared_ptr<JSExecutorFactory> mExecutorFactory;
};
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -19,8 +19,7 @@ using magic_number_t = uint32_t;
const magic_number_t MAGIC_FILE_HEADER = 0xFB0BD1E5;
const char *MAGIC_FILE_NAME = "UNBUNDLE";
namespace facebook {
namespace react {
namespace facebook::react {
using asset_ptr =
std::unique_ptr<AAsset, std::function<decltype(AAsset_close)>>;
@@ -94,5 +93,4 @@ JSModulesUnbundle::Module JniJSModulesUnbundle::getModule(
return {sourceUrl, std::string(buffer, AAsset_getLength(asset.get()))};
}
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -12,8 +12,7 @@
#include <android/asset_manager.h>
#include <cxxreact/JSModulesUnbundle.h>
namespace facebook {
namespace react {
namespace facebook::react {
class JniJSModulesUnbundle : public JSModulesUnbundle {
/**
@@ -41,5 +40,4 @@ class JniJSModulesUnbundle : public JSModulesUnbundle {
std::string m_moduleDirectory;
};
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -24,8 +24,7 @@
using namespace facebook::jni;
namespace facebook {
namespace react {
namespace facebook::react {
namespace {
@@ -311,5 +310,4 @@ MethodCallResult MethodInvoker::invoke(
}
}
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -13,8 +13,7 @@
#include <fbjni/fbjni.h>
#include <folly/dynamic.h>
namespace facebook {
namespace react {
namespace facebook::react {
class Instance;
@@ -62,5 +61,4 @@ class MethodInvoker {
bool isSync_;
};
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -13,8 +13,7 @@
#include <cxxreact/CxxNativeModule.h>
namespace facebook {
namespace react {
namespace facebook::react {
std::string ModuleHolder::getName() const {
static auto method = getClass()->getMethod<jstring()>("getName");
@@ -68,5 +67,4 @@ std::vector<std::unique_ptr<NativeModule>> buildNativeModuleList(
return modules;
}
} // namespace react
} // namespace facebook
} // namespace facebook::react
@@ -14,8 +14,7 @@
#include "CxxModuleWrapper.h"
#include "JavaModuleWrapper.h"
namespace facebook {
namespace react {
namespace facebook::react {
class MessageQueueThread;
@@ -36,5 +35,4 @@ std::vector<std::unique_ptr<NativeModule>> buildNativeModuleList(
jni::alias_ref<jni::JCollection<ModuleHolder::javaobject>::javaobject>
cxxModules,
std::shared_ptr<MessageQueueThread> moduleMessageQueue);
} // namespace react
} // namespace facebook
} // namespace facebook::react

Some files were not shown because too many files have changed in this diff Show More