| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 16 matching lines...) Expand all Loading... |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 | 32 |
| 33 #include "modules/mediastream/MediaConstraintsImpl.h" | 33 #include "modules/mediastream/MediaConstraintsImpl.h" |
| 34 | 34 |
| 35 #include "bindings/v8/ArrayValue.h" | 35 #include "bindings/v8/ArrayValue.h" |
| 36 #include "bindings/v8/Dictionary.h" | 36 #include "bindings/v8/Dictionary.h" |
| 37 #include "bindings/v8/ExceptionState.h" | |
| 38 #include "core/dom/ExceptionCode.h" | 37 #include "core/dom/ExceptionCode.h" |
| 39 #include "wtf/HashMap.h" | 38 #include "wtf/HashMap.h" |
| 40 | 39 |
| 41 namespace WebCore { | 40 namespace WebCore { |
| 42 | 41 |
| 43 PassRefPtr<MediaConstraintsImpl> MediaConstraintsImpl::create(const Dictionary&
constraints, ExceptionState& es) | 42 PassRefPtr<MediaConstraintsImpl> MediaConstraintsImpl::create(const Dictionary&
constraints, ExceptionCode& ec) |
| 44 { | 43 { |
| 45 RefPtr<MediaConstraintsImpl> object = adoptRef(new MediaConstraintsImpl()); | 44 RefPtr<MediaConstraintsImpl> object = adoptRef(new MediaConstraintsImpl()); |
| 46 if (!object->initialize(constraints)) { | 45 if (!object->initialize(constraints)) { |
| 47 es.throwDOMException(TypeMismatchError); | 46 ec = TypeMismatchError; |
| 48 return 0; | 47 return 0; |
| 49 } | 48 } |
| 50 return object.release(); | 49 return object.release(); |
| 51 } | 50 } |
| 52 | 51 |
| 53 PassRefPtr<MediaConstraintsImpl> MediaConstraintsImpl::create() | 52 PassRefPtr<MediaConstraintsImpl> MediaConstraintsImpl::create() |
| 54 { | 53 { |
| 55 return adoptRef(new MediaConstraintsImpl()); | 54 return adoptRef(new MediaConstraintsImpl()); |
| 56 } | 55 } |
| 57 | 56 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 if (i->m_name == name) { | 148 if (i->m_name == name) { |
| 150 value = i->m_value; | 149 value = i->m_value; |
| 151 return true; | 150 return true; |
| 152 } | 151 } |
| 153 } | 152 } |
| 154 | 153 |
| 155 return false; | 154 return false; |
| 156 } | 155 } |
| 157 | 156 |
| 158 } // namespace WebCore | 157 } // namespace WebCore |
| OLD | NEW |