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 AtomicString nativeValue(v8::Isolate* isolate, v8::Local<v8::V
alue> value, ExceptionState& exceptionState) |
| 780 { |
| 781 V8StringResource<> stringValue(value); |
| 782 if (!stringValue.prepare(exceptionState)) |
| 783 return AtomicString(); |
| 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
952 typedef void (*InstallTemplateFunction)(v8::Isolate*, const DOMWrapperWorld&, v8
::Local<v8::FunctionTemplate> interfaceTemplate); | 963 typedef void (*InstallTemplateFunction)(v8::Isolate*, const DOMWrapperWorld&, v8
::Local<v8::FunctionTemplate> interfaceTemplate); |
953 | 964 |
954 // Freeze a V8 object. The type of the first parameter and the return value is | 965 // Freeze a V8 object. The type of the first parameter and the return value is |
955 // intentionally v8::Value so that this function can wrap toV8(). | 966 // intentionally v8::Value so that this function can wrap toV8(). |
956 // If the argument isn't an object, this will crash. | 967 // If the argument isn't an object, this will crash. |
957 v8::Local<v8::Value> freezeV8Object(v8::Local<v8::Value>, v8::Isolate*); | 968 v8::Local<v8::Value> freezeV8Object(v8::Local<v8::Value>, v8::Isolate*); |
958 | 969 |
959 } // namespace blink | 970 } // namespace blink |
960 | 971 |
961 #endif // V8Binding_h | 972 #endif // V8Binding_h |
OLD | NEW |