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

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

Issue 2612793002: Implement ContentSecurityPolicy on the browser-side. (Closed)
Patch Set: Add the TODO and bug ids that was forgotten. 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
209 CSPSource::exposeForNavigationalChecks() const {
210 WebContentSecurityPolicySourceExpression sourceExpression;
211 sourceExpression.scheme = m_scheme;
212 sourceExpression.host = m_host;
213 sourceExpression.isHostWildcard =
214 static_cast<WebWildcardDisposition>(m_hostWildcard);
215 sourceExpression.port = m_port;
216 sourceExpression.isPortWildcard =
217 static_cast<WebWildcardDisposition>(m_portWildcard);
218 sourceExpression.path = m_path;
219 return sourceExpression;
220 }
221
208 DEFINE_TRACE(CSPSource) { 222 DEFINE_TRACE(CSPSource) {
209 visitor->trace(m_policy); 223 visitor->trace(m_policy);
210 } 224 }
211 225
212 } // namespace blink 226 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698