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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 | 55 |
56 v8::Handle<v8::Value> toV8({{container.cpp_class}}&, v8::Handle<v8::Object>, v8:
:Isolate*); | 56 v8::Handle<v8::Value> toV8({{container.cpp_class}}&, v8::Handle<v8::Object>, v8:
:Isolate*); |
57 | 57 |
58 template <class CallbackInfo> | 58 template <class CallbackInfo> |
59 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, {{container.cpp_c
lass}}& impl) | 59 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, {{container.cpp_c
lass}}& impl) |
60 { | 60 { |
61 v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInf
o.GetIsolate())); | 61 v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInf
o.GetIsolate())); |
62 } | 62 } |
63 | 63 |
64 {% endfor %} | 64 {% endfor %} |
| 65 |
| 66 {% for nullable_container in nullable_containers %} |
| 67 class V8{{nullable_container.cpp_class}}OrNull final { |
| 68 public: |
| 69 static void toImpl(v8::Isolate* isolate, v8::Handle<v8::Value> v8Value, {{nu
llable_container.cpp_class}}& impl, ExceptionState& exceptionState) |
| 70 { |
| 71 {# http://heycam.github.io/webidl/#es-union #} |
| 72 {# 1. null or undefined #} |
| 73 if (isUndefinedOrNull(v8Value)) |
| 74 return; |
| 75 V8{{nullable_container.cpp_class}}::toImpl(isolate, v8Value, impl, excep
tionState); |
| 76 } |
| 77 }; |
| 78 |
| 79 {% endfor %} |
65 } // namespace blink | 80 } // namespace blink |
66 | 81 |
67 #endif // {{macro_guard}} | 82 #endif // {{macro_guard}} |
OLD | NEW |