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 10 matching lines...) Expand all Loading... |
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
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 "modules/mediastream/RTCIceCandidate.h" | 31 #include "modules/peerconnection/RTCIceCandidate.h" |
32 | 32 |
33 #include "bindings/core/v8/ExceptionMessages.h" | 33 #include "bindings/core/v8/ExceptionMessages.h" |
34 #include "bindings/core/v8/ExceptionState.h" | 34 #include "bindings/core/v8/ExceptionState.h" |
35 #include "bindings/core/v8/ScriptValue.h" | 35 #include "bindings/core/v8/ScriptValue.h" |
36 #include "bindings/core/v8/V8ObjectBuilder.h" | 36 #include "bindings/core/v8/V8ObjectBuilder.h" |
37 #include "core/dom/ExceptionCode.h" | 37 #include "core/dom/ExceptionCode.h" |
38 #include "core/dom/ExecutionContext.h" | 38 #include "core/dom/ExecutionContext.h" |
39 #include "core/frame/UseCounter.h" | 39 #include "core/frame/UseCounter.h" |
40 #include "modules/mediastream/RTCIceCandidateInit.h" | 40 #include "modules/peerconnection/RTCIceCandidateInit.h" |
41 | 41 |
42 namespace blink { | 42 namespace blink { |
43 | 43 |
44 RTCIceCandidate* RTCIceCandidate::create(ExecutionContext* context, const RTCIce
CandidateInit& candidateInit, ExceptionState& exceptionState) | 44 RTCIceCandidate* RTCIceCandidate::create(ExecutionContext* context, const RTCIce
CandidateInit& candidateInit, ExceptionState& exceptionState) |
45 { | 45 { |
46 if (!candidateInit.hasCandidate() || !candidateInit.candidate().length()) { | 46 if (!candidateInit.hasCandidate() || !candidateInit.candidate().length()) { |
47 exceptionState.throwDOMException(TypeMismatchError, ExceptionMessages::i
ncorrectPropertyType("candidate", "is not a string, or is empty.")); | 47 exceptionState.throwDOMException(TypeMismatchError, ExceptionMessages::i
ncorrectPropertyType("candidate", "is not a string, or is empty.")); |
48 return nullptr; | 48 return nullptr; |
49 } | 49 } |
50 | 50 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 ScriptValue RTCIceCandidate::toJSONForBinding(ScriptState* scriptState) | 110 ScriptValue RTCIceCandidate::toJSONForBinding(ScriptState* scriptState) |
111 { | 111 { |
112 V8ObjectBuilder result(scriptState); | 112 V8ObjectBuilder result(scriptState); |
113 result.addString("candidate", m_webCandidate.candidate()); | 113 result.addString("candidate", m_webCandidate.candidate()); |
114 result.addString("sdpMid", m_webCandidate.sdpMid()); | 114 result.addString("sdpMid", m_webCandidate.sdpMid()); |
115 result.addNumber("sdpMLineIndex", m_webCandidate.sdpMLineIndex()); | 115 result.addNumber("sdpMLineIndex", m_webCandidate.sdpMLineIndex()); |
116 return result.scriptValue(); | 116 return result.scriptValue(); |
117 } | 117 } |
118 | 118 |
119 } // namespace blink | 119 } // namespace blink |
OLD | NEW |