-
Notifications
You must be signed in to change notification settings - Fork 895
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
Fix UNSAFE_TODO for wallet [part 2 of N] #26469
Conversation
4758598
to
c5c7b59
Compare
c5c7b59
to
a7281f6
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.
LGTM
if (type_split.size() != 2) { | ||
return std::nullopt; | ||
} | ||
const std::string array_type = type_split[0]; | ||
auto array_type = type_split[0]; |
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.
auto array_type = type_split[0]; | |
const auto array_type = type_split[0]; |
just a nit for it to be const std::string_view
58b7e1e
to
8a7b93e
Compare
[puLL-Merge] - brave/brave-core@26469 DescriptionThis PR makes several changes to improve code quality, safety, and performance in the Brave Wallet component. The changes primarily focus on modernizing C++ usage, improving type safety, and optimizing memory operations. ChangesChanges
Possible Issues
Security HotspotsNo significant security issues were identified in this change. The modifications generally improve type safety and reduce the risk of buffer overflows or misuse of raw pointers. |
Released in v1.75.27 |
* Merge pull request #26068 from brave/cr132 Upgrade from Chromium 131 to Chromium 132 * [Lit]: Migrate `brave-item-list-more-items` to Lit (#26493) * [CodeHealth] Remove all uses of `NOTREACHED_NORETURN` (#26508) This PR replaces all occurences of `NOTREACHED_NORETURN` with `NOTREACHED`, since they are semantically identical. Chromium change: https://chromium.googlesource.com/chromium/src/+/5a9d4c5aa85977fc711eb9c0ff1207c5ac1a0959 commit 5a9d4c5aa85977fc711eb9c0ff1207c5ac1a0959 Author: Peter Boström <[email protected]> Date: Tue Nov 12 01:38:46 2024 +0000 Remove enable_log_error_not_reached This flag only applied to NOTREACHED_IN_MIGRATION() for ChromeOS which is on its way out. Bug: 40580068 * [CodeHealth] Drop `proc-macro-error` from `filecoin-cxx` (#26427) * [CodeHealth] Drop `proc-macro-error` from `filecoin-cxx` This PR updates all crates around `multihash` to use the latest `multihash` version that does not depend anymore on `proc-macro-error`. This crate is being removed as it is getting flagged in security audits for being unmaintained, and it also relies on unstable rustc features. * [rust] `gnrt` crate changes for `multihash` v.0.19 This commit includes all the mechanical changes done by `gnrt`. * Fix UNSAFE_TODO for wallet [part 2 of N] (#26469) * [CodeHealth] Fix dangling span references (#26461) This PR fixes cases where a local constant is being used to initialise a `span` but then the span is being used by the time the local has already been discarded. This is undefined behaviour although in both cases it seems to be incidently working. Resolve brave/brave-browser#42185 * [CodeHealth] Normalise `const` declaration pt.1 (#26714) This PR is part of a couple of rewrites to be carried out normalising the cases where we have constant declaration. In this PR we have the following fixes: - Remove redundant `const` qualifier alongside `constexpr` - Function-scope constants as `static constexpr` - Remove the use of `extern` declarations - Whenever possible use `constexpr` - When appropriate, use `MakeFixedFlatSet`. These changes are in conformance with some upcoming clarified guidelines. Furthermore, this takes us one step closer to have some automation for clang-tidy, as right now there are too many clang-tidy warnings around constant/variable naming. Resolves brave/brave-browser#42490 * [CodeHealth] Remove all uses of `NOTREACHED_NORETURN` (#26508) This PR replaces all occurences of `NOTREACHED_NORETURN` with `NOTREACHED`, since they are semantically identical. Chromium change: https://chromium.googlesource.com/chromium/src/+/5a9d4c5aa85977fc711eb9c0ff1207c5ac1a0959 commit 5a9d4c5aa85977fc711eb9c0ff1207c5ac1a0959 Author: Peter Boström <[email protected]> Date: Tue Nov 12 01:38:46 2024 +0000 Remove enable_log_error_not_reached This flag only applied to NOTREACHED_IN_MIGRATION() for ChromeOS which is on its way out. Bug: 40580068 * [Lit]: Update ExtensionsToolbarElement override (#26492) * [NOTREACHED]: Migrate a bunch of `NOTREACHED_IN_MIGRATIONS` (#26412) * [NOTREACHED]: Update OpenBraveVPNUrls * [NOTREACHED]: Update ParseFeedItems * [NOTREACHED]: Migrate GenerateAllFeed * [NOTREACHED]: Migrate MdTextButton * [NOTREACHED]: Migrate NTPBackgroundPrefs * [NOTREACHED]: Migrate brave_app_menu_model * [NOTREACHED]: Migrate b/u/tabs * [NOTREACHED]: b/u/v/frame * [NOTREACHED]: b/b/themes * Replaced NOTREACHED_IN_MIGRATION for Brave Sync code (#26391) * Replaced NOTREACHED_IN_MIGRATION for Brave Sync code * [DanglingPtr] Remove `ProfileMenuViewBase` patching (#26499) This patch was introduced as a temporary measure to allow switching on the dangling pointer detector. This PR fixes the two dangling pointers in `ProfileMenuViewBase` by avoiding calling `SetProfileIdentityInfo` more than once, and actually overriding it, so the first call to the `SetProfileIdentityInfo` can be given the correct arguments. One test had to be disabled, as it was not actually testing the way the profile menu viewer was being instantiated. The way brave does it requires to consult theme data, which is not available for this particular test. Resolves brave/brave-browser#42231 * Disable screen_ai component download/installation (#26167) * Disable screen_ai component download/installation * Disable upstream OCR integration --------- Co-authored-by: Anthony Tseng <[email protected]> * Fix unused variables warnings at java (#26433) * Removed unused variables and members at Brave java files * [DanglingPtr] Fix `WebUIBubbleManagerImpl` dangling patch (#26465) A patch was added to `WebUIBubbleManagerImpl` when enabling the dangling pointer detector on Linux, as a temporary measure. This change corrects the the underlying issue requiring this pointer to be marked as dangling. This particular dangling pointer occurred because the toolbar view was being passed as the achor for this browser data bubbles, the toolbar gets destroyed prior to these browser data bubbles being disposed. This PR adds checks during in the `BraveBrowserView` dtor, to make sure there are no dangling references to the toolbar view by the time the termination is cleaning up browser data. Resolves brave/brave-browser#42196 * Merge pull request #26829 from brave/cr132-followup-add-aida-client-unittest Add unit test to ensure that AidaClient remains disabled * Upgrade from Chromium 132.0.6834.15 to Chromium 132.0.6834.33 Update pins list timestamp Updated strings for Chromium 132.0.6834.33 * Merge pull request #26864 from brave/cr132-followup-fix-broken-tab-group-menu-options Fix broken tab group menu options --------- Co-authored-by: Jay Harris <[email protected]> Co-authored-by: cdesouza-chromium <[email protected]> Co-authored-by: Anton Paymyshev <[email protected]> Co-authored-by: AlexeyBarabash <[email protected]> Co-authored-by: Anthony Tseng <[email protected]> Co-authored-by: brave-builds <[email protected]>
Resolves brave/brave-browser#42200
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
wikinpm run presubmit
wiki,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan: