Skip to content

Commit

Permalink
Use C++17 namespace format (facebook#36983)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebook#36983

Changelog: [Internal]

This updates ReactCommon/react code to use C++17 namespace format which was already used partially in other files

Reviewed By: NickGerleman

Differential Revision: D45121589

fbshipit-source-id: 0be5a7bce75dc9f8cde7856684f730f4d6df9202
  • Loading branch information
christophpurrer authored and facebook-github-bot committed Apr 20, 2023
1 parent 6babe4a commit 79c42e7
Show file tree
Hide file tree
Showing 303 changed files with 605 additions and 1,211 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
#include <cxxreact/MessageQueueThread.h>
#include <algorithm>

namespace facebook {
namespace react {
namespace facebook::react {

BufferedRuntimeExecutor::BufferedRuntimeExecutor(
RuntimeExecutor runtimeExecutor)
Expand Down Expand Up @@ -58,5 +57,4 @@ void BufferedRuntimeExecutor::unsafeFlush() {
}
}

} // namespace react
} // namespace facebook
} // namespace facebook::react
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
#include <atomic>
#include <queue>

namespace facebook {
namespace react {
namespace facebook::react {

class BufferedRuntimeExecutor {
public:
Expand Down Expand Up @@ -47,5 +46,4 @@ class BufferedRuntimeExecutor {
std::priority_queue<BufferedWork> queue_;
};

} // namespace react
} // namespace facebook
} // namespace facebook::react
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
#include <ReactCommon/RuntimeExecutor.h>
#include <jsi/jsi.h>

namespace facebook {
namespace react {
namespace facebook::react {

/**
* Interface for a class that creates and owns an instance of a JS VM
Expand All @@ -23,5 +22,4 @@ class JSEngineInstance {
virtual ~JSEngineInstance() = default;
};

} // namespace react
} // namespace facebook
} // namespace facebook::react
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@

#include <cstdint>

namespace facebook {
namespace react {
namespace facebook::react {

/**
* This interface is implemented by each platform.
Expand All @@ -30,5 +29,4 @@ class PlatformTimerRegistry {

using TimerManagerDelegate = PlatformTimerRegistry;

} // namespace react
} // namespace facebook
} // namespace facebook::react
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
#include <tuple>
#include <utility>

namespace facebook {
namespace react {
namespace facebook::react {

// Looping on \c drainMicrotasks until it completes or hits the retries bound.
static void performMicrotaskCheckpoint(jsi::Runtime &runtime) {
Expand Down Expand Up @@ -454,5 +453,4 @@ void ReactInstance::handleMemoryPressureJs(int pressureLevel) {
}
}

} // namespace react
} // namespace facebook
} // namespace facebook::react
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
#include <react/bridgeless/TimerManager.h>
#include <react/renderer/runtimescheduler/RuntimeScheduler.h>

namespace facebook {
namespace react {
namespace facebook::react {

struct CallableModule {
explicit CallableModule(jsi::Function factory)
Expand Down Expand Up @@ -76,5 +75,4 @@ class ReactInstance final {
std::shared_ptr<bool> hasFatalJsError_;
};

} // namespace react
} // namespace facebook
} // namespace facebook::react
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
#include <cxxreact/SystraceSection.h>
#include <utility>

namespace facebook {
namespace react {
namespace facebook::react {

TimerManager::TimerManager(
std::unique_ptr<PlatformTimerRegistry> platformTimerRegistry) noexcept
Expand Down Expand Up @@ -412,5 +411,4 @@ void TimerManager::attachGlobals(jsi::Runtime &runtime) {
}));
}

} // namespace react
} // namespace facebook
} // namespace facebook::react
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@

#include "PlatformTimerRegistry.h"

namespace facebook {
namespace react {
namespace facebook::react {

/*
* A HostObject subclass representing the result of a setTimeout call.
Expand Down Expand Up @@ -113,5 +112,4 @@ class TimerManager {
std::vector<uint32_t> reactNativeMicrotasksQueue_;
};

} // namespace react
} // namespace facebook
} // namespace facebook::react
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
using namespace facebook::hermes;
using namespace facebook::jsi;

namespace facebook {
namespace react {
namespace facebook::react {

#ifdef HERMES_ENABLE_DEBUGGER

Expand Down Expand Up @@ -119,5 +118,4 @@ std::unique_ptr<jsi::Runtime> HermesInstance::createJSRuntime(
return hermesRuntime;
}

} // namespace react
} // namespace facebook
} // namespace facebook::react
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
#include <jsi/jsi.h>
#include <react/config/ReactNativeConfig.h>

namespace facebook {
namespace react {
namespace facebook::react {

class HermesInstance {
public:
Expand All @@ -24,5 +23,4 @@ class HermesInstance {
std::shared_ptr<::hermes::vm::CrashManager> cm) noexcept;
};

} // namespace react
} // namespace facebook
} // namespace facebook::react
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
using ::testing::_;
using ::testing::SaveArg;

namespace facebook {
namespace react {
namespace facebook::react {

class MockTimerRegistry : public PlatformTimerRegistry {
public:
Expand Down Expand Up @@ -866,5 +865,4 @@ function getResult() {
EXPECT_EQ(result.getNumber(), 1);
}

} // namespace react
} // namespace facebook
} // namespace facebook::react
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@

#include <memory>

namespace facebook {
namespace react {
namespace facebook::react {

// Helper for passing jsi::Function arg to other methods.
class CallbackWrapper : public LongLivedObject {
Expand Down Expand Up @@ -63,5 +62,4 @@ class CallbackWrapper : public LongLivedObject {
}
};

} // namespace react
} // namespace facebook
} // namespace facebook::react
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@

#include "LongLivedObject.h"

namespace facebook {
namespace react {
namespace facebook::react {

// LongLivedObjectCollection
LongLivedObjectCollection &LongLivedObjectCollection::get() {
Expand Down Expand Up @@ -47,5 +46,4 @@ void LongLivedObject::allowRelease() {
LongLivedObjectCollection::get().remove(this);
}

} // namespace react
} // namespace facebook
} // namespace facebook::react
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
#include <mutex>
#include <unordered_set>

namespace facebook {
namespace react {
namespace facebook::react {

/**
* A simple wrapper class that can be registered to a collection that keep it
Expand Down Expand Up @@ -55,5 +54,4 @@ class LongLivedObjectCollection {
mutable std::mutex collectionMutex_;
};

} // namespace react
} // namespace facebook
} // namespace facebook::react
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@

#include "ReactNativeConfig.h"

namespace facebook {
namespace react {
namespace facebook::react {

/**
* ReactNative configuration as provided by the hosting app.
Expand Down Expand Up @@ -42,5 +41,4 @@ double EmptyReactNativeConfig::getDouble(const std::string &param) const {
return 0.0;
}

} // namespace react
} // namespace facebook
} // namespace facebook::react
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@

#include <string>

namespace facebook {
namespace react {
namespace facebook::react {

/**
* ReactNative configuration as provided by the hosting app.
Expand Down Expand Up @@ -40,5 +39,4 @@ class EmptyReactNativeConfig : public ReactNativeConfig {
double getDouble(const std::string &param) const override;
};

} // namespace react
} // namespace facebook
} // namespace facebook::react
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
using namespace facebook;
using namespace facebook::xplat::module;

namespace facebook {
namespace react {
namespace facebook::react {

namespace {
CxxModule::Callback makeTurboCxxModuleCallback(
Expand Down Expand Up @@ -225,5 +224,4 @@ jsi::Value TurboCxxModule::invokeMethod(
return jsi::Value::undefined();
}

} // namespace react
} // namespace facebook
} // namespace facebook::react
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@

#include "TurboModule.h"

namespace facebook {
namespace react {
namespace facebook::react {

/**
* A helper class to convert the legacy CxxModule instance to a TurboModule
Expand Down Expand Up @@ -47,5 +46,4 @@ class JSI_EXPORT TurboCxxModule : public TurboModule {
std::unique_ptr<facebook::xplat::module::CxxModule> cxxModule_;
};

} // namespace react
} // namespace facebook
} // namespace facebook::react
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@

#include "TurboModule.h"

namespace facebook {
namespace react {
namespace facebook::react {

TurboModule::TurboModule(
std::string name,
Expand Down Expand Up @@ -39,5 +38,4 @@ void TurboModule::emitDeviceEvent(
});
}

} // namespace react
} // namespace facebook
} // namespace facebook::react
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@

#include <ReactCommon/CallInvoker.h>

namespace facebook {
namespace react {
namespace facebook::react {

/**
* For now, support the same set of return types as existing impl.
Expand Down Expand Up @@ -139,5 +138,4 @@ class JSI_EXPORT TurboModule : public facebook::jsi::HostObject {
using TurboModuleProviderFunctionType =
std::function<std::shared_ptr<TurboModule>(const std::string &name)>;

} // namespace react
} // namespace facebook
} // namespace facebook::react
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@

using namespace facebook;

namespace facebook {
namespace react {
namespace facebook::react {

class BridgelessNativeModuleProxy : public jsi::HostObject {
std::unique_ptr<TurboModuleBinding> binding_;
Expand Down Expand Up @@ -207,5 +206,4 @@ jsi::Value TurboModuleBinding::getModule(
}
}

} // namespace react
} // namespace facebook
} // namespace facebook::react
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
#include <ReactCommon/TurboModule.h>
#include <jsi/jsi.h>

namespace facebook {
namespace react {
namespace facebook::react {

enum class TurboModuleBindingMode : uint8_t {
HostObject = 0,
Expand Down Expand Up @@ -57,5 +56,4 @@ class TurboModuleBinding {
TurboModuleProviderFunctionType moduleProvider_;
};

} // namespace react
} // namespace facebook
} // namespace facebook::react
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@

#include "TurboModulePerfLogger.h"

namespace facebook {
namespace react {
namespace facebook::react {
namespace TurboModulePerfLogger {

std::unique_ptr<NativeModulePerfLogger> g_perfLogger = nullptr;
Expand Down Expand Up @@ -327,5 +326,4 @@ void asyncMethodCallExecutionFail(
}

} // namespace TurboModulePerfLogger
} // namespace react
} // namespace facebook
} // namespace facebook::react

0 comments on commit 79c42e7

Please sign in to comment.