Chromium Code Reviews| 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 13 matching lines...) Expand all Loading... | |
| 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 "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 "V8SpeechRecognitionError.h" | 35 #include "V8SpeechRecognitionError.h" |
| 35 #include "V8SpeechRecognitionResult.h" | 36 #include "V8SpeechRecognitionResult.h" |
| 36 #include "V8SpeechRecognitionResultList.h" | 37 #include "V8SpeechRecognitionResultList.h" |
| 37 #include "V8Storage.h" | 38 #include "V8Storage.h" |
| 38 #include "V8Uint8Array.h" | 39 #include "V8Uint8Array.h" |
| 39 #include "V8VoidCallback.h" | 40 #include "V8VoidCallback.h" |
| 40 #include "bindings/v8/ArrayValue.h" | 41 #include "bindings/v8/ArrayValue.h" |
| 41 #include "bindings/v8/V8Binding.h" | 42 #include "bindings/v8/V8Binding.h" |
| 42 #include "bindings/v8/V8Utilities.h" | 43 #include "bindings/v8/V8Utilities.h" |
| 43 #include "core/dom/DOMStringList.h" | 44 #include "core/dom/DOMStringList.h" |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 324 v8::Local<v8::Value> v8Value; | 325 v8::Local<v8::Value> v8Value; |
| 325 if (!getKey(key, v8Value)) | 326 if (!getKey(key, v8Value)) |
| 326 return false; | 327 return false; |
| 327 | 328 |
| 328 value = 0; | 329 value = 0; |
| 329 if (V8Uint8Array::HasInstance(v8Value, m_isolate, worldType(m_isolate))) | 330 if (V8Uint8Array::HasInstance(v8Value, m_isolate, worldType(m_isolate))) |
| 330 value = V8Uint8Array::toNative(v8::Handle<v8::Object>::Cast(v8Value)); | 331 value = V8Uint8Array::toNative(v8::Handle<v8::Object>::Cast(v8Value)); |
| 331 return true; | 332 return true; |
| 332 } | 333 } |
| 333 | 334 |
| 335 bool Dictionary::get(const String& key, RefPtr<MIDIPort>& value) const | |
| 336 { | |
| 337 v8::Local<v8::Value> v8Value; | |
| 338 if (!getKey(key, v8Value)) | |
| 339 return false; | |
| 340 | |
| 341 value = 0; | |
| 342 if (V8MediaKeyError::HasInstance(v8Value, m_isolate, worldType(m_isolate))) | |
|
haraken
2013/04/25 06:33:00
I don't think this works. V8MediaKeyError => V8MID
Takashi Toyoshima
2013/04/25 07:20:27
Oops. Sorry, I missed to rename it.
| |
| 343 value = V8MIDIPort::toNative(v8::Handle<v8::Object>::Cast(v8Value)); | |
| 344 return true; | |
| 345 } | |
| 346 | |
| 334 #if ENABLE(ENCRYPTED_MEDIA) | 347 #if ENABLE(ENCRYPTED_MEDIA) |
| 335 bool Dictionary::get(const String& key, RefPtr<MediaKeyError>& value) const | 348 bool Dictionary::get(const String& key, RefPtr<MediaKeyError>& value) const |
| 336 { | 349 { |
| 337 v8::Local<v8::Value> v8Value; | 350 v8::Local<v8::Value> v8Value; |
| 338 if (!getKey(key, v8Value)) | 351 if (!getKey(key, v8Value)) |
| 339 return false; | 352 return false; |
| 340 | 353 |
| 341 value = 0; | 354 value = 0; |
| 342 if (V8MediaKeyError::HasInstance(v8Value, m_isolate, worldType(m_isolate))) | 355 if (V8MediaKeyError::HasInstance(v8Value, m_isolate, worldType(m_isolate))) |
| 343 value = V8MediaKeyError::toNative(v8::Handle<v8::Object>::Cast(v8Value)) ; | 356 value = V8MediaKeyError::toNative(v8::Handle<v8::Object>::Cast(v8Value)) ; |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 578 v8::Local<v8::String> key = properties->Get(i)->ToString(); | 591 v8::Local<v8::String> key = properties->Get(i)->ToString(); |
| 579 if (!options->Has(key)) | 592 if (!options->Has(key)) |
| 580 continue; | 593 continue; |
| 581 names.append(toWebCoreString(key)); | 594 names.append(toWebCoreString(key)); |
| 582 } | 595 } |
| 583 | 596 |
| 584 return true; | 597 return true; |
| 585 } | 598 } |
| 586 | 599 |
| 587 } // namespace WebCore | 600 } // namespace WebCore |
| OLD | NEW |