Skip to content

Commit

Permalink
src: rename PROVIDER_FSREQWRAP to PROVIDER_FSREQCALLBACK
Browse files Browse the repository at this point in the history
PR-URL: #21971
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
maclover7 committed Aug 1, 2018
1 parent 172b4d7 commit f479050
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 43 deletions.
2 changes: 1 addition & 1 deletion src/async_wrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ namespace node {
V(FILEHANDLE) \
V(FILEHANDLECLOSEREQ) \
V(FSEVENTWRAP) \
V(FSREQWRAP) \
V(FSREQCALLBACK) \
V(FSREQPROMISE) \
V(GETADDRINFOREQWRAP) \
V(GETNAMEINFOREQWRAP) \
Expand Down
2 changes: 1 addition & 1 deletion src/node_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ void FileHandle::AfterClose() {


FileHandleReadWrap::FileHandleReadWrap(FileHandle* handle, Local<Object> obj)
: ReqWrap(handle->env(), obj, AsyncWrap::PROVIDER_FSREQWRAP),
: ReqWrap(handle->env(), obj, AsyncWrap::PROVIDER_FSREQCALLBACK),
file_handle_(handle) {}

int FileHandle::ReadStart() {
Expand Down
2 changes: 1 addition & 1 deletion src/node_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class FSReqBase : public ReqWrap<uv_fs_t> {
class FSReqCallback : public FSReqBase {
public:
FSReqCallback(Environment* env, Local<Object> req, bool use_bigint)
: FSReqBase(env, req, AsyncWrap::PROVIDER_FSREQWRAP, use_bigint) { }
: FSReqBase(env, req, AsyncWrap::PROVIDER_FSREQCALLBACK, use_bigint) { }

void Reject(Local<Value> reject) override;
void Resolve(Local<Value> value) override;
Expand Down
54 changes: 27 additions & 27 deletions test/async-hooks/coverage.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,30 @@

Showing which kind of async resource is covered by which test:

| Resource Type | Test |
|----------------------|----------------------------------------|
| CONNECTION | test-connection.ssl.js |
| FSEVENTWRAP | test-fseventwrap.js |
| FSREQWRAP | test-fsreqwrap-{access,readFile}.js |
| GETADDRINFOREQWRAP | test-getaddrinforeqwrap.js |
| GETNAMEINFOREQWRAP | test-getnameinforeqwrap.js |
| HTTPPARSER | test-httpparser.{request,response}.js |
| Immediate | test-immediate.js |
| JSSTREAM | TODO (crashes when accessing directly) |
| PBKDF2REQUEST | test-crypto-pbkdf2.js |
| PIPECONNECTWRAP | test-pipeconnectwrap.js |
| PIPEWRAP | test-pipewrap.js |
| PROCESSWRAP | test-pipewrap.js |
| QUERYWRAP | test-querywrap.js |
| RANDOMBYTESREQUEST | test-crypto-randomBytes.js |
| SHUTDOWNWRAP | test-shutdownwrap.js |
| SIGNALWRAP | test-signalwrap.js |
| STATWATCHER | test-statwatcher.js |
| TCPCONNECTWRAP | test-tcpwrap.js |
| TCPWRAP | test-tcpwrap.js |
| TLSWRAP | test-tlswrap.js |
| TTYWRAP | test-ttywrap.{read,write}stream.js |
| UDPSENDWRAP | test-udpsendwrap.js |
| UDPWRAP | test-udpwrap.js |
| WRITEWRAP | test-writewrap.js |
| ZLIB | test-zlib.zlib-binding.deflate.js |
| Resource Type | Test |
|----------------------|--------------------------------------------|
| CONNECTION | test-connection.ssl.js |
| FSEVENTWRAP | test-fseventwrap.js |
| FSREQCALLBACK | test-fsreqcallback-{access,readFile}.js |
| GETADDRINFOREQWRAP | test-getaddrinforeqwrap.js |
| GETNAMEINFOREQWRAP | test-getnameinforeqwrap.js |
| HTTPPARSER | test-httpparser.{request,response}.js |
| Immediate | test-immediate.js |
| JSSTREAM | TODO (crashes when accessing directly) |
| PBKDF2REQUEST | test-crypto-pbkdf2.js |
| PIPECONNECTWRAP | test-pipeconnectwrap.js |
| PIPEWRAP | test-pipewrap.js |
| PROCESSWRAP | test-pipewrap.js |
| QUERYWRAP | test-querywrap.js |
| RANDOMBYTESREQUEST | test-crypto-randomBytes.js |
| SHUTDOWNWRAP | test-shutdownwrap.js |
| SIGNALWRAP | test-signalwrap.js |
| STATWATCHER | test-statwatcher.js |
| TCPCONNECTWRAP | test-tcpwrap.js |
| TCPWRAP | test-tcpwrap.js |
| TLSWRAP | test-tlswrap.js |
| TTYWRAP | test-ttywrap.{read,write}stream.js |
| UDPSENDWRAP | test-udpsendwrap.js |
| UDPWRAP | test-udpwrap.js |
| WRITEWRAP | test-writewrap.js |
| ZLIB | test-zlib.zlib-binding.deflate.js |
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ hooks.enable();
fs.access(__filename, common.mustCall(onaccess));

function onaccess() {
const as = hooks.activitiesOfTypes('FSREQWRAP');
const as = hooks.activitiesOfTypes('FSREQCALLBACK');
const a = as[0];
checkInvocations(a, { init: 1, before: 1 },
'while in onaccess callback');
Expand All @@ -24,13 +24,13 @@ process.on('exit', onexit);

function onexit() {
hooks.disable();
hooks.sanityCheck('FSREQWRAP');
hooks.sanityCheck('FSREQCALLBACK');

const as = hooks.activitiesOfTypes('FSREQWRAP');
const as = hooks.activitiesOfTypes('FSREQCALLBACK');
assert.strictEqual(as.length, 1);

const a = as[0];
assert.strictEqual(a.type, 'FSREQWRAP');
assert.strictEqual(a.type, 'FSREQCALLBACK');
assert.strictEqual(typeof a.uid, 'number');
checkInvocations(a, { init: 1, before: 1, after: 1, destroy: 1 },
'when process exits');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ hooks.enable();
fs.readFile(__filename, common.mustCall(onread));

function onread() {
const as = hooks.activitiesOfTypes('FSREQWRAP');
const as = hooks.activitiesOfTypes('FSREQCALLBACK');
let lastParent = 1;
for (let i = 0; i < as.length; i++) {
const a = as[i];
assert.strictEqual(a.type, 'FSREQWRAP');
assert.strictEqual(a.type, 'FSREQCALLBACK');
assert.strictEqual(typeof a.uid, 'number');
assert.strictEqual(a.triggerAsyncId, lastParent);
lastParent = a.uid;
Expand All @@ -43,8 +43,8 @@ process.on('exit', onexit);

function onexit() {
hooks.disable();
hooks.sanityCheck('FSREQWRAP');
const as = hooks.activitiesOfTypes('FSREQWRAP');
hooks.sanityCheck('FSREQCALLBACK');
const as = hooks.activitiesOfTypes('FSREQCALLBACK');
const a = as.pop();
checkInvocations(a, { init: 1, before: 1, after: 1, destroy: 1 },
'when process exits');
Expand Down
8 changes: 4 additions & 4 deletions test/async-hooks/test-graph.fsreq-readFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ function onexit() {
hooks.disable();
verifyGraph(
hooks,
[ { type: 'FSREQWRAP', id: 'fsreq:1', triggerAsyncId: null },
{ type: 'FSREQWRAP', id: 'fsreq:2', triggerAsyncId: 'fsreq:1' },
{ type: 'FSREQWRAP', id: 'fsreq:3', triggerAsyncId: 'fsreq:2' },
{ type: 'FSREQWRAP', id: 'fsreq:4', triggerAsyncId: 'fsreq:3' } ]
[ { type: 'FSREQCALLBACK', id: 'fsreq:1', triggerAsyncId: null },
{ type: 'FSREQCALLBACK', id: 'fsreq:2', triggerAsyncId: 'fsreq:1' },
{ type: 'FSREQCALLBACK', id: 'fsreq:3', triggerAsyncId: 'fsreq:2' },
{ type: 'FSREQCALLBACK', id: 'fsreq:4', triggerAsyncId: 'fsreq:3' } ]
);
}
2 changes: 1 addition & 1 deletion test/cctest/test_node_postmortem_metadata.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class TestReqWrap : public node::ReqWrap<uv_req_t> {
TestReqWrap(node::Environment* env, v8::Local<v8::Object> object)
: node::ReqWrap<uv_req_t>(env,
object,
node::AsyncWrap::PROVIDER_FSREQWRAP) {}
node::AsyncWrap::PROVIDER_FSREQCALLBACK) {}
};

TEST_F(DebugSymbolsTest, ContextEmbedderEnvironmentIndex) {
Expand Down

0 comments on commit f479050

Please sign in to comment.