summaryrefslogtreecommitdiff
path: root/Source/WebCore/bindings/js/JSXPathResultCustom.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/bindings/js/JSXPathResultCustom.cpp')
-rw-r--r--Source/WebCore/bindings/js/JSXPathResultCustom.cpp24
1 files changed, 6 insertions, 18 deletions
diff --git a/Source/WebCore/bindings/js/JSXPathResultCustom.cpp b/Source/WebCore/bindings/js/JSXPathResultCustom.cpp
index 35ba89231..d4fbbef6f 100644
--- a/Source/WebCore/bindings/js/JSXPathResultCustom.cpp
+++ b/Source/WebCore/bindings/js/JSXPathResultCustom.cpp
@@ -26,30 +26,18 @@
#include "config.h"
#include "JSXPathResult.h"
-#include "JSDOMBinding.h"
#include "JSNodeCustom.h"
-#include "XPathResult.h"
#include "XPathValue.h"
-using namespace JSC;
-
namespace WebCore {
-void JSXPathResult::visitChildren(JSCell* cell, SlotVisitor& visitor)
+void JSXPathResult::visitAdditionalChildren(JSC::SlotVisitor& visitor)
{
- JSXPathResult* thisObject = jsCast<JSXPathResult*>(cell);
- ASSERT_GC_OBJECT_INHERITS(thisObject, info());
- COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
- ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
- Base::visitChildren(thisObject, visitor);
-
- const XPath::Value& xpathValue = thisObject->impl().value();
- if (xpathValue.isNodeSet()) {
- const XPath::NodeSet& nodesToMark = xpathValue.toNodeSet();
- for (size_t i = 0; i < nodesToMark.size(); ++i) {
- Node* node = nodesToMark[i];
- visitor.addOpaqueRoot(root(node));
- }
+ auto& value = wrapped().value();
+ if (value.isNodeSet()) {
+ // FIXME: This looks like it might race, but I'm not sure.
+ for (auto& node : value.toNodeSet())
+ visitor.addOpaqueRoot(root(node.get()));
}
}