mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1156847 - Part 3: When loading a service worker from the network, remember the security info of the channel on the WorkerPrivate; r=nsm
This commit is contained in:
parent
0b4ac3bba8
commit
7fcc696e50
@ -13,6 +13,7 @@
|
||||
#include "nsIIOService.h"
|
||||
#include "nsIProtocolHandler.h"
|
||||
#include "nsIScriptSecurityManager.h"
|
||||
#include "nsISerializable.h"
|
||||
#include "nsIStreamLoader.h"
|
||||
#include "nsIStreamListenerTee.h"
|
||||
#include "nsIThreadRetargetableRequest.h"
|
||||
@ -917,6 +918,20 @@ private:
|
||||
// Take care of the base URI first.
|
||||
mWorkerPrivate->SetBaseURI(finalURI);
|
||||
|
||||
// Store the security info if needed.
|
||||
if (mWorkerPrivate->IsServiceWorker()) {
|
||||
nsCOMPtr<nsISupports> infoObj;
|
||||
channel->GetSecurityInfo(getter_AddRefs(infoObj));
|
||||
if (infoObj) {
|
||||
nsCOMPtr<nsISerializable> serializable = do_QueryInterface(infoObj);
|
||||
if (serializable) {
|
||||
mWorkerPrivate->SetSecurityInfo(serializable);
|
||||
} else {
|
||||
NS_WARNING("A non-serializable object was obtained from nsIChannel::GetSecurityInfo()!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Now to figure out which principal to give this worker.
|
||||
WorkerPrivate* parent = mWorkerPrivate->GetParent();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user