void MixedContentChecker::handleCertificateError(LocalFrame* frame, const ResourceResponse& response, WebURLRequest::FrameType frameType, WebURLRequest::RequestContext requestContext) { Frame* effectiveFrame = effectiveFrameForFrameType(frame, frameType); if (frameType == WebURLRequest::FrameTypeTopLevel || !effectiveFrame) return; // TODO(estark): handle remote frames, perhaps by omitting security info when the effective frame is remote. if (!effectiveFrame->isLocalFrame()) return; LocalFrame* localEffectiveFrame = toLocalFrame(effectiveFrame); // Use the current local frame's client; the embedder doesn't // distinguish mixed content signals from different frames on the // same page. FrameLoaderClient* client = frame->loader().client(); ContextType contextType = MixedContentChecker::contextTypeFromContext(requestContext, effectiveFrame); if (contextType == ContextTypeBlockable) { client->didRunContentWithCertificateErrors(response.url(), response.getSecurityInfo(), mainResourceUrlForFrame(effectiveFrame), localEffectiveFrame->loader().documentLoader()->response().getSecurityInfo()); } else { // contextTypeFromContext() never returns NotMixedContent (it // computes the type of mixed content, given that the content is // mixed). ASSERT(contextType != ContextTypeNotMixedContent); client->didDisplayContentWithCertificateErrors(response.url(), response.getSecurityInfo(), mainResourceUrlForFrame(effectiveFrame), localEffectiveFrame->loader().documentLoader()->response().getSecurityInfo()); } }
void MixedContentChecker::handleCertificateError(LocalFrame* frame, const ResourceRequest& request, const ResourceResponse& response) { WebURLRequest::FrameType frameType = request.frameType(); LocalFrame* effectiveFrame = effectiveFrameForFrameType(frame, frameType); if (frameType == WebURLRequest::FrameTypeTopLevel || !effectiveFrame) return; FrameLoaderClient* client = effectiveFrame->loader().client(); WebURLRequest::RequestContext requestContext = request.requestContext(); ContextType contextType = MixedContentChecker::contextTypeFromContext(requestContext, frame); if (contextType == ContextTypeBlockable) { client->didRunContentWithCertificateErrors(response.url(), response.getSecurityInfo(), effectiveFrame->document()->url(), effectiveFrame->loader().documentLoader()->response().getSecurityInfo()); } else { // contextTypeFromContext() never returns NotMixedContent (it // computes the type of mixed content, given that the content is // mixed). ASSERT(contextType != ContextTypeNotMixedContent); client->didDisplayContentWithCertificateErrors(response.url(), response.getSecurityInfo(), effectiveFrame->document()->url(), effectiveFrame->loader().documentLoader()->response().getSecurityInfo()); } }
void MixedContentChecker::handleCertificateError(LocalFrame* frame, const ResourceResponse& response, WebURLRequest::FrameType frameType, WebURLRequest::RequestContext requestContext) { Frame* effectiveFrame = effectiveFrameForFrameType(frame, frameType); if (frameType == WebURLRequest::FrameTypeTopLevel || !effectiveFrame) return; // Use the current local frame's client; the embedder doesn't // distinguish mixed content signals from different frames on the // same page. FrameLoaderClient* client = frame->loader().client(); bool strictMixedContentCheckingForPlugin = effectiveFrame->settings() && effectiveFrame->settings()->strictMixedContentCheckingForPlugin(); WebMixedContent::ContextType contextType = WebMixedContent::contextTypeFromRequestContext(requestContext, strictMixedContentCheckingForPlugin); if (contextType == WebMixedContent::ContextType::Blockable) { client->didRunContentWithCertificateErrors(response.url(), response.getSecurityInfo()); } else { // contextTypeFromRequestContext() never returns NotMixedContent (it // computes the type of mixed content, given that the content is // mixed). DCHECK(contextType != WebMixedContent::ContextType::NotMixedContent); client->didDisplayContentWithCertificateErrors(response.url(), response.getSecurityInfo()); } }