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
Родитель 1ff1a4a196
Коммит 9ba96ad113
2 изменённых файлов: 3 добавлений и 13 удалений

Просмотреть файл

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

Просмотреть файл

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