Index: Source/core/xml/DocumentXPathEvaluator.cpp |
diff --git a/Source/core/xml/DocumentXPathEvaluator.cpp b/Source/core/xml/DocumentXPathEvaluator.cpp |
index d14ca546074939b0c9fb659b0b722e578096aad2..173ac063e495f9db491bc3d6a200ca082a0a00b2 100644 |
--- a/Source/core/xml/DocumentXPathEvaluator.cpp |
+++ b/Source/core/xml/DocumentXPathEvaluator.cpp |
@@ -41,41 +41,41 @@ DocumentXPathEvaluator::~DocumentXPathEvaluator() |
{ |
} |
-DocumentXPathEvaluator* DocumentXPathEvaluator::from(DocumentSupplementable* document) |
+DocumentXPathEvaluator& DocumentXPathEvaluator::from(DocumentSupplementable& document) |
{ |
DocumentXPathEvaluator* cache = static_cast<DocumentXPathEvaluator*>(DocumentSupplement::from(document, supplementName())); |
if (!cache) { |
cache = new DocumentXPathEvaluator(); |
DocumentSupplement::provideTo(document, supplementName(), adoptPtr(cache)); |
} |
- return cache; |
+ return *cache; |
} |
-PassRefPtr<XPathExpression> DocumentXPathEvaluator::createExpression(DocumentSupplementable* document, |
+PassRefPtr<XPathExpression> DocumentXPathEvaluator::createExpression(DocumentSupplementable& document, |
const String& expression, PassRefPtr<XPathNSResolver> resolver, ExceptionState& exceptionState) |
{ |
- DocumentXPathEvaluator* suplement = from(document); |
- if (!suplement->m_xpathEvaluator) |
- suplement->m_xpathEvaluator = XPathEvaluator::create(); |
- return suplement->m_xpathEvaluator->createExpression(expression, resolver, exceptionState); |
+ DocumentXPathEvaluator& suplement = from(document); |
+ if (!suplement.m_xpathEvaluator) |
+ suplement.m_xpathEvaluator = XPathEvaluator::create(); |
+ return suplement.m_xpathEvaluator->createExpression(expression, resolver, exceptionState); |
} |
-PassRefPtr<XPathNSResolver> DocumentXPathEvaluator::createNSResolver(DocumentSupplementable* document, Node* nodeResolver) |
+PassRefPtr<XPathNSResolver> DocumentXPathEvaluator::createNSResolver(DocumentSupplementable& document, Node* nodeResolver) |
{ |
- DocumentXPathEvaluator* suplement = from(document); |
- if (!suplement->m_xpathEvaluator) |
- suplement->m_xpathEvaluator = XPathEvaluator::create(); |
- return suplement->m_xpathEvaluator->createNSResolver(nodeResolver); |
+ DocumentXPathEvaluator& suplement = from(document); |
+ if (!suplement.m_xpathEvaluator) |
+ suplement.m_xpathEvaluator = XPathEvaluator::create(); |
+ return suplement.m_xpathEvaluator->createNSResolver(nodeResolver); |
} |
-PassRefPtr<XPathResult> DocumentXPathEvaluator::evaluate(DocumentSupplementable* document, const String& expression, |
+PassRefPtr<XPathResult> DocumentXPathEvaluator::evaluate(DocumentSupplementable& document, const String& expression, |
Node* contextNode, PassRefPtr<XPathNSResolver> resolver, unsigned short type, |
XPathResult* result, ExceptionState& exceptionState) |
{ |
- DocumentXPathEvaluator* suplement = from(document); |
- if (!suplement->m_xpathEvaluator) |
- suplement->m_xpathEvaluator = XPathEvaluator::create(); |
- return suplement->m_xpathEvaluator->evaluate(expression, contextNode, resolver, type, result, exceptionState); |
+ DocumentXPathEvaluator& suplement = from(document); |
+ if (!suplement.m_xpathEvaluator) |
+ suplement.m_xpathEvaluator = XPathEvaluator::create(); |
+ return suplement.m_xpathEvaluator->evaluate(expression, contextNode, resolver, type, result, exceptionState); |
} |
} // namespace WebCore |