-
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 import of links and text content to ipfs #8422
Conversation
b48bbef
to
15b1010
Compare
15b1010
to
cf1e851
Compare
chromium_src/chrome/browser/renderer_context_menu/render_view_context_menu.cc
Outdated
Show resolved
Hide resolved
chromium_src/chrome/browser/renderer_context_menu/render_view_context_menu.cc
Outdated
Show resolved
Hide resolved
chromium_src/chrome/browser/renderer_context_menu/render_view_context_menu.cc
Show resolved
Hide resolved
chromium_src/chrome/browser/renderer_context_menu/render_view_context_menu.cc
Outdated
Show resolved
Hide resolved
d9016a4
to
4b10ce9
Compare
87d09d8
to
78f5840
Compare
80f1769
to
e6c64d0
Compare
chromium_src/chrome/browser/renderer_context_menu/render_view_context_menu.cc
Show resolved
Hide resolved
chromium_src/chrome/browser/renderer_context_menu/render_view_context_menu.cc
Outdated
Show resolved
Hide resolved
chromium_src/chrome/browser/renderer_context_menu/render_view_context_menu.cc
Show resolved
Hide resolved
ad4ea71
to
087cb33
Compare
087cb33
to
1e8418b
Compare
chromium_src/chrome/browser/renderer_context_menu/render_view_context_menu.cc
Outdated
Show resolved
Hide resolved
chromium_src/chrome/browser/renderer_context_menu/render_view_context_menu.cc
Show resolved
Hide resolved
chromium_src/chrome/browser/renderer_context_menu/render_view_context_menu.cc
Outdated
Show resolved
Hide resolved
@spylogsster Please don't force-push and replace the commit directly during review, I can't see the interdiff using github. |
8afe5d7
to
e9e28e3
Compare
e9e28e3
to
beee648
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
} | ||
|
||
bool IsIpfsMenuEnabled(content::BrowserContext* browser_context) { | ||
return ipfs::IsIpfsEnabled(browser_context) && |
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.
nit: You can just use IsIpfsEnabled(browser_context) && IsLocalGatewayConfigured(browser_context) here.
base::PostTaskAndReplyWithResult( | ||
io_task_runner_.get(), FROM_HERE, | ||
base::BindOnce(&IpfsImportWorkerBase::CreateResourceRequest, | ||
base::Unretained(this), std::move(blob_builder_callback), |
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.
Passing Unretained
pointers like this is not safe. Fortunately, this function doesn't really need this
, so I'd suggest we make it a free function instead of a class method
auto blob_storage_context_getter = | ||
content::BrowserContext::GetBlobStorageContext(browser_context_); | ||
base::PostTaskAndReplyWithResult( | ||
io_task_runner_.get(), FROM_HERE, |
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.
you can simply do io_task_runner_->PostTaskAndReply...
url_loader_->DownloadToStringOfUnboundedSizeUntilCrashAndDie( | ||
url_loader_factory_.get(), | ||
base::BindOnce(&IpfsImportWorkerBase::OnImportAddComplete, | ||
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.
in this case it is safe to use Unretained
io_task_runner_(base::CreateSequencedTaskRunner( | ||
{base::MayBlock(), content::BrowserThread::IO, | ||
base::TaskPriority::BEST_EFFORT, | ||
base::TaskShutdownBehavior::BLOCK_SHUTDOWN})), |
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.
not sure it really should block the shutdown
auto import_completed_callback = | ||
base::BindOnce(&IpfsService::OnImportFinished, weak_factory_.GetWeakPtr(), | ||
std::move(callback), key); | ||
importers_[key] = std::make_unique<IpfsTextImportWorker>( |
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.
if IpfsTextImportWorker::StartImportText
early returns in case text
or host
is empty, it will synchronously call the callback, that won't erase the failed importer from the map (because it is not inserted yet), correct? After that it will be inserted and will live in the map forever. So maybe we'd better avoid running complex logic that involves chains of callbacks in constructors
On iOS 17 rotating the device with a full screen modal presented (e.g. Playlist, Tab Tray) to landscape then back to portrait does not trigger `traitCollectionDidChange`/`willTransition`/etc calls and so the toolbar remains in the wrong state.
Resolves brave/brave-browser#14769
Resolves brave/brave-browser#15176
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: