| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 <class CallbackInfo> | 63 template <class CallbackInfo> |
| 64 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, {{cpp_class}}& im
pl, v8::Local<v8::Object> creationContext) { | 64 inline void V8SetReturnValue(const CallbackInfo& callbackInfo, {{cpp_class}}& im
pl, v8::Local<v8::Object> creationContext) { |
| 65 v8SetReturnValue(callbackInfo, ToV8(impl, creationContext, callbackInfo.GetIso
late())); | 65 V8SetReturnValue(callbackInfo, ToV8(impl, creationContext, callbackInfo.GetIso
late())); |
| 66 } | 66 } |
| 67 | 67 |
| 68 template <> | 68 template <> |
| 69 struct NativeValueTraits<{{cpp_class}}> : public NativeValueTraitsBase<{{cpp_cla
ss}}> { | 69 struct NativeValueTraits<{{cpp_class}}> : public NativeValueTraitsBase<{{cpp_cla
ss}}> { |
| 70 {{exported}}static {{cpp_class}} nativeValue(v8::Isolate*, v8::Local<v8::Value
>, ExceptionState&); | 70 {{exported}}static {{cpp_class}} NativeValue(v8::Isolate*, v8::Local<v8::Value
>, ExceptionState&); |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 template <> | 73 template <> |
| 74 struct V8TypeOf<{{cpp_class}}> { | 74 struct V8TypeOf<{{cpp_class}}> { |
| 75 typedef {{v8_class}} Type; | 75 typedef {{v8_class}} Type; |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 } // namespace blink | 78 } // namespace blink |
| 79 | 79 |
| 80 // We need to set canInitializeWithMemset=true because HeapVector supports | 80 // We need to set canInitializeWithMemset=true because HeapVector supports |
| 81 // items that can initialize with memset or have a vtable. It is safe to | 81 // items that can initialize with memset or have a vtable. It is safe to |
| 82 // set canInitializeWithMemset=true for a union type object in practice. | 82 // set canInitializeWithMemset=true for a union type object in practice. |
| 83 // See https://codereview.chromium.org/1118993002/#msg5 for more details. | 83 // See https://codereview.chromium.org/1118993002/#msg5 for more details. |
| 84 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::{{cpp_class}}); | 84 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::{{cpp_class}}); |
| 85 | 85 |
| 86 #endif // {{cpp_class}}_h | 86 #endif // {{cpp_class}}_h |
| 87 | 87 |
| 88 {% endfilter %}{# format_blink_cpp_source_code #} | 88 {% endfilter %}{# format_blink_cpp_source_code #} |
| OLD | NEW |