Bug 1437188 - Part 2: Only try to retarget if the listener is retargetable. r=bkelly

MutableBlobStreamListener isn't retargetable, in order to avoid warning about
it we don't try retarget it at all. This should remove about 4,000 warnings
during testing.

--HG--
extra : rebase_source : 9ff00b9c5e818c5eba813915b4118749da1ecad6
This commit is contained in:
Eric Rahm 2018-02-12 11:57:44 -08:00
Родитель 9f798eecf1
Коммит 00725e9047
1 изменённых файлов: 4 добавлений и 2 удалений

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

@ -584,10 +584,12 @@ FetchBodyConsumer<Derived>::BeginConsumeBodyMainThread()
// Try to retarget, otherwise fall back to main thread.
nsCOMPtr<nsIThreadRetargetableRequest> rr = do_QueryInterface(pump);
if (rr) {
nsCOMPtr<nsIThreadRetargetableStreamListener> rl =
do_QueryInterface(listener);
if (rr && rl) {
nsCOMPtr<nsIEventTarget> sts = do_GetService(NS_STREAMTRANSPORTSERVICE_CONTRACTID);
rv = rr->RetargetDeliveryTo(sts);
if (NS_WARN_IF(NS_FAILED(rv))) {
if (NS_FAILED(rv)) {
NS_WARNING("Retargeting failed");
}
}