-
Notifications
You must be signed in to change notification settings - Fork 899
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
Added IPNS keys manager UI to IPFS Settings #8777
Conversation
b78aa85
to
0d83720
Compare
0d8223e
to
6629ad9
Compare
0d83720
to
27a534e
Compare
6629ad9
to
b2f1dd2
Compare
27a534e
to
45af85b
Compare
0d83b0a
to
736ad22
Compare
45af85b
to
f784af7
Compare
736ad22
to
dfe48d8
Compare
7e253b5
to
a65c711
Compare
dfe48d8
to
fe56086
Compare
a4d878f
to
0d9bc9c
Compare
fe56086
to
8b72499
Compare
0d9bc9c
to
34a4969
Compare
3915df3
to
281b39f
Compare
34a4969
to
cee7b3c
Compare
281b39f
to
8ba05e7
Compare
cee7b3c
to
89b33c1
Compare
ff38459
to
dbb8de6
Compare
9c181d9
to
0f91343
Compare
2d168b6
to
0c167d2
Compare
0f91343
to
95a6805
Compare
0c167d2
to
7e3ade0
Compare
Removed File/Text/Directory import classes. Use base class instead, moved blob creation to network utilities
ba7d74e
to
1b326ee
Compare
1b326ee
to
0172152
Compare
<message name="IDS_SETTINGS_IPNS_KEYS_IMPORT_BUTTON_TITLE" desc="The title of the button to import ipns keys"> | ||
Import | ||
</message> | ||
<message name="IDS_SETTINGS_IPNS_KEYS_GENERATE_BUTTON_TITLE" desc="The title of the button to import ipns keys"> |
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.
s/import/generate in the desc
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.
chromium_src
++
service->GetIpnsKeysManager()->ImportKey( | ||
path, dialog_key_, | ||
base::BindOnce(&BraveDefaultExtensionsHandler::OnKeyImported, | ||
base::Unretained(this))); |
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.
@bbondy @spylogsster I was just randomly browsing for Unretained
pointers - this is an easily reproducible crash. Just start an import of a file and quickly close the settings tab (to 100% reproduce pick up any large file, I've tried with videos).
Basically the first thing I do during reviews is Ctrl-F
Unretained
- hope this could help to prevent future crashes
Received signal 11 SEGV_MAPERR ffffd859ca3ff9df
#0 0x7f4936df7659 base::debug::CollectStackTrace()
#1 0x7f4936cf63f3 base::debug::StackTrace::StackTrace()
#2 0x7f4936df71b0 base::debug::(anonymous namespace)::StackDumpSignalHandler()
#3 0x7f49260363c0 (/usr/lib/x86_64-linux-gnu/libpthread-2.31.so+0x153bf)
#4 0x7f4934c79237 content::WebUIMessageHandler::IsJavascriptAllowed()
#5 0x562157e1730f content::WebUIMessageHandler::FireWebUIListener<>()
#6 0x562157e171ed BraveDefaultExtensionsHandler::OnKeyImported()
#7 0x5621577ab147 ipfs::IpnsKeysManager::OnKeyImported()
#8 0x5621577abef9 base::internal::FunctorTraits<>::Invoke<>()
#9 0x5621577abe27 base::internal::Invoker<>::RunOnce()
#10 0x7f49307157ed _ZNO4base12OnceCallbackIFvNSt4__Cr10unique_ptrINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS1_14default_deleteIS8_EEEEEE3RunESB_
#11 0x7f4930715f4e network::(anonymous namespace)::SimpleURLLoaderImpl::FinishWithResult()
#12 0x7f4930713fea network::(anonymous namespace)::SimpleURLLoaderImpl::OnReceiveResponse()
#13 0x7f493075050a network::mojom::URLLoaderClientStubDispatch::Accept()
#14 0x7f4936694dab mojo::InterfaceEndpointClient::HandleValidatedMessage()
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.
thanks brave/brave-browser#15961
|
||
auto iter = url_loaders_.insert(url_loaders_.begin(), std::move(url_loader)); | ||
iter->get()->DownloadToStringOfUnboundedSizeUntilCrashAndDie( | ||
url_loader_factory_.get(), | ||
base::BindOnce(&IpnsKeysManager::OnKeyRemoved, base::Unretained(this), | ||
base::BindOnce(&IpnsKeysManager::OnKeyRemoved, weak_factory_.GetWeakPtr(), |
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.
Here weak_factory_
is redundant, because the manager owns url loaders, and it will destroy loaders in its destructor. Loaders cancel their callbacks when destroyed
Resolves brave/brave-browser#15566
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
,npm run lint
,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan:
ipfs key export -o ./mykey.key mykey
command and import it via brave://settings/ipfs/keys