| 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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 // If we're dealing with a CORS-enabled scheme, then block mixed frames as a
ctive content. Otherwise, | 319 // If we're dealing with a CORS-enabled scheme, then block mixed frames as a
ctive content. Otherwise, |
| 320 // treat frames as passive content. | 320 // treat frames as passive content. |
| 321 // | 321 // |
| 322 // FIXME: Remove this temporary hack once we have a reasonable API for launc
hing external applications | 322 // FIXME: Remove this temporary hack once we have a reasonable API for launc
hing external applications |
| 323 // via URLs. http://crbug.com/318788 and https://crbug.com/393481 | 323 // via URLs. http://crbug.com/318788 and https://crbug.com/393481 |
| 324 if (frameType == WebURLRequest::FrameTypeNested && !SchemeRegistry::shouldTr
eatURLSchemeAsCORSEnabled(url.protocol())) | 324 if (frameType == WebURLRequest::FrameTypeNested && !SchemeRegistry::shouldTr
eatURLSchemeAsCORSEnabled(url.protocol())) |
| 325 contextType = ContextTypeOptionallyBlockable; | 325 contextType = ContextTypeOptionallyBlockable; |
| 326 | 326 |
| 327 switch (contextType) { | 327 switch (contextType) { |
| 328 case ContextTypeOptionallyBlockable: | 328 case ContextTypeOptionallyBlockable: |
| 329 allowed = !strictMode && client->allowDisplayingInsecureContent(settings
&& settings->allowDisplayOfInsecureContent(), securityOrigin, url); | 329 allowed = !strictMode && client->allowDisplayingInsecureContent(settings
&& settings->allowDisplayOfInsecureContent(), url); |
| 330 if (allowed) | 330 if (allowed) |
| 331 client->didDisplayInsecureContent(); | 331 client->didDisplayInsecureContent(); |
| 332 break; | 332 break; |
| 333 | 333 |
| 334 case ContextTypeBlockable: { | 334 case ContextTypeBlockable: { |
| 335 // Strictly block subresources in subframes, unless all insecure | 335 // Strictly block subresources in subframes, unless all insecure |
| 336 // content is allowed. | 336 // content is allowed. |
| 337 if (!settings->allowRunningOfInsecureContent() && requestIsSubframeSubre
source(frame, frameType)) { | 337 if (!settings->allowRunningOfInsecureContent() && requestIsSubframeSubre
source(frame, frameType)) { |
| 338 UseCounter::count(mixedFrame, UseCounter::BlockableMixedContentInSub
frameBlocked); | 338 UseCounter::count(mixedFrame, UseCounter::BlockableMixedContentInSub
frameBlocked); |
| 339 allowed = false; | 339 allowed = false; |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 | 488 |
| 489 // See comment in shouldBlockFetch() about loading the main resource of a su
bframe. | 489 // See comment in shouldBlockFetch() about loading the main resource of a su
bframe. |
| 490 if (request.frameType() == WebURLRequest::FrameTypeNested && !SchemeRegistry
::shouldTreatURLSchemeAsCORSEnabled(request.url().protocol())) { | 490 if (request.frameType() == WebURLRequest::FrameTypeNested && !SchemeRegistry
::shouldTreatURLSchemeAsCORSEnabled(request.url().protocol())) { |
| 491 return ContextTypeOptionallyBlockable; | 491 return ContextTypeOptionallyBlockable; |
| 492 } | 492 } |
| 493 | 493 |
| 494 return contextTypeFromContext(request.requestContext(), mixedFrame); | 494 return contextTypeFromContext(request.requestContext(), mixedFrame); |
| 495 } | 495 } |
| 496 | 496 |
| 497 } // namespace blink | 497 } // namespace blink |
| OLD | NEW |