-
Notifications
You must be signed in to change notification settings - Fork 893
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor loadFromJson from RapidJSON to base::JSONReader #4045
Conversation
4e8ef7f
to
c465ab7
Compare
vendor/bat-native-ledger/src/bat/ledger/internal/state/current_reconcile_state.cc
Show resolved
Hide resolved
c465ab7 is legacy code just refactored to use new code/properties. Legacy code should not be considered |
1dd45c4
to
2ed0bd9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
vendor/bat-native-ledger/src/bat/ledger/internal/properties/current_reconcile_properties.h
Outdated
Show resolved
Hide resolved
I would suggest that we don't add append |
@NejcZdovc Following style guide at https://google.github.io/styleguide/cppguide.html#Type_Names and also within the same |
@tmancey that may be, but one thing to consider is that we will put everything that will be left after anonize removal into mojo, where we don't have Also I think we need to have this two the same |
vendor/bat-native-ledger/src/bat/ledger/internal/contribution/phase_one.cc
Show resolved
Hide resolved
vendor/bat-native-ledger/src/bat/ledger/internal/properties/ballot_properties.h
Outdated
Show resolved
Hide resolved
vendor/bat-native-ledger/src/bat/ledger/internal/properties/batch_votes_properties.h
Outdated
Show resolved
Hide resolved
vendor/bat-native-ledger/src/bat/ledger/internal/properties/client_properties.h
Outdated
Show resolved
Hide resolved
vendor/bat-native-ledger/src/bat/ledger/internal/properties/client_properties.h
Outdated
Show resolved
Hide resolved
vendor/bat-native-ledger/src/bat/ledger/internal/contribution/phase_two.cc
Outdated
Show resolved
Hide resolved
6d88c7e
to
a3a3f04
Compare
CI passed for all builds other than Windows. Rebuilding Windows |
f38a753
to
4e3bace
Compare
4e3bace
to
9799294
Compare
vendor/bat-native-ledger/src/bat/ledger/internal/contribution/contribution_unblinded.cc
Show resolved
Hide resolved
count = properties.count; | ||
prepare_ballot = properties.prepare_ballot; | ||
proof_ballot = properties.proof_ballot; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like there is nothing special in this copy-constructor. Having it declared explicitly prevents generating of move operations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Complex class/struct needs an explicit out-of-line copy constructor as per Chromium style guide
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't agree.
The document explains the style checked by Chromium Style Checker tool.
(https://www.chromium.org/developers/coding-style/chromium-style-checker-errors)
For classes/structs encapsulating other complex types the style requires to have explicit out-of-line constructor/copy-constructor/destructor only if it does non-trival initialization or copying. For other cases, including the one I mentioned above, we should stick with defaulted
implementation.
Prefer to use =default
:
https://chromium.googlesource.com/chromium/src/+/master/styleguide/c++/c++-dos-and-donts.md#prefer-to-use
Also, initialize members in the declaration where possible
:
https://chromium.googlesource.com/chromium/src/+/master/styleguide/c++/c++-dos-and-donts.md#initialize-members-in-the-declaration-where-possible
vendor/bat-native-ledger/src/bat/ledger/internal/properties/batch_proof_properties.cc
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving.
There are many cases when move operations are not generated for types like the one I mentioned in my comments.
When refactoring, please don't forget to default all trival constructors/copy-constructors/destructors
and add move operations when necessary.
Fixes brave/brave-browser#6351
Submitter Checklist:
npm run lint
)git rebase master
(if needed).git rebase -i
to squash commits (if needed).Test Plan:
Reviewer Checklist:
After-merge Checklist:
changes has landed on.