summaryrefslogtreecommitdiff
path: root/src/req_wrap-inl.h
diff options
context:
space:
mode:
authorDaniel Bevenius <daniel.bevenius@gmail.com>2017-11-14 13:34:52 +0100
committerDaniel Bevenius <daniel.bevenius@gmail.com>2017-11-17 12:49:20 +0100
commitb58a1cd70a2ccc97bb97bba4464d2b5aaecf5ab5 (patch)
tree0c3a8f21c48f56326b21d1b7dccfbb41a49206bc /src/req_wrap-inl.h
parenta515e593f397cd60c9f52c4365cba29a85ce232e (diff)
downloadandroid-node-v8-b58a1cd70a2ccc97bb97bba4464d2b5aaecf5ab5.tar.gz
android-node-v8-b58a1cd70a2ccc97bb97bba4464d2b5aaecf5ab5.tar.bz2
android-node-v8-b58a1cd70a2ccc97bb97bba4464d2b5aaecf5ab5.zip
src: rename req-wrap -> req_wrap
This commit renames req-wrap to req_wrap consitency with other c++ source files. PR-URL: https://github.com/nodejs/node/pull/17022 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Diffstat (limited to 'src/req_wrap-inl.h')
-rw-r--r--src/req_wrap-inl.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/req_wrap-inl.h b/src/req_wrap-inl.h
new file mode 100644
index 0000000000..76430439c9
--- /dev/null
+++ b/src/req_wrap-inl.h
@@ -0,0 +1,42 @@
+#ifndef SRC_REQ_WRAP_INL_H_
+#define SRC_REQ_WRAP_INL_H_
+
+#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
+
+#include "req_wrap.h"
+#include "async_wrap-inl.h"
+#include "env-inl.h"
+#include "util-inl.h"
+
+namespace node {
+
+template <typename T>
+ReqWrap<T>::ReqWrap(Environment* env,
+ v8::Local<v8::Object> object,
+ AsyncWrap::ProviderType provider)
+ : AsyncWrap(env, object, provider) {
+ if (env->in_domain())
+ object->Set(env->domain_string(), env->domain_array()->Get(0));
+
+ // FIXME(bnoordhuis) The fact that a reinterpret_cast is needed is
+ // arguably a good indicator that there should be more than one queue.
+ env->req_wrap_queue()->PushBack(reinterpret_cast<ReqWrap<uv_req_t>*>(this));
+}
+
+template <typename T>
+ReqWrap<T>::~ReqWrap() {
+ CHECK_EQ(req_.data, this); // Assert that someone has called Dispatched().
+ CHECK_EQ(false, persistent().IsEmpty());
+ persistent().Reset();
+}
+
+template <typename T>
+void ReqWrap<T>::Dispatched() {
+ req_.data = this;
+}
+
+} // namespace node
+
+#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
+
+#endif // SRC_REQ_WRAP_INL_H_