| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 | 518 |
| 519 // FIXME: Convert this to check the isolated world's Content Security Policy
once webkit.org/b/104520 is solved. | 519 // FIXME: Convert this to check the isolated world's Content Security Policy
once webkit.org/b/104520 is solved. |
| 520 bool shouldBypassMainWorldCSP = frame()->script().shouldBypassMainWorldCSP()
|| options.contentSecurityPolicyOption == DoNotCheckContentSecurityPolicy; | 520 bool shouldBypassMainWorldCSP = frame()->script().shouldBypassMainWorldCSP()
|| options.contentSecurityPolicyOption == DoNotCheckContentSecurityPolicy; |
| 521 | 521 |
| 522 // Don't send CSP messages for preloads, we might never actually display tho
se items. | 522 // Don't send CSP messages for preloads, we might never actually display tho
se items. |
| 523 ContentSecurityPolicy::ReportingStatus cspReporting = forPreload ? | 523 ContentSecurityPolicy::ReportingStatus cspReporting = forPreload ? |
| 524 ContentSecurityPolicy::SuppressReport : ContentSecurityPolicy::SendRepor
t; | 524 ContentSecurityPolicy::SuppressReport : ContentSecurityPolicy::SendRepor
t; |
| 525 | 525 |
| 526 if (m_document) { | 526 if (m_document) { |
| 527 DCHECK(m_document->contentSecurityPolicy()); | 527 DCHECK(m_document->contentSecurityPolicy()); |
| 528 if (!shouldBypassMainWorldCSP && !m_document->contentSecurityPolicy()->a
llowRequest(resourceRequest.requestContext(), url, redirectStatus, cspReporting)
) | 528 if (!shouldBypassMainWorldCSP && !m_document->contentSecurityPolicy()->a
llowRequest(resourceRequest.requestContext(), url, options.contentSecurityPolicy
Nonce, redirectStatus, cspReporting)) |
| 529 return ResourceRequestBlockedReasonCSP; | 529 return ResourceRequestBlockedReasonCSP; |
| 530 } | 530 } |
| 531 | 531 |
| 532 if (type == Resource::Script || type == Resource::ImportResource) { | 532 if (type == Resource::Script || type == Resource::ImportResource) { |
| 533 ASSERT(frame()); | 533 ASSERT(frame()); |
| 534 if (!frame()->loader().client()->allowScriptFromSource(!frame()->setting
s() || frame()->settings()->scriptEnabled(), url)) { | 534 if (!frame()->loader().client()->allowScriptFromSource(!frame()->setting
s() || frame()->settings()->scriptEnabled(), url)) { |
| 535 frame()->loader().client()->didNotAllowScript(); | 535 frame()->loader().client()->didNotAllowScript(); |
| 536 // TODO(estark): Use a different ResourceRequestBlockedReason | 536 // TODO(estark): Use a different ResourceRequestBlockedReason |
| 537 // here, since this check has nothing to do with | 537 // here, since this check has nothing to do with |
| 538 // CSP. https://crbug.com/600795 | 538 // CSP. https://crbug.com/600795 |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 803 } | 803 } |
| 804 | 804 |
| 805 DEFINE_TRACE(FrameFetchContext) | 805 DEFINE_TRACE(FrameFetchContext) |
| 806 { | 806 { |
| 807 visitor->trace(m_document); | 807 visitor->trace(m_document); |
| 808 visitor->trace(m_documentLoader); | 808 visitor->trace(m_documentLoader); |
| 809 FetchContext::trace(visitor); | 809 FetchContext::trace(visitor); |
| 810 } | 810 } |
| 811 | 811 |
| 812 } // namespace blink | 812 } // namespace blink |
| OLD | NEW |