Skip to content

Conversation

eugeneo
Copy link
Contributor

@eugeneo eugeneo commented Apr 21, 2017

AgentImpl was introduce so inspector-agent.h does not leak libuv and
inspector implementation details. Inspector had been reworked since and
new classes provide this isolation and AgentImpl became unnecessary
level of indirection. This change removes that class to streamline the
code.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

inspector - this is a pure refactoring change.

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. dont-land-on-v4.x inspector Issues and PRs related to the V8 inspector protocol labels Apr 21, 2017
Copy link
Member

@bnoordhuis bnoordhuis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM modulo comments.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

static_cast?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't ~Agent() = default; in the header file work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the compiler is unable to instantiate ~unique_ptr at that point as it does not know if the classes have destructors.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I get it now, perhaps the comment is a little vague. The "incomplete types" refers to Agent's unique_ptr data members, not to a std::unique_ptr<Agent> instance elsewhere, correct?

Vague or not, it should at least be punctuated. :-)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tiniest of nits: inconsistent parameter names (info vs. args.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, also renamed in the cc file.

Copy link
Member

@bnoordhuis bnoordhuis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. You can drop the change to node.cc, should be fixed again in master.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I get it now, perhaps the comment is a little vague. The "incomplete types" refers to Agent's unique_ptr data members, not to a std::unique_ptr<Agent> instance elsewhere, correct?

Vague or not, it should at least be punctuated. :-)

@eugeneo eugeneo closed this Apr 24, 2017
@eugeneo eugeneo merged commit 439b35a into nodejs:master Apr 24, 2017
@eugeneo
Copy link
Contributor Author

eugeneo commented Apr 24, 2017

@eugeneo eugeneo deleted the inline_pimpl branch April 24, 2017 20:57
@bnoordhuis
Copy link
Member

@eugeneo You missed this though:

it should at least be punctuated

@eugeneo
Copy link
Contributor Author

eugeneo commented May 1, 2017

@bnoordhuis I tried rewording the comment in another (unrelated) PR: https://github.com/nodejs/node/pull/12777/files#diff-8d16a44747475ef748bab83e5f9dade2R346

@jasnell jasnell mentioned this pull request May 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. inspector Issues and PRs related to the V8 inspector protocol
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants