diff options
author | Joyee Cheung <joyeec9h3@gmail.com> | 2019-03-20 19:31:19 +0800 |
---|---|---|
committer | Joyee Cheung <joyeec9h3@gmail.com> | 2019-03-27 10:30:12 -0400 |
commit | 4565698227c2644cc59bcdb705c4f4c92667d0d7 (patch) | |
tree | d70b3d18d8ad5b6506f5984fc35381f67fe0d79f /src/env.h | |
parent | cc7bb855a78a11d1e7fb3eed78ba0b9458da0841 (diff) | |
download | android-node-v8-4565698227c2644cc59bcdb705c4f4c92667d0d7.tar.gz android-node-v8-4565698227c2644cc59bcdb705c4f4c92667d0d7.tar.bz2 android-node-v8-4565698227c2644cc59bcdb705c4f4c92667d0d7.zip |
src: move ImmediateInfo out of Environment
PR-URL: https://github.com/nodejs/node/pull/26824
Refs: https://github.com/nodejs/node/issues/26776
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/env.h')
-rw-r--r-- | src/env.h | 53 |
1 files changed, 23 insertions, 30 deletions
@@ -624,6 +624,29 @@ class AsyncCallbackScope { Environment* env_; }; +class ImmediateInfo { + public: + inline AliasedBuffer<uint32_t, v8::Uint32Array>& fields(); + inline uint32_t count() const; + inline uint32_t ref_count() const; + inline bool has_outstanding() const; + inline void count_inc(uint32_t increment); + inline void count_dec(uint32_t decrement); + inline void ref_count_inc(uint32_t increment); + inline void ref_count_dec(uint32_t decrement); + + ImmediateInfo(const ImmediateInfo&) = delete; + ImmediateInfo& operator=(const ImmediateInfo&) = delete; + + private: + friend class Environment; // So we can call the constructor. + inline explicit ImmediateInfo(v8::Isolate* isolate); + + enum Fields { kCount, kRefCount, kHasOutstanding, kFieldsCount }; + + AliasedBuffer<uint32_t, v8::Uint32Array> fields_; +}; + class Environment { public: Environment(const Environment&) = delete; @@ -633,36 +656,6 @@ class Environment { inline void PushAsyncCallbackScope(); inline void PopAsyncCallbackScope(); - class ImmediateInfo { - public: - inline AliasedBuffer<uint32_t, v8::Uint32Array>& fields(); - inline uint32_t count() const; - inline uint32_t ref_count() const; - inline bool has_outstanding() const; - - inline void count_inc(uint32_t increment); - inline void count_dec(uint32_t decrement); - - inline void ref_count_inc(uint32_t increment); - inline void ref_count_dec(uint32_t decrement); - - ImmediateInfo(const ImmediateInfo&) = delete; - ImmediateInfo& operator=(const ImmediateInfo&) = delete; - - private: - friend class Environment; // So we can call the constructor. - inline explicit ImmediateInfo(v8::Isolate* isolate); - - enum Fields { - kCount, - kRefCount, - kHasOutstanding, - kFieldsCount - }; - - AliasedBuffer<uint32_t, v8::Uint32Array> fields_; - }; - class TickInfo { public: inline AliasedBuffer<uint8_t, v8::Uint8Array>& fields(); |