Changeset 165247 in webkit
- Timestamp:
- Mar 6, 2014 9:41:16 PM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r165246 r165247 1 2014-03-06 Thiago de Barros Lacerda <thiago.lacerda@openbossa.org> 2 3 [WebRTC] Updating RTCIceServer to match spec 4 https://bugs.webkit.org/show_bug.cgi?id=129844 5 6 Reviewed by Eric Carlson. 7 8 Move RTCIceServer from RTCConfiguration to its own file. 9 10 * Modules/mediastream/RTCPeerConnection.cpp: 11 (WebCore::validateIceServerURL): 12 (WebCore::processIceServer): 13 * platform/mediastream/RTCConfiguration.h: 14 (WebCore::RTCConfiguration::iceServers): 15 * platform/mediastream/RTCIceServer.h: Added. 16 1 17 2014-03-06 Hyowon Kim <hw1008.kim@samsung.com> 2 18 -
trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp
r165226 r165247 67 67 namespace WebCore { 68 68 69 static bool appendIceServer(const String& iceURL, const String& credential, const String& username, RTCConfiguration* rtcConfiguration)69 static bool validateIceServerURL(const String& iceURL) 70 70 { 71 71 URL url(URL(), iceURL); … … 73 73 return false; 74 74 75 rtcConfiguration->appendServer(RTCIceServer::create(url, credential, username));76 75 return true; 77 76 } … … 93 92 // then checking for a comma in the string assures that a string was a sequence and then we convert 94 93 // it to a sequence safely. 94 if (urlString.isEmpty()) 95 return INVALID_ACCESS_ERR; 96 95 97 if (urlString.find(',') != notFound && iceServer.get("urls", urlsList) && urlsList.size()) { 96 98 for (auto iter = urlsList.begin(); iter != urlsList.end(); ++iter) { 97 if (! appendIceServer((*iter), credential, username, rtcConfiguration))99 if (!validateIceServerURL(*iter)) 98 100 return INVALID_ACCESS_ERR; 99 101 } 100 101 return 0; 102 } 103 104 if (!urlString.isEmpty() && appendIceServer(urlString, credential, username, rtcConfiguration)) 105 return 0; 106 107 return INVALID_ACCESS_ERR; 102 } else { 103 if (!validateIceServerURL(urlString)) 104 return INVALID_ACCESS_ERR; 105 106 urlsList.append(urlString); 107 } 108 109 rtcConfiguration->appendServer(RTCIceServer::create(urlsList, credential, username)); 110 return 0; 108 111 } 109 112 -
trunk/Source/WebCore/platform/mediastream/RTCConfiguration.h
r164372 r165247 34 34 #if ENABLE(MEDIA_STREAM) 35 35 36 #include " URL.h"36 #include "RTCIceServer.h" 37 37 #include <wtf/PassRefPtr.h> 38 38 #include <wtf/RefCounted.h> … … 41 41 42 42 namespace WebCore { 43 44 class RTCIceServer : public RefCounted<RTCIceServer> {45 public:46 static PassRefPtr<RTCIceServer> create(const URL& uri, const String& credential, const String& username)47 {48 return adoptRef(new RTCIceServer(uri, credential, username));49 }50 virtual ~RTCIceServer() { }51 52 const URL& uri() { return m_uri; }53 const String& credential() { return m_credential; }54 const String& username() { return m_username; }55 56 private:57 RTCIceServer(const URL& uri, const String& credential, const String& username)58 : m_uri(uri)59 , m_credential(credential)60 , m_username(username)61 {62 }63 64 URL m_uri;65 String m_credential;66 String m_username;67 };68 43 69 44 class RTCConfiguration : public RefCounted<RTCConfiguration> { … … 75 50 size_t numberOfServers() { return m_servers.size(); } 76 51 RTCIceServer* server(size_t index) { return m_servers[index].get(); } 52 77 53 const String& iceTransports() const { return m_iceTransports; } 78 54 void setIceTransports(const String& iceTransports) … … 81 57 m_iceTransports = iceTransports; 82 58 } 59 83 60 const String& requestIdentity() const { return m_requestIdentity; } 84 61 void setRequestIdentity(const String& requestIdentity) … … 87 64 m_requestIdentity = requestIdentity; 88 65 } 66 67 Vector<RefPtr<RTCIceServer>> iceServers() const { return m_servers; } 89 68 90 69 private:
Note: See TracChangeset
for help on using the changeset viewer.