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

Side by Side Diff: Source/core/xml/XPathGrammar.y

Issue 26709019: Vector stores Predicate object as OwnPtr instead of raw pointer in XPath. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
« no previous file with comments | « no previous file | Source/core/xml/XPathParser.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 Frerich Raabe <raabe@kde.org> 2 * Copyright 2005 Frerich Raabe <raabe@kde.org>
3 * Copyright (C) 2006 Apple Inc. All rights reserved. 3 * Copyright (C) 2006 Apple Inc. All rights reserved.
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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 %parse-param { WebCore::XPath::Parser* parser } 55 %parse-param { WebCore::XPath::Parser* parser }
56 56
57 %union 57 %union
58 { 58 {
59 Step::Axis axis; 59 Step::Axis axis;
60 Step::NodeTest* nodeTest; 60 Step::NodeTest* nodeTest;
61 NumericOp::Opcode numop; 61 NumericOp::Opcode numop;
62 EqTestOp::Opcode eqop; 62 EqTestOp::Opcode eqop;
63 String* str; 63 String* str;
64 Expression* expr; 64 Expression* expr;
65 Vector<Predicate*>* predList; 65 Vector<OwnPtr<Predicate> >* predList;
66 Vector<OwnPtr<Expression> >* argList; 66 Vector<OwnPtr<Expression> >* argList;
67 Step* step; 67 Step* step;
68 LocationPath* locationPath; 68 LocationPath* locationPath;
69 } 69 }
70 70
71 %{ 71 %{
72 72
73 static int xpathyylex(YYSTYPE* yylval) { return Parser::current()->lex(yylval); } 73 static int xpathyylex(YYSTYPE* yylval) { return Parser::current()->lex(yylval); }
74 static void xpathyyerror(void*, const char*) { } 74 static void xpathyyerror(void*, const char*) { }
75 75
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 { 284 {
285 $$ = 0; 285 $$ = 0;
286 } 286 }
287 | 287 |
288 PredicateList 288 PredicateList
289 ; 289 ;
290 290
291 PredicateList: 291 PredicateList:
292 Predicate 292 Predicate
293 { 293 {
294 $$ = new Vector<Predicate*>; 294 $$ = new Vector<OwnPtr<Predicate> >;
295 $$->append(new Predicate(adoptPtr($1))); 295 $$->append(adoptPtr(new Predicate(adoptPtr($1))));
296 parser->unregisterParseNode($1); 296 parser->unregisterParseNode($1);
297 parser->registerPredicateVector($$); 297 parser->registerPredicateVector($$);
298 } 298 }
299 | 299 |
300 PredicateList Predicate 300 PredicateList Predicate
301 { 301 {
302 $$->append(new Predicate(adoptPtr($2))); 302 $$->append(adoptPtr(new Predicate(adoptPtr($2))));
303 parser->unregisterParseNode($2); 303 parser->unregisterParseNode($2);
304 } 304 }
305 ; 305 ;
306 306
307 Predicate: 307 Predicate:
308 '[' Expr ']' 308 '[' Expr ']'
309 { 309 {
310 $$ = $2; 310 $$ = $2;
311 } 311 }
312 ; 312 ;
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 MINUS UnaryExpr 545 MINUS UnaryExpr
546 { 546 {
547 $$ = new Negative; 547 $$ = new Negative;
548 $$->addSubExpression(adoptPtr($2)); 548 $$->addSubExpression(adoptPtr($2));
549 parser->unregisterParseNode($2); 549 parser->unregisterParseNode($2);
550 parser->registerParseNode($$); 550 parser->registerParseNode($$);
551 } 551 }
552 ; 552 ;
553 553
554 %% 554 %%
OLDNEW
« no previous file with comments | « no previous file | Source/core/xml/XPathParser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698