Bug 1530190. Cleanup GetStockIcon from first patch. r=aosmond

Looks like this is left over from a partial attempt at making GetStockIcon async like GetHIconFromFile.

But I don't think it needs to be async, the only system call SHGetStockIconInfo doesn't have anything about background thread like SHGetFileInfo.

Differential Revision: https://phabricator.services.mozilla.com/D31013
This commit is contained in:
Timothy Nikkel 2019-05-13 21:34:01 -05:00
parent 1ff1a4a196
commit 9ba96ad113
2 changed files with 3 additions and 13 deletions

View File

@ -530,8 +530,7 @@ nsresult nsIconChannel::GetHIconFromFile(nsIFile* aLocalFile,
return NS_OK;
}
nsresult nsIconChannel::GetStockHIcon(nsIMozIconURI* aIconURI,
bool aNonBlocking, HICON* hIcon) {
nsresult nsIconChannel::GetStockHIcon(nsIMozIconURI* aIconURI, HICON* hIcon) {
nsresult rv = NS_OK;
uint32_t desiredImageSize;
@ -551,14 +550,6 @@ nsresult nsIconChannel::GetStockHIcon(nsIMozIconURI* aIconURI,
sii.cbSize = sizeof(sii);
HRESULT hr = SHGetStockIconInfo(stockIconID, infoFlags, &sii);
if (aNonBlocking) {
nsCOMPtr<nsIRunnable> task = NewRunnableMethod<HICON, nsresult>(
"nsIconChannel::FinishAsyncOpen", this, &nsIconChannel::FinishAsyncOpen,
sii.hIcon, rv);
mListenerTarget->Dispatch(task.forget(), NS_DISPATCH_NORMAL);
return NS_OK;
}
if (SUCCEEDED(hr)) {
*hIcon = sii.hIcon;
} else {
@ -651,7 +642,7 @@ nsresult nsIconChannel::GetHIcon(bool aNonBlocking, HICON* aIcon) {
nsAutoCString stockIcon;
iconURI->GetStockIcon(stockIcon);
if (!stockIcon.IsEmpty()) {
return GetStockHIcon(iconURI, aNonBlocking, aIcon);
return GetStockHIcon(iconURI, aIcon);
}
return GetHIconFromFile(aNonBlocking, aIcon);

View File

@ -74,8 +74,7 @@ class nsIconChannel final : public nsIChannel, public nsIStreamListener {
// Functions specific to Vista and above
protected:
nsresult GetStockHIcon(nsIMozIconURI* aIconURI, bool aNonBlocking,
HICON* hIcon);
nsresult GetStockHIcon(nsIMozIconURI* aIconURI, HICON* hIcon);
};
#endif // mozilla_image_encoders_icon_win_nsIconChannel_h