summaryrefslogtreecommitdiff
path: root/src/node_http2.h
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2019-09-29 01:29:16 +0200
committerAnna Henningsen <anna@addaleax.net>2019-11-19 13:47:30 +0100
commita36f2204d6ffd80437f2b713787c18a58e328e05 (patch)
tree98e7be63e7f9d5a2adbc67f2813ac8649e9ec158 /src/node_http2.h
parent7e6104f1bb63a07885b08f277c3b708caa6b8a23 (diff)
downloadandroid-node-v8-a36f2204d6ffd80437f2b713787c18a58e328e05.tar.gz
android-node-v8-a36f2204d6ffd80437f2b713787c18a58e328e05.tar.bz2
android-node-v8-a36f2204d6ffd80437f2b713787c18a58e328e05.zip
http2: use custom BaseObject smart pointers
Refs: https://github.com/nodejs/quic/pull/141 Reviewed-By: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/30374 Refs: https://github.com/nodejs/quic/pull/149 Refs: https://github.com/nodejs/quic/pull/165 Reviewed-By: David Carlier <devnexen@gmail.com>
Diffstat (limited to 'src/node_http2.h')
-rw-r--r--src/node_http2.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/node_http2.h b/src/node_http2.h
index 6aeb69fa84..1444738470 100644
--- a/src/node_http2.h
+++ b/src/node_http2.h
@@ -456,8 +456,8 @@ class Http2Stream : public AsyncWrap,
nghttp2_stream* operator*();
- Http2Session* session() { return session_; }
- const Http2Session* session() const { return session_; }
+ Http2Session* session() { return session_.get(); }
+ const Http2Session* session() const { return session_.get(); }
void EmitStatistics();
@@ -609,7 +609,7 @@ class Http2Stream : public AsyncWrap,
nghttp2_headers_category category,
int options);
- Http2Session* session_ = nullptr; // The Parent HTTP/2 Session
+ BaseObjectWeakPtr<Http2Session> session_; // The Parent HTTP/2 Session
int32_t id_ = 0; // The Stream Identifier
int32_t code_ = NGHTTP2_NO_ERROR; // The RST_STREAM code (if any)
int flags_ = NGHTTP2_STREAM_FLAG_NONE; // Internal state flags
@@ -822,11 +822,11 @@ class Http2Session : public AsyncWrap, public StreamListener {
return env()->event_loop();
}
- std::unique_ptr<Http2Ping> PopPing();
- Http2Ping* AddPing(std::unique_ptr<Http2Ping> ping);
+ BaseObjectPtr<Http2Ping> PopPing();
+ Http2Ping* AddPing(BaseObjectPtr<Http2Ping> ping);
- std::unique_ptr<Http2Settings> PopSettings();
- Http2Settings* AddSettings(std::unique_ptr<Http2Settings> settings);
+ BaseObjectPtr<Http2Settings> PopSettings();
+ Http2Settings* AddSettings(BaseObjectPtr<Http2Settings> settings);
void IncrementCurrentSessionMemory(uint64_t amount) {
current_session_memory_ += amount;
@@ -1001,10 +1001,10 @@ class Http2Session : public AsyncWrap, public StreamListener {
size_t stream_buf_offset_ = 0;
size_t max_outstanding_pings_ = DEFAULT_MAX_PINGS;
- std::queue<std::unique_ptr<Http2Ping>> outstanding_pings_;
+ std::queue<BaseObjectPtr<Http2Ping>> outstanding_pings_;
size_t max_outstanding_settings_ = DEFAULT_MAX_SETTINGS;
- std::queue<std::unique_ptr<Http2Settings>> outstanding_settings_;
+ std::queue<BaseObjectPtr<Http2Settings>> outstanding_settings_;
std::vector<nghttp2_stream_write> outgoing_buffers_;
std::vector<uint8_t> outgoing_storage_;