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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 , m_username(username) | 59 , m_username(username) |
60 , m_credential(credential) | 60 , m_credential(credential) |
61 { | 61 { |
62 } | 62 } |
63 | 63 |
64 KURL m_uri; | 64 KURL m_uri; |
65 String m_username; | 65 String m_username; |
66 String m_credential; | 66 String m_credential; |
67 }; | 67 }; |
68 | 68 |
69 class RTCIceServerArray final : public GarbageCollectedFinalized<RTCIceServerArr
ay> { | |
70 public: | |
71 static RTCIceServerArray* create() | |
72 { | |
73 return new RTCIceServerArray(); | |
74 } | |
75 | |
76 void appendServer(RTCIceServer* server) { m_servers.append(server); } | |
77 size_t numberOfServers() { return m_servers.size(); } | |
78 RTCIceServer* server(size_t index) { return m_servers[index].get(); } | |
79 | |
80 DEFINE_INLINE_TRACE() { visitor->trace(m_servers); } | |
81 | |
82 private: | |
83 HeapVector<Member<RTCIceServer>> m_servers; | |
84 }; | |
85 | |
86 enum RTCIceTransports { | 69 enum RTCIceTransports { |
87 RTCIceTransportsNone, | 70 RTCIceTransportsNone, |
88 RTCIceTransportsRelay, | 71 RTCIceTransportsRelay, |
89 RTCIceTransportsAll | 72 RTCIceTransportsAll |
90 }; | 73 }; |
91 | 74 |
92 enum RTCBundlePolicy { | 75 enum RTCBundlePolicy { |
93 RTCBundlePolicyBalanced, | 76 RTCBundlePolicyBalanced, |
94 RTCBundlePolicyMaxCompat, | 77 RTCBundlePolicyMaxCompat, |
95 RTCBundlePolicyMaxBundle | 78 RTCBundlePolicyMaxBundle |
96 }; | 79 }; |
97 | 80 |
98 enum RTCRtcpMuxPolicy { | 81 enum RTCRtcpMuxPolicy { |
99 RTCRtcpMuxPolicyNegotiate, | 82 RTCRtcpMuxPolicyNegotiate, |
100 RTCRtcpMuxPolicyRequire | 83 RTCRtcpMuxPolicyRequire |
101 }; | 84 }; |
102 | 85 |
103 class PLATFORM_EXPORT RTCConfiguration final : public GarbageCollectedFinalized<
RTCConfiguration> { | 86 class PLATFORM_EXPORT RTCConfiguration final : public GarbageCollectedFinalized<
RTCConfiguration> { |
104 public: | 87 public: |
105 static RTCConfiguration* create() { return new RTCConfiguration(); } | 88 static RTCConfiguration* create() { return new RTCConfiguration(); } |
| 89 void appendServer(RTCIceServer* server) { m_servers.append(server); } |
| 90 size_t numberOfServers() { return m_servers.size(); } |
| 91 RTCIceServer* server(size_t index) { return m_servers[index].get(); } |
106 | 92 |
107 void setIceTransports(RTCIceTransports iceTransports) { m_iceTransports = ic
eTransports; } | 93 void setIceTransports(RTCIceTransports iceTransports) { m_iceTransports = ic
eTransports; } |
108 RTCIceTransports iceTransports() { return m_iceTransports; } | 94 RTCIceTransports iceTransports() { return m_iceTransports; } |
109 void setBundlePolicy(RTCBundlePolicy bundlePolicy) { m_bundlePolicy = bundle
Policy; } | 95 void setBundlePolicy(RTCBundlePolicy bundlePolicy) { m_bundlePolicy = bundle
Policy; } |
110 RTCBundlePolicy bundlePolicy() { return m_bundlePolicy; } | 96 RTCBundlePolicy bundlePolicy() { return m_bundlePolicy; } |
111 void setRtcpMuxPolicy(RTCRtcpMuxPolicy rtcpMuxPolicy) { m_rtcpMuxPolicy = rt
cpMuxPolicy; } | 97 void setRtcpMuxPolicy(RTCRtcpMuxPolicy rtcpMuxPolicy) { m_rtcpMuxPolicy = rt
cpMuxPolicy; } |
112 RTCRtcpMuxPolicy rtcpMuxPolicy() { return m_rtcpMuxPolicy; } | 98 RTCRtcpMuxPolicy rtcpMuxPolicy() { return m_rtcpMuxPolicy; } |
113 void setIceServers(RTCIceServerArray* iceServers) { m_iceServers = iceServer
s; } | 99 |
114 RTCIceServerArray* iceServers() { return m_iceServers.get(); } | |
115 // Takes ownership of |certificate|. | 100 // Takes ownership of |certificate|. |
116 void appendCertificate(WebRTCCertificate* certificate) { m_certificates.appe
nd(adoptPtr(certificate)); } | 101 void appendCertificate(WebRTCCertificate* certificate) { m_certificates.appe
nd(adoptPtr(certificate)); } |
117 size_t numberOfCertificates() const { return m_certificates.size(); } | 102 size_t numberOfCertificates() const { return m_certificates.size(); } |
118 WebRTCCertificate* certificate(size_t index) const { return m_certificates[i
ndex].get(); } | 103 WebRTCCertificate* certificate(size_t index) const { return m_certificates[i
ndex].get(); } |
119 | 104 |
120 DEFINE_INLINE_TRACE() { visitor->trace(m_iceServers); } | 105 DEFINE_INLINE_TRACE() { visitor->trace(m_servers); } |
121 | 106 |
122 private: | 107 private: |
123 RTCConfiguration() | 108 RTCConfiguration() : |
124 : m_iceTransports(RTCIceTransportsAll) | 109 m_iceTransports(RTCIceTransportsAll), |
125 , m_bundlePolicy(RTCBundlePolicyBalanced) | 110 m_bundlePolicy(RTCBundlePolicyBalanced), |
126 , m_rtcpMuxPolicy(RTCRtcpMuxPolicyNegotiate) | 111 m_rtcpMuxPolicy(RTCRtcpMuxPolicyNegotiate) { } |
127 { | |
128 } | |
129 | 112 |
130 Member<RTCIceServerArray> m_iceServers; | 113 HeapVector<Member<RTCIceServer>> m_servers; |
131 RTCIceTransports m_iceTransports; | 114 RTCIceTransports m_iceTransports; |
132 RTCBundlePolicy m_bundlePolicy; | 115 RTCBundlePolicy m_bundlePolicy; |
133 RTCRtcpMuxPolicy m_rtcpMuxPolicy; | 116 RTCRtcpMuxPolicy m_rtcpMuxPolicy; |
134 Vector<OwnPtr<WebRTCCertificate>> m_certificates; | 117 Vector<OwnPtr<WebRTCCertificate>> m_certificates; |
135 }; | 118 }; |
136 | 119 |
137 } // namespace blink | 120 } // namespace blink |
138 | 121 |
139 #endif // RTCConfiguration_h | 122 #endif // RTCConfiguration_h |
OLD | NEW |