Bug 1377128 - Screenshots overlay button icons are not displayed on latest Nightly build. r=jimm

Set the content type on remote channels in the moz-extension protocol handler.

MozReview-Commit-ID: H6XtYHjhS1Q

--HG--
extra : rebase_source : 48684ab78458b6723f1fd2c9860a5d36e7f5cc8e
This commit is contained in:
Haik Aftandilian 2017-07-03 22:41:53 -07:00
Родитель 6a89d8490a
Коммит edadc69735
1 изменённых файлов: 12 добавлений и 1 удалений

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

@ -25,6 +25,7 @@
#include "nsIFileStreams.h"
#include "nsIFileURL.h"
#include "nsIJARChannel.h"
#include "nsIMIMEService.h"
#include "nsIURL.h"
#include "nsIChannel.h"
#include "nsIInputStreamPump.h"
@ -671,8 +672,18 @@ NewSimpleChannel(nsIURI* aURI,
ExtensionStreamGetter* getter) -> RequestOrReason {
MOZ_TRY(getter->GetAsync(listener, channel));
return RequestOrReason(nullptr);
});
nsresult rv;
nsCOMPtr<nsIMIMEService> mime = do_GetService("@mozilla.org/mime;1", &rv);
if (NS_SUCCEEDED(rv)) {
nsAutoCString contentType;
rv = mime->GetTypeFromURI(aURI, contentType);
if (NS_SUCCEEDED(rv)) {
Unused << channel->SetContentType(contentType);
}
}
channel.swap(*aRetVal);
}