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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLIFrameElement.cpp

Issue 2372563002: Adding Embedding-CSP HTTP header (Closed)
Patch Set: Check for ascii and add console error message Created 4 years, 2 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Simon Hausmann (hausmann@kde.org) 4 * (C) 2000 Simon Hausmann (hausmann@kde.org)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * Copyright (C) 2004, 2006, 2008, 2009 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2006, 2008, 2009 Apple Inc. All rights reserved.
7 * Copyright (C) 2009 Ericsson AB. All rights reserved. 7 * Copyright (C) 2009 Ericsson AB. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 SecurityPolicy::referrerPolicyFromStringWithLegacyKeywords(value, &m _referrerPolicy); 114 SecurityPolicy::referrerPolicyFromStringWithLegacyKeywords(value, &m _referrerPolicy);
115 } else if (name == allowfullscreenAttr) { 115 } else if (name == allowfullscreenAttr) {
116 bool oldAllowFullscreen = m_allowFullscreen; 116 bool oldAllowFullscreen = m_allowFullscreen;
117 m_allowFullscreen = !value.isNull(); 117 m_allowFullscreen = !value.isNull();
118 if (m_allowFullscreen != oldAllowFullscreen) 118 if (m_allowFullscreen != oldAllowFullscreen)
119 frameOwnerPropertiesChanged(); 119 frameOwnerPropertiesChanged();
120 } else if (name == permissionsAttr) { 120 } else if (name == permissionsAttr) {
121 if (initializePermissionsAttribute()) 121 if (initializePermissionsAttribute())
122 m_permissions->setValue(value); 122 m_permissions->setValue(value);
123 } else if (RuntimeEnabledFeatures::embedderCSPEnforcementEnabled() && name = = cspAttr) { 123 } else if (RuntimeEnabledFeatures::embedderCSPEnforcementEnabled() && name = = cspAttr) {
124 for (size_t i = 0; i < value.length(); ++i) {
Mike West 2016/09/29 13:33:13 You can replace this loop with `value.containsOnly
125 if (!isASCII(value[i])) {
126 document().addConsoleMessage(ConsoleMessage::create(OtherMessage Source, ErrorMessageLevel, "'csp' attribute contains non-ASCII characters: " + v alue));
127 return;
128 }
129 }
124 AtomicString oldCSP = m_csp; 130 AtomicString oldCSP = m_csp;
125 m_csp = value; 131 m_csp = value;
126 if (m_csp != oldCSP) 132 if (m_csp != oldCSP)
127 frameOwnerPropertiesChanged(); 133 frameOwnerPropertiesChanged();
128 } else { 134 } else {
129 if (name == srcAttr) 135 if (name == srcAttr)
130 logUpdateAttributeIfIsolatedWorldAndInDocument("iframe", srcAttr, ol dValue, value); 136 logUpdateAttributeIfIsolatedWorldAndInDocument("iframe", srcAttr, ol dValue, value);
131 HTMLFrameElementBase::parseAttribute(name, oldValue, value); 137 HTMLFrameElementBase::parseAttribute(name, oldValue, value);
132 } 138 }
133 } 139 }
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 { 200 {
195 if (!RuntimeEnabledFeatures::permissionDelegationEnabled()) 201 if (!RuntimeEnabledFeatures::permissionDelegationEnabled())
196 return false; 202 return false;
197 203
198 if (!m_permissions) 204 if (!m_permissions)
199 m_permissions = HTMLIFrameElementPermissions::create(this); 205 m_permissions = HTMLIFrameElementPermissions::create(this);
200 return true; 206 return true;
201 } 207 }
202 208
203 } // namespace blink 209 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698