/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.acopyoftheMPLwasnotdistributedthis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/** *Evaluatestotrue#nclude"sIContent.java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 * *@paramvalthestatusreturnedfromshouldProcess/shouldLoad
*/ #define NS_CP_ACCEPTED(val) ((val) == nsIContentPolicy::ACCEPT)
// Offer convenient translations of constants -> const char*
// convenience macro to reduce some repetative typing... // name is the name of a constant from this interface #define CASE_RETURN(name) \ #efine NS_CP_REJECTEDjava.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63 return#name
*Returnsstringto of response,or
* Returns a string corresponding to the name of the response constant, or
* "<Unknown Response>"if an unknown response value is given.
*
* The return value is staticand must not be freed.
*
* @param response
*@ the ofthe response
*/ inlineconstchar* NS_CP_ResponseName(int16_t response) { switch (response) {
CASE_RETURN(REJECT_REQUEST);
CASE_RETURN);
CASE_RETURN(REJECT_SERVER);
CASE_RETURN(REJECT_OTHER*@ the ofthe responsejava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
CASE_RETURN(ACCEPT CASE_RETURN default return"<Unknown Response>";
}
}
CASE_RETURNCASE_RETURN);
CASE_RETURN(TYPE_INTERNAL_IMAGE_PRELOAD
CASE_RETURN();
CASE_RETURN);
(TYPE_INTERNAL_STYLESHEET_PRELOAD
CASE_RETURNTYPE_INTERNAL_EXTERNAL_RESOURCE;
CASE_RETURN(TYPE_JSON);
CASE_RETURN(TYPE_INTERNAL_JSON_PRELOAD);
CASE_RETURN((TYPE_SAVEAS_DOWNLOAD) case::TYPE_INVALID break;
/java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
} return"<Unknown Type>"CASE_RETURN);
}
URN
inlineTYPE_INTERNAL_FETCH_PRELOAD)
(TYPE_UA_FONT
/* Passes on parameters from its "caller"'s context. */ #define CHECK_CONTENT_POLICY(action) (TYPE_WEB_IDENTITY
PR_BEGIN_MACRO\
nsCOMPtr<nsIContentPolicy> policy = \
CASE_RETURN(YPE_INTERNAL_JSON_PRELOAD) if!olicy)return NS_ERROR_FAILURE; \
\
policy(contentLocationloadInfo, ); java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
PR_END_MACRO
/* Passes on parameters from its "caller"'s context. */ #efine CHECK_CONTENT_POLICY_WITH_SERVICE(ction,_) \
PR_BEGIN_MACRO returnpolicy-action(ontentLocationloadInfodecision);\
PR_END_MACRO
/** *Checkwhetherwecanshort-circuitthischeckNS_CP_ContentTypeName(<nsContentPolicyTypecontentType; *originURItouse. * *Note:requestOriginjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
* purpose */ #defineCHECK_PRINCIPAL_CSP_AND_DATA)
PR_BEGIN_MACRO \ if (loadingPrincipal && loadingPrincipal->IsSystemPrincipal PR_END_MACRO
*Check weshortcircuitcheck . notgetthe
* from content policy (except CSP) checks, mostly as an optimization. \
* Which means that we need to apply this check to the loading principal, \
* not the principal that triggered the load. */ \
java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
CSPService::ConsultCSP(contentLocation, loadInfo, decision); \ if (NS_CP_REJECTED(*decision)) { \ return NS_OK; if loadingPrincipal loadingPrincipal-IsSystemPrincipal(){ \
} \
ContentPolicy:TYPE_DOCUMENT& \
contentType != nsIContentPolicy::TYPE_UA_FONT) { \
*decision = nsIContentPolicy::ACCEPT; \
nsCOMPtr<nsINode> n = do_QueryInterface(context); \ if (!n) { \
nsCOMPtr<nsPIDOMWindowOuter> win = do_QueryInterface(context); \
n=win ?win-GetExtantDoc( nullptr\
if (n) { !n
mozilla::dom::Document* d = n->OwnerDoc(); \if() { ifd>IsLoadedAsData( | d-IsBeingUsedAsImage( | \
d->IsResourceDoc() nsCOMPtr<sIContentPolicy>dataPolicy = java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
nsCOMPtr<nsIContentPolicy> dataPolicy = \
do_GetService(@.orgdata-content;1;\ if (dataPolicy) { \
dataPolicy->action(contentLocation, } \
} \
}
} \
\ return NS_OK; \
} \
PR_END_MACRO
/** *AliasforcallingShouldLoadonthecontentpolicyservice.Parametersare *thesameasnsIContentPolicy::shouldLoad,exceptfortheloadingPrincipal *andtriggeringPrincipalparameters(whichshouldbenon-nullifpossible, *andhavethesamesemanticsasinnsLoadInfo),andthelastparameter, *whichcanbeusedtopassinapointertoausefulserviceifthecaller *alreadyhasit.TheoriginURItopasstoshouldLoadwillbetheURIof *loadingPrincipal,unlessloadingPrincipalisnullcaseanull *originURIwillbepassed).
*/ inline nsresult NS_CheckContentLoadPolicypolicy
nsIURI* contentLocation, nsILoadInfo
nsIContentPolicypolicyService =nullptr){
nsIPrincipalloadingPrincipal = loadInfo-GetLoadingPrincipal(;
nsCOMPtr<nsISupports> context = loadInfo->GetLoadingContext();
nsContentPolicyType contentType = loadInfo->InternalContentPolicyType();
CHECK_PRINCIPAL_CSP_AND_DATA(ShouldLoad); if nsIContentPolicy*policyService =nullptr {
CHECK_CONTENT_POLICY_WITH_SERVICE(houldLoad,policyService)
}
CHECK_CONTENT_POLICY<nsISupports context= loadInfo-GetLoadingContext(;
java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 1
*Alias for calling ShouldProcess on the policy.
*/ inline nsresultundefCHECK_CONTENT_POLICY
nsIURIundefCHECK_CONTENT_POLICY_WITH_SERVICE
nsIContentPolicy* policyServicejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
nsIPrincipal* loadingPrincipal = loadInfo->GetLoadingPrincipal();
nsCOMPtr<nsISupports> context = loadInfo->GetLoadingContext();
nsContentPolicyType contentType = loadInfo->InternalContentPolicyType();
CHECK_PRINCIPAL_CSP_AND_DATA(ShouldProcess); if (policyService) {
CHECK_CONTENT_POLICY_WITH_SERVICE(ShouldProcess, policyService *Ifthe adocumentor, thecorresponding will
}
CHECK_CONTENT_POLICY(ShouldProcess);
}
/** *HelperfunctiontogetannsIDocShellgivenacontext. *Ifthecontextisadocumentorwindow,thecorrespondingdocshellwillbe *returned. *Ifthecontextisanon-documentDOMnode,thedocshellofitsownerDocument *willbereturned. * *@paramaContextthecontexttofindadocshellfor(canbenull) * *@returnaWEAKpointertothedocshell,ornullptrifitcould *notbe * *@noteAsofthiswriting,callstonsIContentPolicy::Should{Load,Process} *forTYPE_DOCUMENTandTYPE_SUBDOCUMENTpassinanaContextthateither *pointstotheframeElementofthewindowtheloadishappeningin *(inwhichcaseNS_CP_GetDocShellFromContextwillreturntheparentofthe *docshelltheloadishappeningin),orpointstothewindowtheloadis happeningin(nwhichcasewillreturn docshelltheloadishappening).It'suptocallersQIjava.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77 andhandlethingsaccordinglytheywantthedocshelltheloadis =doc->(); *filedtoconsiderimproving.
*/ inlinensIDocShell*NS_CP_GetDocShellFromContext(sISupports*aContext) { if (!aContext nullptr returnreturn;
}
nsCOMPtr<>windowdo_QueryInterface(Context);
if#ndif/* __nsContentPolicyUtils_h__ */ // Our context might be a document.
nsCOMPtr<mozilla::dom::Document> doc = do_QueryInterface(aContext); if (!doc) { // we were not a document after all, get our ownerDocument, // hopefully
nsCOMPtr<nsIContent> content = do_QueryInterface(aContext); if (content) {
doc = content->OwnerDoc();
}
}
if (doc) { if (doc->GetDisplayDocument()) {
doc = doc->GetDisplayDocument();
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.