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 |
(...skipping 14 matching lines...) Expand all Loading... |
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 "V8CSSFontFaceRule.h" | 29 #include "V8CSSFontFaceRule.h" |
30 #include "V8DOMError.h" | 30 #include "V8DOMError.h" |
31 #include "V8DOMWindow.h" | 31 #include "V8DOMWindow.h" |
32 #include "V8EventTarget.h" | 32 #include "V8EventTarget.h" |
33 #include "V8IDBKeyRange.h" | 33 #include "V8IDBKeyRange.h" |
34 #include "V8MIDIPort.h" | 34 #include "V8MIDIPort.h" |
| 35 #include "V8MediaKeyError.h" |
35 #include "V8SpeechRecognitionError.h" | 36 #include "V8SpeechRecognitionError.h" |
36 #include "V8SpeechRecognitionResult.h" | 37 #include "V8SpeechRecognitionResult.h" |
37 #include "V8SpeechRecognitionResultList.h" | 38 #include "V8SpeechRecognitionResultList.h" |
38 #include "V8Storage.h" | 39 #include "V8Storage.h" |
39 #include "V8Uint8Array.h" | 40 #include "V8Uint8Array.h" |
40 #include "V8VoidCallback.h" | 41 #include "V8VoidCallback.h" |
41 #include "bindings/v8/ArrayValue.h" | 42 #include "bindings/v8/ArrayValue.h" |
42 #include "bindings/v8/V8Binding.h" | 43 #include "bindings/v8/V8Binding.h" |
43 #include "bindings/v8/V8Utilities.h" | 44 #include "bindings/v8/V8Utilities.h" |
44 #include "core/dom/DOMStringList.h" | 45 #include "core/dom/DOMStringList.h" |
45 #include "modules/indexeddb/IDBKeyRange.h" | 46 #include "modules/indexeddb/IDBKeyRange.h" |
46 #include "modules/speech/SpeechRecognitionError.h" | 47 #include "modules/speech/SpeechRecognitionError.h" |
47 #include "modules/speech/SpeechRecognitionResult.h" | 48 #include "modules/speech/SpeechRecognitionResult.h" |
48 #include "modules/speech/SpeechRecognitionResultList.h" | 49 #include "modules/speech/SpeechRecognitionResultList.h" |
49 #include "wtf/MathExtras.h" | 50 #include "wtf/MathExtras.h" |
50 | 51 |
51 #if ENABLE(ENCRYPTED_MEDIA) | |
52 #include "V8MediaKeyError.h" | |
53 #endif | |
54 | |
55 #include "V8TextTrack.h" | 52 #include "V8TextTrack.h" |
56 #include "core/html/track/TrackBase.h" | 53 #include "core/html/track/TrackBase.h" |
57 | 54 |
58 #include "V8MediaStream.h" | 55 #include "V8MediaStream.h" |
59 #include "modules/mediastream/MediaStream.h" | 56 #include "modules/mediastream/MediaStream.h" |
60 | 57 |
61 namespace WebCore { | 58 namespace WebCore { |
62 | 59 |
63 Dictionary::Dictionary() | 60 Dictionary::Dictionary() |
64 : m_isolate(0) | 61 : m_isolate(0) |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 v8::Local<v8::Value> v8Value; | 332 v8::Local<v8::Value> v8Value; |
336 if (!getKey(key, v8Value)) | 333 if (!getKey(key, v8Value)) |
337 return false; | 334 return false; |
338 | 335 |
339 value = 0; | 336 value = 0; |
340 if (V8MIDIPort::HasInstance(v8Value, m_isolate, worldType(m_isolate))) | 337 if (V8MIDIPort::HasInstance(v8Value, m_isolate, worldType(m_isolate))) |
341 value = V8MIDIPort::toNative(v8::Handle<v8::Object>::Cast(v8Value)); | 338 value = V8MIDIPort::toNative(v8::Handle<v8::Object>::Cast(v8Value)); |
342 return true; | 339 return true; |
343 } | 340 } |
344 | 341 |
345 #if ENABLE(ENCRYPTED_MEDIA) | |
346 bool Dictionary::get(const String& key, RefPtr<MediaKeyError>& value) const | 342 bool Dictionary::get(const String& key, RefPtr<MediaKeyError>& value) const |
347 { | 343 { |
348 v8::Local<v8::Value> v8Value; | 344 v8::Local<v8::Value> v8Value; |
349 if (!getKey(key, v8Value)) | 345 if (!getKey(key, v8Value)) |
350 return false; | 346 return false; |
351 | 347 |
352 value = 0; | 348 value = 0; |
353 if (V8MediaKeyError::HasInstance(v8Value, m_isolate, worldType(m_isolate))) | 349 if (V8MediaKeyError::HasInstance(v8Value, m_isolate, worldType(m_isolate))) |
354 value = V8MediaKeyError::toNative(v8::Handle<v8::Object>::Cast(v8Value))
; | 350 value = V8MediaKeyError::toNative(v8::Handle<v8::Object>::Cast(v8Value))
; |
355 return true; | 351 return true; |
356 } | 352 } |
357 #endif | |
358 | 353 |
359 bool Dictionary::get(const String& key, RefPtr<TrackBase>& value) const | 354 bool Dictionary::get(const String& key, RefPtr<TrackBase>& value) const |
360 { | 355 { |
361 v8::Local<v8::Value> v8Value; | 356 v8::Local<v8::Value> v8Value; |
362 if (!getKey(key, v8Value)) | 357 if (!getKey(key, v8Value)) |
363 return false; | 358 return false; |
364 | 359 |
365 TrackBase* source = 0; | 360 TrackBase* source = 0; |
366 if (v8Value->IsObject()) { | 361 if (v8Value->IsObject()) { |
367 v8::Handle<v8::Object> wrapper = v8::Handle<v8::Object>::Cast(v8Value); | 362 v8::Handle<v8::Object> wrapper = v8::Handle<v8::Object>::Cast(v8Value); |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 v8::Local<v8::String> key = properties->Get(i)->ToString(); | 582 v8::Local<v8::String> key = properties->Get(i)->ToString(); |
588 if (!options->Has(key)) | 583 if (!options->Has(key)) |
589 continue; | 584 continue; |
590 names.append(toWebCoreString(key)); | 585 names.append(toWebCoreString(key)); |
591 } | 586 } |
592 | 587 |
593 return true; | 588 return true; |
594 } | 589 } |
595 | 590 |
596 } // namespace WebCore | 591 } // namespace WebCore |
OLD | NEW |