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

Side by Side Diff: third_party/WebKit/Source/core/dom/StyleElement.cpp

Issue 2873433003: Move MediaQuery classes off BlinkGC heap (Closed)
Patch Set: Created 3 years, 7 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 /* 1 /*
2 * Copyright (C) 2006, 2007 Rob Buis 2 * Copyright (C) 2006, 2007 Rob Buis
3 * Copyright (C) 2008 Apple, Inc. All rights reserved. 3 * Copyright (C) 2008 Apple, Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 element.fastGetAttribute(HTMLNames::nonceAttr), 143 element.fastGetAttribute(HTMLNames::nonceAttr),
144 m_startPosition.m_line, text); 144 m_startPosition.m_line, text);
145 145
146 // Clearing the current sheet may remove the cache entry so create the new 146 // Clearing the current sheet may remove the cache entry so create the new
147 // sheet first 147 // sheet first
148 CSSStyleSheet* newSheet = nullptr; 148 CSSStyleSheet* newSheet = nullptr;
149 149
150 // If type is empty or CSS, this is a CSS style sheet. 150 // If type is empty or CSS, this is a CSS style sheet.
151 const AtomicString& type = this->type(); 151 const AtomicString& type = this->type();
152 if (isCSS(element, type) && passesContentSecurityPolicyChecks) { 152 if (isCSS(element, type) && passesContentSecurityPolicyChecks) {
153 MediaQuerySet* mediaQueries = MediaQuerySet::create(media()); 153 RefPtr<MediaQuerySet> mediaQueries = MediaQuerySet::create(media());
154 154
155 MediaQueryEvaluator screenEval("screen"); 155 MediaQueryEvaluator screenEval("screen");
156 MediaQueryEvaluator printEval("print"); 156 MediaQueryEvaluator printEval("print");
157 if (screenEval.eval(mediaQueries) || printEval.eval(mediaQueries)) { 157 if (screenEval.eval(*mediaQueries) || printEval.eval(*mediaQueries)) {
158 m_loading = true; 158 m_loading = true;
159 TextPosition startPosition = 159 TextPosition startPosition =
160 m_startPosition == TextPosition::belowRangePosition() 160 m_startPosition == TextPosition::belowRangePosition()
161 ? TextPosition::minimumPosition() 161 ? TextPosition::minimumPosition()
162 : m_startPosition; 162 : m_startPosition;
163 newSheet = document.styleEngine().createSheet( 163 newSheet = document.styleEngine().createSheet(
164 element, text, startPosition, m_styleEngineContext); 164 element, text, startPosition, m_styleEngineContext);
165 newSheet->setMediaQueries(mediaQueries); 165 newSheet->setMediaQueries(mediaQueries);
166 m_loading = false; 166 m_loading = false;
167 } 167 }
(...skipping 27 matching lines...) Expand all
195 195
196 void StyleElement::startLoadingDynamicSheet(Document& document) { 196 void StyleElement::startLoadingDynamicSheet(Document& document) {
197 document.styleEngine().addPendingSheet(m_styleEngineContext); 197 document.styleEngine().addPendingSheet(m_styleEngineContext);
198 } 198 }
199 199
200 DEFINE_TRACE(StyleElement) { 200 DEFINE_TRACE(StyleElement) {
201 visitor->trace(m_sheet); 201 visitor->trace(m_sheet);
202 } 202 }
203 203
204 } // namespace blink 204 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698