| 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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 | 242 |
| 243 Settings* settings = frame->settings(); | 243 Settings* settings = frame->settings(); |
| 244 FrameLoaderClient* client = frame->loader().client(); | 244 FrameLoaderClient* client = frame->loader().client(); |
| 245 SecurityOrigin* securityOrigin = frame->document()->securityOrigin(); | 245 SecurityOrigin* securityOrigin = frame->document()->securityOrigin(); |
| 246 bool allowed = false; | 246 bool allowed = false; |
| 247 | 247 |
| 248 ContextType contextType = contextTypeFromContext(resourceRequest.requestCont
ext()); | 248 ContextType contextType = contextTypeFromContext(resourceRequest.requestCont
ext()); |
| 249 if (contextType == ContextTypeBlockableUnlessLax) | 249 if (contextType == ContextTypeBlockableUnlessLax) |
| 250 contextType = RuntimeEnabledFeatures::laxMixedContentCheckingEnabled() ?
ContextTypeOptionallyBlockable : ContextTypeBlockable; | 250 contextType = RuntimeEnabledFeatures::laxMixedContentCheckingEnabled() ?
ContextTypeOptionallyBlockable : ContextTypeBlockable; |
| 251 | 251 |
| 252 // If we're loading the main resource of a subframe, we need to take a close
look at the loaded URL. |
| 253 // If we're dealing with a CORS-enabled scheme, then block mixed frames as a
ctive content. Otherwise, |
| 254 // treat frames as passive content. |
| 255 // |
| 256 // FIXME: Remove this temporary hack once we have a reasonable API for launc
hing external applications |
| 257 // via URLs. http://crbug.com/318788 and https://crbug.com/393481 |
| 258 if (resourceRequest.frameType() == WebURLRequest::FrameTypeNested && !Scheme
Registry::shouldTreatURLSchemeAsCORSEnabled(url.protocol())) |
| 259 contextType = ContextTypeOptionallyBlockable; |
| 260 |
| 252 switch (contextType) { | 261 switch (contextType) { |
| 253 case ContextTypeOptionallyBlockable: | 262 case ContextTypeOptionallyBlockable: |
| 254 allowed = client->allowDisplayingInsecureContent(settings && settings->a
llowDisplayOfInsecureContent(), securityOrigin, url); | 263 allowed = client->allowDisplayingInsecureContent(settings && settings->a
llowDisplayOfInsecureContent(), securityOrigin, url); |
| 255 if (allowed) | 264 if (allowed) |
| 256 client->didDisplayInsecureContent(); | 265 client->didDisplayInsecureContent(); |
| 257 break; | 266 break; |
| 258 | 267 |
| 259 case ContextTypeBlockable: | 268 case ContextTypeBlockable: |
| 260 allowed = client->allowRunningInsecureContent(settings && settings->allo
wRunningOfInsecureContent(), securityOrigin, url); | 269 allowed = client->allowRunningInsecureContent(settings && settings->allo
wRunningOfInsecureContent(), securityOrigin, url); |
| 261 if (allowed) | 270 if (allowed) |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 if (Platform::current()->isReservedIPAddress(resourceIP) && !Platform::curre
nt()->isReservedIPAddress(documentIP)) | 415 if (Platform::current()->isReservedIPAddress(resourceIP) && !Platform::curre
nt()->isReservedIPAddress(documentIP)) |
| 407 UseCounter::count(frame->document(), UseCounter::MixedContentPrivateHost
nameInPublicHostname); | 416 UseCounter::count(frame->document(), UseCounter::MixedContentPrivateHost
nameInPublicHostname); |
| 408 } | 417 } |
| 409 | 418 |
| 410 void MixedContentChecker::trace(Visitor* visitor) | 419 void MixedContentChecker::trace(Visitor* visitor) |
| 411 { | 420 { |
| 412 visitor->trace(m_frame); | 421 visitor->trace(m_frame); |
| 413 } | 422 } |
| 414 | 423 |
| 415 } // namespace blink | 424 } // namespace blink |
| OLD | NEW |