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