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 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
638 if (value->IsArray()) { | 638 if (value->IsArray()) { |
639 length = v8::Local<v8::Array>::Cast(v8Value)->Length(); | 639 length = v8::Local<v8::Array>::Cast(v8Value)->Length(); |
640 } else if (toV8Sequence(value, length, isolate).IsEmpty()) { | 640 } else if (toV8Sequence(value, length, isolate).IsEmpty()) { |
641 throwTypeError(ExceptionMessages::notASequenceTypeProperty(propertyName)
, isolate); | 641 throwTypeError(ExceptionMessages::notASequenceTypeProperty(propertyName)
, isolate); |
642 return Vector<RefPtr<T> >(); | 642 return Vector<RefPtr<T> >(); |
643 } | 643 } |
644 return toRefPtrNativeArrayUnchecked<T, V8T>(v8Value, length, isolate, succes
s); | 644 return toRefPtrNativeArrayUnchecked<T, V8T>(v8Value, length, isolate, succes
s); |
645 } | 645 } |
646 | 646 |
647 template <class T, class V8T> | 647 template <class T, class V8T> |
648 HeapVector<Member<T> > toRefPtrWillBeMemberNativeArray(v8::Handle<v8::Value> val
ue, int argumentIndex, v8::Isolate* isolate, bool* success = 0) | 648 WillBeHeapVector<RefPtrWillBeMember<T> > toRefPtrWillBeMemberNativeArray(v8::Han
dle<v8::Value> value, int argumentIndex, v8::Isolate* isolate, bool* success = 0
) |
649 { | 649 { |
650 if (success) | 650 if (success) |
651 *success = true; | 651 *success = true; |
652 | 652 |
653 v8::Local<v8::Value> v8Value(v8::Local<v8::Value>::New(isolate, value)); | 653 v8::Local<v8::Value> v8Value(v8::Local<v8::Value>::New(isolate, value)); |
654 uint32_t length = 0; | 654 uint32_t length = 0; |
655 if (value->IsArray()) { | 655 if (value->IsArray()) { |
656 length = v8::Local<v8::Array>::Cast(v8Value)->Length(); | 656 length = v8::Local<v8::Array>::Cast(v8Value)->Length(); |
657 } else if (toV8Sequence(value, length, isolate).IsEmpty()) { | 657 } else if (toV8Sequence(value, length, isolate).IsEmpty()) { |
658 throwTypeError(ExceptionMessages::notAnArrayTypeArgumentOrValue(argument
Index), isolate); | 658 throwTypeError(ExceptionMessages::notAnArrayTypeArgumentOrValue(argument
Index), isolate); |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
931 | 931 |
932 private: | 932 private: |
933 v8::HandleScope m_handleScope; | 933 v8::HandleScope m_handleScope; |
934 v8::Context::Scope m_contextScope; | 934 v8::Context::Scope m_contextScope; |
935 RefPtr<ScriptState> m_scriptState; | 935 RefPtr<ScriptState> m_scriptState; |
936 }; | 936 }; |
937 | 937 |
938 } // namespace WebCore | 938 } // namespace WebCore |
939 | 939 |
940 #endif // V8Binding_h | 940 #endif // V8Binding_h |
OLD | NEW |