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

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

Issue 2616093003: Make CSSParserContext be garbage collected. (Closed)
Patch Set: fix fuzzer compile again Created 3 years, 11 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) 2000 Peter Kelly (pmk@post.com) 2 * Copyright (C) 2000 Peter Kelly (pmk@post.com)
3 * Copyright (C) 2006, 2008, 2009 Apple Inc. All rights reserved. 3 * Copyright (C) 2006, 2008, 2009 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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 const String& href, 188 const String& href,
189 const KURL& baseURL, 189 const KURL& baseURL,
190 const String& charset, 190 const String& charset,
191 const CSSStyleSheetResource* sheet) { 191 const CSSStyleSheetResource* sheet) {
192 if (!isConnected()) { 192 if (!isConnected()) {
193 DCHECK(!m_sheet); 193 DCHECK(!m_sheet);
194 return; 194 return;
195 } 195 }
196 196
197 DCHECK(m_isCSS); 197 DCHECK(m_isCSS);
198 CSSParserContext parserContext(document(), nullptr, baseURL, charset); 198 CSSParserContext* parserContext =
199 CSSParserContext::create(document(), baseURL, charset);
199 200
200 StyleSheetContents* newSheet = 201 StyleSheetContents* newSheet =
201 StyleSheetContents::create(href, parserContext); 202 StyleSheetContents::create(href, parserContext);
202 203
203 CSSStyleSheet* cssSheet = CSSStyleSheet::create(newSheet, *this); 204 CSSStyleSheet* cssSheet = CSSStyleSheet::create(newSheet, *this);
204 cssSheet->setDisabled(m_alternate); 205 cssSheet->setDisabled(m_alternate);
205 cssSheet->setTitle(m_title); 206 cssSheet->setTitle(m_title);
206 if (!m_alternate && !m_title.isEmpty()) 207 if (!m_alternate && !m_title.isEmpty())
207 document().styleEngine().setPreferredStylesheetSetNameIfNotSet(m_title); 208 document().styleEngine().setPreferredStylesheetSetNameIfNotSet(m_title);
208 cssSheet->setMediaQueries(MediaQuerySet::create(m_media)); 209 cssSheet->setMediaQueries(MediaQuerySet::create(m_media));
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 } 292 }
292 293
293 DEFINE_TRACE(ProcessingInstruction) { 294 DEFINE_TRACE(ProcessingInstruction) {
294 visitor->trace(m_sheet); 295 visitor->trace(m_sheet);
295 visitor->trace(m_listenerForXSLT); 296 visitor->trace(m_listenerForXSLT);
296 CharacterData::trace(visitor); 297 CharacterData::trace(visitor);
297 ResourceOwner<StyleSheetResource>::trace(visitor); 298 ResourceOwner<StyleSheetResource>::trace(visitor);
298 } 299 }
299 300
300 } // namespace blink 301 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/CSSSelectorWatch.cpp ('k') | third_party/WebKit/Source/core/dom/SelectorQuery.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698