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 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 { | |
jochen (gone - plz use gerrit)
2015/09/15 08:04:19
non-trivial dtors shouldn't go into the header
hbos_chromium
2015/09/21 16:12:22
Done. I saw that nearby classes uses PLATFORM_EXPO
| |
92 for (WebRTCCertificate* certificate : m_certificates) | |
93 delete certificate; | |
94 } | |
95 | |
89 void appendServer(RTCIceServer* server) { m_servers.append(server); } | 96 void appendServer(RTCIceServer* server) { m_servers.append(server); } |
90 size_t numberOfServers() { return m_servers.size(); } | 97 size_t numberOfServers() { return m_servers.size(); } |
91 RTCIceServer* server(size_t index) { return m_servers[index].get(); } | 98 RTCIceServer* server(size_t index) { return m_servers[index].get(); } |
92 void setIceTransports(RTCIceTransports iceTransports) { m_iceTransports = ic eTransports; } | 99 void setIceTransports(RTCIceTransports iceTransports) { m_iceTransports = ic eTransports; } |
93 RTCIceTransports iceTransports() { return m_iceTransports; } | 100 RTCIceTransports iceTransports() { return m_iceTransports; } |
94 void setBundlePolicy(RTCBundlePolicy bundlePolicy) { m_bundlePolicy = bundle Policy; } | 101 void setBundlePolicy(RTCBundlePolicy bundlePolicy) { m_bundlePolicy = bundle Policy; } |
95 RTCBundlePolicy bundlePolicy() { return m_bundlePolicy; } | 102 RTCBundlePolicy bundlePolicy() { return m_bundlePolicy; } |
96 void setRtcpMuxPolicy(RTCRtcpMuxPolicy rtcpMuxPolicy) { m_rtcpMuxPolicy = rt cpMuxPolicy; } | 103 void setRtcpMuxPolicy(RTCRtcpMuxPolicy rtcpMuxPolicy) { m_rtcpMuxPolicy = rt cpMuxPolicy; } |
97 RTCRtcpMuxPolicy rtcpMuxPolicy() { return m_rtcpMuxPolicy; } | 104 RTCRtcpMuxPolicy rtcpMuxPolicy() { return m_rtcpMuxPolicy; } |
105 void appendCertificate(WebRTCCertificate* certificate) { m_certificates.appe nd(certificate); } | |
106 size_t numberOfCertificates() const { return m_certificates.size(); } | |
107 WebRTCCertificate* certificate(size_t index) const { return m_certificates[i ndex]; } | |
98 | 108 |
99 DEFINE_INLINE_TRACE() { visitor->trace(m_servers); } | 109 DEFINE_INLINE_TRACE() { visitor->trace(m_servers); } |
100 | 110 |
101 private: | 111 private: |
102 RTCConfiguration() : | 112 RTCConfiguration() : |
103 m_iceTransports(RTCIceTransportsAll), | 113 m_iceTransports(RTCIceTransportsAll), |
104 m_bundlePolicy(RTCBundlePolicyBalanced), | 114 m_bundlePolicy(RTCBundlePolicyBalanced), |
105 m_rtcpMuxPolicy(RTCRtcpMuxPolicyNegotiate) { } | 115 m_rtcpMuxPolicy(RTCRtcpMuxPolicyNegotiate) { } |
106 | 116 |
107 HeapVector<Member<RTCIceServer>> m_servers; | 117 HeapVector<Member<RTCIceServer>> m_servers; |
108 RTCIceTransports m_iceTransports; | 118 RTCIceTransports m_iceTransports; |
109 RTCBundlePolicy m_bundlePolicy; | 119 RTCBundlePolicy m_bundlePolicy; |
110 RTCRtcpMuxPolicy m_rtcpMuxPolicy; | 120 RTCRtcpMuxPolicy m_rtcpMuxPolicy; |
121 Vector<WebRTCCertificate*> m_certificates; | |
111 }; | 122 }; |
112 | 123 |
113 } // namespace blink | 124 } // namespace blink |
114 | 125 |
115 #endif // RTCConfiguration_h | 126 #endif // RTCConfiguration_h |
OLD | NEW |