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

Unified Diff: Source/core/frame/csp/CSPDirectiveList.cpp

Issue 1009583003: Add CSP header for resources with an active policy (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: test tweaks Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/frame/csp/CSPDirectiveList.cpp
diff --git a/Source/core/frame/csp/CSPDirectiveList.cpp b/Source/core/frame/csp/CSPDirectiveList.cpp
index e7dbb996d57cd1090d3233ed4aafc458d2a35e19..da027ad89b46f6bba0b8db88477502e712316b8c 100644
--- a/Source/core/frame/csp/CSPDirectiveList.cpp
+++ b/Source/core/frame/csp/CSPDirectiveList.cpp
@@ -408,6 +408,36 @@ const String& CSPDirectiveList::pluginTypesText() const
return m_pluginTypes->text();
}
+bool CSPDirectiveList::hasScriptPolicy() const
+{
+ return !!operativeDirective(m_scriptSrc.get());
+}
+
+bool CSPDirectiveList::hasStylePolicy() const
+{
+ return !!operativeDirective(m_styleSrc.get());
+}
+
+bool CSPDirectiveList::hasImagePolicy() const
+{
+ return !!operativeDirective(m_imgSrc.get());
+}
+
+bool CSPDirectiveList::hasFontPolicy() const
+{
+ return !!operativeDirective(m_fontSrc.get());
+}
+
+bool CSPDirectiveList::hasMediaPolicy() const
+{
+ return !!operativeDirective(m_mediaSrc.get());
+}
+
+bool CSPDirectiveList::hasPluginPolicy() const
+{
+ return !!operativeDirective(m_objectSrc.get());
Mike West 2015/03/16 10:39:11 Should this take `plugin-types` into account as we
estark 2015/03/17 18:27:34 I can't quite figure out if it's necessary or not,
+}
+
// policy = directive-list
// directive-list = [ directive *( ";" [ directive ] ) ]
//

Powered by Google App Engine
This is Rietveld 408576698