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

Side by Side Diff: Source/bindings/tests/results/V8TestCallback.cpp

Issue 47073007: Bindings: Remove special cases for DOMStringList (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 This file is part of the Blink open source project. 2 This file is part of the Blink open source project.
3 This file has been auto-generated by CodeGeneratorV8.pm. DO NOT MODIFY! 3 This file has been auto-generated by CodeGeneratorV8.pm. DO NOT MODIFY!
4 4
5 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public 6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either 7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version. 8 version 2 of the License, or (at your option) any later version.
9 9
10 This library is distributed in the hope that it will be useful, 10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19 */ 19 */
20 20
21 #include "config.h" 21 #include "config.h"
22 #include "V8TestCallback.h" 22 #include "V8TestCallback.h"
23 23
24 #include "V8DOMStringList.h"
25 #include "V8TestObject.h" 24 #include "V8TestObject.h"
26 #include "bindings/v8/V8Binding.h" 25 #include "bindings/v8/V8Binding.h"
27 #include "bindings/v8/V8Callback.h" 26 #include "bindings/v8/V8Callback.h"
28 #include "core/dom/ExecutionContext.h" 27 #include "core/dom/ExecutionContext.h"
29 #include "wtf/Assertions.h" 28 #include "wtf/Assertions.h"
30 #include "wtf/GetPtr.h" 29 #include "wtf/GetPtr.h"
31 #include "wtf/RefPtr.h" 30 #include "wtf/RefPtr.h"
32 namespace WebCore { 31 namespace WebCore {
33 32
34 V8TestCallback::V8TestCallback(v8::Handle<v8::Object> callback, ExecutionContext * context) 33 V8TestCallback::V8TestCallback(v8::Handle<v8::Object> callback, ExecutionContext * context)
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 122
124 v8::Handle<v8::Value> argv[] = { 123 v8::Handle<v8::Value> argv[] = {
125 class2ParamHandle, 124 class2ParamHandle,
126 strArgHandle 125 strArgHandle
127 }; 126 };
128 127
129 bool callbackReturnValue = false; 128 bool callbackReturnValue = false;
130 return !invokeCallback(m_callback.newLocal(isolate), 2, argv, callbackReturn Value, executionContext(), isolate); 129 return !invokeCallback(m_callback.newLocal(isolate), 2, argv, callbackReturn Value, executionContext(), isolate);
131 } 130 }
132 131
133 bool V8TestCallback::callbackWithStringList(RefPtr<DOMStringList> listParam)
134 {
135 if (!canInvokeCallback())
136 return true;
137
138 v8::Isolate* isolate = v8::Isolate::GetCurrent();
139 v8::HandleScope handleScope(isolate);
140
141 v8::Handle<v8::Context> v8Context = toV8Context(executionContext(), m_world. get());
142 if (v8Context.IsEmpty())
143 return true;
144
145 v8::Context::Scope scope(v8Context);
146
147 v8::Handle<v8::Value> listParamHandle = toV8(listParam, v8::Handle<v8::Objec t>(), isolate);
148 if (listParamHandle.IsEmpty()) {
149 if (!isScriptControllerTerminating())
150 CRASH();
151 return true;
152 }
153
154 v8::Handle<v8::Value> argv[] = {
155 listParamHandle
156 };
157
158 bool callbackReturnValue = false;
159 return !invokeCallback(m_callback.newLocal(isolate), 1, argv, callbackReturn Value, executionContext(), isolate);
160 }
161
162 bool V8TestCallback::callbackWithBoolean(bool boolParam) 132 bool V8TestCallback::callbackWithBoolean(bool boolParam)
163 { 133 {
164 if (!canInvokeCallback()) 134 if (!canInvokeCallback())
165 return true; 135 return true;
166 136
167 v8::Isolate* isolate = v8::Isolate::GetCurrent(); 137 v8::Isolate* isolate = v8::Isolate::GetCurrent();
168 v8::HandleScope handleScope(isolate); 138 v8::HandleScope handleScope(isolate);
169 139
170 v8::Handle<v8::Context> v8Context = toV8Context(executionContext(), m_world. get()); 140 v8::Handle<v8::Context> v8Context = toV8Context(executionContext(), m_world. get());
171 if (v8Context.IsEmpty()) 141 if (v8Context.IsEmpty())
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 v8::Handle<v8::Value> argv[] = { 247 v8::Handle<v8::Value> argv[] = {
278 paramHandle 248 paramHandle
279 }; 249 };
280 250
281 bool callbackReturnValue = false; 251 bool callbackReturnValue = false;
282 return !invokeCallback(m_callback.newLocal(isolate), v8::Handle<v8::Object>: :Cast(thisHandle), 1, argv, callbackReturnValue, executionContext(), isolate); 252 return !invokeCallback(m_callback.newLocal(isolate), v8::Handle<v8::Object>: :Cast(thisHandle), 1, argv, callbackReturnValue, executionContext(), isolate);
283 } 253 }
284 254
285 } // namespace WebCore 255 } // namespace WebCore
286 256
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698