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

Side by Side Diff: third_party/WebKit/Source/bindings/tests/results/core/DoubleOrString.h

Issue 2709983004: WIP bindings: Add support for the record<K,V> WebIDL type. (Closed)
Patch Set: Rebased patch using NativeValueTraits for IDL types 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 DoubleOrString_h 12 #ifndef DoubleOrString_h
13 #define DoubleOrString_h 13 #define DoubleOrString_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 "core/CoreExport.h" 19 #include "core/CoreExport.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 CORE_EXPORT DoubleOrString final { 24 class CORE_EXPORT DoubleOrString final {
24 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); 25 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
25 public: 26 public:
26 DoubleOrString(); 27 DoubleOrString();
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
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, DoubleOrString& i mpl, v8::Local<v8::Object> creationContext) { 72 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, DoubleOrString& i mpl, 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<DoubleOrString> { 77 struct NativeValueTraits<DoubleOrString> {
78 using ImplType = DoubleOrString;
77 CORE_EXPORT static DoubleOrString nativeValue(v8::Isolate*, v8::Local<v8::Valu e>, ExceptionState&); 79 CORE_EXPORT static DoubleOrString nativeValue(v8::Isolate*, v8::Local<v8::Valu e>, ExceptionState&);
78 }; 80 };
79 81
82 template <>
83 struct V8TypeOf<DoubleOrString> {
84 typedef V8DoubleOrString Type;
85 };
86
80 } // namespace blink 87 } // namespace blink
81 88
82 // We need to set canInitializeWithMemset=true because HeapVector supports 89 // We need to set canInitializeWithMemset=true because HeapVector supports
83 // items that can initialize with memset or have a vtable. It is safe to 90 // 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. 91 // set canInitializeWithMemset=true for a union type object in practice.
85 // See https://codereview.chromium.org/1118993002/#msg5 for more details. 92 // See https://codereview.chromium.org/1118993002/#msg5 for more details.
86 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::DoubleOrString); 93 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::DoubleOrString);
87 94
88 #endif // DoubleOrString_h 95 #endif // DoubleOrString_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698