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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 | 305 |
306 MixedContentChecker::count(mixedFrame, requestContext); | 306 MixedContentChecker::count(mixedFrame, requestContext); |
307 | 307 |
308 Settings* settings = mixedFrame->settings(); | 308 Settings* settings = mixedFrame->settings(); |
309 FrameLoaderClient* client = mixedFrame->loader().client(); | 309 FrameLoaderClient* client = mixedFrame->loader().client(); |
310 SecurityOrigin* securityOrigin = mixedFrame->document()->securityOrigin(); | 310 SecurityOrigin* securityOrigin = mixedFrame->document()->securityOrigin(); |
311 bool allowed = false; | 311 bool allowed = false; |
312 | 312 |
313 // If we're in strict mode, we'll automagically fail everything, and intenti
onally skip | 313 // If we're in strict mode, we'll automagically fail everything, and intenti
onally skip |
314 // the client checks in order to prevent degrading the site's security UI. | 314 // the client checks in order to prevent degrading the site's security UI. |
315 bool strictMode = mixedFrame->document()->shouldEnforceStrictMixedContentChe
cking() || settings->strictMixedContentChecking(); | 315 bool strictMode = mixedFrame->securityContext()->shouldEnforceStrictMixedCon
tentChecking() || settings->strictMixedContentChecking(); |
316 | 316 |
317 ContextType contextType = contextTypeFromContext(requestContext, mixedFrame)
; | 317 ContextType contextType = contextTypeFromContext(requestContext, mixedFrame)
; |
318 | 318 |
319 // If we're loading the main resource of a subframe, we need to take a close
look at the loaded URL. | 319 // If we're loading the main resource of a subframe, we need to take a close
look at the loaded URL. |
320 // If we're dealing with a CORS-enabled scheme, then block mixed frames as a
ctive content. Otherwise, | 320 // If we're dealing with a CORS-enabled scheme, then block mixed frames as a
ctive content. Otherwise, |
321 // treat frames as passive content. | 321 // treat frames as passive content. |
322 // | 322 // |
323 // FIXME: Remove this temporary hack once we have a reasonable API for launc
hing external applications | 323 // FIXME: Remove this temporary hack once we have a reasonable API for launc
hing external applications |
324 // via URLs. http://crbug.com/318788 and https://crbug.com/393481 | 324 // via URLs. http://crbug.com/318788 and https://crbug.com/393481 |
325 if (frameType == WebURLRequest::FrameTypeNested && !SchemeRegistry::shouldTr
eatURLSchemeAsCORSEnabled(url.protocol())) | 325 if (frameType == WebURLRequest::FrameTypeNested && !SchemeRegistry::shouldTr
eatURLSchemeAsCORSEnabled(url.protocol())) |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 | 468 |
469 // See comment in shouldBlockFetch() about loading the main resource of a su
bframe. | 469 // See comment in shouldBlockFetch() about loading the main resource of a su
bframe. |
470 if (request.frameType() == WebURLRequest::FrameTypeNested && !SchemeRegistry
::shouldTreatURLSchemeAsCORSEnabled(request.url().protocol())) { | 470 if (request.frameType() == WebURLRequest::FrameTypeNested && !SchemeRegistry
::shouldTreatURLSchemeAsCORSEnabled(request.url().protocol())) { |
471 return ContextTypeOptionallyBlockable; | 471 return ContextTypeOptionallyBlockable; |
472 } | 472 } |
473 | 473 |
474 return contextTypeFromContext(request.requestContext(), mixedFrame); | 474 return contextTypeFromContext(request.requestContext(), mixedFrame); |
475 } | 475 } |
476 | 476 |
477 } // namespace blink | 477 } // namespace blink |
OLD | NEW |