| 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 20 matching lines...) Expand all Loading... |
| 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" | 36 #include "bindings/v8/ExceptionState.h" |
| 37 #include "core/dom/ExceptionCode.h" | 37 #include "core/dom/ExceptionCode.h" |
| 38 | 38 |
| 39 namespace WebCore { | 39 namespace WebCore { |
| 40 | 40 |
| 41 PassRefPtr<RTCIceCandidate> RTCIceCandidate::create(const Dictionary& dictionary
, ExceptionState& es) | 41 PassRefPtr<RTCIceCandidate> RTCIceCandidate::create(const Dictionary& dictionary
, ExceptionState& exceptionState) |
| 42 { | 42 { |
| 43 String candidate; | 43 String candidate; |
| 44 bool ok = dictionary.get("candidate", candidate); | 44 bool ok = dictionary.get("candidate", candidate); |
| 45 if (!ok || !candidate.length()) { | 45 if (!ok || !candidate.length()) { |
| 46 es.throwUninformativeAndGenericDOMException(TypeMismatchError); | 46 exceptionState.throwUninformativeAndGenericDOMException(TypeMismatchErro
r); |
| 47 return 0; | 47 return 0; |
| 48 } | 48 } |
| 49 | 49 |
| 50 String sdpMid; | 50 String sdpMid; |
| 51 dictionary.get("sdpMid", sdpMid); | 51 dictionary.get("sdpMid", sdpMid); |
| 52 | 52 |
| 53 unsigned short sdpMLineIndex = 0; | 53 unsigned short sdpMLineIndex = 0; |
| 54 dictionary.get("sdpMLineIndex", sdpMLineIndex); | 54 dictionary.get("sdpMLineIndex", sdpMLineIndex); |
| 55 | 55 |
| 56 return adoptRef(new RTCIceCandidate(blink::WebRTCICECandidate(candidate, sdp
Mid, sdpMLineIndex))); | 56 return adoptRef(new RTCIceCandidate(blink::WebRTCICECandidate(candidate, sdp
Mid, sdpMLineIndex))); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 81 { | 81 { |
| 82 return m_webCandidate.sdpMLineIndex(); | 82 return m_webCandidate.sdpMLineIndex(); |
| 83 } | 83 } |
| 84 | 84 |
| 85 blink::WebRTCICECandidate RTCIceCandidate::webCandidate() | 85 blink::WebRTCICECandidate RTCIceCandidate::webCandidate() |
| 86 { | 86 { |
| 87 return m_webCandidate; | 87 return m_webCandidate; |
| 88 } | 88 } |
| 89 | 89 |
| 90 } // namespace WebCore | 90 } // namespace WebCore |
| OLD | NEW |