зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1178508 ServiceWorker scripts should never be intercepted. r=baku
This commit is contained in:
Родитель
97d45626f1
Коммит
0fd3dd2bfb
|
@ -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))) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче