Skip to content

Conversation

@eugeneo
Copy link
Contributor

@eugeneo eugeneo commented Sep 14, 2016

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

Change is internal to inspector.

Description of change

Ctor has to be added as memset to 0 is no longer an option, since
the structure now has std::vector member.

This is an attempt at guessing a fix for #8155 - so far I was not able to repro it.

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. inspector Issues and PRs related to the V8 inspector protocol labels Sep 14, 2016
@eugeneo
Copy link
Contributor Author

eugeneo commented Sep 14, 2016

@ofrobots

@ofrobots
Copy link
Contributor

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. Maybe make the structs DISALLOW_COPY_AND_ASSIGN while you're here.

@eugeneo
Copy link
Contributor Author

eugeneo commented Sep 15, 2016

I've added DISALLOW_COPY_AND_ASSIGN. Then it showed that inspector socket instance needs a cleanup to be reused - so I decided that it would be best if inspector_accept did a reset, instead of expecting a clean instance.

Please take another look.

@ofrobots
Copy link
Contributor

@eugeneo
Copy link
Contributor Author

eugeneo commented Sep 15, 2016

Sorry, forgot to run the linter. I uploaded a fixed version.

@ofrobots
Copy link
Contributor

Copy link
Member

Choose a reason for hiding this comment

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

This looks like it should be a inspector_socket_s method.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for the review. I introduced the function... But that pushed the struct to class territory too far for me :)

I changed the struct to class, renamed it appropriately and added the namespace. In fairness, other inspector_* functions need to become member functions as well and the state needs to be made private, etc.

But I am currently working on a complex refactoring that will significantly change this class (I'm hoping to remove libuv interactions) so I don't see much value in doing a comprehensive change right now...

Please take a look at updated CL.

Copy link
Member

Choose a reason for hiding this comment

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

Maybe switch to static_cast while here?

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.

Indentation is off here.

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.

Can you drop the struct keywords?

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.

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.

@eugeneo
Copy link
Contributor Author

eugeneo commented Sep 19, 2016

Thank you for the review. I updated the code, please take another look.

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.

Ctor has to be added as memset to 0 is no longer an option, since
the structure now has std::vector member.

Attemp at fixing #8155 (so far I was not able to repro it)
@ofrobots
Copy link
Contributor

@ofrobots
Copy link
Contributor

Thanks, landed as bc1ebd6.

@ofrobots ofrobots closed this Sep 20, 2016
ofrobots pushed a commit that referenced this pull request Sep 20, 2016
Ctor has to be added as memset to 0 is no longer an option, since
the structure now has std::vector member.

Attempt at fixing #8155 (so far I was not able to repro it)

PR-URL: #8536
Reviewed-By: bnoordhuis - Ben Noordhuis <[email protected]>
@ofrobots ofrobots added the v6.x label Sep 28, 2016
MylesBorins pushed a commit to MylesBorins/node that referenced this pull request Sep 28, 2016
Ctor has to be added as memset to 0 is no longer an option, since
the structure now has std::vector member.

Attempt at fixing nodejs#8155 (so far I was not able to repro it)

PR-URL: nodejs#8536
Reviewed-By: bnoordhuis - Ben Noordhuis <[email protected]>
MylesBorins pushed a commit that referenced this pull request Sep 30, 2016
Ctor has to be added as memset to 0 is no longer an option, since
the structure now has std::vector member.

Attempt at fixing #8155 (so far I was not able to repro it)

PR-URL: #8536
Reviewed-By: bnoordhuis - Ben Noordhuis <[email protected]>
@eugeneo eugeneo deleted the zero_out branch October 13, 2016 23:33
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.

5 participants