OLD | NEW |
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}}. DO NOT MODIFY! | 5 // This file has been auto-generated by {{code_generator}}. DO NOT MODIFY! |
6 | 6 |
7 #ifndef {{macro_guard}} | 7 #ifndef {{macro_guard}} |
8 #define {{macro_guard}} | 8 #define {{macro_guard}} |
9 | 9 |
10 {% for filename in header_includes %} | 10 {% for filename in header_includes %} |
(...skipping 29 matching lines...) Expand all Loading... |
40 {% for member in container.members %} | 40 {% for member in container.members %} |
41 {{member.specific_type_enum}}, | 41 {{member.specific_type_enum}}, |
42 {% endfor %} | 42 {% endfor %} |
43 }; | 43 }; |
44 SpecificTypes m_type; | 44 SpecificTypes m_type; |
45 | 45 |
46 {% for member in container.members %} | 46 {% for member in container.members %} |
47 {{member.cpp_type}} m_{{member.cpp_name}}; | 47 {{member.cpp_type}} m_{{member.cpp_name}}; |
48 {% endfor %} | 48 {% endfor %} |
49 | 49 |
50 friend v8::Handle<v8::Value> toV8(const {{container.cpp_class}}&, v8::Handle
<v8::Object>, v8::Isolate*); | 50 friend v8::Local<v8::Value> toV8(const {{container.cpp_class}}&, v8::Local<v
8::Object>, v8::Isolate*); |
51 }; | 51 }; |
52 | 52 |
53 class V8{{container.cpp_class}} final { | 53 class V8{{container.cpp_class}} final { |
54 public: | 54 public: |
55 static void toImpl(v8::Isolate*, v8::Handle<v8::Value>, {{container.cpp_clas
s}}&, ExceptionState&); | 55 static void toImpl(v8::Isolate*, v8::Local<v8::Value>, {{container.cpp_class
}}&, ExceptionState&); |
56 }; | 56 }; |
57 | 57 |
58 v8::Handle<v8::Value> toV8(const {{container.cpp_class}}&, v8::Handle<v8::Object
>, v8::Isolate*); | 58 v8::Local<v8::Value> toV8(const {{container.cpp_class}}&, v8::Local<v8::Object>,
v8::Isolate*); |
59 | 59 |
60 template <class CallbackInfo> | 60 template <class CallbackInfo> |
61 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, {{container.cpp_c
lass}}& impl) | 61 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, {{container.cpp_c
lass}}& impl) |
62 { | 62 { |
63 v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInf
o.GetIsolate())); | 63 v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInf
o.GetIsolate())); |
64 } | 64 } |
65 | 65 |
66 template <> | 66 template <> |
67 struct NativeValueTraits<{{container.cpp_class}}> { | 67 struct NativeValueTraits<{{container.cpp_class}}> { |
68 static {{container.cpp_class}} nativeValue(const v8::Handle<v8::Value>&, v8:
:Isolate*, ExceptionState&); | 68 static {{container.cpp_class}} nativeValue(const v8::Local<v8::Value>&, v8::
Isolate*, ExceptionState&); |
69 }; | 69 }; |
70 | 70 |
71 {% endfor %} | 71 {% endfor %} |
72 {% for cpp_type in nullable_cpp_types %} | 72 {% for cpp_type in nullable_cpp_types %} |
73 class V8{{cpp_type}}OrNull final { | 73 class V8{{cpp_type}}OrNull final { |
74 public: | 74 public: |
75 static void toImpl(v8::Isolate* isolate, v8::Handle<v8::Value> v8Value, {{cp
p_type}}& impl, ExceptionState& exceptionState) | 75 static void toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value, {{cpp
_type}}& impl, ExceptionState& exceptionState) |
76 { | 76 { |
77 {# http://heycam.github.io/webidl/#es-union #} | 77 {# http://heycam.github.io/webidl/#es-union #} |
78 {# 1. null or undefined #} | 78 {# 1. null or undefined #} |
79 if (isUndefinedOrNull(v8Value)) | 79 if (isUndefinedOrNull(v8Value)) |
80 return; | 80 return; |
81 V8{{cpp_type}}::toImpl(isolate, v8Value, impl, exceptionState); | 81 V8{{cpp_type}}::toImpl(isolate, v8Value, impl, exceptionState); |
82 } | 82 } |
83 }; | 83 }; |
84 | 84 |
85 {% endfor %} | 85 {% endfor %} |
86 } // namespace blink | 86 } // namespace blink |
87 | 87 |
88 #endif // {{macro_guard}} | 88 #endif // {{macro_guard}} |
OLD | NEW |