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

Side by Side Diff: third_party/WebKit/Source/core/css/parser/CSSParserContext.cpp

Issue 2720933003: Removed FrameHost::useCounter() (Closed)
Patch Set: Created 3 years, 9 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 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/Deprecation.h"
10 #include "core/frame/FrameHost.h"
11 #include "core/frame/Settings.h" 10 #include "core/frame/Settings.h"
12 #include "core/frame/csp/ContentSecurityPolicy.h" 11 #include "core/frame/csp/ContentSecurityPolicy.h"
13 #include "core/html/imports/HTMLImportsController.h" 12 #include "core/html/imports/HTMLImportsController.h"
13 #include "core/page/Page.h"
14 14
15 namespace blink { 15 namespace blink {
16 16
17 // static 17 // static
18 CSSParserContext* CSSParserContext::createWithStyleSheet( 18 CSSParserContext* CSSParserContext::createWithStyleSheet(
19 const CSSParserContext* other, 19 const CSSParserContext* other,
20 const CSSStyleSheet* styleSheet) { 20 const CSSStyleSheet* styleSheet) {
21 return CSSParserContext::create( 21 return CSSParserContext::create(
22 other, CSSStyleSheet::singleOwnerDocument(styleSheet)); 22 other, CSSStyleSheet::singleOwnerDocument(styleSheet));
23 } 23 }
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 if (isUseCounterRecordingEnabled()) 145 if (isUseCounterRecordingEnabled())
146 UseCounter::count(*m_document, feature); 146 UseCounter::count(*m_document, feature);
147 } 147 }
148 148
149 void CSSParserContext::countDeprecation(UseCounter::Feature feature) const { 149 void CSSParserContext::countDeprecation(UseCounter::Feature feature) const {
150 if (isUseCounterRecordingEnabled()) 150 if (isUseCounterRecordingEnabled())
151 Deprecation::countDeprecation(*m_document, feature); 151 Deprecation::countDeprecation(*m_document, feature);
152 } 152 }
153 153
154 void CSSParserContext::count(CSSParserMode mode, CSSPropertyID property) const { 154 void CSSParserContext::count(CSSParserMode mode, CSSPropertyID property) const {
155 if (isUseCounterRecordingEnabled() && m_document->frameHost()) { 155 if (isUseCounterRecordingEnabled() && m_document->page()) {
156 UseCounter* useCounter = &m_document->frameHost()->useCounter(); 156 UseCounter* useCounter = &m_document->page()->useCounter();
157 if (useCounter) 157 if (useCounter)
158 useCounter->count(mode, property); 158 useCounter->count(mode, property);
159 } 159 }
160 } 160 }
161 161
162 bool CSSParserContext::isDocumentHandleEqual(const Document* other) const { 162 bool CSSParserContext::isDocumentHandleEqual(const Document* other) const {
163 return m_document.get() == other; 163 return m_document.get() == other;
164 } 164 }
165 165
166 DEFINE_TRACE(CSSParserContext) { 166 DEFINE_TRACE(CSSParserContext) {
167 visitor->trace(m_document); 167 visitor->trace(m_document);
168 } 168 }
169 169
170 } // namespace blink 170 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/parser/CSSLazyParsingTest.cpp ('k') | third_party/WebKit/Source/core/frame/FrameHost.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698