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

Side by Side Diff: third_party/WebKit/Source/core/xml/XPathPredicate.cpp

Issue 1854543002: Oilpan: Remove WillBe types (part 7) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 Frerich Raabe <raabe@kde.org> 2 * Copyright 2005 Frerich Raabe <raabe@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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 } 249 }
250 250
251 Value Union::evaluate(EvaluationContext& context) const 251 Value Union::evaluate(EvaluationContext& context) const
252 { 252 {
253 Value lhsResult = subExpr(0)->evaluate(context); 253 Value lhsResult = subExpr(0)->evaluate(context);
254 Value rhs = subExpr(1)->evaluate(context); 254 Value rhs = subExpr(1)->evaluate(context);
255 255
256 NodeSet& resultSet = lhsResult.modifiableNodeSet(context); 256 NodeSet& resultSet = lhsResult.modifiableNodeSet(context);
257 const NodeSet& rhsNodes = rhs.toNodeSet(&context); 257 const NodeSet& rhsNodes = rhs.toNodeSet(&context);
258 258
259 WillBeHeapHashSet<RawPtrWillBeMember<Node>> nodes; 259 HeapHashSet<Member<Node>> nodes;
260 for (size_t i = 0; i < resultSet.size(); ++i) 260 for (size_t i = 0; i < resultSet.size(); ++i)
261 nodes.add(resultSet[i]); 261 nodes.add(resultSet[i]);
262 262
263 for (size_t i = 0; i < rhsNodes.size(); ++i) { 263 for (size_t i = 0; i < rhsNodes.size(); ++i) {
264 Node* node = rhsNodes[i]; 264 Node* node = rhsNodes[i];
265 if (nodes.add(node).isNewEntry) 265 if (nodes.add(node).isNewEntry)
266 resultSet.append(node); 266 resultSet.append(node);
267 } 267 }
268 268
269 // It is also possible to use merge sort to avoid making the result 269 // It is also possible to use merge sort to avoid making the result
(...skipping 22 matching lines...) Expand all
292 // foo[3] means foo[position()=3] 292 // foo[3] means foo[position()=3]
293 if (result.isNumber()) 293 if (result.isNumber())
294 return EqTestOp(EqTestOp::OpcodeEqual, createFunction("position"), new N umber(result.toNumber())).evaluate(context).toBoolean(); 294 return EqTestOp(EqTestOp::OpcodeEqual, createFunction("position"), new N umber(result.toNumber())).evaluate(context).toBoolean();
295 295
296 return result.toBoolean(); 296 return result.toBoolean();
297 } 297 }
298 298
299 } // namespace XPath 299 } // namespace XPath
300 300
301 } // namespace blink 301 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/xml/XPathPath.cpp ('k') | third_party/WebKit/Source/core/xml/XPathResult.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698