Bug 1178508 ServiceWorker scripts should never be intercepted. r=baku

This commit is contained in:
Ben Kelly 2015-07-02 07:30:06 -07:00
parent 4965ecc09e
commit 268167f91a

View File

@ -10,6 +10,7 @@
#include "nsIContentPolicy.h"
#include "nsIContentSecurityPolicy.h"
#include "nsIHttpChannel.h"
#include "nsIHttpChannelInternal.h"
#include "nsIInputStreamPump.h"
#include "nsIIOService.h"
#include "nsIProtocolHandler.h"
@ -870,6 +871,16 @@ private:
return rv;
}
// If we are loading a script for a ServiceWorker then we must not
// try to intercept it. If the interception matches the current
// ServiceWorker's scope then we could deadlock the load.
if (mWorkerPrivate->IsServiceWorker()) {
nsCOMPtr<nsIHttpChannelInternal> internal = do_QueryInterface(channel);
if (internal) {
internal->ForceNoIntercept();
}
}
if (loadInfo.mCacheStatus != ScriptLoadInfo::ToBeCached) {
rv = channel->AsyncOpen(loader, indexSupports);
if (NS_WARN_IF(NS_FAILED(rv))) {