<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[207897] trunk/Source/WebCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/207897">207897</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-10-26 07:49:48 -0700 (Wed, 26 Oct 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>IceCandidate does not need to be refcounted
https://bugs.webkit.org/show_bug.cgi?id=163944
Patch by Youenn Fablet <youennf@gmail.com> on 2016-10-26
Reviewed by Eric Carlson.
No change of behavior.
Simplifying IceCandidate class into a simple structure, no longer refcounted.
Updated call sites accordingly.
Updated SDP parsing of candidates to return a Variant instead of having both a return and an out parameter.
* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::addIceCandidateTask):
(WebCore::MediaEndpointPeerConnection::gotIceCandidate):
* Modules/mediastream/MediaEndpointPeerConnection.h:
* Modules/mediastream/SDPProcessor.cpp:
(WebCore::createCandidateObject):
(WebCore::createCandidate):
(WebCore::iceCandidateFromJSON):
(WebCore::configurationToJSON):
(WebCore::SDPProcessor::parseCandidateLine):
* Modules/mediastream/SDPProcessor.h:
(WebCore::SDPProcessor::ParsingResult::parsingStatus):
(WebCore::SDPProcessor::ParsingResult::candidate):
* platform/mediastream/IceCandidate.h:
* platform/mediastream/MediaEndpoint.cpp:
* platform/mediastream/MediaEndpoint.h:
* platform/mediastream/PeerMediaDescription.h:
(WebCore::PeerMediaDescription::iceCandidates):
(WebCore::PeerMediaDescription::addIceCandidate):
(WebCore::PeerMediaDescription::clone):
* platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
(WebCore::MediaEndpointOwr::updateSendConfiguration):
(WebCore::MediaEndpointOwr::addRemoteCandidate):
(WebCore::MediaEndpointOwr::dispatchNewIceCandidate):
(WebCore::MediaEndpointOwr::internalAddRemoteCandidate):
* platform/mediastream/openwebrtc/MediaEndpointOwr.h:
* platform/mock/MockMediaEndpoint.cpp:
(WebCore::MockMediaEndpoint::addRemoteCandidate):
(WebCore::MockMediaEndpoint::dispatchFakeIceCandidates):
* platform/mock/MockMediaEndpoint.h:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamMediaEndpointPeerConnectioncpp">trunk/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamMediaEndpointPeerConnectionh">trunk/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.h</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamSDPProcessorcpp">trunk/Source/WebCore/Modules/mediastream/SDPProcessor.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamSDPProcessorh">trunk/Source/WebCore/Modules/mediastream/SDPProcessor.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamIceCandidateh">trunk/Source/WebCore/platform/mediastream/IceCandidate.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamMediaEndpointcpp">trunk/Source/WebCore/platform/mediastream/MediaEndpoint.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamMediaEndpointh">trunk/Source/WebCore/platform/mediastream/MediaEndpoint.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamPeerMediaDescriptionh">trunk/Source/WebCore/platform/mediastream/PeerMediaDescription.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamopenwebrtcMediaEndpointOwrcpp">trunk/Source/WebCore/platform/mediastream/openwebrtc/MediaEndpointOwr.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamopenwebrtcMediaEndpointOwrh">trunk/Source/WebCore/platform/mediastream/openwebrtc/MediaEndpointOwr.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmockMockMediaEndpointcpp">trunk/Source/WebCore/platform/mock/MockMediaEndpoint.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmockMockMediaEndpointh">trunk/Source/WebCore/platform/mock/MockMediaEndpoint.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (207896 => 207897)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-10-26 13:24:12 UTC (rev 207896)
+++ trunk/Source/WebCore/ChangeLog        2016-10-26 14:49:48 UTC (rev 207897)
</span><span class="lines">@@ -1,3 +1,47 @@
</span><ins>+2016-10-26 Youenn Fablet <youennf@gmail.com>
+
+ IceCandidate does not need to be refcounted
+ https://bugs.webkit.org/show_bug.cgi?id=163944
+
+ Reviewed by Eric Carlson.
+
+ No change of behavior.
+
+ Simplifying IceCandidate class into a simple structure, no longer refcounted.
+ Updated call sites accordingly.
+ Updated SDP parsing of candidates to return a Variant instead of having both a return and an out parameter.
+
+ * Modules/mediastream/MediaEndpointPeerConnection.cpp:
+ (WebCore::MediaEndpointPeerConnection::addIceCandidateTask):
+ (WebCore::MediaEndpointPeerConnection::gotIceCandidate):
+ * Modules/mediastream/MediaEndpointPeerConnection.h:
+ * Modules/mediastream/SDPProcessor.cpp:
+ (WebCore::createCandidateObject):
+ (WebCore::createCandidate):
+ (WebCore::iceCandidateFromJSON):
+ (WebCore::configurationToJSON):
+ (WebCore::SDPProcessor::parseCandidateLine):
+ * Modules/mediastream/SDPProcessor.h:
+ (WebCore::SDPProcessor::ParsingResult::parsingStatus):
+ (WebCore::SDPProcessor::ParsingResult::candidate):
+ * platform/mediastream/IceCandidate.h:
+ * platform/mediastream/MediaEndpoint.cpp:
+ * platform/mediastream/MediaEndpoint.h:
+ * platform/mediastream/PeerMediaDescription.h:
+ (WebCore::PeerMediaDescription::iceCandidates):
+ (WebCore::PeerMediaDescription::addIceCandidate):
+ (WebCore::PeerMediaDescription::clone):
+ * platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
+ (WebCore::MediaEndpointOwr::updateSendConfiguration):
+ (WebCore::MediaEndpointOwr::addRemoteCandidate):
+ (WebCore::MediaEndpointOwr::dispatchNewIceCandidate):
+ (WebCore::MediaEndpointOwr::internalAddRemoteCandidate):
+ * platform/mediastream/openwebrtc/MediaEndpointOwr.h:
+ * platform/mock/MockMediaEndpoint.cpp:
+ (WebCore::MockMediaEndpoint::addRemoteCandidate):
+ (WebCore::MockMediaEndpoint::dispatchFakeIceCandidates):
+ * platform/mock/MockMediaEndpoint.h:
+
</ins><span class="cx"> 2016-10-26 Andreas Kling <akling@apple.com>
</span><span class="cx">
</span><span class="cx"> Fix mach port leak in ResourceUsageThread.
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamMediaEndpointPeerConnectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp (207896 => 207897)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp        2016-10-26 13:24:12 UTC (rev 207896)
+++ trunk/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp        2016-10-26 14:49:48 UTC (rev 207897)
</span><span class="lines">@@ -676,10 +676,9 @@
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- RefPtr<IceCandidate> candidate;
- SDPProcessor::Result result = m_sdpProcessor->parseCandidateLine(rtcCandidate.candidate(), candidate);
- if (result != SDPProcessor::Result::Success) {
- if (result == SDPProcessor::Result::ParseError)
</del><ins>+ auto result = m_sdpProcessor->parseCandidateLine(rtcCandidate.candidate());
+ if (result.parsingStatus() != SDPProcessor::Result::Success) {
+ if (result.parsingStatus() == SDPProcessor::Result::ParseError)
</ins><span class="cx"> promise.reject(OperationError, "Invalid candidate content");
</span><span class="cx"> else
</span><span class="cx"> LOG_ERROR("SDPProcessor internal error");
</span><span class="lines">@@ -686,10 +685,9 @@
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- targetMediaDescription->addIceCandidate(candidate.copyRef());
</del><ins>+ m_mediaEndpoint->addRemoteCandidate(result.candidate(), targetMediaDescription->mid(), targetMediaDescription->iceUfrag(), targetMediaDescription->icePassword());
</ins><span class="cx">
</span><del>- m_mediaEndpoint->addRemoteCandidate(*candidate, targetMediaDescription->mid(), targetMediaDescription->iceUfrag(),
- targetMediaDescription->icePassword());
</del><ins>+ targetMediaDescription->addIceCandidate(WTFMove(result.candidate()));
</ins><span class="cx">
</span><span class="cx"> promise.resolve(nullptr);
</span><span class="cx"> }
</span><span class="lines">@@ -835,7 +833,7 @@
</span><span class="cx"> startRunningTasks();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void MediaEndpointPeerConnection::gotIceCandidate(const String& mid, RefPtr<IceCandidate>&& candidate)
</del><ins>+void MediaEndpointPeerConnection::gotIceCandidate(const String& mid, IceCandidate&& candidate)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(isMainThread());
</span><span class="cx">
</span><span class="lines">@@ -850,19 +848,18 @@
</span><span class="cx"> }
</span><span class="cx"> ASSERT(mediaDescriptionIndex != notFound);
</span><span class="cx">
</span><del>- PeerMediaDescription& mediaDescription = *mediaDescriptions[mediaDescriptionIndex];
- mediaDescription.addIceCandidate(candidate.copyRef());
-
</del><span class="cx"> String candidateLine;
</span><del>- SDPProcessor::Result result = m_sdpProcessor->generateCandidateLine(*candidate, candidateLine);
</del><ins>+ auto result = m_sdpProcessor->generateCandidateLine(candidate, candidateLine);
</ins><span class="cx"> if (result != SDPProcessor::Result::Success) {
</span><span class="cx"> LOG_ERROR("SDPProcessor internal error");
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- RefPtr<RTCIceCandidate> iceCandidate = RTCIceCandidate::create(candidateLine, mid, mediaDescriptionIndex);
</del><ins>+ auto& mediaDescription = mediaDescriptions[mediaDescriptionIndex];
+ ASSERT(mediaDescription);
+ mediaDescription->addIceCandidate(WTFMove(candidate));
</ins><span class="cx">
</span><del>- m_client->fireEvent(RTCIceCandidateEvent::create(false, false, WTFMove(iceCandidate)));
</del><ins>+ m_client->fireEvent(RTCIceCandidateEvent::create(false, false, RTCIceCandidate::create(candidateLine, mid, mediaDescriptionIndex)));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void MediaEndpointPeerConnection::doneGatheringCandidates(const String& mid)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamMediaEndpointPeerConnectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.h (207896 => 207897)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.h        2016-10-26 13:24:12 UTC (rev 207896)
+++ trunk/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.h        2016-10-26 14:49:48 UTC (rev 207897)
</span><span class="lines">@@ -108,7 +108,7 @@
</span><span class="cx">
</span><span class="cx"> // MediaEndpointClient
</span><span class="cx"> void gotDtlsFingerprint(const String& fingerprint, const String& fingerprintFunction) override;
</span><del>- void gotIceCandidate(const String& mid, RefPtr<IceCandidate>&&) override;
</del><ins>+ void gotIceCandidate(const String& mid, IceCandidate&&) override;
</ins><span class="cx"> void doneGatheringCandidates(const String& mid) override;
</span><span class="cx"> void iceTransportStateChanged(const String& mid, MediaEndpoint::IceTransportState) override;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamSDPProcessorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/SDPProcessor.cpp (207896 => 207897)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/SDPProcessor.cpp        2016-10-26 13:24:12 UTC (rev 207896)
+++ trunk/Source/WebCore/Modules/mediastream/SDPProcessor.cpp        2016-10-26 14:49:48 UTC (rev 207897)
</span><span class="lines">@@ -111,58 +111,58 @@
</span><span class="cx"> {
</span><span class="cx"> RefPtr<InspectorObject> candidateObject = InspectorObject::create();
</span><span class="cx">
</span><del>- candidateObject->setString(typeString(), candidate.type());
- candidateObject->setString(foundationString(), candidate.foundation());
- candidateObject->setInteger(componentIdString(), candidate.componentId());
- candidateObject->setString(transportString(), candidate.transport());
- candidateObject->setInteger(priorityString(), candidate.priority());
- candidateObject->setString(addressString(), candidate.address());
- candidateObject->setInteger(portString(), candidate.port());
- if (!candidate.tcpType().isEmpty())
- candidateObject->setString(tcpTypeString(), candidate.tcpType());
- if (candidate.type().convertToASCIIUppercase() != "HOST") {
- candidateObject->setString(relatedAddressString(), candidate.relatedAddress());
- candidateObject->setInteger(relatedPortString(), candidate.relatedPort());
</del><ins>+ candidateObject->setString(typeString(), candidate.type);
+ candidateObject->setString(foundationString(), candidate.foundation);
+ candidateObject->setInteger(componentIdString(), candidate.componentId);
+ candidateObject->setString(transportString(), candidate.transport);
+ candidateObject->setInteger(priorityString(), candidate.priority);
+ candidateObject->setString(addressString(), candidate.address);
+ candidateObject->setInteger(portString(), candidate.port);
+ if (!candidate.tcpType.isEmpty())
+ candidateObject->setString(tcpTypeString(), candidate.tcpType);
+ if (candidate.type.convertToASCIIUppercase() != "HOST") {
+ candidateObject->setString(relatedAddressString(), candidate.relatedAddress);
+ candidateObject->setInteger(relatedPortString(), candidate.relatedPort);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> return candidateObject;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static RefPtr<IceCandidate> createCandidate(const InspectorObject& candidateObject)
</del><ins>+static IceCandidate createCandidate(const InspectorObject& candidateObject)
</ins><span class="cx"> {
</span><del>- RefPtr<IceCandidate> candidate = IceCandidate::create();
</del><ins>+ IceCandidate candidate;
</ins><span class="cx"> String stringValue;
</span><span class="cx"> unsigned intValue;
</span><span class="cx">
</span><span class="cx"> if (candidateObject.getString(typeString(), stringValue))
</span><del>- candidate->setType(stringValue);
</del><ins>+ candidate.type = stringValue;
</ins><span class="cx">
</span><span class="cx"> if (candidateObject.getString(foundationString(), stringValue))
</span><del>- candidate->setFoundation(stringValue);
</del><ins>+ candidate.foundation = stringValue;
</ins><span class="cx">
</span><span class="cx"> if (candidateObject.getInteger(componentIdString(), intValue))
</span><del>- candidate->setComponentId(intValue);
</del><ins>+ candidate.componentId = intValue;
</ins><span class="cx">
</span><span class="cx"> if (candidateObject.getString(transportString(), stringValue))
</span><del>- candidate->setTransport(stringValue);
</del><ins>+ candidate.transport = stringValue;
</ins><span class="cx">
</span><span class="cx"> if (candidateObject.getInteger(priorityString(), intValue))
</span><del>- candidate->setPriority(intValue);
</del><ins>+ candidate.priority = intValue;
</ins><span class="cx">
</span><span class="cx"> if (candidateObject.getString(addressString(), stringValue))
</span><del>- candidate->setAddress(stringValue);
</del><ins>+ candidate.address = stringValue;
</ins><span class="cx">
</span><span class="cx"> if (candidateObject.getInteger(portString(), intValue))
</span><del>- candidate->setPort(intValue);
</del><ins>+ candidate.port = intValue;
</ins><span class="cx">
</span><span class="cx"> if (candidateObject.getString(tcpTypeString(), stringValue))
</span><del>- candidate->setTcpType(stringValue);
</del><ins>+ candidate.tcpType = stringValue;
</ins><span class="cx">
</span><span class="cx"> if (candidateObject.getString(relatedAddressString(), stringValue))
</span><del>- candidate->setRelatedAddress(stringValue);
</del><ins>+ candidate.relatedAddress = stringValue;
</ins><span class="cx">
</span><span class="cx"> if (candidateObject.getInteger(relatedPortString(), intValue))
</span><del>- candidate->setRelatedPort(intValue);
</del><ins>+ candidate.relatedPort = intValue;
</ins><span class="cx">
</span><span class="cx"> return candidate;
</span><span class="cx"> }
</span><span class="lines">@@ -327,15 +327,15 @@
</span><span class="cx"> return configuration;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static RefPtr<IceCandidate> iceCandidateFromJSON(const String& json)
</del><ins>+static Optional<IceCandidate> iceCandidateFromJSON(const String& json)
</ins><span class="cx"> {
</span><span class="cx"> RefPtr<InspectorValue> value;
</span><span class="cx"> if (!InspectorValue::parseJSON(json, value))
</span><del>- return nullptr;
</del><ins>+ return Nullopt;
</ins><span class="cx">
</span><span class="cx"> RefPtr<InspectorObject> candidateObject;
</span><span class="cx"> if (!value->asObject(candidateObject))
</span><del>- return nullptr;
</del><ins>+ return Nullopt;
</ins><span class="cx">
</span><span class="cx"> return createCandidate(*candidateObject);
</span><span class="cx"> }
</span><span class="lines">@@ -415,8 +415,8 @@
</span><span class="cx">
</span><span class="cx"> RefPtr<InspectorArray> candidatesArray = InspectorArray::create();
</span><span class="cx">
</span><del>- for (RefPtr<IceCandidate> candidate : mediaDescription->iceCandidates())
- candidatesArray->pushObject(createCandidateObject(*candidate));
</del><ins>+ for (auto& candidate : mediaDescription->iceCandidates())
+ candidatesArray->pushObject(createCandidateObject(candidate));
</ins><span class="cx">
</span><span class="cx"> iceObject->setArray(candidatesString(), candidatesArray);
</span><span class="cx"> mediaDescriptionObject->setObject(iceString(), iceObject);
</span><span class="lines">@@ -470,21 +470,19 @@
</span><span class="cx"> return Result::Success;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-SDPProcessor::Result SDPProcessor::parseCandidateLine(const String& candidateLine, RefPtr<IceCandidate>& outCandidate) const
</del><ins>+SDPProcessor::ParsingResult SDPProcessor::parseCandidateLine(const String& candidateLine) const
</ins><span class="cx"> {
</span><span class="cx"> String scriptOutput;
</span><span class="cx"> if (!callScript("parseCandidateLine", candidateLine, scriptOutput))
</span><del>- return Result::InternalError;
</del><ins>+ return { Result::InternalError };
</ins><span class="cx">
</span><span class="cx"> if (scriptOutput == "ParseError")
</span><del>- return Result::ParseError;
</del><ins>+ return { Result::ParseError };
</ins><span class="cx">
</span><del>- RefPtr<IceCandidate> candidate = iceCandidateFromJSON(scriptOutput);
</del><ins>+ auto candidate = iceCandidateFromJSON(scriptOutput);
</ins><span class="cx"> if (!candidate)
</span><del>- return Result::InternalError;
-
- outCandidate = candidate;
- return Result::Success;
</del><ins>+ return { Result::InternalError };
+ return { WTFMove(candidate.value()) };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool SDPProcessor::callScript(const String& functionName, const String& argument, String& outResult) const
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamSDPProcessorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/SDPProcessor.h (207896 => 207897)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/SDPProcessor.h        2016-10-26 13:24:12 UTC (rev 207896)
+++ trunk/Source/WebCore/Modules/mediastream/SDPProcessor.h        2016-10-26 14:49:48 UTC (rev 207897)
</span><span class="lines">@@ -37,6 +37,7 @@
</span><span class="cx"> #include "IceCandidate.h"
</span><span class="cx"> #include "MediaEndpointSessionConfiguration.h"
</span><span class="cx"> #include <wtf/RefPtr.h>
</span><ins>+#include <wtf/Variant.h>
</ins><span class="cx"> #include <wtf/text/WTFString.h>
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -58,8 +59,15 @@
</span><span class="cx"> Result parse(const String& sdp, RefPtr<MediaEndpointSessionConfiguration>&) const;
</span><span class="cx">
</span><span class="cx"> Result generateCandidateLine(const IceCandidate&, String& outCandidateLine) const;
</span><del>- Result parseCandidateLine(const String& candidateLine, RefPtr<IceCandidate>&) const;
</del><span class="cx">
</span><ins>+ struct ParsingResult {
+ Variant<IceCandidate, Result> result;
+
+ Result parsingStatus() const { return WTF::holds_alternative<IceCandidate>(result) ? Result::Success : WTF::get<SDPProcessor::Result>(result); }
+ IceCandidate& candidate() { return WTF::get<IceCandidate>(result); }
+ };
+ ParsingResult parseCandidateLine(const String& candidateLine) const;
+
</ins><span class="cx"> private:
</span><span class="cx"> bool callScript(const String& functionName, const String& argument, String& outResult) const;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamIceCandidateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/IceCandidate.h (207896 => 207897)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/IceCandidate.h        2016-10-26 13:24:12 UTC (rev 207896)
+++ trunk/Source/WebCore/platform/mediastream/IceCandidate.h        2016-10-26 14:49:48 UTC (rev 207897)
</span><span class="lines">@@ -28,90 +28,41 @@
</span><span class="cx"> * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef IceCandidate_h
-#define IceCandidate_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(WEB_RTC)
</span><span class="cx">
</span><del>-#include <wtf/RefCounted.h>
-#include <wtf/RefPtr.h>
</del><span class="cx"> #include <wtf/text/WTFString.h>
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-class IceCandidate : public RefCounted<IceCandidate> {
-public:
- static RefPtr<IceCandidate> create()
- {
- return adoptRef(new IceCandidate());
- }
- virtual ~IceCandidate() { }
</del><ins>+struct IceCandidate {
+ String type;
+ String foundation;
+ unsigned componentId { 0 };
+ String transport;
+ unsigned long priority { 0 };
+ String address;
+ unsigned port { 0 };
+ String tcpType;
+ String relatedAddress;
+ unsigned relatedPort { 0 };
</ins><span class="cx">
</span><del>- const String& type() const { return m_type; }
- void setType(const String& type) { m_type = type; }
-
- const String& foundation() const { return m_foundation; }
- void setFoundation(const String& foundation) { m_foundation = foundation; }
-
- unsigned componentId() const { return m_componentId; }
- void setComponentId(unsigned componentId) { m_componentId = componentId; }
-
- const String& transport() const { return m_transport; }
- void setTransport(const String& transport) { m_transport = transport; }
-
- int priority() const { return m_priority; }
- void setPriority(int priority) { m_priority = priority; }
-
- const String& address() const { return m_address; }
- void setAddress(const String& address) { m_address = address; }
-
- unsigned port() const { return m_port; }
- void setPort(unsigned port) { m_port = port; }
-
- const String& tcpType() const { return m_tcpType; }
- void setTcpType(const String& tcpType) { m_tcpType = tcpType; }
-
- const String& relatedAddress() const { return m_relatedAddress; }
- void setRelatedAddress(const String& relatedAddress) { m_relatedAddress = relatedAddress; }
-
- unsigned relatedPort() const { return m_relatedPort; }
- void setRelatedPort(unsigned relatedPort) { m_relatedPort = relatedPort; }
-
- RefPtr<IceCandidate> clone() const
- {
- RefPtr<IceCandidate> copy = create();
-
- copy->m_type = String(m_type);
- copy->m_foundation = String(m_foundation);
- copy->m_componentId = m_componentId;
- copy->m_transport = String(m_transport);
- copy->m_priority = m_priority;
- copy->m_address = String(m_address);
- copy->m_port = m_port;
- copy->m_tcpType = String(m_tcpType);
- copy->m_relatedAddress = String(m_relatedAddress);
- copy->m_relatedPort = m_relatedPort;
-
- return copy;
- }
-
-private:
- IceCandidate() { }
-
- String m_type;
- String m_foundation;
- unsigned m_componentId { 0 };
- String m_transport;
- int m_priority { 0 };
- String m_address;
- unsigned m_port { 0 };
- String m_tcpType;
- String m_relatedAddress;
- unsigned m_relatedPort { 0 };
</del><ins>+ IceCandidate() = default;
+ IceCandidate(String&& type, String&& foundation, unsigned componentId, String&& transport, unsigned long priority, String&& address, unsigned port, String&& tcpType, String&& relatedAddress, unsigned relatedPort)
+ : type(WTFMove(type))
+ , foundation(WTFMove(foundation))
+ , componentId(componentId)
+ , transport(WTFMove(transport))
+ , priority(priority)
+ , address(WTFMove(address))
+ , port(port)
+ , tcpType(WTFMove(tcpType))
+ , relatedAddress(WTFMove(relatedAddress))
+ , relatedPort(relatedPort)
+ { }
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> #endif // ENABLE(WEB_RTC)
</span><del>-
-#endif // IceCandidate_h
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamMediaEndpointcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/MediaEndpoint.cpp (207896 => 207897)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/MediaEndpoint.cpp        2016-10-26 13:24:12 UTC (rev 207896)
+++ trunk/Source/WebCore/platform/mediastream/MediaEndpoint.cpp        2016-10-26 14:49:48 UTC (rev 207897)
</span><span class="lines">@@ -67,7 +67,7 @@
</span><span class="cx"> UpdateResult updateReceiveConfiguration(MediaEndpointSessionConfiguration*, bool) override { return UpdateResult::Failed; }
</span><span class="cx"> UpdateResult updateSendConfiguration(MediaEndpointSessionConfiguration*, const RealtimeMediaSourceMap&, bool) override { return UpdateResult::Failed; }
</span><span class="cx">
</span><del>- void addRemoteCandidate(IceCandidate&, const String&, const String&, const String&) override { }
</del><ins>+ void addRemoteCandidate(const IceCandidate&, const String&, const String&, const String&) override { }
</ins><span class="cx">
</span><span class="cx"> Ref<RealtimeMediaSource> createMutedRemoteSource(const String&, RealtimeMediaSource::Type) override { return EmptyRealtimeMediaSource::create(); }
</span><span class="cx"> void replaceSendSource(RealtimeMediaSource&, const String&) override { }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamMediaEndpointh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/MediaEndpoint.h (207896 => 207897)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/MediaEndpoint.h        2016-10-26 13:24:12 UTC (rev 207896)
+++ trunk/Source/WebCore/platform/mediastream/MediaEndpoint.h        2016-10-26 14:49:48 UTC (rev 207897)
</span><span class="lines">@@ -39,7 +39,7 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-class IceCandidate;
</del><ins>+struct IceCandidate;
</ins><span class="cx"> class MediaEndpoint;
</span><span class="cx"> class MediaEndpointClient;
</span><span class="cx"> class MediaEndpointSessionConfiguration;
</span><span class="lines">@@ -73,7 +73,7 @@
</span><span class="cx"> virtual UpdateResult updateReceiveConfiguration(MediaEndpointSessionConfiguration*, bool isInitiator) = 0;
</span><span class="cx"> virtual UpdateResult updateSendConfiguration(MediaEndpointSessionConfiguration*, const RealtimeMediaSourceMap&, bool isInitiator) = 0;
</span><span class="cx">
</span><del>- virtual void addRemoteCandidate(IceCandidate&, const String& mid, const String& ufrag, const String& password) = 0;
</del><ins>+ virtual void addRemoteCandidate(const IceCandidate&, const String& mid, const String& ufrag, const String& password) = 0;
</ins><span class="cx">
</span><span class="cx"> virtual Ref<RealtimeMediaSource> createMutedRemoteSource(const String& mid, RealtimeMediaSource::Type) = 0;
</span><span class="cx"> virtual void replaceSendSource(RealtimeMediaSource&, const String& mid) = 0;
</span><span class="lines">@@ -87,7 +87,7 @@
</span><span class="cx"> class MediaEndpointClient {
</span><span class="cx"> public:
</span><span class="cx"> virtual void gotDtlsFingerprint(const String& fingerprint, const String& fingerprintFunction) = 0;
</span><del>- virtual void gotIceCandidate(const String& mid, RefPtr<IceCandidate>&&) = 0;
</del><ins>+ virtual void gotIceCandidate(const String& mid, IceCandidate&&) = 0;
</ins><span class="cx"> virtual void doneGatheringCandidates(const String& mid) = 0;
</span><span class="cx"> virtual void iceTransportStateChanged(const String& mid, MediaEndpoint::IceTransportState) = 0;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamPeerMediaDescriptionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/PeerMediaDescription.h (207896 => 207897)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/PeerMediaDescription.h        2016-10-26 13:24:12 UTC (rev 207896)
+++ trunk/Source/WebCore/platform/mediastream/PeerMediaDescription.h        2016-10-26 14:49:48 UTC (rev 207897)
</span><span class="lines">@@ -106,8 +106,8 @@
</span><span class="cx"> const String& icePassword() const { return m_icePassword; }
</span><span class="cx"> void setIcePassword(const String& icePassword) { m_icePassword = icePassword; }
</span><span class="cx">
</span><del>- const Vector<RefPtr<IceCandidate>>& iceCandidates() const { return m_iceCandidates; }
- void addIceCandidate(RefPtr<IceCandidate>&& candidate) { m_iceCandidates.append(WTFMove(candidate)); }
</del><ins>+ const Vector<IceCandidate>& iceCandidates() const { return m_iceCandidates; }
+ void addIceCandidate(IceCandidate&& candidate) { m_iceCandidates.append(WTFMove(candidate)); }
</ins><span class="cx">
</span><span class="cx"> RefPtr<PeerMediaDescription> clone() const
</span><span class="cx"> {
</span><span class="lines">@@ -141,8 +141,7 @@
</span><span class="cx"> copy->m_iceUfrag = String(m_iceUfrag);
</span><span class="cx"> copy->m_icePassword = String(m_icePassword);
</span><span class="cx">
</span><del>- for (auto& candidate : m_iceCandidates)
- copy->m_iceCandidates.append(candidate->clone());
</del><ins>+ copy->m_iceCandidates = m_iceCandidates;
</ins><span class="cx">
</span><span class="cx"> return copy;
</span><span class="cx"> }
</span><span class="lines">@@ -174,7 +173,7 @@
</span><span class="cx">
</span><span class="cx"> String m_iceUfrag;
</span><span class="cx"> String m_icePassword;
</span><del>- Vector<RefPtr<IceCandidate>> m_iceCandidates;
</del><ins>+ Vector<IceCandidate> m_iceCandidates;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamopenwebrtcMediaEndpointOwrcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/openwebrtc/MediaEndpointOwr.cpp (207896 => 207897)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/openwebrtc/MediaEndpointOwr.cpp        2016-10-26 13:24:12 UTC (rev 207896)
+++ trunk/Source/WebCore/platform/mediastream/openwebrtc/MediaEndpointOwr.cpp        2016-10-26 14:49:48 UTC (rev 207897)
</span><span class="lines">@@ -267,7 +267,7 @@
</span><span class="cx">
</span><span class="cx"> if (mdesc.iceCandidates().size()) {
</span><span class="cx"> for (auto& candidate : mdesc.iceCandidates())
</span><del>- internalAddRemoteCandidate(session, *candidate, mdesc.iceUfrag(), mdesc.icePassword());
</del><ins>+ internalAddRemoteCandidate(session, candidate, mdesc.iceUfrag(), mdesc.icePassword());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (i < m_numberOfSendPreparedSessions)
</span><span class="lines">@@ -311,7 +311,7 @@
</span><span class="cx"> return UpdateResult::Success;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void MediaEndpointOwr::addRemoteCandidate(IceCandidate& candidate, const String& mid, const String& ufrag, const String& password)
</del><ins>+void MediaEndpointOwr::addRemoteCandidate(const IceCandidate& candidate, const String& mid, const String& ufrag, const String& password)
</ins><span class="cx"> {
</span><span class="cx"> for (auto& transceiver : m_transceivers) {
</span><span class="cx"> if (transceiver->mid() == mid) {
</span><span class="lines">@@ -394,7 +394,7 @@
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void MediaEndpointOwr::dispatchNewIceCandidate(const String& mid, RefPtr<IceCandidate>&& iceCandidate)
</del><ins>+void MediaEndpointOwr::dispatchNewIceCandidate(const String& mid, IceCandidate&& iceCandidate)
</ins><span class="cx"> {
</span><span class="cx"> m_client.gotIceCandidate(mid, WTFMove(iceCandidate));
</span><span class="cx"> }
</span><span class="lines">@@ -590,35 +590,35 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void MediaEndpointOwr::internalAddRemoteCandidate(OwrSession* session, IceCandidate& candidate, const String& ufrag, const String& password)
</del><ins>+void MediaEndpointOwr::internalAddRemoteCandidate(OwrSession* session, const IceCandidate& candidate, const String& ufrag, const String& password)
</ins><span class="cx"> {
</span><span class="cx"> gboolean rtcpMux;
</span><span class="cx"> g_object_get(session, "rtcp-mux", &rtcpMux, nullptr);
</span><span class="cx">
</span><del>- if (rtcpMux && candidate.componentId() == OWR_COMPONENT_TYPE_RTCP)
</del><ins>+ if (rtcpMux && candidate.componentId == OWR_COMPONENT_TYPE_RTCP)
</ins><span class="cx"> return;
</span><span class="cx">
</span><del>- ASSERT(candidateTypes.find(candidate.type()) != notFound);
</del><ins>+ ASSERT(candidateTypes.find(candidate.type) != notFound);
</ins><span class="cx">
</span><del>- OwrCandidateType candidateType = static_cast<OwrCandidateType>(candidateTypes.find(candidate.type()));
- OwrComponentType componentId = static_cast<OwrComponentType>(candidate.componentId());
</del><ins>+ OwrCandidateType candidateType = static_cast<OwrCandidateType>(candidateTypes.find(candidate.type));
+ OwrComponentType componentId = static_cast<OwrComponentType>(candidate.componentId);
</ins><span class="cx"> OwrTransportType transportType;
</span><span class="cx">
</span><del>- if (candidate.transport().convertToASCIIUppercase() == "UDP")
</del><ins>+ if (candidate.transport.convertToASCIIUppercase() == "UDP")
</ins><span class="cx"> transportType = OWR_TRANSPORT_TYPE_UDP;
</span><span class="cx"> else {
</span><del>- ASSERT(candidateTcpTypes.find(candidate.tcpType()) != notFound);
- transportType = static_cast<OwrTransportType>(candidateTcpTypes.find(candidate.tcpType()));
</del><ins>+ ASSERT(candidateTcpTypes.find(candidate.tcpType) != notFound);
+ transportType = static_cast<OwrTransportType>(candidateTcpTypes.find(candidate.tcpType));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> OwrCandidate* owrCandidate = owr_candidate_new(candidateType, componentId);
</span><span class="cx"> g_object_set(owrCandidate, "transport-type", transportType,
</span><del>- "address", candidate.address().ascii().data(),
- "port", candidate.port(),
- "base-address", candidate.relatedAddress().ascii().data(),
- "base-port", candidate.relatedPort(),
- "priority", candidate.priority(),
- "foundation", candidate.foundation().ascii().data(),
</del><ins>+ "address", candidate.address.ascii().data(),
+ "port", candidate.port,
+ "base-address", candidate.relatedAddress.ascii().data(),
+ "base-port", candidate.relatedPort,
+ "priority", candidate.priority,
+ "foundation", candidate.foundation.ascii().data(),
</ins><span class="cx"> "ufrag", ufrag.ascii().data(),
</span><span class="cx"> "password", password.ascii().data(),
</span><span class="cx"> nullptr);
</span><span class="lines">@@ -652,24 +652,24 @@
</span><span class="cx"> ASSERT(candidateType >= 0 && candidateType < candidateTypes.size());
</span><span class="cx"> ASSERT(transportType >= 0 && transportType < candidateTcpTypes.size());
</span><span class="cx">
</span><del>- RefPtr<IceCandidate> iceCandidate = IceCandidate::create();
- iceCandidate->setType(candidateTypes[candidateType]);
- iceCandidate->setFoundation(foundation);
- iceCandidate->setComponentId(componentId);
- iceCandidate->setPriority(priority);
- iceCandidate->setAddress(address);
- iceCandidate->setPort(port ? port : candidateDefaultPort);
</del><ins>+ IceCandidate iceCandidate;
+ iceCandidate.type = candidateTypes[candidateType];
+ iceCandidate.foundation = foundation;
+ iceCandidate.componentId = componentId;
+ iceCandidate.priority = priority;
+ iceCandidate.address = address;
+ iceCandidate.port = port ? port : candidateDefaultPort;
</ins><span class="cx">
</span><span class="cx"> if (transportType == OWR_TRANSPORT_TYPE_UDP)
</span><del>- iceCandidate->setTransport("UDP");
</del><ins>+ iceCandidate.transport = "UDP";
</ins><span class="cx"> else {
</span><del>- iceCandidate->setTransport("TCP");
- iceCandidate->setTcpType(candidateTcpTypes[transportType]);
</del><ins>+ iceCandidate.transport = "TCP";
+ iceCandidate.tcpType = candidateTcpTypes[transportType];
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (candidateType != OWR_CANDIDATE_TYPE_HOST) {
</span><del>- iceCandidate->setRelatedAddress(relatedAddress);
- iceCandidate->setRelatedPort(relatedPort ? relatedPort : candidateDefaultPort);
</del><ins>+ iceCandidate.relatedAddress = relatedAddress;
+ iceCandidate.relatedPort = relatedPort ? relatedPort : candidateDefaultPort;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> g_object_set(G_OBJECT(candidate), "ufrag", g_object_get_data(G_OBJECT(session), "ice-ufrag"),
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamopenwebrtcMediaEndpointOwrh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/openwebrtc/MediaEndpointOwr.h (207896 => 207897)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/openwebrtc/MediaEndpointOwr.h        2016-10-26 13:24:12 UTC (rev 207896)
+++ trunk/Source/WebCore/platform/mediastream/openwebrtc/MediaEndpointOwr.h        2016-10-26 14:49:48 UTC (rev 207897)
</span><span class="lines">@@ -92,7 +92,7 @@
</span><span class="cx"> UpdateResult updateReceiveConfiguration(MediaEndpointSessionConfiguration*, bool isInitiator) override;
</span><span class="cx"> UpdateResult updateSendConfiguration(MediaEndpointSessionConfiguration*, const RealtimeMediaSourceMap&, bool isInitiator) override;
</span><span class="cx">
</span><del>- void addRemoteCandidate(IceCandidate&, const String& mid, const String& ufrag, const String& password) override;
</del><ins>+ void addRemoteCandidate(const IceCandidate&, const String& mid, const String& ufrag, const String& password) override;
</ins><span class="cx">
</span><span class="cx"> Ref<RealtimeMediaSource> createMutedRemoteSource(const String& mid, RealtimeMediaSource::Type) override;
</span><span class="cx"> void replaceMutedRemoteSourceMid(const String&, const String&) final;
</span><span class="lines">@@ -104,7 +104,7 @@
</span><span class="cx"> const String& sessionMid(OwrSession*) const;
</span><span class="cx"> OwrTransceiver* matchTransceiverByMid(const String& mid) const;
</span><span class="cx">
</span><del>- void dispatchNewIceCandidate(const String& mid, RefPtr<IceCandidate>&&);
</del><ins>+ void dispatchNewIceCandidate(const String& mid, IceCandidate&&);
</ins><span class="cx"> void dispatchGatheringDone(const String& mid);
</span><span class="cx"> void processIceTransportStateChange(OwrSession*);
</span><span class="cx"> void dispatchDtlsFingerprint(gchar* privateKey, gchar* certificate, const String& fingerprint, const String& fingerprintFunction);
</span><span class="lines">@@ -123,7 +123,7 @@
</span><span class="cx"> void prepareMediaSession(OwrMediaSession*, PeerMediaDescription*, bool isInitiator);
</span><span class="cx">
</span><span class="cx"> void ensureTransportAgentAndTransceivers(bool isInitiator, const Vector<TransceiverConfig>&);
</span><del>- void internalAddRemoteCandidate(OwrSession*, IceCandidate&, const String& ufrag, const String& password);
</del><ins>+ void internalAddRemoteCandidate(OwrSession*, const IceCandidate&, const String& ufrag, const String& password);
</ins><span class="cx">
</span><span class="cx"> Optional<MediaEndpointConfiguration> m_configuration;
</span><span class="cx"> GRegex* m_helperServerRegEx;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmockMockMediaEndpointcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mock/MockMediaEndpoint.cpp (207896 => 207897)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mock/MockMediaEndpoint.cpp        2016-10-26 13:24:12 UTC (rev 207896)
+++ trunk/Source/WebCore/platform/mock/MockMediaEndpoint.cpp        2016-10-26 14:49:48 UTC (rev 207897)
</span><span class="lines">@@ -173,7 +173,7 @@
</span><span class="cx"> return UpdateResult::Success;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void MockMediaEndpoint::addRemoteCandidate(IceCandidate& candidate, const String& mid, const String& ufrag, const String& password)
</del><ins>+void MockMediaEndpoint::addRemoteCandidate(const IceCandidate& candidate, const String& mid, const String& ufrag, const String& password)
</ins><span class="cx"> {
</span><span class="cx"> UNUSED_PARAM(candidate);
</span><span class="cx"> UNUSED_PARAM(mid);
</span><span class="lines">@@ -232,39 +232,10 @@
</span><span class="cx">
</span><span class="cx"> void MockMediaEndpoint::dispatchFakeIceCandidates()
</span><span class="cx"> {
</span><del>- RefPtr<IceCandidate> iceCandidate = IceCandidate::create();
- iceCandidate->setType("host");
- iceCandidate->setFoundation("1");
- iceCandidate->setComponentId(1);
- iceCandidate->setPriority(2013266431);
- iceCandidate->setAddress("192.168.0.100");
- iceCandidate->setPort(38838);
- iceCandidate->setTransport("UDP");
- m_fakeIceCandidates.append(WTFMove(iceCandidate));
</del><ins>+ m_fakeIceCandidates.append({ "host", "1", 1, "UDP", 2013266431, "192.168.0.100", 38838, { }, { }, 0 });
+ m_fakeIceCandidates.append({ "host", "2", 1, "TCP", 1019216383, "192.168.0.100", 9, "active", { }, 0 });
+ m_fakeIceCandidates.append({ "srflx", "3", 1, "UDP", 1677722111, "172.18.0.1", 47989, { }, "192.168.0.100", 47989 });
</ins><span class="cx">
</span><del>- iceCandidate = IceCandidate::create();
- iceCandidate->setType("host");
- iceCandidate->setFoundation("2");
- iceCandidate->setComponentId(1);
- iceCandidate->setPriority(1019216383);
- iceCandidate->setAddress("192.168.0.100");
- iceCandidate->setPort(9);
- iceCandidate->setTransport("TCP");
- iceCandidate->setTcpType("active");
- m_fakeIceCandidates.append(WTFMove(iceCandidate));
-
- iceCandidate = IceCandidate::create();
- iceCandidate->setType("srflx");
- iceCandidate->setFoundation("3");
- iceCandidate->setComponentId(1);
- iceCandidate->setPriority(1677722111);
- iceCandidate->setAddress("172.18.0.1");
- iceCandidate->setPort(47989);
- iceCandidate->setTransport("UDP");
- iceCandidate->setRelatedAddress("192.168.0.100");
- iceCandidate->setRelatedPort(47989);
- m_fakeIceCandidates.append(WTFMove(iceCandidate));
-
</del><span class="cx"> // Reverse order to use takeLast() while keeping the above order
</span><span class="cx"> m_fakeIceCandidates.reverse();
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmockMockMediaEndpointh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mock/MockMediaEndpoint.h (207896 => 207897)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mock/MockMediaEndpoint.h        2016-10-26 13:24:12 UTC (rev 207896)
+++ trunk/Source/WebCore/platform/mock/MockMediaEndpoint.h        2016-10-26 14:49:48 UTC (rev 207897)
</span><span class="lines">@@ -55,7 +55,7 @@
</span><span class="cx"> UpdateResult updateReceiveConfiguration(MediaEndpointSessionConfiguration*, bool isInitiator) final;
</span><span class="cx"> UpdateResult updateSendConfiguration(MediaEndpointSessionConfiguration*, const RealtimeMediaSourceMap&, bool isInitiator) final;
</span><span class="cx">
</span><del>- void addRemoteCandidate(IceCandidate&, const String& mid, const String& ufrag, const String& password) final;
</del><ins>+ void addRemoteCandidate(const IceCandidate&, const String& mid, const String& ufrag, const String& password) final;
</ins><span class="cx">
</span><span class="cx"> Ref<RealtimeMediaSource> createMutedRemoteSource(const String& mid, RealtimeMediaSource::Type) final;
</span><span class="cx"> void replaceSendSource(RealtimeMediaSource&, const String& mid) final;
</span><span class="lines">@@ -81,7 +81,7 @@
</span><span class="cx"> Vector<String> m_mids;
</span><span class="cx"> HashMap<String, RefPtr<RealtimeMediaSource>> m_mutedRemoteSources;
</span><span class="cx">
</span><del>- Vector<RefPtr<IceCandidate>> m_fakeIceCandidates;
</del><ins>+ Vector<IceCandidate> m_fakeIceCandidates;
</ins><span class="cx"> Timer m_iceCandidateTimer;
</span><span class="cx">
</span><span class="cx"> Vector<std::pair<String, MediaEndpoint::IceTransportState>> m_iceTransportStateChanges;
</span></span></pre>
</div>
</div>
</body>
</html>