| 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 15 matching lines...) Expand all Loading... |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 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/RTCIceCandidate.h" | 33 #include "modules/mediastream/RTCIceCandidate.h" |
| 34 | 34 |
| 35 #include "bindings/v8/Dictionary.h" | 35 #include "bindings/v8/Dictionary.h" |
| 36 #include "bindings/v8/ExceptionState.h" | |
| 37 #include "core/dom/ExceptionCode.h" | 36 #include "core/dom/ExceptionCode.h" |
| 38 #include "public/platform/WebRTCICECandidate.h" | 37 #include "public/platform/WebRTCICECandidate.h" |
| 39 | 38 |
| 40 namespace WebCore { | 39 namespace WebCore { |
| 41 | 40 |
| 42 PassRefPtr<RTCIceCandidate> RTCIceCandidate::create(const Dictionary& dictionary
, ExceptionState& es) | 41 PassRefPtr<RTCIceCandidate> RTCIceCandidate::create(const Dictionary& dictionary
, ExceptionCode& ec) |
| 43 { | 42 { |
| 44 String candidate; | 43 String candidate; |
| 45 bool ok = dictionary.get("candidate", candidate); | 44 bool ok = dictionary.get("candidate", candidate); |
| 46 if (!ok || !candidate.length()) { | 45 if (!ok || !candidate.length()) { |
| 47 es.throwDOMException(TypeMismatchError); | 46 ec = TypeMismatchError; |
| 48 return 0; | 47 return 0; |
| 49 } | 48 } |
| 50 | 49 |
| 51 String sdpMid; | 50 String sdpMid; |
| 52 dictionary.get("sdpMid", sdpMid); | 51 dictionary.get("sdpMid", sdpMid); |
| 53 | 52 |
| 54 unsigned short sdpMLineIndex = 0; | 53 unsigned short sdpMLineIndex = 0; |
| 55 dictionary.get("sdpMLineIndex", sdpMLineIndex); | 54 dictionary.get("sdpMLineIndex", sdpMLineIndex); |
| 56 | 55 |
| 57 return adoptRef(new RTCIceCandidate(WebKit::WebRTCICECandidate(candidate, sd
pMid, sdpMLineIndex))); | 56 return adoptRef(new RTCIceCandidate(WebKit::WebRTCICECandidate(candidate, sd
pMid, sdpMLineIndex))); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 86 { | 85 { |
| 87 return m_webCandidate.sdpMLineIndex(); | 86 return m_webCandidate.sdpMLineIndex(); |
| 88 } | 87 } |
| 89 | 88 |
| 90 WebKit::WebRTCICECandidate RTCIceCandidate::webCandidate() | 89 WebKit::WebRTCICECandidate RTCIceCandidate::webCandidate() |
| 91 { | 90 { |
| 92 return m_webCandidate; | 91 return m_webCandidate; |
| 93 } | 92 } |
| 94 | 93 |
| 95 } // namespace WebCore | 94 } // namespace WebCore |
| OLD | NEW |