зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1210941 P3 Make jar channels use LOAD_BYPASS_SERVICE_WORKER internally. r=jduell
This commit is contained in:
Родитель
5f0bbc9218
Коммит
bf39f45fae
|
@ -203,7 +203,6 @@ nsJARChannel::nsJARChannel()
|
|||
, mIsUnsafe(true)
|
||||
, mOpeningRemote(false)
|
||||
, mSynthesizedStreamLength(0)
|
||||
, mForceNoIntercept(false)
|
||||
, mBlockRemoteFiles(false)
|
||||
{
|
||||
if (!gJarProtocolLog)
|
||||
|
@ -863,6 +862,12 @@ nsJARChannel::Open2(nsIInputStream** aStream)
|
|||
return Open(aStream);
|
||||
}
|
||||
|
||||
bool
|
||||
nsJARChannel::BypassServiceWorker() const
|
||||
{
|
||||
return mLoadFlags & LOAD_BYPASS_SERVICE_WORKER;
|
||||
}
|
||||
|
||||
bool
|
||||
nsJARChannel::ShouldIntercept()
|
||||
{
|
||||
|
@ -877,7 +882,7 @@ nsJARChannel::ShouldIntercept()
|
|||
NS_GET_IID(nsINetworkInterceptController),
|
||||
getter_AddRefs(controller));
|
||||
bool shouldIntercept = false;
|
||||
if (controller && !mForceNoIntercept && mLoadInfo) {
|
||||
if (controller && !BypassServiceWorker() && mLoadInfo) {
|
||||
bool isNavigation = mLoadFlags & LOAD_DOCUMENT_URI;
|
||||
nsContentPolicyType type = mLoadInfo->InternalContentPolicyType();
|
||||
nsresult rv = controller->ShouldPrepareForIntercept(mAppURI,
|
||||
|
@ -1124,7 +1129,7 @@ nsJARChannel::GetZipEntry(nsIZipEntry **aZipEntry)
|
|||
NS_IMETHODIMP
|
||||
nsJARChannel::ForceNoIntercept()
|
||||
{
|
||||
mForceNoIntercept = true;
|
||||
mLoadFlags |= LOAD_BYPASS_SERVICE_WORKER;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -80,6 +80,8 @@ private:
|
|||
mozilla::net::MemoryDownloader::Data aData)
|
||||
override;
|
||||
|
||||
bool BypassServiceWorker() const;
|
||||
|
||||
// Returns true if this channel should intercept the network request and
|
||||
// prepare for a possible synthesized response instead.
|
||||
bool ShouldIntercept();
|
||||
|
@ -136,9 +138,6 @@ private:
|
|||
nsRefPtr<nsInputStreamPump> mSynthesizedResponsePump;
|
||||
int64_t mSynthesizedStreamLength;
|
||||
|
||||
// True if this channel should skip any interception checks.
|
||||
bool mForceNoIntercept;
|
||||
|
||||
// True if this channel should not download any remote files.
|
||||
bool mBlockRemoteFiles;
|
||||
friend class mozilla::net::InterceptedJARChannel;
|
||||
|
|
Загрузка…
Ссылка в новой задаче