Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: implement special member functions for Environment #28579

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions src/env.h
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,8 @@ class IsolateData : public MemoryRetainer {
inline v8::Isolate* isolate() const;
IsolateData(const IsolateData&) = delete;
IsolateData& operator=(const IsolateData&) = delete;
IsolateData(IsolateData&&) = delete;
IsolateData& operator=(IsolateData&&) = delete;

private:
void DeserializeProperties(const std::vector<size_t>* indexes);
Expand Down Expand Up @@ -574,6 +576,12 @@ class AsyncRequest : public MemoryRetainer {
public:
AsyncRequest() = default;
~AsyncRequest();

AsyncRequest(const AsyncRequest&) = delete;
AsyncRequest& operator=(const AsyncRequest&) = delete;
AsyncRequest(AsyncRequest&&) = delete;
AsyncRequest& operator=(AsyncRequest&&) = delete;

void Install(Environment* env, void* data, uv_async_cb target);
void Uninstall();
void Stop();
Expand Down Expand Up @@ -658,6 +666,9 @@ class AsyncHooks : public MemoryRetainer {

AsyncHooks(const AsyncHooks&) = delete;
AsyncHooks& operator=(const AsyncHooks&) = delete;
AsyncHooks(AsyncHooks&&) = delete;
AsyncHooks& operator=(AsyncHooks&&) = delete;
~AsyncHooks() = default;

// Used to set the kDefaultTriggerAsyncId in a scope. This is instead of
// passing the trigger_async_id along with other constructor arguments.
Expand All @@ -672,6 +683,9 @@ class AsyncHooks : public MemoryRetainer {
DefaultTriggerAsyncIdScope(const DefaultTriggerAsyncIdScope&) = delete;
DefaultTriggerAsyncIdScope& operator=(const DefaultTriggerAsyncIdScope&) =
delete;
DefaultTriggerAsyncIdScope(DefaultTriggerAsyncIdScope&&) = delete;
DefaultTriggerAsyncIdScope& operator=(DefaultTriggerAsyncIdScope&&) =
delete;

private:
AsyncHooks* async_hooks_;
Expand Down Expand Up @@ -701,6 +715,8 @@ class AsyncCallbackScope {
~AsyncCallbackScope();
AsyncCallbackScope(const AsyncCallbackScope&) = delete;
AsyncCallbackScope& operator=(const AsyncCallbackScope&) = delete;
AsyncCallbackScope(AsyncCallbackScope&&) = delete;
AsyncCallbackScope& operator=(AsyncCallbackScope&&) = delete;

private:
Environment* env_;
Expand All @@ -719,6 +735,9 @@ class ImmediateInfo : public MemoryRetainer {

ImmediateInfo(const ImmediateInfo&) = delete;
ImmediateInfo& operator=(const ImmediateInfo&) = delete;
ImmediateInfo(ImmediateInfo&&) = delete;
ImmediateInfo& operator=(ImmediateInfo&&) = delete;
~ImmediateInfo() = default;

SET_MEMORY_INFO_NAME(ImmediateInfo)
SET_SELF_SIZE(ImmediateInfo)
Expand All @@ -745,6 +764,9 @@ class TickInfo : public MemoryRetainer {

TickInfo(const TickInfo&) = delete;
TickInfo& operator=(const TickInfo&) = delete;
TickInfo(TickInfo&&) = delete;
TickInfo& operator=(TickInfo&&) = delete;
~TickInfo() = default;

private:
friend class Environment; // So we can call the constructor.
Expand Down Expand Up @@ -779,6 +801,12 @@ class ShouldNotAbortOnUncaughtScope {
explicit inline ShouldNotAbortOnUncaughtScope(Environment* env);
inline void Close();
inline ~ShouldNotAbortOnUncaughtScope();
ShouldNotAbortOnUncaughtScope(const ShouldNotAbortOnUncaughtScope&) = delete;
ShouldNotAbortOnUncaughtScope& operator=(
const ShouldNotAbortOnUncaughtScope&) = delete;
ShouldNotAbortOnUncaughtScope(ShouldNotAbortOnUncaughtScope&&) = delete;
ShouldNotAbortOnUncaughtScope& operator=(ShouldNotAbortOnUncaughtScope&&) =
delete;

private:
Environment* env_;
Expand Down Expand Up @@ -818,6 +846,8 @@ class Environment : public MemoryRetainer {
public:
Environment(const Environment&) = delete;
Environment& operator=(const Environment&) = delete;
Environment(Environment&&) = delete;
Environment& operator=(Environment&&) = delete;

SET_MEMORY_INFO_NAME(Environment)

Expand Down