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

Side by Side Diff: third_party/WebKit/Source/core/frame/csp/CSPSource.cpp

Issue 2612793002: Implement ContentSecurityPolicy on the browser-side. (Closed)
Patch Set: Rename SchemeShouldBypass => SchemeShouldBypassCSP. Created 3 years, 10 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/frame/csp/CSPSource.h" 5 #include "core/frame/csp/CSPSource.h"
6 6
7 #include "core/frame/UseCounter.h" 7 #include "core/frame/UseCounter.h"
8 #include "core/frame/csp/ContentSecurityPolicy.h" 8 #include "core/frame/csp/ContentSecurityPolicy.h"
9 #include "platform/weborigin/KURL.h" 9 #include "platform/weborigin/KURL.h"
10 #include "platform/weborigin/KnownPorts.h" 10 #include "platform/weborigin/KnownPorts.h"
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 for (const auto& sourceA : listA) { 198 for (const auto& sourceA : listA) {
199 if ((foundMatch = sourceA->subsumes(sourceB))) 199 if ((foundMatch = sourceA->subsumes(sourceB)))
200 break; 200 break;
201 } 201 }
202 if (!foundMatch) 202 if (!foundMatch)
203 return false; 203 return false;
204 } 204 }
205 return true; 205 return true;
206 } 206 }
207 207
208 WebContentSecurityPolicySourceExpression CSPSource::expose() const {
209 WebContentSecurityPolicySourceExpression sourceExpression;
210 sourceExpression.scheme = m_scheme;
211 sourceExpression.host = m_host;
212 sourceExpression.isHostWildcard = (m_hostWildcard == HasWildcard);
Mike West 2017/02/13 14:10:51 Nit: It seems like we should either use booleans o
arthursonzogni 2017/02/14 17:07:03 Okay, let's use an enum in blink.
213 sourceExpression.port = m_port;
214 sourceExpression.isPortWildcard = (m_portWildcard == HasWildcard);
215 sourceExpression.path = m_path;
216 return sourceExpression;
217 }
218
208 DEFINE_TRACE(CSPSource) { 219 DEFINE_TRACE(CSPSource) {
209 visitor->trace(m_policy); 220 visitor->trace(m_policy);
210 } 221 }
211 222
212 } // namespace blink 223 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698