OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/css/parser/CSSParserContext.h" | 5 #include "core/css/parser/CSSParserContext.h" |
6 | 6 |
7 #include "core/css/CSSStyleSheet.h" | 7 #include "core/css/CSSStyleSheet.h" |
8 #include "core/css/StyleSheetContents.h" | 8 #include "core/css/StyleSheetContents.h" |
| 9 #include "core/frame/Deprecation.h" |
9 #include "core/frame/FrameHost.h" | 10 #include "core/frame/FrameHost.h" |
10 #include "core/frame/Settings.h" | 11 #include "core/frame/Settings.h" |
11 #include "core/frame/csp/ContentSecurityPolicy.h" | 12 #include "core/frame/csp/ContentSecurityPolicy.h" |
12 #include "core/html/imports/HTMLImportsController.h" | 13 #include "core/html/imports/HTMLImportsController.h" |
13 | 14 |
14 namespace blink { | 15 namespace blink { |
15 | 16 |
16 // static | 17 // static |
17 CSSParserContext* CSSParserContext::createWithStyleSheet( | 18 CSSParserContext* CSSParserContext::createWithStyleSheet( |
18 const CSSParserContext* other, | 19 const CSSParserContext* other, |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 if (charset().isEmpty()) | 139 if (charset().isEmpty()) |
139 return KURL(baseURL(), url); | 140 return KURL(baseURL(), url); |
140 return KURL(baseURL(), url, charset()); | 141 return KURL(baseURL(), url, charset()); |
141 } | 142 } |
142 | 143 |
143 void CSSParserContext::count(UseCounter::Feature feature) const { | 144 void CSSParserContext::count(UseCounter::Feature feature) const { |
144 if (isUseCounterRecordingEnabled()) | 145 if (isUseCounterRecordingEnabled()) |
145 UseCounter::count(*m_document, feature); | 146 UseCounter::count(*m_document, feature); |
146 } | 147 } |
147 | 148 |
| 149 void CSSParserContext::countDeprecation(UseCounter::Feature feature) const { |
| 150 if (isUseCounterRecordingEnabled()) |
| 151 Deprecation::countDeprecation(*m_document, feature); |
| 152 } |
| 153 |
148 void CSSParserContext::count(CSSParserMode mode, CSSPropertyID property) const { | 154 void CSSParserContext::count(CSSParserMode mode, CSSPropertyID property) const { |
149 if (isUseCounterRecordingEnabled() && m_document->frameHost()) { | 155 if (isUseCounterRecordingEnabled() && m_document->frameHost()) { |
150 UseCounter* useCounter = &m_document->frameHost()->useCounter(); | 156 UseCounter* useCounter = &m_document->frameHost()->useCounter(); |
151 if (useCounter) | 157 if (useCounter) |
152 useCounter->count(mode, property); | 158 useCounter->count(mode, property); |
153 } | 159 } |
154 } | 160 } |
155 | 161 |
156 bool CSSParserContext::isDocumentHandleEqual(const Document* other) const { | 162 bool CSSParserContext::isDocumentHandleEqual(const Document* other) const { |
157 return m_document.get() == other; | 163 return m_document.get() == other; |
158 } | 164 } |
159 | 165 |
160 DEFINE_TRACE(CSSParserContext) { | 166 DEFINE_TRACE(CSSParserContext) { |
161 visitor->trace(m_document); | 167 visitor->trace(m_document); |
162 } | 168 } |
163 | 169 |
164 } // namespace blink | 170 } // namespace blink |
OLD | NEW |