OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * Copyright (C) 2012 Ericsson AB. All rights reserved. | 3 * Copyright (C) 2012 Ericsson AB. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
768 static inline String nativeValue(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exceptionState) | 768 static inline String nativeValue(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exceptionState) |
769 { | 769 { |
770 V8StringResource<> stringValue(value); | 770 V8StringResource<> stringValue(value); |
771 if (!stringValue.prepare(exceptionState)) | 771 if (!stringValue.prepare(exceptionState)) |
772 return String(); | 772 return String(); |
773 return stringValue; | 773 return stringValue; |
774 } | 774 } |
775 }; | 775 }; |
776 | 776 |
777 template<> | 777 template<> |
778 struct NativeValueTraits<AtomicString> { | |
779 static inline String nativeValue(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exceptionState) | |
haraken
2016/06/06 01:39:15
Why do you want to return a String for NativeValue
kojii
2016/06/06 11:12:35
Done, that was typo, thank you for catching.
| |
780 { | |
781 V8StringResource<> stringValue(value); | |
782 if (!stringValue.prepare(exceptionState)) | |
783 return String(); | |
784 return stringValue; | |
785 } | |
786 }; | |
787 | |
788 template<> | |
778 struct NativeValueTraits<int> { | 789 struct NativeValueTraits<int> { |
779 static inline int nativeValue(v8::Isolate* isolate, v8::Local<v8::Value> val ue, ExceptionState& exceptionState) | 790 static inline int nativeValue(v8::Isolate* isolate, v8::Local<v8::Value> val ue, ExceptionState& exceptionState) |
780 { | 791 { |
781 return toInt32(isolate, value, NormalConversion, exceptionState); | 792 return toInt32(isolate, value, NormalConversion, exceptionState); |
782 } | 793 } |
783 }; | 794 }; |
784 | 795 |
785 template<> | 796 template<> |
786 struct NativeValueTraits<unsigned> { | 797 struct NativeValueTraits<unsigned> { |
787 static inline unsigned nativeValue(v8::Isolate* isolate, v8::Local<v8::Value > value, ExceptionState& exceptionState) | 798 static inline unsigned nativeValue(v8::Isolate* isolate, v8::Local<v8::Value > value, ExceptionState& exceptionState) |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
953 typedef void (*InstallTemplateFunction)(v8::Isolate*, const DOMWrapperWorld&, v8 ::Local<v8::FunctionTemplate> interfaceTemplate); | 964 typedef void (*InstallTemplateFunction)(v8::Isolate*, const DOMWrapperWorld&, v8 ::Local<v8::FunctionTemplate> interfaceTemplate); |
954 | 965 |
955 // Freeze a V8 object. The type of the first parameter and the return value is | 966 // Freeze a V8 object. The type of the first parameter and the return value is |
956 // intentionally v8::Value so that this function can wrap toV8(). | 967 // intentionally v8::Value so that this function can wrap toV8(). |
957 // If the argument isn't an object, this will crash. | 968 // If the argument isn't an object, this will crash. |
958 v8::Local<v8::Value> freezeV8Object(v8::Local<v8::Value>, v8::Isolate*); | 969 v8::Local<v8::Value> freezeV8Object(v8::Local<v8::Value>, v8::Isolate*); |
959 | 970 |
960 } // namespace blink | 971 } // namespace blink |
961 | 972 |
962 #endif // V8Binding_h | 973 #endif // V8Binding_h |
OLD | NEW |