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

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

Issue 255983003: Oilpan: Move all supplements of Page, Document, and WorkerClients to the managed heap. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: using namespace WebCore Created 6 years, 7 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 | Annotate | Revision Log
OLDNEW
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 19 matching lines...) Expand all
30 #include "core/dom/Document.h" 30 #include "core/dom/Document.h"
31 #include "core/xml/XPathExpression.h" 31 #include "core/xml/XPathExpression.h"
32 #include "core/xml/XPathResult.h" 32 #include "core/xml/XPathResult.h"
33 33
34 namespace WebCore { 34 namespace WebCore {
35 35
36 DocumentXPathEvaluator::DocumentXPathEvaluator() 36 DocumentXPathEvaluator::DocumentXPathEvaluator()
37 { 37 {
38 } 38 }
39 39
40 DocumentXPathEvaluator::~DocumentXPathEvaluator()
41 {
42 }
43
44 DocumentXPathEvaluator& DocumentXPathEvaluator::from(DocumentSupplementable& doc ument) 40 DocumentXPathEvaluator& DocumentXPathEvaluator::from(DocumentSupplementable& doc ument)
45 { 41 {
46 DocumentXPathEvaluator* cache = static_cast<DocumentXPathEvaluator*>(Documen tSupplement::from(document, supplementName())); 42 DocumentXPathEvaluator* cache = static_cast<DocumentXPathEvaluator*>(Documen tSupplement::from(document, supplementName()));
47 if (!cache) { 43 if (!cache) {
48 cache = new DocumentXPathEvaluator(); 44 cache = new DocumentXPathEvaluator();
49 DocumentSupplement::provideTo(document, supplementName(), adoptPtr(cache )); 45 DocumentSupplement::provideTo(document, supplementName(), adoptPtrWillBe Noop(cache));
50 } 46 }
51 return *cache; 47 return *cache;
52 } 48 }
53 49
54 PassRefPtrWillBeRawPtr<XPathExpression> DocumentXPathEvaluator::createExpression (DocumentSupplementable& document, 50 PassRefPtrWillBeRawPtr<XPathExpression> DocumentXPathEvaluator::createExpression (DocumentSupplementable& document,
55 const String& expression, PassRefPtrWillBeRawPtr<XPathNSResolver> resolver, ExceptionState& exceptionState) 51 const String& expression, PassRefPtrWillBeRawPtr<XPathNSResolver> resolver, ExceptionState& exceptionState)
56 { 52 {
57 DocumentXPathEvaluator& suplement = from(document); 53 DocumentXPathEvaluator& suplement = from(document);
58 if (!suplement.m_xpathEvaluator) 54 if (!suplement.m_xpathEvaluator)
59 suplement.m_xpathEvaluator = XPathEvaluator::create(); 55 suplement.m_xpathEvaluator = XPathEvaluator::create();
(...skipping 11 matching lines...) Expand all
71 PassRefPtrWillBeRawPtr<XPathResult> DocumentXPathEvaluator::evaluate(DocumentSup plementable& document, const String& expression, 67 PassRefPtrWillBeRawPtr<XPathResult> DocumentXPathEvaluator::evaluate(DocumentSup plementable& document, const String& expression,
72 Node* contextNode, PassRefPtrWillBeRawPtr<XPathNSResolver> resolver, unsigne d short type, 68 Node* contextNode, PassRefPtrWillBeRawPtr<XPathNSResolver> resolver, unsigne d short type,
73 XPathResult* result, ExceptionState& exceptionState) 69 XPathResult* result, ExceptionState& exceptionState)
74 { 70 {
75 DocumentXPathEvaluator& suplement = from(document); 71 DocumentXPathEvaluator& suplement = from(document);
76 if (!suplement.m_xpathEvaluator) 72 if (!suplement.m_xpathEvaluator)
77 suplement.m_xpathEvaluator = XPathEvaluator::create(); 73 suplement.m_xpathEvaluator = XPathEvaluator::create();
78 return suplement.m_xpathEvaluator->evaluate(expression, contextNode, resolve r, type, result, exceptionState); 74 return suplement.m_xpathEvaluator->evaluate(expression, contextNode, resolve r, type, result, exceptionState);
79 } 75 }
80 76
77 void DocumentXPathEvaluator::trace(Visitor* visitor)
78 {
79 visitor->trace(m_xpathEvaluator);
80 }
81
81 } // namespace WebCore 82 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/xml/DocumentXPathEvaluator.h ('k') | Source/modules/device_orientation/DeviceMotionController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698