Ejemplo n.º 1
0
SandboxFlags DocumentInit::getSandboxFlags() const
{
    DCHECK(frameForSecurityContext());
    FrameLoader* loader = &frameForSecurityContext()->loader();
    SandboxFlags flags = loader->effectiveSandboxFlags();

    // If the load was blocked by X-Frame-Options or CSP, force the Document's
    // origin to be unique, so that the blocked document appears to be a normal
    // cross-origin document's load per CSP spec:
    // https://www.w3.org/TR/CSP2/#directive-frame-ancestors
    if (loader->documentLoader() && loader->documentLoader()->wasBlockedAfterXFrameOptionsOrCSP())
        flags |= SandboxOrigin;

    return flags;
}
Ejemplo n.º 2
0
bool DocumentInit::isHostedInReservedIPRange() const
{
    if (LocalFrame* frame = frameForSecurityContext()) {
        if (DocumentLoader* loader = frame->loader().provisionalDocumentLoader() ? frame->loader().provisionalDocumentLoader() : frame->loader().documentLoader()) {
            if (!loader->response().remoteIPAddress().isEmpty())
                return Platform::current()->isReservedIPAddress(loader->response().remoteIPAddress());
        }
    }
    return false;
}
Ejemplo n.º 3
0
bool DocumentInit::shouldSetURL() const
{
    LocalFrame* frame = frameForSecurityContext();
    return (frame && frame->owner()) || !m_url.isEmpty();
}
Ejemplo n.º 4
0
Settings* DocumentInit::settings() const
{
    ASSERT(frameForSecurityContext());
    return frameForSecurityContext()->settings();
}
Ejemplo n.º 5
0
SecurityContext::InsecureNavigationsSet* DocumentInit::insecureNavigationsToUpgrade() const
{
    ASSERT(frameForSecurityContext());
    return frameForSecurityContext()->loader().insecureNavigationsToUpgrade();
}
Ejemplo n.º 6
0
SecurityContext::InsecureRequestsPolicy DocumentInit::insecureRequestsPolicy() const
{
    ASSERT(frameForSecurityContext());
    return frameForSecurityContext()->loader().insecureRequestsPolicy();
}
Ejemplo n.º 7
0
bool DocumentInit::shouldEnforceStrictMixedContentChecking() const
{
    ASSERT(frameForSecurityContext());
    return frameForSecurityContext()->loader().shouldEnforceStrictMixedContentChecking();
}
Ejemplo n.º 8
0
SandboxFlags DocumentInit::sandboxFlags() const
{
    ASSERT(frameForSecurityContext());
    return frameForSecurityContext()->loader().effectiveSandboxFlags();
}
Ejemplo n.º 9
0
WebInsecureRequestPolicy DocumentInit::getInsecureRequestPolicy() const
{
    DCHECK(frameForSecurityContext());
    return frameForSecurityContext()->loader().getInsecureRequestPolicy();
}