| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google, Inc. | 2 * Copyright (C) 2013 Google, Inc. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 { | 47 { |
| 48 DocumentXPathEvaluator* cache = static_cast<DocumentXPathEvaluator*>(Documen
tSupplement::from(document, supplementName())); | 48 DocumentXPathEvaluator* cache = static_cast<DocumentXPathEvaluator*>(Documen
tSupplement::from(document, supplementName())); |
| 49 if (!cache) { | 49 if (!cache) { |
| 50 cache = new DocumentXPathEvaluator(); | 50 cache = new DocumentXPathEvaluator(); |
| 51 DocumentSupplement::provideTo(document, supplementName(), adoptPtr(cache
)); | 51 DocumentSupplement::provideTo(document, supplementName(), adoptPtr(cache
)); |
| 52 } | 52 } |
| 53 return cache; | 53 return cache; |
| 54 } | 54 } |
| 55 | 55 |
| 56 PassRefPtr<XPathExpression> DocumentXPathEvaluator::createExpression(DocumentSup
plementable* document, | 56 PassRefPtr<XPathExpression> DocumentXPathEvaluator::createExpression(DocumentSup
plementable* document, |
| 57 const String& expression, XPathNSResolver* resolver, ExceptionState& es) | 57 const String& expression, XPathNSResolver* resolver, ExceptionState& excepti
onState) |
| 58 { | 58 { |
| 59 DocumentXPathEvaluator* suplement = from(document); | 59 DocumentXPathEvaluator* suplement = from(document); |
| 60 if (!suplement->m_xpathEvaluator) | 60 if (!suplement->m_xpathEvaluator) |
| 61 suplement->m_xpathEvaluator = XPathEvaluator::create(); | 61 suplement->m_xpathEvaluator = XPathEvaluator::create(); |
| 62 return suplement->m_xpathEvaluator->createExpression(expression, resolver, e
s); | 62 return suplement->m_xpathEvaluator->createExpression(expression, resolver, e
xceptionState); |
| 63 } | 63 } |
| 64 | 64 |
| 65 PassRefPtr<XPathNSResolver> DocumentXPathEvaluator::createNSResolver(DocumentSup
plementable* document, Node* nodeResolver) | 65 PassRefPtr<XPathNSResolver> DocumentXPathEvaluator::createNSResolver(DocumentSup
plementable* document, Node* nodeResolver) |
| 66 { | 66 { |
| 67 DocumentXPathEvaluator* suplement = from(document); | 67 DocumentXPathEvaluator* suplement = from(document); |
| 68 if (!suplement->m_xpathEvaluator) | 68 if (!suplement->m_xpathEvaluator) |
| 69 suplement->m_xpathEvaluator = XPathEvaluator::create(); | 69 suplement->m_xpathEvaluator = XPathEvaluator::create(); |
| 70 return suplement->m_xpathEvaluator->createNSResolver(nodeResolver); | 70 return suplement->m_xpathEvaluator->createNSResolver(nodeResolver); |
| 71 } | 71 } |
| 72 | 72 |
| 73 PassRefPtr<XPathResult> DocumentXPathEvaluator::evaluate(DocumentSupplementable*
document, const String& expression, | 73 PassRefPtr<XPathResult> DocumentXPathEvaluator::evaluate(DocumentSupplementable*
document, const String& expression, |
| 74 Node* contextNode, XPathNSResolver* resolver, unsigned short type, | 74 Node* contextNode, XPathNSResolver* resolver, unsigned short type, |
| 75 XPathResult* result, ExceptionState& es) | 75 XPathResult* result, ExceptionState& exceptionState) |
| 76 { | 76 { |
| 77 DocumentXPathEvaluator* suplement = from(document); | 77 DocumentXPathEvaluator* suplement = from(document); |
| 78 if (!suplement->m_xpathEvaluator) | 78 if (!suplement->m_xpathEvaluator) |
| 79 suplement->m_xpathEvaluator = XPathEvaluator::create(); | 79 suplement->m_xpathEvaluator = XPathEvaluator::create(); |
| 80 return suplement->m_xpathEvaluator->evaluate(expression, contextNode, resolv
er, type, result, es); | 80 return suplement->m_xpathEvaluator->evaluate(expression, contextNode, resolv
er, type, result, exceptionState); |
| 81 } | 81 } |
| 82 | 82 |
| 83 } // namespace WebCore | 83 } // namespace WebCore |
| OLD | NEW |