mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Make RuntimeScheduler module compile in C++ 14
Summary: changelog: [internal] Don't use C++ 17 features in RuntimeScheduler module as it needs to be imported into C++14 module. Also removes redundant dependency. Reviewed By: ShikaSD Differential Revision: D30485642 fbshipit-source-id: 0a20f85c596eebe193affc815c8ca851fc72e46d
This commit is contained in:
committed by
Facebook GitHub Bot
parent
569c1cdce9
commit
dbda1917cc
@@ -50,7 +50,6 @@ rn_xplat_cxx_library(
|
||||
tests = [":tests"],
|
||||
visibility = ["PUBLIC"],
|
||||
deps = [
|
||||
react_native_xplat_target("react/renderer/core:core"),
|
||||
react_native_xplat_target("runtimeexecutor:runtimeexecutor"),
|
||||
react_native_xplat_target("react/renderer/debug:debug"),
|
||||
react_native_xplat_target("better:better"),
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
|
||||
#include "RuntimeScheduler.h"
|
||||
|
||||
namespace facebook::react {
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
#pragma mark - Public
|
||||
|
||||
@@ -113,4 +114,5 @@ void RuntimeScheduler::startWorkLoop(jsi::Runtime &runtime) const {
|
||||
isPerformingWork_ = false;
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
|
||||
@@ -14,7 +14,8 @@
|
||||
#include <memory>
|
||||
#include <queue>
|
||||
|
||||
namespace facebook::react {
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
class RuntimeScheduler final {
|
||||
public:
|
||||
@@ -100,4 +101,5 @@ class RuntimeScheduler final {
|
||||
mutable bool isPerformingWork_{false};
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
|
||||
@@ -10,11 +10,11 @@
|
||||
#include "primitives.h"
|
||||
|
||||
#include <react/debug/react_native_assert.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <chrono>
|
||||
#include <memory>
|
||||
|
||||
namespace facebook::react {
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
std::shared_ptr<RuntimeSchedulerBinding>
|
||||
RuntimeSchedulerBinding::createAndInstallIfNeeded(
|
||||
@@ -167,4 +167,5 @@ jsi::Value RuntimeSchedulerBinding::get(
|
||||
return jsi::Value::undefined();
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
#include <jsi/jsi.h>
|
||||
#include <react/renderer/runtimescheduler/RuntimeScheduler.h>
|
||||
|
||||
namespace facebook::react {
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
/*
|
||||
* Exposes RuntimeScheduler to JavaScript realm.
|
||||
@@ -39,4 +40,5 @@ class RuntimeSchedulerBinding : public jsi::HostObject {
|
||||
std::shared_ptr<RuntimeScheduler> runtimeScheduler_;
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
|
||||
#include <chrono>
|
||||
|
||||
namespace facebook::react {
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
/*
|
||||
* Represents a monotonic clock suitable for measuring intervals.
|
||||
@@ -19,4 +20,5 @@ using RuntimeSchedulerClock = std::chrono::steady_clock;
|
||||
using RuntimeSchedulerTimePoint = RuntimeSchedulerClock::time_point;
|
||||
using RuntimeSchedulerDuration = RuntimeSchedulerClock::duration;
|
||||
|
||||
} // namespace facebook::react
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <react/debug/react_native_assert.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <chrono>
|
||||
|
||||
namespace facebook::react {
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
enum class SchedulerPriority : int {
|
||||
ImmediatePriority = 1,
|
||||
@@ -61,4 +61,5 @@ static inline std::chrono::milliseconds timeoutForSchedulerPriority(
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
|
||||
#include "RuntimeScheduler.h"
|
||||
|
||||
namespace facebook::react {
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
Task::Task(
|
||||
SchedulerPriority priority,
|
||||
@@ -32,4 +33,5 @@ jsi::Value Task::execute(jsi::Runtime &runtime) {
|
||||
return result;
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
#include <react/renderer/runtimescheduler/RuntimeSchedulerClock.h>
|
||||
#include <react/renderer/runtimescheduler/SchedulerPriority.h>
|
||||
|
||||
namespace facebook::react {
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
class RuntimeScheduler;
|
||||
class TaskPriorityComparer;
|
||||
@@ -43,4 +44,5 @@ class TaskPriorityComparer {
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
#include <jsi/jsi.h>
|
||||
#include <react/renderer/runtimescheduler/Task.h>
|
||||
|
||||
namespace facebook::react {
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
struct TaskWrapper : public jsi::HostObject {
|
||||
TaskWrapper(std::shared_ptr<Task> const &task) : task(task) {}
|
||||
@@ -36,4 +37,5 @@ inline static std::shared_ptr<Task> taskFromValue(
|
||||
return value.getObject(runtime).getHostObject<TaskWrapper>(runtime)->task;
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
|
||||
Reference in New Issue
Block a user