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

Side by Side Diff: Source/bindings/tests/results/core/V8TestSpecialOperations.cpp

Issue 946973005: IDL: Drop value conversion (V8 -> C++) macros from generated code (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: address comments Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
6 6
7 #include "config.h" 7 #include "config.h"
8 #include "V8TestSpecialOperations.h" 8 #include "V8TestSpecialOperations.h"
9 9
10 #include "bindings/core/v8/ExceptionState.h" 10 #include "bindings/core/v8/ExceptionState.h"
(...skipping 27 matching lines...) Expand all
38 38
39 static void namedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 39 static void namedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
40 { 40 {
41 if (UNLIKELY(info.Length() < 1)) { 41 if (UNLIKELY(info.Length() < 1)) {
42 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod(in fo.GetIsolate(), "namedItem", "TestSpecialOperations", 1, info.Length()), info.G etIsolate()); 42 V8ThrowException::throwException(createMinimumArityTypeErrorForMethod(in fo.GetIsolate(), "namedItem", "TestSpecialOperations", 1, info.Length()), info.G etIsolate());
43 return; 43 return;
44 } 44 }
45 TestSpecialOperations* impl = V8TestSpecialOperations::toImpl(info.Holder()) ; 45 TestSpecialOperations* impl = V8TestSpecialOperations::toImpl(info.Holder()) ;
46 V8StringResource<> name; 46 V8StringResource<> name;
47 { 47 {
48 TOSTRING_VOID_INTERNAL(name, info[0]); 48 name = info[0];
49 if (!name.prepare())
50 return;
49 } 51 }
50 NodeOrNodeList result; 52 NodeOrNodeList result;
51 impl->getItem(name, result); 53 impl->getItem(name, result);
52 v8SetReturnValue(info, result); 54 v8SetReturnValue(info, result);
53 } 55 }
54 56
55 static void namedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& i nfo) 57 static void namedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& i nfo)
56 { 58 {
57 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 59 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
58 TestSpecialOperationsV8Internal::namedItemMethod(info); 60 TestSpecialOperationsV8Internal::namedItemMethod(info);
(...skipping 20 matching lines...) Expand all
79 TestSpecialOperationsV8Internal::namedPropertyGetter(name, info); 81 TestSpecialOperationsV8Internal::namedPropertyGetter(name, info);
80 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 82 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
81 } 83 }
82 84
83 static void namedPropertySetter(v8::Local<v8::Name> name, v8::Local<v8::Value> v 8Value, const v8::PropertyCallbackInfo<v8::Value>& info) 85 static void namedPropertySetter(v8::Local<v8::Name> name, v8::Local<v8::Value> v 8Value, const v8::PropertyCallbackInfo<v8::Value>& info)
84 { 86 {
85 if (!name->IsString()) 87 if (!name->IsString())
86 return; 88 return;
87 auto nameString = name.As<v8::String>(); 89 auto nameString = name.As<v8::String>();
88 TestSpecialOperations* impl = V8TestSpecialOperations::toImpl(info.Holder()) ; 90 TestSpecialOperations* impl = V8TestSpecialOperations::toImpl(info.Holder()) ;
89 TOSTRING_VOID(V8StringResource<>, propertyName, nameString); 91 V8StringResource<> propertyName(nameString);
92 if (!propertyName.prepare())
93 return;
90 Node* propertyValue = V8Node::toImplWithTypeCheck(info.GetIsolate(), v8Value ); 94 Node* propertyValue = V8Node::toImplWithTypeCheck(info.GetIsolate(), v8Value );
91 if (!propertyValue && !isUndefinedOrNull(v8Value)) { 95 if (!propertyValue && !isUndefinedOrNull(v8Value)) {
92 exceptionState.throwTypeError("The provided value is not of type 'Node'. "); 96 exceptionState.throwTypeError("The provided value is not of type 'Node'. ");
93 exceptionState.throwIfNeeded(); 97 exceptionState.throwIfNeeded();
94 return; 98 return;
95 } 99 }
96 bool result = impl->anonymousNamedSetter(propertyName, propertyValue); 100 bool result = impl->anonymousNamedSetter(propertyName, propertyValue);
97 if (!result) 101 if (!result)
98 return; 102 return;
99 v8SetReturnValue(info, v8Value); 103 v8SetReturnValue(info, v8Value);
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 { 206 {
203 scriptWrappable->toImpl<TestSpecialOperations>()->ref(); 207 scriptWrappable->toImpl<TestSpecialOperations>()->ref();
204 } 208 }
205 209
206 void V8TestSpecialOperations::derefObject(ScriptWrappable* scriptWrappable) 210 void V8TestSpecialOperations::derefObject(ScriptWrappable* scriptWrappable)
207 { 211 {
208 scriptWrappable->toImpl<TestSpecialOperations>()->deref(); 212 scriptWrappable->toImpl<TestSpecialOperations>()->deref();
209 } 213 }
210 214
211 } // namespace blink 215 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/core/V8TestObject.cpp ('k') | Source/bindings/tests/results/core/V8TestTypedefs.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698