OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2015 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 |
(...skipping 17 matching lines...) Expand all Loading... |
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 "public/platform/WebRTCCertificate.h" |
37 #include "wtf/PassRefPtr.h" | 37 #include "wtf/PassRefPtr.h" |
| 38 #include "wtf/PtrUtil.h" |
38 #include "wtf/Vector.h" | 39 #include "wtf/Vector.h" |
39 #include "wtf/text/WTFString.h" | 40 #include "wtf/text/WTFString.h" |
| 41 #include <memory> |
40 | 42 |
41 namespace blink { | 43 namespace blink { |
42 | 44 |
43 class RTCIceServer final : public GarbageCollectedFinalized<RTCIceServer> { | 45 class RTCIceServer final : public GarbageCollectedFinalized<RTCIceServer> { |
44 public: | 46 public: |
45 static RTCIceServer* create(const KURL& uri, const String& username, const S
tring& credential) | 47 static RTCIceServer* create(const KURL& uri, const String& username, const S
tring& credential) |
46 { | 48 { |
47 return new RTCIceServer(uri, username, credential); | 49 return new RTCIceServer(uri, username, credential); |
48 } | 50 } |
49 | 51 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 size_t numberOfServers() { return m_servers.size(); } | 92 size_t numberOfServers() { return m_servers.size(); } |
91 RTCIceServer* server(size_t index) { return m_servers[index].get(); } | 93 RTCIceServer* server(size_t index) { return m_servers[index].get(); } |
92 | 94 |
93 void setIceTransports(RTCIceTransports iceTransports) { m_iceTransports = ic
eTransports; } | 95 void setIceTransports(RTCIceTransports iceTransports) { m_iceTransports = ic
eTransports; } |
94 RTCIceTransports iceTransports() { return m_iceTransports; } | 96 RTCIceTransports iceTransports() { return m_iceTransports; } |
95 void setBundlePolicy(RTCBundlePolicy bundlePolicy) { m_bundlePolicy = bundle
Policy; } | 97 void setBundlePolicy(RTCBundlePolicy bundlePolicy) { m_bundlePolicy = bundle
Policy; } |
96 RTCBundlePolicy bundlePolicy() { return m_bundlePolicy; } | 98 RTCBundlePolicy bundlePolicy() { return m_bundlePolicy; } |
97 void setRtcpMuxPolicy(RTCRtcpMuxPolicy rtcpMuxPolicy) { m_rtcpMuxPolicy = rt
cpMuxPolicy; } | 99 void setRtcpMuxPolicy(RTCRtcpMuxPolicy rtcpMuxPolicy) { m_rtcpMuxPolicy = rt
cpMuxPolicy; } |
98 RTCRtcpMuxPolicy rtcpMuxPolicy() { return m_rtcpMuxPolicy; } | 100 RTCRtcpMuxPolicy rtcpMuxPolicy() { return m_rtcpMuxPolicy; } |
99 | 101 |
100 void appendCertificate(std::unique_ptr<WebRTCCertificate> certificate) { m_c
ertificates.append(adoptPtr(certificate.release())); } | 102 void appendCertificate(std::unique_ptr<WebRTCCertificate> certificate) { m_c
ertificates.append(wrapUnique(certificate.release())); } |
101 size_t numberOfCertificates() const { return m_certificates.size(); } | 103 size_t numberOfCertificates() const { return m_certificates.size(); } |
102 WebRTCCertificate* certificate(size_t index) const { return m_certificates[i
ndex].get(); } | 104 WebRTCCertificate* certificate(size_t index) const { return m_certificates[i
ndex].get(); } |
103 | 105 |
104 DEFINE_INLINE_TRACE() { visitor->trace(m_servers); } | 106 DEFINE_INLINE_TRACE() { visitor->trace(m_servers); } |
105 | 107 |
106 private: | 108 private: |
107 RTCConfiguration() : | 109 RTCConfiguration() : |
108 m_iceTransports(RTCIceTransportsAll), | 110 m_iceTransports(RTCIceTransportsAll), |
109 m_bundlePolicy(RTCBundlePolicyBalanced), | 111 m_bundlePolicy(RTCBundlePolicyBalanced), |
110 m_rtcpMuxPolicy(RTCRtcpMuxPolicyNegotiate) { } | 112 m_rtcpMuxPolicy(RTCRtcpMuxPolicyNegotiate) { } |
111 | 113 |
112 HeapVector<Member<RTCIceServer>> m_servers; | 114 HeapVector<Member<RTCIceServer>> m_servers; |
113 RTCIceTransports m_iceTransports; | 115 RTCIceTransports m_iceTransports; |
114 RTCBundlePolicy m_bundlePolicy; | 116 RTCBundlePolicy m_bundlePolicy; |
115 RTCRtcpMuxPolicy m_rtcpMuxPolicy; | 117 RTCRtcpMuxPolicy m_rtcpMuxPolicy; |
116 Vector<OwnPtr<WebRTCCertificate>> m_certificates; | 118 Vector<std::unique_ptr<WebRTCCertificate>> m_certificates; |
117 }; | 119 }; |
118 | 120 |
119 } // namespace blink | 121 } // namespace blink |
120 | 122 |
121 #endif // RTCConfiguration_h | 123 #endif // RTCConfiguration_h |
OLD | NEW |