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

Side by Side Diff: third_party/WebKit/Source/bindings/templates/dictionary_v8.h.tmpl

Issue 2653093002: [bindings] Allow dictionary and union types to be returned from static methods. (Closed)
Patch Set: Created 3 years, 11 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 {% 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 {{v8_original_class}}_h 4 #ifndef {{v8_original_class}}_h
5 #define {{v8_original_class}}_h 5 #define {{v8_original_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
11 namespace blink { 11 namespace blink {
12 12
13 class ExceptionState; 13 class ExceptionState;
14 14
15 class {{v8_class}} { 15 class {{v8_class}} {
16 public: 16 public:
17 {{exported}}static void toImpl(v8::Isolate*, v8::Local<v8::Value>, {{cpp_class }}&, ExceptionState&); 17 {{exported}}static void toImpl(v8::Isolate*, v8::Local<v8::Value>, {{cpp_class }}&, ExceptionState&);
18 }; 18 };
19 19
20 {{exported}}bool toV8{{cpp_class}}(const {{cpp_class}}&, v8::Local<v8::Object> d ictionary, v8::Local<v8::Object> creationContext, v8::Isolate*); 20 {{exported}}bool toV8{{cpp_class}}(const {{cpp_class}}&, v8::Local<v8::Object> d ictionary, v8::Local<v8::Object> creationContext, v8::Isolate*);
21 21
22 template<class CallbackInfo> 22 template <class CallbackInfo>
23 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, {{cpp_class}}& im pl) { 23 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, {{cpp_class}}& im pl) {
24 v8SetReturnValue(callbackInfo, ToV8(impl, callbackInfo.Holder(), callbackInfo. GetIsolate())); 24 v8SetReturnValue(callbackInfo, ToV8(impl, callbackInfo.Holder(), callbackInfo. GetIsolate()));
25 } 25 }
26 26
27 template <class CallbackInfo>
28 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, {{cpp_class}}& im pl, v8::Local<v8::Object> creationContext) {
29 v8SetReturnValue(callbackInfo, ToV8(impl, creationContext, callbackInfo.GetIso late()));
30 }
31
27 template <> 32 template <>
28 struct NativeValueTraits<{{cpp_class}}> { 33 struct NativeValueTraits<{{cpp_class}}> {
29 static {{cpp_class}} nativeValue(v8::Isolate*, v8::Local<v8::Value>, Exception State&); 34 static {{cpp_class}} nativeValue(v8::Isolate*, v8::Local<v8::Value>, Exception State&);
30 }; 35 };
31 36
32 template <> 37 template <>
33 struct V8TypeOf<{{cpp_class}}> { 38 struct V8TypeOf<{{cpp_class}}> {
34 typedef {{v8_class}} Type; 39 typedef {{v8_class}} Type;
35 }; 40 };
36 41
37 } // namespace blink 42 } // namespace blink
38 43
39 #endif // {{v8_original_class}}_h 44 #endif // {{v8_original_class}}_h
40 45
41 {% endfilter %}{# format_blink_cpp_source_code #} 46 {% endfilter %}{# format_blink_cpp_source_code #}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698