OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
451 if (frameType == WebURLRequest::FrameTypeNested) { | 451 if (frameType == WebURLRequest::FrameTypeNested) { |
452 // FIXME: Deal with RemoteFrames. | 452 // FIXME: Deal with RemoteFrames. |
453 Frame* parentFrame = effectiveFrame->tree().parent(); | 453 Frame* parentFrame = effectiveFrame->tree().parent(); |
454 ASSERT(parentFrame); | 454 ASSERT(parentFrame); |
455 if (parentFrame->isLocalFrame()) | 455 if (parentFrame->isLocalFrame()) |
456 effectiveFrame = toLocalFrame(parentFrame); | 456 effectiveFrame = toLocalFrame(parentFrame); |
457 } | 457 } |
458 return effectiveFrame; | 458 return effectiveFrame; |
459 } | 459 } |
460 | 460 |
461 void MixedContentChecker::handleCertificateError(LocalFrame* frame, const KURL& url, WebURLRequest::RequestContext requestContext, WebURLRequest::FrameType fram eType, const CString& securityInfo) | |
jww
2015/11/20 01:25:08
Do we have any MixedContentChecker unit tests yet?
estark
2015/11/23 23:40:24
Acknowledged, but haven't done this yet. MixedCont
| |
462 { | |
463 if (frameType == WebURLRequest::FrameTypeTopLevel || !frame) | |
jww
2015/11/20 01:25:08
How can we can !frame? Can this be an ASSERT?
estark
2015/11/23 23:40:24
I put this here because shouldBlockFetch() has a s
jww
2015/11/25 19:24:02
Hm, maybe Service Worker or something? Anyway, thi
| |
464 return; | |
465 | |
466 FrameLoaderClient* client = frame->loader().client(); | |
467 ContextType contextType = MixedContentChecker::contextTypeFromContext(reques tContext, frame); | |
468 if (contextType == ContextTypeBlockable) { | |
469 SecurityOrigin* securityOrigin = frame->document()->securityOrigin(); | |
470 client->didRunContentWithCertificateErrors(securityOrigin, url, security Info); | |
471 } else { | |
472 ASSERT(contextType != ContextTypeNotMixedContent); | |
jww
2015/11/20 01:25:08
I guess this ASSERT exists because handleCertifica
estark
2015/11/23 23:40:24
Actually, it's because contextTypeFromContext() ne
| |
473 client->didDisplayContentWithCertificateErrors(url, securityInfo); | |
474 } | |
475 } | |
476 | |
461 MixedContentChecker::ContextType MixedContentChecker::contextTypeForInspector(Lo calFrame* frame, const ResourceRequest& request) | 477 MixedContentChecker::ContextType MixedContentChecker::contextTypeForInspector(Lo calFrame* frame, const ResourceRequest& request) |
462 { | 478 { |
463 LocalFrame* effectiveFrame = effectiveFrameForFrameType(frame, request.frame Type()); | 479 LocalFrame* effectiveFrame = effectiveFrameForFrameType(frame, request.frame Type()); |
464 | 480 |
465 LocalFrame* mixedFrame = inWhichFrameIsContentMixed(effectiveFrame, request. frameType(), request.url()); | 481 LocalFrame* mixedFrame = inWhichFrameIsContentMixed(effectiveFrame, request. frameType(), request.url()); |
466 if (!mixedFrame) | 482 if (!mixedFrame) |
467 return ContextTypeNotMixedContent; | 483 return ContextTypeNotMixedContent; |
468 | 484 |
469 // See comment in shouldBlockFetch() about loading the main resource of a su bframe. | 485 // See comment in shouldBlockFetch() about loading the main resource of a su bframe. |
470 if (request.frameType() == WebURLRequest::FrameTypeNested && !SchemeRegistry ::shouldTreatURLSchemeAsCORSEnabled(request.url().protocol())) { | 486 if (request.frameType() == WebURLRequest::FrameTypeNested && !SchemeRegistry ::shouldTreatURLSchemeAsCORSEnabled(request.url().protocol())) { |
471 return ContextTypeOptionallyBlockable; | 487 return ContextTypeOptionallyBlockable; |
472 } | 488 } |
473 | 489 |
474 return contextTypeFromContext(request.requestContext(), mixedFrame); | 490 return contextTypeFromContext(request.requestContext(), mixedFrame); |
475 } | 491 } |
476 | 492 |
477 } // namespace blink | 493 } // namespace blink |
OLD | NEW |