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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
64 ASSERT(!isNull()); | 64 ASSERT(!isNull()); |
65 return m_private->username(); | 65 return m_private->username(); |
66 } | 66 } |
67 | 67 |
68 WebString WebRTCICEServer::credential() const | 68 WebString WebRTCICEServer::credential() const |
69 { | 69 { |
70 ASSERT(!isNull()); | 70 ASSERT(!isNull()); |
71 return m_private->credential(); | 71 return m_private->credential(); |
72 } | 72 } |
73 | 73 |
74 WebRTCICEServerArray::WebRTCICEServerArray(RTCIceServerArray* iceServers) | |
75 : m_private(iceServers) | |
76 { | |
77 } | |
78 | |
79 void WebRTCICEServerArray::assign(const WebRTCICEServerArray& other) | |
80 { | |
81 m_private = other.m_private; | |
82 } | |
83 | |
84 void WebRTCICEServerArray::reset() | |
85 { | |
86 m_private.reset(); | |
87 } | |
88 | |
89 size_t WebRTCICEServerArray::numberOfServers() const | |
90 { | |
91 ASSERT(!isNull()); | |
92 return m_private->numberOfServers(); | |
93 } | |
94 | |
95 WebRTCICEServer WebRTCICEServerArray::server(size_t index) const | |
96 { | |
97 ASSERT(!isNull()); | |
98 return WebRTCICEServer(m_private->server(index)); | |
99 } | |
100 | |
74 WebRTCConfiguration::WebRTCConfiguration(RTCConfiguration* configuration) | 101 WebRTCConfiguration::WebRTCConfiguration(RTCConfiguration* configuration) |
75 : m_private(configuration) | 102 : m_private(configuration) |
76 { | 103 { |
77 } | 104 } |
78 | 105 |
79 void WebRTCConfiguration::assign(const WebRTCConfiguration& other) | 106 void WebRTCConfiguration::assign(const WebRTCConfiguration& other) |
80 { | 107 { |
81 m_private = other.m_private; | 108 m_private = other.m_private; |
82 } | 109 } |
83 | 110 |
84 void WebRTCConfiguration::reset() | 111 void WebRTCConfiguration::reset() |
85 { | 112 { |
86 m_private.reset(); | 113 m_private.reset(); |
87 } | 114 } |
88 | 115 |
116 // TODO(guoweis): Remove this function. | |
pthatcher2
2015/09/16 04:09:58
When?
| |
89 size_t WebRTCConfiguration::numberOfServers() const | 117 size_t WebRTCConfiguration::numberOfServers() const |
90 { | 118 { |
91 ASSERT(!isNull()); | 119 ASSERT(!isNull()); |
92 return m_private->numberOfServers(); | 120 if (!m_private->iceServers()) { |
121 return 0; | |
122 } | |
123 return m_private->iceServers()->numberOfServers(); | |
93 } | 124 } |
94 | 125 |
126 // TODO(guoweis): Remove this function. | |
95 WebRTCICEServer WebRTCConfiguration::server(size_t index) const | 127 WebRTCICEServer WebRTCConfiguration::server(size_t index) const |
96 { | 128 { |
97 ASSERT(!isNull()); | 129 ASSERT(!isNull()); |
98 return WebRTCICEServer(m_private->server(index)); | 130 return WebRTCICEServer(m_private->iceServers()->server(index)); |
99 } | 131 } |
100 | 132 |
101 WebRTCIceTransports WebRTCConfiguration::iceTransports() const | 133 WebRTCIceTransports WebRTCConfiguration::iceTransports() const |
102 { | 134 { |
103 ASSERT(!isNull()); | 135 ASSERT(!isNull()); |
104 switch (m_private->iceTransports()) { | 136 switch (m_private->iceTransports()) { |
105 case RTCIceTransportsNone: | 137 case RTCIceTransportsNone: |
106 return WebRTCIceTransportsNone; | 138 return WebRTCIceTransportsNone; |
107 case RTCIceTransportsRelay: | 139 case RTCIceTransportsRelay: |
108 return WebRTCIceTransportsRelay; | 140 return WebRTCIceTransportsRelay; |
(...skipping 28 matching lines...) Expand all Loading... | |
137 case RTCRtcpMuxPolicyNegotiate: | 169 case RTCRtcpMuxPolicyNegotiate: |
138 return WebRTCRtcpMuxPolicyNegotiate; | 170 return WebRTCRtcpMuxPolicyNegotiate; |
139 case RTCRtcpMuxPolicyRequire: | 171 case RTCRtcpMuxPolicyRequire: |
140 return WebRTCRtcpMuxPolicyRequire; | 172 return WebRTCRtcpMuxPolicyRequire; |
141 default: | 173 default: |
142 ASSERT_NOT_REACHED(); | 174 ASSERT_NOT_REACHED(); |
143 } | 175 } |
144 return WebRTCRtcpMuxPolicyNegotiate; | 176 return WebRTCRtcpMuxPolicyNegotiate; |
145 } | 177 } |
146 | 178 |
179 WebRTCICEServerArray WebRTCConfiguration::iceServers() const | |
180 { | |
181 ASSERT(!isNull()); | |
182 return WebRTCICEServerArray(m_private->iceServers()); | |
183 } | |
184 | |
147 } // namespace blink | 185 } // namespace blink |
OLD | NEW |