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

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

Issue 18398002: Remove IDBNotFoundError ExceptionCode (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: merge Created 7 years, 6 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 7b372b668493fa4e54e27e270ccc63c6105a5b41..99256adbca3baee5a53a2fee984955bad5073d30 100644
--- a/Source/bindings/v8/custom/V8NodeCustom.cpp
+++ b/Source/bindings/v8/custom/V8NodeCustom.cpp
@@ -46,6 +46,7 @@
#include "V8SVGElement.h"
#include "V8ShadowRoot.h"
#include "V8Text.h"
+#include "bindings/v8/ExceptionState.h"
#include "bindings/v8/V8AbstractEventListener.h"
#include "bindings/v8/V8Binding.h"
#include "bindings/v8/V8EventListener.h"
@@ -61,14 +62,12 @@ void V8Node::insertBeforeMethodCustom(const v8::FunctionCallbackInfo<v8::Value>&
{
v8::Handle<v8::Object> holder = args.Holder();
Node* imp = V8Node::toNative(holder);
- ExceptionCode ec = 0;
+ ExceptionState es(args.GetIsolate());
Node* newChild = V8Node::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
Node* refChild = V8Node::HasInstance(args[1], args.GetIsolate(), worldType(args.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[1])) : 0;
- bool success = imp->insertBefore(newChild, refChild, ec, AttachLazily);
- if (ec) {
- setDOMException(ec, args.GetIsolate());
+ bool success = imp->insertBefore(newChild, refChild, es, AttachLazily);
+ if (es.throwIfNeeded())
return;
- }
if (success) {
v8SetReturnValue(args, args[0]);
return;
@@ -81,14 +80,12 @@ void V8Node::replaceChildMethodCustom(const v8::FunctionCallbackInfo<v8::Value>&
{
v8::Handle<v8::Object> holder = args.Holder();
Node* imp = V8Node::toNative(holder);
- ExceptionCode ec = 0;
+ ExceptionState es(args.GetIsolate());
Node* newChild = V8Node::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
Node* oldChild = V8Node::HasInstance(args[1], args.GetIsolate(), worldType(args.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[1])) : 0;
- bool success = imp->replaceChild(newChild, oldChild, ec, AttachLazily);
- if (ec) {
- setDOMException(ec, args.GetIsolate());
+ bool success = imp->replaceChild(newChild, oldChild, es, AttachLazily);
+ if (es.throwIfNeeded())
return;
- }
if (success) {
v8SetReturnValue(args, args[1]);
return;
@@ -100,13 +97,11 @@ void V8Node::removeChildMethodCustom(const v8::FunctionCallbackInfo<v8::Value>&
{
v8::Handle<v8::Object> holder = args.Holder();
Node* imp = V8Node::toNative(holder);
- ExceptionCode ec = 0;
+ ExceptionState es(args.GetIsolate());
Node* oldChild = V8Node::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
- bool success = imp->removeChild(oldChild, ec);
- if (ec) {
- setDOMException(ec, args.GetIsolate());
+ bool success = imp->removeChild(oldChild, es);
+ if (es.throwIfNeeded())
return;
- }
if (success) {
v8SetReturnValue(args, args[0]);
return;
@@ -119,13 +114,11 @@ void V8Node::appendChildMethodCustom(const v8::FunctionCallbackInfo<v8::Value>&
{
v8::Handle<v8::Object> holder = args.Holder();
Node* imp = V8Node::toNative(holder);
- ExceptionCode ec = 0;
+ ExceptionState es(args.GetIsolate());
Node* newChild = V8Node::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
- bool success = imp->appendChild(newChild, ec, AttachLazily);
- if (ec) {
- setDOMException(ec, args.GetIsolate());
+ bool success = imp->appendChild(newChild, es, AttachLazily);
+ if (es.throwIfNeeded())
return;
- }
if (success) {
v8SetReturnValue(args, args[0]);
return;

Powered by Google App Engine
This is Rietveld 408576698