| OLD | NEW |
| 1 {% filter format_blink_cpp_source_code %} | 1 {% filter format_blink_cpp_source_code %} |
| 2 | 2 |
| 3 {% include 'copyright_block.txt' %} | 3 {% include 'copyright_block.txt' %} |
| 4 #ifndef {{cpp_class}}_h | 4 #ifndef {{cpp_class}}_h |
| 5 #define {{cpp_class}}_h | 5 #define {{cpp_class}}_h |
| 6 | 6 |
| 7 {% for filename in header_includes %} | 7 {% for filename in header_includes %} |
| 8 #include "{{filename}}" | 8 #include "{{filename}}" |
| 9 {% endfor %} | 9 {% endfor %} |
| 10 | 10 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 {% for member in members %} | 38 {% for member in members %} |
| 39 {{member.specific_type_enum}}, | 39 {{member.specific_type_enum}}, |
| 40 {% endfor %} | 40 {% endfor %} |
| 41 }; | 41 }; |
| 42 SpecificTypes m_type; | 42 SpecificTypes m_type; |
| 43 | 43 |
| 44 {% for member in members %} | 44 {% for member in members %} |
| 45 {{member.cpp_type}} m_{{member.cpp_name}}; | 45 {{member.cpp_type}} m_{{member.cpp_name}}; |
| 46 {% endfor %} | 46 {% endfor %} |
| 47 | 47 |
| 48 friend {{exported}}v8::Local<v8::Value> toV8(const {{cpp_class}}&, v8::Local<v
8::Object>, v8::Isolate*); | 48 friend {{exported}}v8::Local<v8::Value> ToV8(const {{cpp_class}}&, v8::Local<v
8::Object>, v8::Isolate*); |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 class {{v8_class}} final { | 51 class {{v8_class}} final { |
| 52 public: | 52 public: |
| 53 {{exported}}static void toImpl(v8::Isolate*, v8::Local<v8::Value>, {{cpp_class
}}&, UnionTypeConversionMode, ExceptionState&); | 53 {{exported}}static void toImpl(v8::Isolate*, v8::Local<v8::Value>, {{cpp_class
}}&, UnionTypeConversionMode, ExceptionState&); |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 {{exported}}v8::Local<v8::Value> toV8(const {{cpp_class}}&, v8::Local<v8::Object
>, v8::Isolate*); | 56 {{exported}}v8::Local<v8::Value> ToV8(const {{cpp_class}}&, v8::Local<v8::Object
>, v8::Isolate*); |
| 57 | 57 |
| 58 template <class CallbackInfo> | 58 template <class CallbackInfo> |
| 59 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, {{cpp_class}}& im
pl) { | 59 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, {{cpp_class}}& im
pl) { |
| 60 v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInfo.
GetIsolate())); | 60 v8SetReturnValue(callbackInfo, ToV8(impl, callbackInfo.Holder(), callbackInfo.
GetIsolate())); |
| 61 } | 61 } |
| 62 | 62 |
| 63 template <> | 63 template <> |
| 64 struct NativeValueTraits<{{cpp_class}}> { | 64 struct NativeValueTraits<{{cpp_class}}> { |
| 65 {{exported}}static {{cpp_class}} nativeValue(v8::Isolate*, v8::Local<v8::Value
>, ExceptionState&); | 65 {{exported}}static {{cpp_class}} nativeValue(v8::Isolate*, v8::Local<v8::Value
>, ExceptionState&); |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 } // namespace blink | 68 } // namespace blink |
| 69 | 69 |
| 70 // We need to set canInitializeWithMemset=true because HeapVector supports | 70 // We need to set canInitializeWithMemset=true because HeapVector supports |
| 71 // items that can initialize with memset or have a vtable. It is safe to | 71 // items that can initialize with memset or have a vtable. It is safe to |
| 72 // set canInitializeWithMemset=true for a union type object in practice. | 72 // set canInitializeWithMemset=true for a union type object in practice. |
| 73 // See https://codereview.chromium.org/1118993002/#msg5 for more details. | 73 // See https://codereview.chromium.org/1118993002/#msg5 for more details. |
| 74 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::{{cpp_class}}); | 74 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::{{cpp_class}}); |
| 75 | 75 |
| 76 #endif // {{cpp_class}}_h | 76 #endif // {{cpp_class}}_h |
| 77 | 77 |
| 78 {% endfilter %}{# format_blink_cpp_source_code #} | 78 {% endfilter %}{# format_blink_cpp_source_code #} |
| OLD | NEW |