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

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

Issue 26763004: Vector stores Expression object as OwnPtr instead of raw pointer in XPath. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Change XPathGrammar.y also Created 7 years, 2 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 2005 Maksim Orlovich <maksim@kde.org> 2 * Copyright 2005 Maksim Orlovich <maksim@kde.org>
3 * Copyright (C) 2006 Apple Computer, Inc. 3 * Copyright (C) 2006 Apple Computer, Inc.
4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 deleteAllValues(m_parseNodes); 479 deleteAllValues(m_parseNodes);
480 m_parseNodes.clear(); 480 m_parseNodes.clear();
481 481
482 HashSet<Vector<Predicate*>*>::iterator pend = m_predicateVectors.end(); 482 HashSet<Vector<Predicate*>*>::iterator pend = m_predicateVectors.end();
483 for (HashSet<Vector<Predicate*>*>::iterator it = m_predicateVectors.begi n(); it != pend; ++it) { 483 for (HashSet<Vector<Predicate*>*>::iterator it = m_predicateVectors.begi n(); it != pend; ++it) {
484 deleteAllValues(**it); 484 deleteAllValues(**it);
485 delete *it; 485 delete *it;
486 } 486 }
487 m_predicateVectors.clear(); 487 m_predicateVectors.clear();
488 488
489 HashSet<Vector<Expression*>*>::iterator eend = m_expressionVectors.end() ; 489 HashSet<Vector<OwnPtr<Expression> >*>::iterator eend = m_expressionVecto rs.end();
490 for (HashSet<Vector<Expression*>*>::iterator it = m_expressionVectors.be gin(); it != eend; ++it) { 490 for (HashSet<Vector<OwnPtr<Expression> >*>::iterator it = m_expressionVe ctors.begin(); it != eend; ++it)
491 deleteAllValues(**it);
492 delete *it; 491 delete *it;
493 }
494 m_expressionVectors.clear(); 492 m_expressionVectors.clear();
495 493
496 deleteAllValues(m_strings); 494 deleteAllValues(m_strings);
497 m_strings.clear(); 495 m_strings.clear();
498 496
499 deleteAllValues(m_nodeTests); 497 deleteAllValues(m_nodeTests);
500 m_nodeTests.clear(); 498 m_nodeTests.clear();
501 499
502 m_topExpr = 0; 500 m_topExpr = 0;
503 501
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 if (vector == 0) 555 if (vector == 0)
558 return; 556 return;
559 557
560 ASSERT(m_predicateVectors.contains(vector)); 558 ASSERT(m_predicateVectors.contains(vector));
561 559
562 m_predicateVectors.remove(vector); 560 m_predicateVectors.remove(vector);
563 delete vector; 561 delete vector;
564 } 562 }
565 563
566 564
567 void Parser::registerExpressionVector(Vector<Expression*>* vector) 565 void Parser::registerExpressionVector(Vector<OwnPtr<Expression> >* vector)
568 { 566 {
569 if (vector == 0) 567 if (vector == 0)
570 return; 568 return;
571 569
572 ASSERT(!m_expressionVectors.contains(vector)); 570 ASSERT(!m_expressionVectors.contains(vector));
573 571
574 m_expressionVectors.add(vector); 572 m_expressionVectors.add(vector);
575 } 573 }
576 574
577 void Parser::deleteExpressionVector(Vector<Expression*>* vector) 575 void Parser::deleteExpressionVector(Vector<OwnPtr<Expression> >* vector)
578 { 576 {
579 if (vector == 0) 577 if (vector == 0)
580 return; 578 return;
581 579
582 ASSERT(m_expressionVectors.contains(vector)); 580 ASSERT(m_expressionVectors.contains(vector));
583 581
584 m_expressionVectors.remove(vector); 582 m_expressionVectors.remove(vector);
585 delete vector; 583 delete vector;
586 } 584 }
587 585
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 { 618 {
621 if (t == 0) 619 if (t == 0)
622 return; 620 return;
623 621
624 ASSERT(m_nodeTests.contains(t)); 622 ASSERT(m_nodeTests.contains(t));
625 623
626 m_nodeTests.remove(t); 624 m_nodeTests.remove(t);
627 delete t; 625 delete t;
628 } 626 }
629 627
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698