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

Side by Side Diff: src/xml/SkDOM.cpp

Issue 2154733003: Remove SkDOM::build(const char doc[], size_t len) (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: rebase Created 4 years, 5 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 | « include/xml/SkDOM.h ('k') | tests/SkDOMTest.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 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 8
9 #include "SkDOM.h" 9 #include "SkDOM.h"
10 #include "SkStream.h" 10 #include "SkStream.h"
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 { 316 {
317 SkDEBUGCODE(SkDebugf("xml parse error, line %d\n", parser.fParserError.g etLineNumber());) 317 SkDEBUGCODE(SkDebugf("xml parse error, line %d\n", parser.fParserError.g etLineNumber());)
318 fRoot = nullptr; 318 fRoot = nullptr;
319 fAlloc.reset(); 319 fAlloc.reset();
320 return nullptr; 320 return nullptr;
321 } 321 }
322 fRoot = parser.getRoot(); 322 fRoot = parser.getRoot();
323 return fRoot; 323 return fRoot;
324 } 324 }
325 325
326 const SkDOM::Node* SkDOM::build(const char doc[], size_t len) {
327 SkMemoryStream docStream(doc, len);
328 return this->build(docStream);
329 }
330
331 /////////////////////////////////////////////////////////////////////////// 326 ///////////////////////////////////////////////////////////////////////////
332 327
333 static void walk_dom(const SkDOM& dom, const SkDOM::Node* node, SkXMLParser* par ser) 328 static void walk_dom(const SkDOM& dom, const SkDOM::Node* node, SkXMLParser* par ser)
334 { 329 {
335 const char* elem = dom.getName(node); 330 const char* elem = dom.getName(node);
336 if (dom.getType(node) == SkDOM::kText_Type) { 331 if (dom.getType(node) == SkDOM::kText_Type) {
337 SkASSERT(dom.countChildren(node) == 0); 332 SkASSERT(dom.countChildren(node) == 0);
338 parser->text(elem, SkToInt(strlen(elem))); 333 parser->text(elem, SkToInt(strlen(elem)));
339 return; 334 return;
340 } 335 }
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 { 468 {
474 if (node == nullptr) 469 if (node == nullptr)
475 node = this->getRootNode(); 470 node = this->getRootNode();
476 471
477 SkDebugWStream debugStream; 472 SkDebugWStream debugStream;
478 SkXMLStreamWriter xmlWriter(&debugStream); 473 SkXMLStreamWriter xmlWriter(&debugStream);
479 xmlWriter.writeDOM(*this, node, false); 474 xmlWriter.writeDOM(*this, node, false);
480 } 475 }
481 476
482 #endif 477 #endif
OLDNEW
« no previous file with comments | « include/xml/SkDOM.h ('k') | tests/SkDOMTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698