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

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

Issue 252633005: Enable WTF::HashSet<OwnPtr<> > (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Met comments from Erik Corry Created 6 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
« no previous file with comments | « Source/core/xml/XPathParser.h ('k') | Source/wtf/HashFunctions.h » ('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 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 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 HashSet<Vector<OwnPtr<Predicate> >*>::iterator pend = m_predicateVectors .end(); 481 HashSet<Vector<OwnPtr<Predicate> >*>::iterator pend = m_predicateVectors .end();
482 for (HashSet<Vector<OwnPtr<Predicate> >*>::iterator it = m_predicateVect ors.begin(); it != pend; ++it) 482 for (HashSet<Vector<OwnPtr<Predicate> >*>::iterator it = m_predicateVect ors.begin(); it != pend; ++it)
483 delete *it; 483 delete *it;
484 m_predicateVectors.clear(); 484 m_predicateVectors.clear();
485 485
486 HashSet<Vector<OwnPtr<Expression> >*>::iterator eend = m_expressionVecto rs.end(); 486 HashSet<Vector<OwnPtr<Expression> >*>::iterator eend = m_expressionVecto rs.end();
487 for (HashSet<Vector<OwnPtr<Expression> >*>::iterator it = m_expressionVe ctors.begin(); it != eend; ++it) 487 for (HashSet<Vector<OwnPtr<Expression> >*>::iterator it = m_expressionVe ctors.begin(); it != eend; ++it)
488 delete *it; 488 delete *it;
489 m_expressionVectors.clear(); 489 m_expressionVectors.clear();
490 490
491 deleteAllValues(m_strings);
492 m_strings.clear(); 491 m_strings.clear();
493 492
494 deleteAllValues(m_nodeTests);
495 m_nodeTests.clear(); 493 m_nodeTests.clear();
496 494
497 m_topExpr = 0; 495 m_topExpr = 0;
498 496
499 if (m_gotNamespaceError) 497 if (m_gotNamespaceError)
500 exceptionState.throwDOMException(NamespaceError, "The string '" + st atement + "' contains unresolvable namespaces."); 498 exceptionState.throwDOMException(NamespaceError, "The string '" + st atement + "' contains unresolvable namespaces.");
501 else 499 else
502 exceptionState.throwDOMException(SyntaxError, "The string '" + state ment + "' is not a valid XPath expression."); 500 exceptionState.throwDOMException(SyntaxError, "The string '" + state ment + "' is not a valid XPath expression.");
503 return 0; 501 return 0;
504 } 502 }
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 delete vector; 578 delete vector;
581 } 579 }
582 580
583 void Parser::registerString(String* s) 581 void Parser::registerString(String* s)
584 { 582 {
585 if (s == 0) 583 if (s == 0)
586 return; 584 return;
587 585
588 ASSERT(!m_strings.contains(s)); 586 ASSERT(!m_strings.contains(s));
589 587
590 m_strings.add(s); 588 m_strings.add(adoptPtr(s));
591 } 589 }
592 590
593 void Parser::deleteString(String* s) 591 void Parser::deleteString(String* s)
594 { 592 {
595 if (s == 0) 593 if (s == 0)
596 return; 594 return;
597 595
598 ASSERT(m_strings.contains(s)); 596 ASSERT(m_strings.contains(s));
599 597
600 m_strings.remove(s); 598 m_strings.remove(s);
601 delete s;
602 } 599 }
603 600
604 void Parser::registerNodeTest(Step::NodeTest* t) 601 void Parser::registerNodeTest(Step::NodeTest* t)
605 { 602 {
606 if (t == 0) 603 if (t == 0)
607 return; 604 return;
608 605
609 ASSERT(!m_nodeTests.contains(t)); 606 ASSERT(!m_nodeTests.contains(t));
610 607
611 m_nodeTests.add(t); 608 m_nodeTests.add(adoptPtr(t));
612 } 609 }
613 610
614 void Parser::deleteNodeTest(Step::NodeTest* t) 611 void Parser::deleteNodeTest(Step::NodeTest* t)
615 { 612 {
616 if (t == 0) 613 if (t == 0)
617 return; 614 return;
618 615
619 ASSERT(m_nodeTests.contains(t)); 616 ASSERT(m_nodeTests.contains(t));
620 617
621 m_nodeTests.remove(t); 618 m_nodeTests.remove(t);
622 delete t;
623 } 619 }
624 620
OLDNEW
« no previous file with comments | « Source/core/xml/XPathParser.h ('k') | Source/wtf/HashFunctions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698