mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1059832 - Disallow initiating asynchronous remote JAR channel requests for synchronous operations. r=jduell
This commit is contained in:
parent
35daa6f03d
commit
7e273e8979
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user