Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(706)

Side by Side Diff: third_party/WebKit/Source/core/loader/FrameFetchContext.cpp

Issue 2056183002: Implement the `require-sri-for` CSP directive (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated tests Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 517
518 // FIXME: Convert this to check the isolated world's Content Security Policy once webkit.org/b/104520 is solved. 518 // FIXME: Convert this to check the isolated world's Content Security Policy once webkit.org/b/104520 is solved.
519 bool shouldBypassMainWorldCSP = frame()->script().shouldBypassMainWorldCSP() || options.contentSecurityPolicyOption == DoNotCheckContentSecurityPolicy; 519 bool shouldBypassMainWorldCSP = frame()->script().shouldBypassMainWorldCSP() || options.contentSecurityPolicyOption == DoNotCheckContentSecurityPolicy;
520 520
521 // Don't send CSP messages for preloads, we might never actually display tho se items. 521 // Don't send CSP messages for preloads, we might never actually display tho se items.
522 ContentSecurityPolicy::ReportingStatus cspReporting = forPreload ? 522 ContentSecurityPolicy::ReportingStatus cspReporting = forPreload ?
523 ContentSecurityPolicy::SuppressReport : ContentSecurityPolicy::SendRepor t; 523 ContentSecurityPolicy::SuppressReport : ContentSecurityPolicy::SendRepor t;
524 524
525 if (m_document) { 525 if (m_document) {
526 DCHECK(m_document->contentSecurityPolicy()); 526 DCHECK(m_document->contentSecurityPolicy());
527 if (!shouldBypassMainWorldCSP && !m_document->contentSecurityPolicy()->a llowRequest(resourceRequest.requestContext(), url, options.contentSecurityPolicy Nonce, redirectStatus, cspReporting)) 527 if (!shouldBypassMainWorldCSP && !m_document->contentSecurityPolicy()->a llowRequest(resourceRequest.requestContext(), url, options.contentSecurityPolicy Nonce, options.integrityMetadata, redirectStatus, cspReporting))
528 return ResourceRequestBlockedReasonCSP; 528 return ResourceRequestBlockedReasonCSP;
529 } 529 }
530 530
531 if (type == Resource::Script || type == Resource::ImportResource) { 531 if (type == Resource::Script || type == Resource::ImportResource) {
532 ASSERT(frame()); 532 ASSERT(frame());
533 if (!frame()->loader().client()->allowScriptFromSource(!frame()->setting s() || frame()->settings()->scriptEnabled(), url)) { 533 if (!frame()->loader().client()->allowScriptFromSource(!frame()->setting s() || frame()->settings()->scriptEnabled(), url)) {
534 frame()->loader().client()->didNotAllowScript(); 534 frame()->loader().client()->didNotAllowScript();
535 // TODO(estark): Use a different ResourceRequestBlockedReason 535 // TODO(estark): Use a different ResourceRequestBlockedReason
536 // here, since this check has nothing to do with 536 // here, since this check has nothing to do with
537 // CSP. https://crbug.com/600795 537 // CSP. https://crbug.com/600795
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 } 757 }
758 758
759 DEFINE_TRACE(FrameFetchContext) 759 DEFINE_TRACE(FrameFetchContext)
760 { 760 {
761 visitor->trace(m_document); 761 visitor->trace(m_document);
762 visitor->trace(m_documentLoader); 762 visitor->trace(m_documentLoader);
763 FetchContext::trace(visitor); 763 FetchContext::trace(visitor);
764 } 764 }
765 765
766 } // namespace blink 766 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLLinkElement.cpp ('k') | third_party/WebKit/Source/core/workers/AbstractWorker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698