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

Side by Side Diff: third_party/WebKit/Source/bindings/tests/results/modules/BooleanOrString.h

Issue 2730183003: bindings: Add C++ versions of WebIDL types and generalize NativeValueTraits. (Closed)
Patch Set: Move specialization for SerializedScriptValue to the appropriate header Created 3 years, 9 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 // 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_v8.py. 5 // This file has been auto-generated by code_generator_v8.py.
6 // DO NOT MODIFY! 6 // DO NOT MODIFY!
7 7
8 // This file has been generated from the Jinja2 template in 8 // This file has been generated from the Jinja2 template in
9 // third_party/WebKit/Source/bindings/templates/union_container.h.tmpl 9 // third_party/WebKit/Source/bindings/templates/union_container.h.tmpl
10 10
11 // clang-format off 11 // clang-format off
12 #ifndef BooleanOrString_h 12 #ifndef BooleanOrString_h
13 #define BooleanOrString_h 13 #define BooleanOrString_h
14 14
15 #include "bindings/core/v8/Dictionary.h" 15 #include "bindings/core/v8/Dictionary.h"
16 #include "bindings/core/v8/ExceptionState.h" 16 #include "bindings/core/v8/ExceptionState.h"
17 #include "bindings/core/v8/NativeValueTraits.h"
17 #include "bindings/core/v8/V8Binding.h" 18 #include "bindings/core/v8/V8Binding.h"
18 #include "modules/ModulesExport.h" 19 #include "modules/ModulesExport.h"
19 #include "platform/heap/Handle.h" 20 #include "platform/heap/Handle.h"
20 21
21 namespace blink { 22 namespace blink {
22 23
23 class MODULES_EXPORT BooleanOrString final { 24 class MODULES_EXPORT BooleanOrString final {
24 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); 25 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
25 public: 26 public:
26 BooleanOrString(); 27 BooleanOrString();
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, BooleanOrString& impl) { 67 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, BooleanOrString& impl) {
67 v8SetReturnValue(callbackInfo, ToV8(impl, callbackInfo.Holder(), callbackInfo. GetIsolate())); 68 v8SetReturnValue(callbackInfo, ToV8(impl, callbackInfo.Holder(), callbackInfo. GetIsolate()));
68 } 69 }
69 70
70 template <class CallbackInfo> 71 template <class CallbackInfo>
71 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, BooleanOrString& impl, v8::Local<v8::Object> creationContext) { 72 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, BooleanOrString& impl, v8::Local<v8::Object> creationContext) {
72 v8SetReturnValue(callbackInfo, ToV8(impl, creationContext, callbackInfo.GetIso late())); 73 v8SetReturnValue(callbackInfo, ToV8(impl, creationContext, callbackInfo.GetIso late()));
73 } 74 }
74 75
75 template <> 76 template <>
76 struct NativeValueTraits<BooleanOrString> { 77 struct NativeValueTraits<BooleanOrString> : public NativeValueTraitsBase<Boolean OrString> {
77 MODULES_EXPORT static BooleanOrString nativeValue(v8::Isolate*, v8::Local<v8:: Value>, ExceptionState&); 78 MODULES_EXPORT static BooleanOrString nativeValue(v8::Isolate*, v8::Local<v8:: Value>, ExceptionState&);
78 }; 79 };
79 80
81 template <>
82 struct V8TypeOf<BooleanOrString> {
83 typedef V8BooleanOrString Type;
84 };
85
80 } // namespace blink 86 } // namespace blink
81 87
82 // We need to set canInitializeWithMemset=true because HeapVector supports 88 // We need to set canInitializeWithMemset=true because HeapVector supports
83 // items that can initialize with memset or have a vtable. It is safe to 89 // items that can initialize with memset or have a vtable. It is safe to
84 // set canInitializeWithMemset=true for a union type object in practice. 90 // set canInitializeWithMemset=true for a union type object in practice.
85 // See https://codereview.chromium.org/1118993002/#msg5 for more details. 91 // See https://codereview.chromium.org/1118993002/#msg5 for more details.
86 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::BooleanOrString); 92 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::BooleanOrString);
87 93
88 #endif // BooleanOrString_h 94 #endif // BooleanOrString_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698