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

Unified Diff: Source/bindings/v8/custom/V8NodeCustom.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
Index: Source/bindings/v8/custom/V8NodeCustom.cpp
diff --git a/Source/bindings/v8/custom/V8NodeCustom.cpp b/Source/bindings/v8/custom/V8NodeCustom.cpp
index 0e74ef1e13403266118cf3c5f845267ba70e92bb..bde8861d4b20da1e28e979c2938b8659333f14d3 100644
--- a/Source/bindings/v8/custom/V8NodeCustom.cpp
+++ b/Source/bindings/v8/custom/V8NodeCustom.cpp
@@ -66,8 +66,8 @@ void V8Node::insertBeforeMethodCustom(const v8::FunctionCallbackInfo<v8::Value>&
CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
ExceptionState exceptionState(ExceptionState::ExecutionContext, "insertBefore", "Node", info.Holder(), info.GetIsolate());
- Node* newChild = V8Node::hasInstance(info[0], info.GetIsolate()) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0;
- Node* refChild = V8Node::hasInstance(info[1], info.GetIsolate()) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(info[1])) : 0;
+ Node* newChild = V8Node::toNativeWithTypeCheck(info.GetIsolate(), info[0]);
+ Node* refChild = V8Node::toNativeWithTypeCheck(info.GetIsolate(), info[1]);
imp->insertBefore(newChild, refChild, exceptionState);
if (exceptionState.throwIfNeeded())
return;
@@ -82,8 +82,8 @@ void V8Node::replaceChildMethodCustom(const v8::FunctionCallbackInfo<v8::Value>&
CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
ExceptionState exceptionState(ExceptionState::ExecutionContext, "replaceChild", "Node", info.Holder(), info.GetIsolate());
- Node* newChild = V8Node::hasInstance(info[0], info.GetIsolate()) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0;
- Node* oldChild = V8Node::hasInstance(info[1], info.GetIsolate()) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(info[1])) : 0;
+ Node* newChild = V8Node::toNativeWithTypeCheck(info.GetIsolate(), info[0]);
+ Node* oldChild = V8Node::toNativeWithTypeCheck(info.GetIsolate(), info[1]);
imp->replaceChild(newChild, oldChild, exceptionState);
if (exceptionState.throwIfNeeded())
return;
@@ -98,7 +98,7 @@ void V8Node::removeChildMethodCustom(const v8::FunctionCallbackInfo<v8::Value>&
CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
ExceptionState exceptionState(ExceptionState::ExecutionContext, "removeChild", "Node", info.Holder(), info.GetIsolate());
- Node* oldChild = V8Node::hasInstance(info[0], info.GetIsolate()) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0;
+ Node* oldChild = V8Node::toNativeWithTypeCheck(info.GetIsolate(), info[0]);
imp->removeChild(oldChild, exceptionState);
if (exceptionState.throwIfNeeded())
return;
@@ -113,7 +113,7 @@ void V8Node::appendChildMethodCustom(const v8::FunctionCallbackInfo<v8::Value>&
CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
ExceptionState exceptionState(ExceptionState::ExecutionContext, "appendChild", "Node", info.Holder(), info.GetIsolate());
- Node* newChild = V8Node::hasInstance(info[0], info.GetIsolate()) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0;
+ Node* newChild = V8Node::toNativeWithTypeCheck(info.GetIsolate(), info[0]);
imp->appendChild(newChild, exceptionState);
if (exceptionState.throwIfNeeded())
return;
« no previous file with comments | « Source/bindings/v8/custom/V8InjectedScriptHostCustom.cpp ('k') | Source/bindings/v8/custom/V8TypedArrayCustom.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698