Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(297)

Side by Side Diff: Source/platform/mediastream/RTCConfiguration.h

Issue 1311853005: RTCCertificate and RTCPeerConnection.generateCertificate added to JavaScript (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Code cleanup, added comments Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 15 matching lines...) Expand all
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
41 #include <vector>
42
40 namespace blink { 43 namespace blink {
41 44
42 class RTCIceServer final : public GarbageCollectedFinalized<RTCIceServer> { 45 class RTCIceServer final : public GarbageCollectedFinalized<RTCIceServer> {
43 public: 46 public:
44 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)
45 { 48 {
46 return new RTCIceServer(uri, username, credential); 49 return new RTCIceServer(uri, username, credential);
47 } 50 }
48 51
49 const KURL& uri() { return m_uri; } 52 const KURL& uri() { return m_uri; }
(...skipping 25 matching lines...) Expand all
75 RTCBundlePolicyBalanced, 78 RTCBundlePolicyBalanced,
76 RTCBundlePolicyMaxCompat, 79 RTCBundlePolicyMaxCompat,
77 RTCBundlePolicyMaxBundle 80 RTCBundlePolicyMaxBundle
78 }; 81 };
79 82
80 enum RTCRtcpMuxPolicy { 83 enum RTCRtcpMuxPolicy {
81 RTCRtcpMuxPolicyNegotiate, 84 RTCRtcpMuxPolicyNegotiate,
82 RTCRtcpMuxPolicyRequire 85 RTCRtcpMuxPolicyRequire
83 }; 86 };
84 87
85 class RTCConfiguration final : public GarbageCollected<RTCConfiguration> { 88 class RTCConfiguration final : public GarbageCollectedFinalized<RTCConfiguration > {
86 public: 89 public:
87 static RTCConfiguration* create() { return new RTCConfiguration(); } 90 static RTCConfiguration* create() { return new RTCConfiguration(); }
88 91
92 ~RTCConfiguration()
Guido Urdaneta 2015/09/03 11:07:49 Implement this in the .cpp
hbos_chromium 2015/09/03 16:01:37 I'm having trouble compiling after adding a .cpp f
93 {
94 for (WebRTCCertificate* certificate : m_certificates)
95 delete certificate;
96 }
97
89 void appendServer(RTCIceServer* server) { m_servers.append(server); } 98 void appendServer(RTCIceServer* server) { m_servers.append(server); }
90 size_t numberOfServers() { return m_servers.size(); } 99 size_t numberOfServers() { return m_servers.size(); }
91 RTCIceServer* server(size_t index) { return m_servers[index].get(); } 100 RTCIceServer* server(size_t index) { return m_servers[index].get(); }
92 void setIceTransports(RTCIceTransports iceTransports) { m_iceTransports = ic eTransports; } 101 void setIceTransports(RTCIceTransports iceTransports) { m_iceTransports = ic eTransports; }
93 RTCIceTransports iceTransports() { return m_iceTransports; } 102 RTCIceTransports iceTransports() { return m_iceTransports; }
94 void setBundlePolicy(RTCBundlePolicy bundlePolicy) { m_bundlePolicy = bundle Policy; } 103 void setBundlePolicy(RTCBundlePolicy bundlePolicy) { m_bundlePolicy = bundle Policy; }
95 RTCBundlePolicy bundlePolicy() { return m_bundlePolicy; } 104 RTCBundlePolicy bundlePolicy() { return m_bundlePolicy; }
96 void setRtcpMuxPolicy(RTCRtcpMuxPolicy rtcpMuxPolicy) { m_rtcpMuxPolicy = rt cpMuxPolicy; } 105 void setRtcpMuxPolicy(RTCRtcpMuxPolicy rtcpMuxPolicy) { m_rtcpMuxPolicy = rt cpMuxPolicy; }
97 RTCRtcpMuxPolicy rtcpMuxPolicy() { return m_rtcpMuxPolicy; } 106 RTCRtcpMuxPolicy rtcpMuxPolicy() { return m_rtcpMuxPolicy; }
107 void appendCertificate(WebRTCCertificate* certificate) { m_certificates.push _back(certificate); }
108 size_t numberOfCertificates() const { return m_certificates.size(); }
109 WebRTCCertificate* certificate(size_t index) const { return m_certificates[i ndex]; }
98 110
99 DEFINE_INLINE_TRACE() { visitor->trace(m_servers); } 111 DEFINE_INLINE_TRACE() { visitor->trace(m_servers); }
100 112
101 private: 113 private:
102 RTCConfiguration() : 114 RTCConfiguration() :
103 m_iceTransports(RTCIceTransportsAll), 115 m_iceTransports(RTCIceTransportsAll),
104 m_bundlePolicy(RTCBundlePolicyBalanced), 116 m_bundlePolicy(RTCBundlePolicyBalanced),
105 m_rtcpMuxPolicy(RTCRtcpMuxPolicyNegotiate) { } 117 m_rtcpMuxPolicy(RTCRtcpMuxPolicyNegotiate) { }
106 118
107 HeapVector<Member<RTCIceServer>> m_servers; 119 HeapVector<Member<RTCIceServer>> m_servers;
108 RTCIceTransports m_iceTransports; 120 RTCIceTransports m_iceTransports;
109 RTCBundlePolicy m_bundlePolicy; 121 RTCBundlePolicy m_bundlePolicy;
110 RTCRtcpMuxPolicy m_rtcpMuxPolicy; 122 RTCRtcpMuxPolicy m_rtcpMuxPolicy;
123 std::vector<WebRTCCertificate*> m_certificates;
Guido Urdaneta 2015/09/03 11:07:49 Apparently Vector is preferred to std::vector in b
hbos_chromium 2015/09/03 16:01:37 Done.
111 }; 124 };
112 125
113 } // namespace blink 126 } // namespace blink
114 127
115 #endif // RTCConfiguration_h 128 #endif // RTCConfiguration_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698