bug 1116382 reuse some UTF8toUTF16 code r=bholley

--HG--
extra : rebase_source : 7d8ee725dcfb1b40ee6d975c0746a8bdff1b5683
This commit is contained in:
Karl Tomlinson 2015-05-26 17:41:43 +12:00
Родитель 72f7f38b47
Коммит c4cb17e0b1
1 изменённых файлов: 4 добавлений и 6 удалений

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

@ -1193,9 +1193,8 @@ nsresult HTMLMediaElement::LoadResource()
nsRefPtr<DOMMediaStream> stream; nsRefPtr<DOMMediaStream> stream;
rv = NS_GetStreamForMediaStreamURI(mLoadingSrc, getter_AddRefs(stream)); rv = NS_GetStreamForMediaStreamURI(mLoadingSrc, getter_AddRefs(stream));
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {
nsCString specUTF8; nsAutoString spec;
mLoadingSrc->GetSpec(specUTF8); GetCurrentSrc(spec);
NS_ConvertUTF8toUTF16 spec(specUTF8);
const char16_t* params[] = { spec.get() }; const char16_t* params[] = { spec.get() };
ReportLoadError("MediaLoadInvalidURI", params, ArrayLength(params)); ReportLoadError("MediaLoadInvalidURI", params, ArrayLength(params));
return rv; return rv;
@ -1208,9 +1207,8 @@ nsresult HTMLMediaElement::LoadResource()
nsRefPtr<MediaSource> source; nsRefPtr<MediaSource> source;
rv = NS_GetSourceForMediaSourceURI(mLoadingSrc, getter_AddRefs(source)); rv = NS_GetSourceForMediaSourceURI(mLoadingSrc, getter_AddRefs(source));
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {
nsCString specUTF8; nsAutoString spec;
mLoadingSrc->GetSpec(specUTF8); GetCurrentSrc(spec);
NS_ConvertUTF8toUTF16 spec(specUTF8);
const char16_t* params[] = { spec.get() }; const char16_t* params[] = { spec.get() };
ReportLoadError("MediaLoadInvalidURI", params, ArrayLength(params)); ReportLoadError("MediaLoadInvalidURI", params, ArrayLength(params));
return rv; return rv;