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 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 | 457 |
458 return true; | 458 return true; |
459 } | 459 } |
460 | 460 |
461 void MixedContentChecker::checkMixedPrivatePublic(LocalFrame* frame, const Atomi
cString& resourceIPAddress) | 461 void MixedContentChecker::checkMixedPrivatePublic(LocalFrame* frame, const Atomi
cString& resourceIPAddress) |
462 { | 462 { |
463 if (!frame || !frame->document() || !frame->document()->loader()) | 463 if (!frame || !frame->document() || !frame->document()->loader()) |
464 return; | 464 return; |
465 | 465 |
466 // Just count these for the moment, don't block them. | 466 // Just count these for the moment, don't block them. |
467 if (Platform::current()->isReservedIPAddress(resourceIPAddress) && !frame->d
ocument()->isHostedInReservedIPRange()) | 467 if (Platform::current()->isReservedIPAddress(resourceIPAddress) && frame->do
cument()->addressSpace() == WebURLRequest::AddressSpacePublic) |
468 UseCounter::count(frame->document(), UseCounter::MixedContentPrivateHost
nameInPublicHostname); | 468 UseCounter::count(frame->document(), UseCounter::MixedContentPrivateHost
nameInPublicHostname); |
469 } | 469 } |
470 | 470 |
471 Frame* MixedContentChecker::effectiveFrameForFrameType(LocalFrame* frame, WebURL
Request::FrameType frameType) | 471 Frame* MixedContentChecker::effectiveFrameForFrameType(LocalFrame* frame, WebURL
Request::FrameType frameType) |
472 { | 472 { |
473 // If we're loading the main resource of a subframe, ensure that we check | 473 // If we're loading the main resource of a subframe, ensure that we check |
474 // against the parent of the active frame, rather than the frame itself. | 474 // against the parent of the active frame, rather than the frame itself. |
475 if (frameType != WebURLRequest::FrameTypeNested) | 475 if (frameType != WebURLRequest::FrameTypeNested) |
476 return frame; | 476 return frame; |
477 | 477 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 | 518 |
519 // See comment in shouldBlockFetch() about loading the main resource of a su
bframe. | 519 // See comment in shouldBlockFetch() about loading the main resource of a su
bframe. |
520 if (request.frameType() == WebURLRequest::FrameTypeNested && !SchemeRegistry
::shouldTreatURLSchemeAsCORSEnabled(request.url().protocol())) { | 520 if (request.frameType() == WebURLRequest::FrameTypeNested && !SchemeRegistry
::shouldTreatURLSchemeAsCORSEnabled(request.url().protocol())) { |
521 return ContextTypeOptionallyBlockable; | 521 return ContextTypeOptionallyBlockable; |
522 } | 522 } |
523 | 523 |
524 return contextTypeFromContext(request.requestContext(), mixedFrame); | 524 return contextTypeFromContext(request.requestContext(), mixedFrame); |
525 } | 525 } |
526 | 526 |
527 } // namespace blink | 527 } // namespace blink |
OLD | NEW |