| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2015 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 |
| 11 * notice, this list of conditions and the following disclaimer | 11 * notice, this list of conditions and the following disclaimer |
| 12 * in the documentation and/or other materials provided with the | 12 * in the documentation and/or other materials provided with the |
| (...skipping 13 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 #ifndef RTCConfiguration_h | 31 #ifndef RTCConfiguration_h |
| 32 #define RTCConfiguration_h | 32 #define RTCConfiguration_h |
| 33 | 33 |
| 34 #include "platform/heap/Handle.h" | 34 #include "platform/heap/Handle.h" |
| 35 #include "platform/weborigin/KURL.h" | 35 #include "platform/weborigin/KURL.h" |
| 36 #include "public/platform/WebRTCCertificate.h" |
| 36 #include "wtf/PassRefPtr.h" | 37 #include "wtf/PassRefPtr.h" |
| 37 #include "wtf/Vector.h" | 38 #include "wtf/Vector.h" |
| 38 #include "wtf/text/WTFString.h" | 39 #include "wtf/text/WTFString.h" |
| 39 | 40 |
| 40 namespace blink { | 41 namespace blink { |
| 41 | 42 |
| 42 class RTCIceServer final : public GarbageCollectedFinalized<RTCIceServer> { | 43 class RTCIceServer final : public GarbageCollectedFinalized<RTCIceServer> { |
| 43 public: | 44 public: |
| 44 static RTCIceServer* create(const KURL& uri, const String& username, const S
tring& credential) | 45 static RTCIceServer* create(const KURL& uri, const String& username, const S
tring& credential) |
| 45 { | 46 { |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 RTCBundlePolicyBalanced, | 93 RTCBundlePolicyBalanced, |
| 93 RTCBundlePolicyMaxCompat, | 94 RTCBundlePolicyMaxCompat, |
| 94 RTCBundlePolicyMaxBundle | 95 RTCBundlePolicyMaxBundle |
| 95 }; | 96 }; |
| 96 | 97 |
| 97 enum RTCRtcpMuxPolicy { | 98 enum RTCRtcpMuxPolicy { |
| 98 RTCRtcpMuxPolicyNegotiate, | 99 RTCRtcpMuxPolicyNegotiate, |
| 99 RTCRtcpMuxPolicyRequire | 100 RTCRtcpMuxPolicyRequire |
| 100 }; | 101 }; |
| 101 | 102 |
| 102 class RTCConfiguration final : public GarbageCollected<RTCConfiguration> { | 103 class PLATFORM_EXPORT RTCConfiguration final : public GarbageCollectedFinalized<
RTCConfiguration> { |
| 103 public: | 104 public: |
| 104 static RTCConfiguration* create() { return new RTCConfiguration(); } | 105 static RTCConfiguration* create() { return new RTCConfiguration(); } |
| 105 | 106 |
| 106 void setIceTransports(RTCIceTransports iceTransports) { m_iceTransports = ic
eTransports; } | 107 void setIceTransports(RTCIceTransports iceTransports) { m_iceTransports = ic
eTransports; } |
| 107 RTCIceTransports iceTransports() { return m_iceTransports; } | 108 RTCIceTransports iceTransports() { return m_iceTransports; } |
| 108 void setBundlePolicy(RTCBundlePolicy bundlePolicy) { m_bundlePolicy = bundle
Policy; } | 109 void setBundlePolicy(RTCBundlePolicy bundlePolicy) { m_bundlePolicy = bundle
Policy; } |
| 109 RTCBundlePolicy bundlePolicy() { return m_bundlePolicy; } | 110 RTCBundlePolicy bundlePolicy() { return m_bundlePolicy; } |
| 110 void setRtcpMuxPolicy(RTCRtcpMuxPolicy rtcpMuxPolicy) { m_rtcpMuxPolicy = rt
cpMuxPolicy; } | 111 void setRtcpMuxPolicy(RTCRtcpMuxPolicy rtcpMuxPolicy) { m_rtcpMuxPolicy = rt
cpMuxPolicy; } |
| 111 RTCRtcpMuxPolicy rtcpMuxPolicy() { return m_rtcpMuxPolicy; } | 112 RTCRtcpMuxPolicy rtcpMuxPolicy() { return m_rtcpMuxPolicy; } |
| 112 void setIceServers(RTCIceServerArray* iceServers) { m_iceServers = iceServer
s; } | 113 void setIceServers(RTCIceServerArray* iceServers) { m_iceServers = iceServer
s; } |
| 113 RTCIceServerArray* iceServers() { return m_iceServers.get(); } | 114 RTCIceServerArray* iceServers() { return m_iceServers.get(); } |
| 115 // Takes ownership of |certificate|. |
| 116 void appendCertificate(WebRTCCertificate* certificate) { m_certificates.appe
nd(adoptPtr(certificate)); } |
| 117 size_t numberOfCertificates() const { return m_certificates.size(); } |
| 118 WebRTCCertificate* certificate(size_t index) const { return m_certificates[i
ndex].get(); } |
| 114 | 119 |
| 115 DEFINE_INLINE_TRACE() { visitor->trace(m_iceServers); } | 120 DEFINE_INLINE_TRACE() { visitor->trace(m_iceServers); } |
| 116 | 121 |
| 117 private: | 122 private: |
| 118 RTCConfiguration() | 123 RTCConfiguration() |
| 119 : m_iceTransports(RTCIceTransportsAll) | 124 : m_iceTransports(RTCIceTransportsAll) |
| 120 , m_bundlePolicy(RTCBundlePolicyBalanced) | 125 , m_bundlePolicy(RTCBundlePolicyBalanced) |
| 121 , m_rtcpMuxPolicy(RTCRtcpMuxPolicyNegotiate) | 126 , m_rtcpMuxPolicy(RTCRtcpMuxPolicyNegotiate) |
| 122 { | 127 { |
| 123 } | 128 } |
| 124 | 129 |
| 125 Member<RTCIceServerArray> m_iceServers; | 130 Member<RTCIceServerArray> m_iceServers; |
| 126 RTCIceTransports m_iceTransports; | 131 RTCIceTransports m_iceTransports; |
| 127 RTCBundlePolicy m_bundlePolicy; | 132 RTCBundlePolicy m_bundlePolicy; |
| 128 RTCRtcpMuxPolicy m_rtcpMuxPolicy; | 133 RTCRtcpMuxPolicy m_rtcpMuxPolicy; |
| 134 Vector<OwnPtr<WebRTCCertificate>> m_certificates; |
| 129 }; | 135 }; |
| 130 | 136 |
| 131 } // namespace blink | 137 } // namespace blink |
| 132 | 138 |
| 133 #endif // RTCConfiguration_h | 139 #endif // RTCConfiguration_h |
| OLD | NEW |