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

Unified Diff: Source/bindings/tests/results/V8TestNode.cpp

Issue 171533006: V8 Binding: Introduce toNativeWithTypeCheck (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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/tests/results/V8TestNode.h ('k') | Source/bindings/tests/results/V8TestObject.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/tests/results/V8TestNode.cpp
diff --git a/Source/bindings/tests/results/V8TestNode.cpp b/Source/bindings/tests/results/V8TestNode.cpp
index 00902f1bf091a0d5b6e69eab92aa8510eb8436cf..8458e2358eb5f9cafc823320c10bfad8c5f555f3 100644
--- a/Source/bindings/tests/results/V8TestNode.cpp
+++ b/Source/bindings/tests/results/V8TestNode.cpp
@@ -227,6 +227,11 @@ bool V8TestNode::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate
|| V8PerIsolateData::from(isolate)->hasInstanceInNonMainWorld(&wrapperTypeInfo, jsValue);
}
+TestNode* V8TestNode::toNativeWithTypeCheck(v8::Isolate* isolate, v8::Handle<v8::Value> value)
+{
+ return hasInstance(value, isolate) ? fromInternalPointer(v8::Handle<v8::Object>::Cast(value)->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex)) : 0;
+}
+
EventTarget* V8TestNode::toEventTarget(v8::Handle<v8::Object> object)
{
return toNative(object);
« no previous file with comments | « Source/bindings/tests/results/V8TestNode.h ('k') | Source/bindings/tests/results/V8TestObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698