Skip to content

Commit b5a8376

Browse files
sam-githubaddaleax
authored andcommitted
src: organize TLSWrap declarations by parent
Make it clear which of the multiple interfaces a TLSWrap method is implementing by grouping and commenting the related methods. PR-URL: #25861 Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent 0772ce3 commit b5a8376

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

src/tls_wrap.h

+13-12
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,19 @@ class TLSWrap : public AsyncWrap,
5757
v8::Local<v8::Context> context,
5858
void* priv);
5959

60-
int GetFD() override;
60+
// Implement StreamBase:
6161
bool IsAlive() override;
6262
bool IsClosing() override;
63-
64-
// JavaScript functions
65-
int ReadStart() override;
66-
int ReadStop() override;
67-
63+
bool IsIPCPipe() override;
64+
int GetFD() override;
6865
ShutdownWrap* CreateShutdownWrap(
6966
v8::Local<v8::Object> req_wrap_object) override;
67+
AsyncWrap* GetAsyncWrap() override;
68+
69+
70+
// Implement StreamResource:
71+
int ReadStart() override; // Exposed to JS
72+
int ReadStop() override; // Exposed to JS
7073
int DoShutdown(ShutdownWrap* req_wrap) override;
7174
int DoWrite(WriteWrap* w,
7275
uv_buf_t* bufs,
@@ -79,8 +82,8 @@ class TLSWrap : public AsyncWrap,
7982

8083
void NewSessionDoneCb();
8184

85+
// Implement MemoryRetainer:
8286
void MemoryInfo(MemoryTracker* tracker) const override;
83-
8487
SET_MEMORY_INFO_NAME(TLSWrap)
8588
SET_SELF_SIZE(TLSWrap)
8689

@@ -136,13 +139,11 @@ class TLSWrap : public AsyncWrap,
136139
}
137140
}
138141

139-
AsyncWrap* GetAsyncWrap() override;
140-
bool IsIPCPipe() override;
141-
142-
// Resource implementation
143-
void OnStreamAfterWrite(WriteWrap* w, int status) override;
142+
// Implement StreamListener:
143+
// Returns buf that points into enc_in_.
144144
uv_buf_t OnStreamAlloc(size_t size) override;
145145
void OnStreamRead(ssize_t nread, const uv_buf_t& buf) override;
146+
void OnStreamAfterWrite(WriteWrap* w, int status) override;
146147

147148
v8::Local<v8::Value> GetSSLError(int status, int* err, std::string* msg);
148149

0 commit comments

Comments
 (0)