OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
11 * notice, this list of conditions and the following disclaimer in the | 11 * notice, this list of conditions and the following disclaimer in the |
12 * documentation and/or other materials provided with the distribution. | 12 * documentation and/or other materials provided with the distribution. |
13 * | 13 * |
14 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY | 14 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY |
15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
16 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 16 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
17 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY | 17 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY |
18 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 18 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
19 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 19 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
20 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 20 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
21 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #include "config.h" | 26 #include "config.h" |
27 #include "bindings/v8/Dictionary.h" | 27 #include "bindings/v8/Dictionary.h" |
28 | 28 |
29 #include "V8DOMError.h" | 29 #include "V8DOMError.h" |
| 30 #include "V8Element.h" |
30 #include "V8EventTarget.h" | 31 #include "V8EventTarget.h" |
31 #include "V8Gamepad.h" | 32 #include "V8Gamepad.h" |
32 #include "V8IDBKeyRange.h" | 33 #include "V8IDBKeyRange.h" |
33 #include "V8MIDIPort.h" | 34 #include "V8MIDIPort.h" |
34 #include "V8MediaKeyError.h" | 35 #include "V8MediaKeyError.h" |
35 #include "V8MessagePort.h" | 36 #include "V8MessagePort.h" |
| 37 #include "V8Path2D.h" |
36 #include "V8SpeechRecognitionError.h" | 38 #include "V8SpeechRecognitionError.h" |
37 #include "V8SpeechRecognitionResult.h" | 39 #include "V8SpeechRecognitionResult.h" |
38 #include "V8SpeechRecognitionResultList.h" | 40 #include "V8SpeechRecognitionResultList.h" |
39 #include "V8Storage.h" | 41 #include "V8Storage.h" |
40 #include "V8VoidCallback.h" | 42 #include "V8VoidCallback.h" |
41 #include "V8Window.h" | 43 #include "V8Window.h" |
42 #include "bindings/v8/ArrayValue.h" | 44 #include "bindings/v8/ArrayValue.h" |
43 #include "bindings/v8/ExceptionMessages.h" | 45 #include "bindings/v8/ExceptionMessages.h" |
44 #include "bindings/v8/ExceptionState.h" | 46 #include "bindings/v8/ExceptionState.h" |
45 #include "bindings/v8/V8Binding.h" | 47 #include "bindings/v8/V8Binding.h" |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 bool Dictionary::get(const String& key, RefPtr<ArrayBufferView>& value) const | 435 bool Dictionary::get(const String& key, RefPtr<ArrayBufferView>& value) const |
434 { | 436 { |
435 v8::Local<v8::Value> v8Value; | 437 v8::Local<v8::Value> v8Value; |
436 if (!getKey(key, v8Value)) | 438 if (!getKey(key, v8Value)) |
437 return false; | 439 return false; |
438 | 440 |
439 value = V8ArrayBufferView::toNativeWithTypeCheck(m_isolate, v8Value); | 441 value = V8ArrayBufferView::toNativeWithTypeCheck(m_isolate, v8Value); |
440 return true; | 442 return true; |
441 } | 443 } |
442 | 444 |
| 445 bool Dictionary::get(const String& key, RefPtr<Element>& value) const |
| 446 { |
| 447 v8::Local<v8::Value> v8Value; |
| 448 if (!getKey(key, v8Value)) |
| 449 return false; |
| 450 |
| 451 value = V8Element::toNativeWithTypeCheck(m_isolate, v8Value); |
| 452 return true; |
| 453 } |
| 454 |
443 bool Dictionary::get(const String& key, RefPtr<MIDIPort>& value) const | 455 bool Dictionary::get(const String& key, RefPtr<MIDIPort>& value) const |
444 { | 456 { |
445 v8::Local<v8::Value> v8Value; | 457 v8::Local<v8::Value> v8Value; |
446 if (!getKey(key, v8Value)) | 458 if (!getKey(key, v8Value)) |
447 return false; | 459 return false; |
448 | 460 |
449 value = V8MIDIPort::toNativeWithTypeCheck(m_isolate, v8Value); | 461 value = V8MIDIPort::toNativeWithTypeCheck(m_isolate, v8Value); |
450 return true; | 462 return true; |
451 } | 463 } |
452 | 464 |
453 bool Dictionary::get(const String& key, RefPtr<MediaKeyError>& value) const | 465 bool Dictionary::get(const String& key, RefPtr<MediaKeyError>& value) const |
454 { | 466 { |
455 v8::Local<v8::Value> v8Value; | 467 v8::Local<v8::Value> v8Value; |
456 if (!getKey(key, v8Value)) | 468 if (!getKey(key, v8Value)) |
457 return false; | 469 return false; |
458 | 470 |
459 value = V8MediaKeyError::toNativeWithTypeCheck(m_isolate, v8Value); | 471 value = V8MediaKeyError::toNativeWithTypeCheck(m_isolate, v8Value); |
460 return true; | 472 return true; |
461 } | 473 } |
462 | 474 |
| 475 bool Dictionary::get(const String& key, RefPtr<Path2D>& value) const |
| 476 { |
| 477 v8::Local<v8::Value> v8Value; |
| 478 if (!getKey(key, v8Value)) |
| 479 return false; |
| 480 |
| 481 value = V8Path2D::toNativeWithTypeCheck(m_isolate, v8Value); |
| 482 return true; |
| 483 } |
| 484 |
463 bool Dictionary::get(const String& key, RefPtrWillBeMember<TrackBase>& value) co
nst | 485 bool Dictionary::get(const String& key, RefPtrWillBeMember<TrackBase>& value) co
nst |
464 { | 486 { |
465 v8::Local<v8::Value> v8Value; | 487 v8::Local<v8::Value> v8Value; |
466 if (!getKey(key, v8Value)) | 488 if (!getKey(key, v8Value)) |
467 return false; | 489 return false; |
468 | 490 |
469 TrackBase* source = 0; | 491 TrackBase* source = 0; |
470 if (v8Value->IsObject()) { | 492 if (v8Value->IsObject()) { |
471 v8::Handle<v8::Object> wrapper = v8::Handle<v8::Object>::Cast(v8Value); | 493 v8::Handle<v8::Object> wrapper = v8::Handle<v8::Object>::Cast(v8Value); |
472 | 494 |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
751 | 773 |
752 return *this; | 774 return *this; |
753 } | 775 } |
754 | 776 |
755 void Dictionary::ConversionContext::throwTypeError(const String& detail) | 777 void Dictionary::ConversionContext::throwTypeError(const String& detail) |
756 { | 778 { |
757 exceptionState().throwTypeError(detail); | 779 exceptionState().throwTypeError(detail); |
758 } | 780 } |
759 | 781 |
760 } // namespace WebCore | 782 } // namespace WebCore |
OLD | NEW |