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

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

Issue 1099613003: Oilpan: have xml/ objects on the heap by default. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: simplify XPathResult dtor Created 5 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
« no previous file with comments | « Source/core/xml/XPathEvaluator.h ('k') | Source/core/xml/XPathEvaluator.idl » ('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 Computer, Inc. 3 * Copyright (C) 2006 Apple Computer, Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 21 matching lines...) Expand all
32 #include "core/dom/Node.h" 32 #include "core/dom/Node.h"
33 #include "core/xml/NativeXPathNSResolver.h" 33 #include "core/xml/NativeXPathNSResolver.h"
34 #include "core/xml/XPathExpression.h" 34 #include "core/xml/XPathExpression.h"
35 #include "core/xml/XPathResult.h" 35 #include "core/xml/XPathResult.h"
36 #include "core/xml/XPathUtil.h" 36 #include "core/xml/XPathUtil.h"
37 37
38 namespace blink { 38 namespace blink {
39 39
40 using namespace XPath; 40 using namespace XPath;
41 41
42 PassRefPtrWillBeRawPtr<XPathExpression> XPathEvaluator::createExpression(const S tring& expression, PassRefPtrWillBeRawPtr<XPathNSResolver> resolver, ExceptionSt ate& exceptionState) 42 XPathExpression* XPathEvaluator::createExpression(const String& expression, XPat hNSResolver* resolver, ExceptionState& exceptionState)
43 { 43 {
44 return XPathExpression::createExpression(expression, resolver, exceptionStat e); 44 return XPathExpression::createExpression(expression, resolver, exceptionStat e);
45 } 45 }
46 46
47 PassRefPtrWillBeRawPtr<XPathNSResolver> XPathEvaluator::createNSResolver(Node* n odeResolver) 47 XPathNSResolver* XPathEvaluator::createNSResolver(Node* nodeResolver)
48 { 48 {
49 return NativeXPathNSResolver::create(nodeResolver); 49 return NativeXPathNSResolver::create(nodeResolver);
50 } 50 }
51 51
52 PassRefPtrWillBeRawPtr<XPathResult> XPathEvaluator::evaluate(const String& expre ssion, Node* contextNode, 52 XPathResult* XPathEvaluator::evaluate(const String& expression, Node* contextNod e, XPathNSResolver* resolver, unsigned short type, const ScriptValue&, Exception State& exceptionState)
53 PassRefPtrWillBeRawPtr<XPathNSResolver> resolver, unsigned short type, const ScriptValue&, ExceptionState& exceptionState)
54 { 53 {
55 if (!isValidContextNode(contextNode)) { 54 if (!isValidContextNode(contextNode)) {
56 exceptionState.throwDOMException(NotSupportedError, "The node provided i s '" + contextNode->nodeName() + "', which is not a valid context node type."); 55 exceptionState.throwDOMException(NotSupportedError, "The node provided i s '" + contextNode->nodeName() + "', which is not a valid context node type.");
57 return nullptr; 56 return nullptr;
58 } 57 }
59 58
60 RefPtrWillBeRawPtr<XPathExpression> expr = createExpression(expression, reso lver, exceptionState); 59 XPathExpression* expr = createExpression(expression, resolver, exceptionStat e);
61 if (exceptionState.hadException()) 60 if (exceptionState.hadException())
62 return nullptr; 61 return nullptr;
63 62
64 return expr->evaluate(contextNode, type, ScriptValue(), exceptionState); 63 return expr->evaluate(contextNode, type, ScriptValue(), exceptionState);
65 } 64 }
66 65
67 } 66 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/xml/XPathEvaluator.h ('k') | Source/core/xml/XPathEvaluator.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698