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

Unified Diff: webrtc/p2p/base/transportdescriptionfactory.cc

Issue 1303393002: Reland "Remove GICE (gone forever!) and PORTALLOCATOR_ENABLE_SHARED_UFRAG (enabled forever)." becau… (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Add memcheck suppression Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/p2p/base/transportdescriptionfactory.cc
diff --git a/webrtc/p2p/base/transportdescriptionfactory.cc b/webrtc/p2p/base/transportdescriptionfactory.cc
index 1230ba52c18dee87447875245c289e048a47f21a..7654fdfcf504a1abd5f4e97ed8db4c75eee8548f 100644
--- a/webrtc/p2p/base/transportdescriptionfactory.cc
+++ b/webrtc/p2p/base/transportdescriptionfactory.cc
@@ -19,11 +19,8 @@
namespace cricket {
-static TransportProtocol kDefaultProtocol = ICEPROTO_RFC5245;
-
TransportDescriptionFactory::TransportDescriptionFactory()
- : protocol_(kDefaultProtocol),
- secure_(SEC_DISABLED),
+ : secure_(SEC_DISABLED),
identity_(NULL) {
}
@@ -32,16 +29,6 @@ TransportDescription* TransportDescriptionFactory::CreateOffer(
const TransportDescription* current_description) const {
rtc::scoped_ptr<TransportDescription> desc(new TransportDescription());
- // Set the transport type depending on the selected protocol.
- if (protocol_ == ICEPROTO_RFC5245) {
- desc->transport_type = NS_JINGLE_ICE_UDP;
- } else if (protocol_ == ICEPROTO_HYBRID) {
- desc->transport_type = NS_JINGLE_ICE_UDP;
- desc->AddOption(ICE_OPTION_GICE);
- } else if (protocol_ == ICEPROTO_GOOGLE) {
- desc->transport_type = NS_GINGLE_P2P;
- }
-
// Generate the ICE credentials if we don't already have them.
if (!current_description || options.ice_restart) {
desc->ice_ufrag = rtc::CreateRandomString(ICE_UFRAG_LENGTH);
@@ -67,33 +54,14 @@ TransportDescription* TransportDescriptionFactory::CreateAnswer(
const TransportDescription* offer,
const TransportOptions& options,
const TransportDescription* current_description) const {
- // A NULL offer is treated as a GICE transport description.
// TODO(juberti): Figure out why we get NULL offers, and fix this upstream.
- rtc::scoped_ptr<TransportDescription> desc(new TransportDescription());
-
- // Figure out which ICE variant to negotiate; prefer RFC 5245 ICE, but fall
- // back to G-ICE if needed. Note that we never create a hybrid answer, since
- // we know what the other side can support already.
- if (offer && offer->transport_type == NS_JINGLE_ICE_UDP &&
- (protocol_ == ICEPROTO_RFC5245 || protocol_ == ICEPROTO_HYBRID)) {
- // Offer is ICE or hybrid, we support ICE or hybrid: use ICE.
- desc->transport_type = NS_JINGLE_ICE_UDP;
- } else if (offer && offer->transport_type == NS_JINGLE_ICE_UDP &&
- offer->HasOption(ICE_OPTION_GICE) &&
- protocol_ == ICEPROTO_GOOGLE) {
- desc->transport_type = NS_GINGLE_P2P;
- // Offer is hybrid, we support GICE: use GICE.
- } else if ((!offer || offer->transport_type == NS_GINGLE_P2P) &&
- (protocol_ == ICEPROTO_HYBRID || protocol_ == ICEPROTO_GOOGLE)) {
- // Offer is GICE, we support hybrid or GICE: use GICE.
- desc->transport_type = NS_GINGLE_P2P;
- } else {
- // Mismatch.
- LOG(LS_WARNING) << "Failed to create TransportDescription answer "
- "because of incompatible transport types";
+ if (!offer) {
+ LOG(LS_WARNING) << "Failed to create TransportDescription answer " <<
+ "because offer is NULL";
return NULL;
}
+ rtc::scoped_ptr<TransportDescription> desc(new TransportDescription());
// Generate the ICE credentials if we don't already have them or ice is
// being restarted.
if (!current_description || options.ice_restart) {
@@ -157,4 +125,3 @@ bool TransportDescriptionFactory::SetSecurityInfo(
}
} // namespace cricket
-
« no previous file with comments | « webrtc/p2p/base/transportdescriptionfactory.h ('k') | webrtc/p2p/base/transportdescriptionfactory_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698