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

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

Issue 21274004: Fix Document leak from NodeFilter. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add assertions to wrap 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
Index: Source/bindings/v8/custom/V8TreeWalkerCustom.cpp
diff --git a/Source/bindings/v8/custom/V8TreeWalkerCustom.cpp b/Source/bindings/v8/custom/V8TreeWalkerCustom.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..5b60189c8703912bcd8065a5fade3f39849b6a7a
--- /dev/null
+++ b/Source/bindings/v8/custom/V8TreeWalkerCustom.cpp
@@ -0,0 +1,28 @@
+#include "config.h"
haraken 2013/08/01 13:32:20 Please add a copyright.
kouhei (in TOK) 2013/08/02 03:26:57 Done.
+#include "V8TreeWalker.h"
+
+#include "V8NodeFilter.h"
+#include "bindings/v8/V8Binding.h"
+#include "bindings/v8/V8HiddenPropertyName.h"
+#include "bindings/v8/V8Utilities.h"
+#include "core/dom/Node.h"
+#include "core/dom/TreeWalker.h"
+
+#include "wtf/RefPtr.h"
+
+namespace WebCore {
+
+v8::Handle<v8::Object> wrap(TreeWalker* treeWalker, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ ASSERT(treeWalker);
+ ASSERT(DOMDataStore::getWrapper<V8TreeWalker>(treeWalker, isolate).IsEmpty());
+
+ v8::Handle<v8::Object> wrapper = V8TreeWalker::createWrapper(treeWalker, creationContext, isolate);
+
+ if (treeWalker->filter())
+ V8HiddenPropertyName::setNamedHiddenReference(wrapper, "filter", toV8(treeWalker->filter(), creationContext, isolate));
+
+ return wrapper;
+}
+
+} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698