mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1119026 - Respect skip serviceworker flag. r=baku,bkelly
This commit is contained in:
parent
905b0da674
commit
c5d867ffe6
@ -241,6 +241,11 @@ FetchRequest(nsIGlobalObject* aGlobal, const RequestOrUSVString& aInput,
|
||||
} else {
|
||||
WorkerPrivate* worker = GetCurrentThreadWorkerPrivate();
|
||||
MOZ_ASSERT(worker);
|
||||
|
||||
if (worker->IsServiceWorker()) {
|
||||
r->SetSkipServiceWorker();
|
||||
}
|
||||
|
||||
nsRefPtr<MainThreadFetchRunnable> run = new MainThreadFetchRunnable(worker, p, r);
|
||||
if (NS_FAILED(NS_DispatchToMainThread(run))) {
|
||||
NS_WARNING("MainThreadFetchRunnable dispatch failed!");
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include "nsIInputStream.h"
|
||||
#include "nsIOutputStream.h"
|
||||
#include "nsIHttpChannel.h"
|
||||
#include "nsIHttpChannelInternal.h"
|
||||
#include "nsIHttpHeaderVisitor.h"
|
||||
#include "nsIScriptSecurityManager.h"
|
||||
#include "nsIThreadRetargetableRequest.h"
|
||||
@ -450,6 +451,14 @@ FetchDriver::HttpFetch(bool aCORSFlag, bool aCORSPreflightFlag, bool aAuthentica
|
||||
}
|
||||
}
|
||||
|
||||
// Set skip serviceworker flag.
|
||||
// While the spec also gates on the client being a ServiceWorker, we can't
|
||||
// infer that here. Instead we rely on callers to set the flag correctly.
|
||||
if (mRequest->SkipServiceWorker()) {
|
||||
nsCOMPtr<nsIHttpChannelInternal> internalChan = do_QueryInterface(httpChan);
|
||||
internalChan->ForceNoIntercept();
|
||||
}
|
||||
|
||||
// Set up a CORS proxy that will handle the various requirements of the CORS
|
||||
// protocol. It handles the preflight cache and CORS response headers.
|
||||
// If the request is allowed, it will start our original request
|
||||
|
@ -179,6 +179,18 @@ public:
|
||||
mReferrer.Assign(aReferrer);
|
||||
}
|
||||
|
||||
bool
|
||||
SkipServiceWorker() const
|
||||
{
|
||||
return mSkipServiceWorker;
|
||||
}
|
||||
|
||||
void
|
||||
SetSkipServiceWorker()
|
||||
{
|
||||
mSkipServiceWorker = true;
|
||||
}
|
||||
|
||||
bool
|
||||
IsSynchronous() const
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user