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

Side by Side Diff: Source/bindings/v8/custom/V8NodeCustom.cpp

Issue 68563003: Create DOM exceptions in the correct context. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased onto df9a982fbe97 Created 7 years, 1 month 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007-2009 Google Inc. All rights reserved. 2 * Copyright (C) 2007-2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 59
60 // These functions are custom to prevent a wrapper lookup of the return value wh ich is always 60 // These functions are custom to prevent a wrapper lookup of the return value wh ich is always
61 // part of the arguments. 61 // part of the arguments.
62 void V8Node::insertBeforeMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info) 62 void V8Node::insertBeforeMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
63 { 63 {
64 v8::Handle<v8::Object> holder = info.Holder(); 64 v8::Handle<v8::Object> holder = info.Holder();
65 Node* imp = V8Node::toNative(holder); 65 Node* imp = V8Node::toNative(holder);
66 66
67 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 67 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
68 68
69 ExceptionState exceptionState(info.GetIsolate()); 69 ExceptionState exceptionState(info.Holder(), info.GetIsolate());
70 Node* newChild = V8Node::hasInstance(info[0], info.GetIsolate(), worldType(i nfo.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0 ; 70 Node* newChild = V8Node::hasInstance(info[0], info.GetIsolate(), worldType(i nfo.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0 ;
71 Node* refChild = V8Node::hasInstance(info[1], info.GetIsolate(), worldType(i nfo.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(info[1])) : 0 ; 71 Node* refChild = V8Node::hasInstance(info[1], info.GetIsolate(), worldType(i nfo.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(info[1])) : 0 ;
72 imp->insertBefore(newChild, refChild, exceptionState); 72 imp->insertBefore(newChild, refChild, exceptionState);
73 if (exceptionState.throwIfNeeded()) 73 if (exceptionState.throwIfNeeded())
74 return; 74 return;
75 v8SetReturnValue(info, info[0]); 75 v8SetReturnValue(info, info[0]);
76 } 76 }
77 77
78 void V8Node::replaceChildMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info) 78 void V8Node::replaceChildMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
79 { 79 {
80 v8::Handle<v8::Object> holder = info.Holder(); 80 v8::Handle<v8::Object> holder = info.Holder();
81 Node* imp = V8Node::toNative(holder); 81 Node* imp = V8Node::toNative(holder);
82 82
83 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 83 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
84 84
85 ExceptionState exceptionState(info.GetIsolate()); 85 ExceptionState exceptionState(info.Holder(), info.GetIsolate());
86 Node* newChild = V8Node::hasInstance(info[0], info.GetIsolate(), worldType(i nfo.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0 ; 86 Node* newChild = V8Node::hasInstance(info[0], info.GetIsolate(), worldType(i nfo.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0 ;
87 Node* oldChild = V8Node::hasInstance(info[1], info.GetIsolate(), worldType(i nfo.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(info[1])) : 0 ; 87 Node* oldChild = V8Node::hasInstance(info[1], info.GetIsolate(), worldType(i nfo.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(info[1])) : 0 ;
88 imp->replaceChild(newChild, oldChild, exceptionState); 88 imp->replaceChild(newChild, oldChild, exceptionState);
89 if (exceptionState.throwIfNeeded()) 89 if (exceptionState.throwIfNeeded())
90 return; 90 return;
91 v8SetReturnValue(info, info[1]); 91 v8SetReturnValue(info, info[1]);
92 } 92 }
93 93
94 void V8Node::removeChildMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info) 94 void V8Node::removeChildMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
95 { 95 {
96 v8::Handle<v8::Object> holder = info.Holder(); 96 v8::Handle<v8::Object> holder = info.Holder();
97 Node* imp = V8Node::toNative(holder); 97 Node* imp = V8Node::toNative(holder);
98 98
99 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 99 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
100 100
101 ExceptionState exceptionState(info.GetIsolate()); 101 ExceptionState exceptionState(info.Holder(), info.GetIsolate());
102 Node* oldChild = V8Node::hasInstance(info[0], info.GetIsolate(), worldType(i nfo.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0 ; 102 Node* oldChild = V8Node::hasInstance(info[0], info.GetIsolate(), worldType(i nfo.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0 ;
103 imp->removeChild(oldChild, exceptionState); 103 imp->removeChild(oldChild, exceptionState);
104 if (exceptionState.throwIfNeeded()) 104 if (exceptionState.throwIfNeeded())
105 return; 105 return;
106 v8SetReturnValue(info, info[0]); 106 v8SetReturnValue(info, info[0]);
107 } 107 }
108 108
109 void V8Node::appendChildMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info) 109 void V8Node::appendChildMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
110 { 110 {
111 v8::Handle<v8::Object> holder = info.Holder(); 111 v8::Handle<v8::Object> holder = info.Holder();
112 Node* imp = V8Node::toNative(holder); 112 Node* imp = V8Node::toNative(holder);
113 113
114 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 114 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
115 115
116 ExceptionState exceptionState(info.GetIsolate()); 116 ExceptionState exceptionState(info.Holder(), info.GetIsolate());
117 Node* newChild = V8Node::hasInstance(info[0], info.GetIsolate(), worldType(i nfo.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0 ; 117 Node* newChild = V8Node::hasInstance(info[0], info.GetIsolate(), worldType(i nfo.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0 ;
118 imp->appendChild(newChild, exceptionState); 118 imp->appendChild(newChild, exceptionState);
119 if (exceptionState.throwIfNeeded()) 119 if (exceptionState.throwIfNeeded())
120 return; 120 return;
121 v8SetReturnValue(info, info[0]); 121 v8SetReturnValue(info, info[0]);
122 } 122 }
123 123
124 v8::Handle<v8::Object> wrap(Node* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) 124 v8::Handle<v8::Object> wrap(Node* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
125 { 125 {
126 ASSERT(impl); 126 ASSERT(impl);
(...skipping 27 matching lines...) Expand all
154 case Node::NOTATION_NODE: 154 case Node::NOTATION_NODE:
155 // We never create objects of Entity and Notation. 155 // We never create objects of Entity and Notation.
156 ASSERT_NOT_REACHED(); 156 ASSERT_NOT_REACHED();
157 break; 157 break;
158 default: 158 default:
159 break; // ENTITY_REFERENCE_NODE or XPATH_NAMESPACE_NODE 159 break; // ENTITY_REFERENCE_NODE or XPATH_NAMESPACE_NODE
160 } 160 }
161 return V8Node::createWrapper(impl, creationContext, isolate); 161 return V8Node::createWrapper(impl, creationContext, isolate);
162 } 162 }
163 } // namespace WebCore 163 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/custom/V8MessagePortCustom.cpp ('k') | Source/bindings/v8/custom/V8SQLTransactionCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698