diff options
Diffstat (limited to 'chromium/third_party/WebKit/Source/core/xml/DocumentXPathEvaluator.cpp')
-rw-r--r-- | chromium/third_party/WebKit/Source/core/xml/DocumentXPathEvaluator.cpp | 50 |
1 files changed, 26 insertions, 24 deletions
diff --git a/chromium/third_party/WebKit/Source/core/xml/DocumentXPathEvaluator.cpp b/chromium/third_party/WebKit/Source/core/xml/DocumentXPathEvaluator.cpp index d14ca546074..a5181ef8dab 100644 --- a/chromium/third_party/WebKit/Source/core/xml/DocumentXPathEvaluator.cpp +++ b/chromium/third_party/WebKit/Source/core/xml/DocumentXPathEvaluator.cpp @@ -37,45 +37,47 @@ DocumentXPathEvaluator::DocumentXPathEvaluator() { } -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)); + DocumentSupplement::provideTo(document, supplementName(), adoptPtrWillBeNoop(cache)); } - return cache; + return *cache; } -PassRefPtr<XPathExpression> DocumentXPathEvaluator::createExpression(DocumentSupplementable* document, - const String& expression, PassRefPtr<XPathNSResolver> resolver, ExceptionState& exceptionState) +PassRefPtrWillBeRawPtr<XPathExpression> DocumentXPathEvaluator::createExpression(DocumentSupplementable& document, + const String& expression, PassRefPtrWillBeRawPtr<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) +PassRefPtrWillBeRawPtr<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, - Node* contextNode, PassRefPtr<XPathNSResolver> resolver, unsigned short type, +PassRefPtrWillBeRawPtr<XPathResult> DocumentXPathEvaluator::evaluate(DocumentSupplementable& document, const String& expression, + Node* contextNode, PassRefPtrWillBeRawPtr<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); +} + +void DocumentXPathEvaluator::trace(Visitor* visitor) +{ + visitor->trace(m_xpathEvaluator); + DocumentSupplement::trace(visitor); } } // namespace WebCore |