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

Side by Side Diff: Source/bindings/tests/results/core/UnionTypesCore.h

Issue 860353002: IDL: Add toRestricted{Float,Double}() helpers to V8Binding.h (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add FIXME comment Created 5 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 // 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. DO NOT MODIFY! 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
6 6
7 #ifndef UnionTypeCore_h 7 #ifndef UnionTypeCore_h
8 #define UnionTypeCore_h 8 #define UnionTypeCore_h
9 9
10 #include "bindings/core/v8/Dictionary.h" 10 #include "bindings/core/v8/Dictionary.h"
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestInterfaceWill BeGarbageCollectedOrTestDictionary& impl) 641 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestInterfaceWill BeGarbageCollectedOrTestDictionary& impl)
642 { 642 {
643 v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInf o.GetIsolate())); 643 v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInf o.GetIsolate()));
644 } 644 }
645 645
646 template <> 646 template <>
647 struct NativeValueTraits<TestInterfaceWillBeGarbageCollectedOrTestDictionary> { 647 struct NativeValueTraits<TestInterfaceWillBeGarbageCollectedOrTestDictionary> {
648 static TestInterfaceWillBeGarbageCollectedOrTestDictionary nativeValue(const v8::Local<v8::Value>&, v8::Isolate*, ExceptionState&); 648 static TestInterfaceWillBeGarbageCollectedOrTestDictionary nativeValue(const v8::Local<v8::Value>&, v8::Isolate*, ExceptionState&);
649 }; 649 };
650 650
651 class UnrestrictedDoubleOrString final {
652 ALLOW_ONLY_INLINE_ALLOCATION();
653 public:
654 UnrestrictedDoubleOrString();
655 bool isNull() const { return m_type == SpecificTypeNone; }
656
657 bool isUnrestrictedDouble() const { return m_type == SpecificTypeUnrestricte dDouble; }
658 double getAsUnrestrictedDouble() const;
659 void setUnrestrictedDouble(double);
660
661 bool isString() const { return m_type == SpecificTypeString; }
662 String getAsString() const;
663 void setString(String);
664
665 private:
666 enum SpecificTypes {
667 SpecificTypeNone,
668 SpecificTypeUnrestrictedDouble,
669 SpecificTypeString,
670 };
671 SpecificTypes m_type;
672
673 double m_unrestrictedDouble;
674 String m_string;
675
676 friend v8::Local<v8::Value> toV8(const UnrestrictedDoubleOrString&, v8::Loca l<v8::Object>, v8::Isolate*);
677 };
678
679 class V8UnrestrictedDoubleOrString final {
680 public:
681 static void toImpl(v8::Isolate*, v8::Local<v8::Value>, UnrestrictedDoubleOrS tring&, ExceptionState&);
682 };
683
684 v8::Local<v8::Value> toV8(const UnrestrictedDoubleOrString&, v8::Local<v8::Objec t>, v8::Isolate*);
685
686 template <class CallbackInfo>
687 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, UnrestrictedDoubl eOrString& impl)
688 {
689 v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInf o.GetIsolate()));
690 }
691
692 template <>
693 struct NativeValueTraits<UnrestrictedDoubleOrString> {
694 static UnrestrictedDoubleOrString nativeValue(const v8::Local<v8::Value>&, v 8::Isolate*, ExceptionState&);
695 };
696
651 class V8DoubleOrStringOrNull final { 697 class V8DoubleOrStringOrNull final {
652 public: 698 public:
653 static void toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value, Doubl eOrString& impl, ExceptionState& exceptionState) 699 static void toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value, Doubl eOrString& impl, ExceptionState& exceptionState)
654 { 700 {
655 if (isUndefinedOrNull(v8Value)) 701 if (isUndefinedOrNull(v8Value))
656 return; 702 return;
657 V8DoubleOrString::toImpl(isolate, v8Value, impl, exceptionState); 703 V8DoubleOrString::toImpl(isolate, v8Value, impl, exceptionState);
658 } 704 }
659 }; 705 };
660 706
661 } // namespace blink 707 } // namespace blink
662 708
663 #endif // UnionTypeCore_h 709 #endif // UnionTypeCore_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698