mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 15:23:51 +00:00
Bug 1817393 - Fix missing null check in RecvGetSystemIcon. r=nika
Depends on D170184 Differential Revision: https://phabricator.services.mozilla.com/D170185
This commit is contained in:
parent
843be769fb
commit
93336d3327
@ -8225,17 +8225,23 @@ void ContentParent::DidLaunchSubprocess() {
|
||||
|
||||
IPCResult ContentParent::RecvGetSystemIcon(nsIURI* aURI,
|
||||
GetSystemIconResolver&& aResolver) {
|
||||
using ResolverArgs = Tuple<const nsresult&, mozilla::Maybe<ByteBuf>&&>;
|
||||
|
||||
if (!aURI) {
|
||||
Maybe<ByteBuf> bytebuf = Nothing();
|
||||
aResolver(ResolverArgs(NS_ERROR_NULL_POINTER, std::move(bytebuf)));
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
#if defined(MOZ_WIDGET_GTK)
|
||||
Maybe<ByteBuf> bytebuf = Some(ByteBuf{});
|
||||
nsresult rv = nsIconChannel::GetIcon(aURI, bytebuf.ptr());
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
bytebuf = Nothing();
|
||||
}
|
||||
using ResolverArgs = Tuple<const nsresult&, mozilla::Maybe<ByteBuf>&&>;
|
||||
aResolver(ResolverArgs(rv, std::move(bytebuf)));
|
||||
return IPC_OK();
|
||||
#elif defined(XP_WIN)
|
||||
using ResolverArgs = Tuple<const nsresult&, mozilla::Maybe<ByteBuf>&&>;
|
||||
nsIconChannel::GetIconAsync(aURI)->Then(
|
||||
GetCurrentSerialEventTarget(), __func__,
|
||||
[aResolver](ByteBuf&& aByteBuf) {
|
||||
|
Loading…
Reference in New Issue
Block a user