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

Side by Side Diff: Source/core/xml/XSLStyleSheetLibxslt.cpp

Issue 1161323007: Use nullptr instead of 0 in xml and xmlhttprequest. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated as per review comment & modified in other files which assigned "0" to ptr. Created 5 years, 6 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
« no previous file with comments | « Source/core/xml/XSLImportRule.cpp ('k') | Source/core/xml/XSLTProcessorLibxslt.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of the XSL implementation. 2 * This file is part of the XSL implementation.
3 * 3 *
4 * Copyright (C) 2004, 2005, 2006, 2008, 2012 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2005, 2006, 2008, 2012 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 } 132 }
133 } 133 }
134 134
135 bool XSLStyleSheet::parseString(const String& source) 135 bool XSLStyleSheet::parseString(const String& source)
136 { 136 {
137 // Parse in a single chunk into an xmlDocPtr 137 // Parse in a single chunk into an xmlDocPtr
138 if (!m_stylesheetDocTaken) 138 if (!m_stylesheetDocTaken)
139 xmlFreeDoc(m_stylesheetDoc); 139 xmlFreeDoc(m_stylesheetDoc);
140 m_stylesheetDocTaken = false; 140 m_stylesheetDocTaken = false;
141 141
142 FrameConsole* console = 0; 142 FrameConsole* console = nullptr;
143 if (LocalFrame* frame = ownerDocument()->frame()) 143 if (LocalFrame* frame = ownerDocument()->frame())
144 console = &frame->console(); 144 console = &frame->console();
145 145
146 XMLDocumentParserScope scope(ownerDocument(), XSLTProcessor::genericErrorFun c, XSLTProcessor::parseErrorFunc, console); 146 XMLDocumentParserScope scope(ownerDocument(), XSLTProcessor::genericErrorFun c, XSLTProcessor::parseErrorFunc, console);
147 XMLParserInput input(source); 147 XMLParserInput input(source);
148 148
149 xmlParserCtxtPtr ctxt = xmlCreateMemoryParserCtxt(input.data(), input.size() ); 149 xmlParserCtxtPtr ctxt = xmlCreateMemoryParserCtxt(input.data(), input.size() );
150 if (!ctxt) 150 if (!ctxt)
151 return 0; 151 return 0;
152 152
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 262
263 Document* XSLStyleSheet::ownerDocument() 263 Document* XSLStyleSheet::ownerDocument()
264 { 264 {
265 for (XSLStyleSheet* styleSheet = this; styleSheet; styleSheet = styleSheet-> parentStyleSheet()) { 265 for (XSLStyleSheet* styleSheet = this; styleSheet; styleSheet = styleSheet-> parentStyleSheet()) {
266 if (styleSheet->m_ownerDocument) 266 if (styleSheet->m_ownerDocument)
267 return styleSheet->m_ownerDocument.get(); 267 return styleSheet->m_ownerDocument.get();
268 Node* node = styleSheet->ownerNode(); 268 Node* node = styleSheet->ownerNode();
269 if (node) 269 if (node)
270 return &node->document(); 270 return &node->document();
271 } 271 }
272 return 0; 272 return nullptr;
273 } 273 }
274 274
275 xmlDocPtr XSLStyleSheet::locateStylesheetSubResource(xmlDocPtr parentDoc, const xmlChar* uri) 275 xmlDocPtr XSLStyleSheet::locateStylesheetSubResource(xmlDocPtr parentDoc, const xmlChar* uri)
276 { 276 {
277 bool matchedParent = (parentDoc == document()); 277 bool matchedParent = (parentDoc == document());
278 for (unsigned i = 0; i < m_children.size(); ++i) { 278 for (unsigned i = 0; i < m_children.size(); ++i) {
279 XSLImportRule* import = m_children.at(i).get(); 279 XSLImportRule* import = m_children.at(i).get();
280 XSLStyleSheet* child = import->styleSheet(); 280 XSLStyleSheet* child = import->styleSheet();
281 if (!child) 281 if (!child)
282 continue; 282 continue;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 DEFINE_TRACE(XSLStyleSheet) 319 DEFINE_TRACE(XSLStyleSheet)
320 { 320 {
321 visitor->trace(m_ownerNode); 321 visitor->trace(m_ownerNode);
322 visitor->trace(m_children); 322 visitor->trace(m_children);
323 visitor->trace(m_parentStyleSheet); 323 visitor->trace(m_parentStyleSheet);
324 visitor->trace(m_ownerDocument); 324 visitor->trace(m_ownerDocument);
325 StyleSheet::trace(visitor); 325 StyleSheet::trace(visitor);
326 } 326 }
327 327
328 } // namespace blink 328 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/xml/XSLImportRule.cpp ('k') | Source/core/xml/XSLTProcessorLibxslt.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698