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

Unified Diff: Source/bindings/v8/custom/V8NodeIteratorCustom.cpp

Issue 21274004: Fix Document leak from NodeFilter. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: don't print numberOfLiveDocuments when test passed Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/bindings/v8/V8NodeFilterCondition.cpp ('k') | Source/bindings/v8/custom/V8TreeWalkerCustom.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/custom/V8NodeIteratorCustom.cpp
diff --git a/Source/core/dom/NodeList.cpp b/Source/bindings/v8/custom/V8NodeIteratorCustom.cpp
similarity index 71%
copy from Source/core/dom/NodeList.cpp
copy to Source/bindings/v8/custom/V8NodeIteratorCustom.cpp
index fb06c70817bff7406297e671ca5dd5f5ff7f29e6..d758730f6bd19942ca02ecf19c195d0ad8636443 100644
--- a/Source/core/dom/NodeList.cpp
+++ b/Source/bindings/v8/custom/V8NodeIteratorCustom.cpp
@@ -29,29 +29,26 @@
*/
#include "config.h"
-#include "core/dom/NodeList.h"
+#include "V8NodeIterator.h"
+#include "V8NodeFilter.h"
+#include "bindings/v8/V8Binding.h"
+#include "bindings/v8/V8HiddenPropertyName.h"
#include "core/dom/Node.h"
namespace WebCore {
-void NodeList::anonymousNamedGetter(const AtomicString& name, bool& returnValue0Enabled, RefPtr<Node>& returnValue0, bool& returnValue1Enabled, unsigned& returnValue1)
+v8::Handle<v8::Object> wrap(NodeIterator* nodeIterator, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
{
- // Length property cannot be overridden.
- DEFINE_STATIC_LOCAL(const AtomicString, length, ("length", AtomicString::ConstructFromLiteral));
- if (name == length) {
- returnValue1Enabled = true;
- returnValue1 = this->length();
- return;
- }
-
- Node* result = namedItem(name);
- if (!result)
- return;
-
- returnValue0Enabled = true;
- returnValue0 = result;
-}
+ ASSERT(nodeIterator);
+ ASSERT(DOMDataStore::getWrapper<V8NodeIterator>(nodeIterator, isolate).IsEmpty());
+
+ v8::Handle<v8::Object> wrapper = V8NodeIterator::createWrapper(nodeIterator, creationContext, isolate);
+ if (nodeIterator->filter())
+ V8HiddenPropertyName::setNamedHiddenReference(wrapper, "filter", toV8(nodeIterator->filter(), creationContext, isolate));
+
+ return wrapper;
+}
} // namespace WebCore
« no previous file with comments | « Source/bindings/v8/V8NodeFilterCondition.cpp ('k') | Source/bindings/v8/custom/V8TreeWalkerCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698