зеркало из https://github.com/mozilla/gecko-dev.git
Bug 965413 part 11. Use a LoadInfo as needed for loading stylesheets. r=smaug
This commit is contained in:
Родитель
22cec45b71
Коммит
11bc3578c0
|
@ -17,6 +17,7 @@
|
|||
/* loading of CSS style sheets using the network APIs */
|
||||
|
||||
#include "mozilla/ArrayUtils.h"
|
||||
#include "mozilla/LoadInfo.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
|
||||
#include "mozilla/css/Loader.h"
|
||||
|
@ -1560,12 +1561,17 @@ Loader::LoadSheet(SheetLoadData* aLoadData, StyleSheetState aSheetState)
|
|||
rv = NS_URIChainHasFlags(aLoadData->mURI,
|
||||
nsIProtocolHandler::URI_INHERITS_SECURITY_CONTEXT,
|
||||
&inherit);
|
||||
if ((NS_SUCCEEDED(rv) && inherit) ||
|
||||
(nsContentUtils::URIIsLocalFile(aLoadData->mURI) &&
|
||||
NS_SUCCEEDED(aLoadData->mLoaderPrincipal->
|
||||
CheckMayLoad(aLoadData->mURI, false, false)))) {
|
||||
channel->SetOwner(aLoadData->mLoaderPrincipal);
|
||||
}
|
||||
inherit =
|
||||
((NS_SUCCEEDED(rv) && inherit) ||
|
||||
(nsContentUtils::URIIsLocalFile(aLoadData->mURI) &&
|
||||
NS_SUCCEEDED(aLoadData->mLoaderPrincipal->
|
||||
CheckMayLoad(aLoadData->mURI, false, false))));
|
||||
nsCOMPtr<nsILoadInfo> loadInfo =
|
||||
new LoadInfo(aLoadData->mLoaderPrincipal,
|
||||
inherit ?
|
||||
LoadInfo::eInheritPrincipal : LoadInfo::eDontInheritPrincipal,
|
||||
LoadInfo::eNotSandboxed);
|
||||
channel->SetLoadInfo(loadInfo);
|
||||
}
|
||||
|
||||
// We don't have to hold on to the stream loader. The ownership
|
||||
|
|
Загрузка…
Ссылка в новой задаче