Skip to content

Commit 83eaaf9

Browse files
committed
src: remove unused AsyncWrapObject
Following the crypto subsystem refactor, this is now unused. Begone!! Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: #35511 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 2310f67 commit 83eaaf9

File tree

1 file changed

+0
-46
lines changed

1 file changed

+0
-46
lines changed

src/async_wrap.cc

-46
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ using v8::PropertyAttribute;
5454
using v8::PropertyCallbackInfo;
5555
using v8::ReadOnly;
5656
using v8::String;
57-
using v8::Uint32;
5857
using v8::Undefined;
5958
using v8::Value;
6059
using v8::WeakCallbackInfo;
@@ -71,45 +70,6 @@ static const char* const provider_names[] = {
7170
#undef V
7271
};
7372

74-
75-
struct AsyncWrapObject : public AsyncWrap {
76-
static inline void New(const FunctionCallbackInfo<Value>& args) {
77-
Environment* env = Environment::GetCurrent(args);
78-
CHECK(args.IsConstructCall());
79-
CHECK(env->async_wrap_object_ctor_template()->HasInstance(args.This()));
80-
CHECK(args[0]->IsUint32());
81-
auto type = static_cast<ProviderType>(args[0].As<Uint32>()->Value());
82-
new AsyncWrapObject(env, args.This(), type);
83-
}
84-
85-
inline AsyncWrapObject(Environment* env, Local<Object> object,
86-
ProviderType type) : AsyncWrap(env, object, type) {}
87-
88-
static Local<FunctionTemplate> GetConstructorTemplate(Environment* env) {
89-
Local<FunctionTemplate> tmpl = env->async_wrap_object_ctor_template();
90-
if (tmpl.IsEmpty()) {
91-
tmpl = env->NewFunctionTemplate(AsyncWrapObject::New);
92-
tmpl->SetClassName(
93-
FIXED_ONE_BYTE_STRING(env->isolate(), "AsyncWrap"));
94-
tmpl->Inherit(AsyncWrap::GetConstructorTemplate(env));
95-
tmpl->InstanceTemplate()->SetInternalFieldCount(
96-
AsyncWrapObject::kInternalFieldCount);
97-
env->set_async_wrap_object_ctor_template(tmpl);
98-
}
99-
return tmpl;
100-
}
101-
102-
bool IsNotIndicativeOfMemoryLeakAtExit() const override {
103-
// We can't really know what the underlying operation does. One of the
104-
// signs that it's time to remove this class. :)
105-
return true;
106-
}
107-
108-
SET_NO_MEMORY_INFO()
109-
SET_MEMORY_INFO_NAME(AsyncWrapObject)
110-
SET_SELF_SIZE(AsyncWrapObject)
111-
};
112-
11373
void AsyncWrap::DestroyAsyncIdsCallback(Environment* env) {
11474
Local<Function> fn = env->async_hooks_destroy_function();
11575

@@ -751,11 +711,6 @@ void AsyncWrap::Initialize(Local<Object> target,
751711
env->set_async_hooks_promise_resolve_function(Local<Function>());
752712
env->set_async_hooks_binding(target);
753713

754-
target->Set(env->context(),
755-
FIXED_ONE_BYTE_STRING(env->isolate(), "AsyncWrap"),
756-
AsyncWrapObject::GetConstructorTemplate(env)
757-
->GetFunction(env->context()).ToLocalChecked()).Check();
758-
759714
// TODO(qard): maybe this should be GetConstructorTemplate instead?
760715
PromiseWrap::Initialize(env);
761716
}
@@ -772,7 +727,6 @@ void AsyncWrap::RegisterExternalReferences(
772727
registry->Register(EnablePromiseHook);
773728
registry->Register(DisablePromiseHook);
774729
registry->Register(RegisterDestroyHook);
775-
registry->Register(AsyncWrapObject::New);
776730
registry->Register(AsyncWrap::GetAsyncId);
777731
registry->Register(AsyncWrap::AsyncReset);
778732
registry->Register(AsyncWrap::GetProviderType);

0 commit comments

Comments
 (0)