| 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 29 matching lines...) Expand all Loading... |
| 75 RTCBundlePolicyBalanced, | 76 RTCBundlePolicyBalanced, |
| 76 RTCBundlePolicyMaxCompat, | 77 RTCBundlePolicyMaxCompat, |
| 77 RTCBundlePolicyMaxBundle | 78 RTCBundlePolicyMaxBundle |
| 78 }; | 79 }; |
| 79 | 80 |
| 80 enum RTCRtcpMuxPolicy { | 81 enum RTCRtcpMuxPolicy { |
| 81 RTCRtcpMuxPolicyNegotiate, | 82 RTCRtcpMuxPolicyNegotiate, |
| 82 RTCRtcpMuxPolicyRequire | 83 RTCRtcpMuxPolicyRequire |
| 83 }; | 84 }; |
| 84 | 85 |
| 85 class RTCConfiguration final : public GarbageCollected<RTCConfiguration> { | 86 class PLATFORM_EXPORT RTCConfiguration final : public GarbageCollectedFinalized<
RTCConfiguration> { |
| 86 public: | 87 public: |
| 87 static RTCConfiguration* create() { return new RTCConfiguration(); } | 88 static RTCConfiguration* create() { return new RTCConfiguration(); } |
| 88 | 89 |
| 90 ~RTCConfiguration(); |
| 91 |
| 89 void appendServer(RTCIceServer* server) { m_servers.append(server); } | 92 void appendServer(RTCIceServer* server) { m_servers.append(server); } |
| 90 size_t numberOfServers() { return m_servers.size(); } | 93 size_t numberOfServers() { return m_servers.size(); } |
| 91 RTCIceServer* server(size_t index) { return m_servers[index].get(); } | 94 RTCIceServer* server(size_t index) { return m_servers[index].get(); } |
| 92 void setIceTransports(RTCIceTransports iceTransports) { m_iceTransports = ic
eTransports; } | 95 void setIceTransports(RTCIceTransports iceTransports) { m_iceTransports = ic
eTransports; } |
| 93 RTCIceTransports iceTransports() { return m_iceTransports; } | 96 RTCIceTransports iceTransports() { return m_iceTransports; } |
| 94 void setBundlePolicy(RTCBundlePolicy bundlePolicy) { m_bundlePolicy = bundle
Policy; } | 97 void setBundlePolicy(RTCBundlePolicy bundlePolicy) { m_bundlePolicy = bundle
Policy; } |
| 95 RTCBundlePolicy bundlePolicy() { return m_bundlePolicy; } | 98 RTCBundlePolicy bundlePolicy() { return m_bundlePolicy; } |
| 96 void setRtcpMuxPolicy(RTCRtcpMuxPolicy rtcpMuxPolicy) { m_rtcpMuxPolicy = rt
cpMuxPolicy; } | 99 void setRtcpMuxPolicy(RTCRtcpMuxPolicy rtcpMuxPolicy) { m_rtcpMuxPolicy = rt
cpMuxPolicy; } |
| 97 RTCRtcpMuxPolicy rtcpMuxPolicy() { return m_rtcpMuxPolicy; } | 100 RTCRtcpMuxPolicy rtcpMuxPolicy() { return m_rtcpMuxPolicy; } |
| 101 void appendCertificate(WebRTCCertificate* certificate) { m_certificates.appe
nd(certificate); } |
| 102 size_t numberOfCertificates() const { return m_certificates.size(); } |
| 103 WebRTCCertificate* certificate(size_t index) const { return m_certificates[i
ndex]; } |
| 98 | 104 |
| 99 DEFINE_INLINE_TRACE() { visitor->trace(m_servers); } | 105 DEFINE_INLINE_TRACE() { visitor->trace(m_servers); } |
| 100 | 106 |
| 101 private: | 107 private: |
| 102 RTCConfiguration() : | 108 RTCConfiguration() : |
| 103 m_iceTransports(RTCIceTransportsAll), | 109 m_iceTransports(RTCIceTransportsAll), |
| 104 m_bundlePolicy(RTCBundlePolicyBalanced), | 110 m_bundlePolicy(RTCBundlePolicyBalanced), |
| 105 m_rtcpMuxPolicy(RTCRtcpMuxPolicyNegotiate) { } | 111 m_rtcpMuxPolicy(RTCRtcpMuxPolicyNegotiate) { } |
| 106 | 112 |
| 107 HeapVector<Member<RTCIceServer>> m_servers; | 113 HeapVector<Member<RTCIceServer>> m_servers; |
| 108 RTCIceTransports m_iceTransports; | 114 RTCIceTransports m_iceTransports; |
| 109 RTCBundlePolicy m_bundlePolicy; | 115 RTCBundlePolicy m_bundlePolicy; |
| 110 RTCRtcpMuxPolicy m_rtcpMuxPolicy; | 116 RTCRtcpMuxPolicy m_rtcpMuxPolicy; |
| 117 Vector<WebRTCCertificate*> m_certificates; |
| 111 }; | 118 }; |
| 112 | 119 |
| 113 } // namespace blink | 120 } // namespace blink |
| 114 | 121 |
| 115 #endif // RTCConfiguration_h | 122 #endif // RTCConfiguration_h |
| OLD | NEW |