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

Side by Side Diff: Source/core/frame/csp/ContentSecurityPolicy.cpp

Issue 1326823003: CSP: 'frame-ancestors' should override 'x-frame-options'. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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) 2011 Google, Inc. All rights reserved. 2 * Copyright (C) 2011 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 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 bool ContentSecurityPolicy::allowManifestFromSource(const KURL& url, ContentSecu rityPolicy::RedirectStatus redirectStatus, ContentSecurityPolicy::ReportingStatu s reportingStatus) const 608 bool ContentSecurityPolicy::allowManifestFromSource(const KURL& url, ContentSecu rityPolicy::RedirectStatus redirectStatus, ContentSecurityPolicy::ReportingStatu s reportingStatus) const
609 { 609 {
610 return isAllowedByAllWithURL<&CSPDirectiveList::allowManifestFromSource>(m_p olicies, url, redirectStatus, reportingStatus); 610 return isAllowedByAllWithURL<&CSPDirectiveList::allowManifestFromSource>(m_p olicies, url, redirectStatus, reportingStatus);
611 } 611 }
612 612
613 bool ContentSecurityPolicy::allowAncestors(LocalFrame* frame, const KURL& url, C ontentSecurityPolicy::ReportingStatus reportingStatus) const 613 bool ContentSecurityPolicy::allowAncestors(LocalFrame* frame, const KURL& url, C ontentSecurityPolicy::ReportingStatus reportingStatus) const
614 { 614 {
615 return isAllowedByAllWithFrame<&CSPDirectiveList::allowAncestors>(m_policies , frame, url, reportingStatus); 615 return isAllowedByAllWithFrame<&CSPDirectiveList::allowAncestors>(m_policies , frame, url, reportingStatus);
616 } 616 }
617 617
618 bool ContentSecurityPolicy::isFrameAncestorsEnforced() const
619 {
620 for (const auto& policy : m_policies) {
621 if (policy->isFrameAncestorsEnforced())
622 return true;
623 }
624 return false;
625 }
626
618 bool ContentSecurityPolicy::isActive() const 627 bool ContentSecurityPolicy::isActive() const
619 { 628 {
620 return !m_policies.isEmpty(); 629 return !m_policies.isEmpty();
621 } 630 }
622 631
623 ReflectedXSSDisposition ContentSecurityPolicy::reflectedXSSDisposition() const 632 ReflectedXSSDisposition ContentSecurityPolicy::reflectedXSSDisposition() const
624 { 633 {
625 ReflectedXSSDisposition disposition = ReflectedXSSUnset; 634 ReflectedXSSDisposition disposition = ReflectedXSSUnset;
626 for (const auto& policy : m_policies) { 635 for (const auto& policy : m_policies) {
627 if (policy->reflectedXSSDisposition() > disposition) 636 if (policy->reflectedXSSDisposition() > disposition)
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
1008 // Collisions have no security impact, so we can save space by storing only the string's hash rather than the whole report. 1017 // Collisions have no security impact, so we can save space by storing only the string's hash rather than the whole report.
1009 return !m_violationReportsSent.contains(report.impl()->hash()); 1018 return !m_violationReportsSent.contains(report.impl()->hash());
1010 } 1019 }
1011 1020
1012 void ContentSecurityPolicy::didSendViolationReport(const String& report) 1021 void ContentSecurityPolicy::didSendViolationReport(const String& report)
1013 { 1022 {
1014 m_violationReportsSent.add(report.impl()->hash()); 1023 m_violationReportsSent.add(report.impl()->hash());
1015 } 1024 }
1016 1025
1017 } // namespace blink 1026 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698