Update talk to 56698267.
TBR=sergeyu@chromium.org
Review URL: https://webrtc-codereview.appspot.com/4119004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@5143 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/talk/app/webrtc/webrtcsessiondescriptionfactory.cc b/talk/app/webrtc/webrtcsessiondescriptionfactory.cc
index 51427d2..b6f523c 100644
--- a/talk/app/webrtc/webrtcsessiondescriptionfactory.cc
+++ b/talk/app/webrtc/webrtcsessiondescriptionfactory.cc
@@ -33,10 +33,10 @@
#include "talk/app/webrtc/mediastreamsignaling.h"
#include "talk/app/webrtc/webrtcsession.h"
+using cricket::MediaSessionOptions;
+
namespace webrtc {
-
namespace {
-
static const char kFailedDueToIdentityFailed[] =
" failed because DTLS identity request failed";
@@ -46,25 +46,24 @@
static const uint64 kInitSessionVersion = 2;
-typedef cricket::MediaSessionOptions::Stream Stream;
-typedef cricket::MediaSessionOptions::Streams Streams;
-
-static bool CompareStream(const Stream& stream1, const Stream& stream2) {
- return (stream1.id < stream2.id);
+static bool CompareStream(const MediaSessionOptions::Stream& stream1,
+ const MediaSessionOptions::Stream& stream2) {
+ return stream1.id < stream2.id;
}
-static bool SameId(const Stream& stream1, const Stream& stream2) {
- return (stream1.id == stream2.id);
+static bool SameId(const MediaSessionOptions::Stream& stream1,
+ const MediaSessionOptions::Stream& stream2) {
+ return stream1.id == stream2.id;
}
// Checks if each Stream within the |streams| has unique id.
-static bool ValidStreams(const Streams& streams) {
- Streams sorted_streams = streams;
+static bool ValidStreams(const MediaSessionOptions::Streams& streams) {
+ MediaSessionOptions::Streams sorted_streams = streams;
std::sort(sorted_streams.begin(), sorted_streams.end(), CompareStream);
- Streams::iterator it =
+ MediaSessionOptions::Streams::iterator it =
std::adjacent_find(sorted_streams.begin(), sorted_streams.end(),
SameId);
- return (it == sorted_streams.end());
+ return it == sorted_streams.end();
}
enum {
@@ -83,7 +82,6 @@
std::string error;
talk_base::scoped_ptr<webrtc::SessionDescriptionInterface> description;
};
-
} // namespace
// static
@@ -130,33 +128,35 @@
transport_desc_factory_.set_protocol(cricket::ICEPROTO_HYBRID);
session_desc_factory_.set_add_legacy_streams(false);
// By default SRTP-SDES is enabled in WebRtc.
- set_secure(cricket::SEC_REQUIRED);
+ SetSecure(cricket::SEC_REQUIRED);
- if (dtls_enabled) {
- if (identity_service_.get()) {
- identity_request_observer_ =
- new talk_base::RefCountedObject<WebRtcIdentityRequestObserver>();
+ if (!dtls_enabled) {
+ return;
+ }
- identity_request_observer_->SignalRequestFailed.connect(
- this, &WebRtcSessionDescriptionFactory::OnIdentityRequestFailed);
- identity_request_observer_->SignalIdentityReady.connect(
- this, &WebRtcSessionDescriptionFactory::OnIdentityReady);
+ if (identity_service_.get()) {
+ identity_request_observer_ =
+ new talk_base::RefCountedObject<WebRtcIdentityRequestObserver>();
- if (identity_service_->RequestIdentity(kWebRTCIdentityName,
- kWebRTCIdentityName,
- identity_request_observer_)) {
- LOG(LS_VERBOSE) << "DTLS-SRTP enabled; sent DTLS identity request.";
- identity_request_state_ = IDENTITY_WAITING;
- } else {
- LOG(LS_ERROR) << "Failed to send DTLS identity request.";
- identity_request_state_ = IDENTITY_FAILED;
- }
- } else {
+ identity_request_observer_->SignalRequestFailed.connect(
+ this, &WebRtcSessionDescriptionFactory::OnIdentityRequestFailed);
+ identity_request_observer_->SignalIdentityReady.connect(
+ this, &WebRtcSessionDescriptionFactory::OnIdentityReady);
+
+ if (identity_service_->RequestIdentity(kWebRTCIdentityName,
+ kWebRTCIdentityName,
+ identity_request_observer_)) {
+ LOG(LS_VERBOSE) << "DTLS-SRTP enabled; sent DTLS identity request.";
identity_request_state_ = IDENTITY_WAITING;
- // Do not generate the identity in the constructor since the caller has
- // not got a chance to connect to SignalIdentityReady.
- signaling_thread_->Post(this, MSG_GENERATE_IDENTITY, NULL);
+ } else {
+ LOG(LS_ERROR) << "Failed to send DTLS identity request.";
+ identity_request_state_ = IDENTITY_FAILED;
}
+ } else {
+ identity_request_state_ = IDENTITY_WAITING;
+ // Do not generate the identity in the constructor since the caller has
+ // not got a chance to connect to SignalIdentityReady.
+ signaling_thread_->Post(this, MSG_GENERATE_IDENTITY, NULL);
}
}
@@ -261,19 +261,15 @@
}
}
-void WebRtcSessionDescriptionFactory::set_secure(
+void WebRtcSessionDescriptionFactory::SetSecure(
cricket::SecureMediaPolicy secure_policy) {
session_desc_factory_.set_secure(secure_policy);
}
-cricket::SecureMediaPolicy WebRtcSessionDescriptionFactory::secure() const {
+cricket::SecureMediaPolicy WebRtcSessionDescriptionFactory::Secure() const {
return session_desc_factory_.secure();
}
-bool WebRtcSessionDescriptionFactory::waiting_for_identity() const {
- return identity_request_state_ == IDENTITY_WAITING;
-}
-
void WebRtcSessionDescriptionFactory::OnMessage(talk_base::Message* msg) {
switch (msg->message_id) {
case MSG_CREATE_SESSIONDESCRIPTION_SUCCESS: {
@@ -450,5 +446,4 @@
create_session_description_requests_.pop();
}
}
-
} // namespace webrtc