| OLD | NEW |
| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 } | 69 } |
| 70 | 70 |
| 71 bool CSPSource::pathMatches(const KURL& url) const | 71 bool CSPSource::pathMatches(const KURL& url) const |
| 72 { | 72 { |
| 73 if (m_path.isEmpty()) | 73 if (m_path.isEmpty()) |
| 74 return true; | 74 return true; |
| 75 | 75 |
| 76 String path = decodeURLEscapeSequences(url.path()); | 76 String path = decodeURLEscapeSequences(url.path()); |
| 77 | 77 |
| 78 if (m_path.endsWith("/")) | 78 if (m_path.endsWith("/")) |
| 79 return path.startsWith(m_path, TextCaseInsensitive); | 79 return path.startsWith(m_path); |
| 80 | 80 |
| 81 return path == m_path; | 81 return path == m_path; |
| 82 } | 82 } |
| 83 | 83 |
| 84 bool CSPSource::portMatches(const KURL& url) const | 84 bool CSPSource::portMatches(const KURL& url) const |
| 85 { | 85 { |
| 86 if (m_portWildcard == HasWildcard) | 86 if (m_portWildcard == HasWildcard) |
| 87 return true; | 87 return true; |
| 88 | 88 |
| 89 int port = url.port(); | 89 int port = url.port(); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 104 { | 104 { |
| 105 return m_host.isEmpty(); | 105 return m_host.isEmpty(); |
| 106 } | 106 } |
| 107 | 107 |
| 108 DEFINE_TRACE(CSPSource) | 108 DEFINE_TRACE(CSPSource) |
| 109 { | 109 { |
| 110 visitor->trace(m_policy); | 110 visitor->trace(m_policy); |
| 111 } | 111 } |
| 112 | 112 |
| 113 } // namespace blink | 113 } // namespace blink |
| OLD | NEW |