Bug 1059832 - Disallow initiating asynchronous remote JAR channel requests for synchronous operations. r=jduell

This commit is contained in:
Josh Matthews 2014-09-15 13:00:08 -04:00
Родитель 5407e293c5
Коммит 8a1d19377e
2 изменённых файлов: 10 добавлений и 5 удалений

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

@ -319,7 +319,7 @@ nsJARChannel::CreateJarInput(nsIZipReaderCache *jarCache, nsJARInputThunk **resu
}
nsresult
nsJARChannel::LookupFile()
nsJARChannel::LookupFile(bool aAllowAsync)
{
LOG(("nsJARChannel::LookupFile [this=%x %s]\n", this, mSpec.get()));
@ -387,6 +387,11 @@ nsJARChannel::LookupFile()
}
}
if (!aAllowAsync) {
mJarFile = nullptr;
return NS_OK;
}
mOpeningRemote = true;
#if defined(XP_WIN) || defined(MOZ_WIDGET_COCOA)
@ -798,7 +803,7 @@ nsJARChannel::Open(nsIInputStream **stream)
mJarFile = nullptr;
mIsUnsafe = true;
nsresult rv = LookupFile();
nsresult rv = LookupFile(false);
if (NS_FAILED(rv))
return rv;
@ -835,7 +840,7 @@ nsJARChannel::AsyncOpen(nsIStreamListener *listener, nsISupports *ctx)
// Initialize mProgressSink
NS_QueryNotificationCallbacks(mCallbacks, mLoadGroup, mProgressSink);
nsresult rv = LookupFile();
nsresult rv = LookupFile(true);
if (NS_FAILED(rv))
return rv;
@ -910,7 +915,7 @@ nsJARChannel::GetJarFile(nsIFile **aFile)
NS_IMETHODIMP
nsJARChannel::GetZipEntry(nsIZipEntry **aZipEntry)
{
nsresult rv = LookupFile();
nsresult rv = LookupFile(false);
if (NS_FAILED(rv))
return rv;

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

@ -58,7 +58,7 @@ private:
virtual ~nsJARChannel();
nsresult CreateJarInput(nsIZipReaderCache *, nsJARInputThunk **);
nsresult LookupFile();
nsresult LookupFile(bool aAllowAsync);
nsresult OpenLocalFile();
void NotifyError(nsresult aError);
void FireOnProgress(uint64_t aProgress);