diff options
author | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-22 19:49:21 +0000 |
---|---|---|
committer | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-22 19:49:21 +0000 |
commit | 71a0c6be93d9303fcdcf7a6f7f99201a0fa41618 (patch) | |
tree | 3dcc118a2e8296be5230f373e4939c73f69d6821 | |
parent | e101fc3da10d9ac1ab490ae13adbd5d25e74eb9a (diff) | |
download | chromium_src-71a0c6be93d9303fcdcf7a6f7f99201a0fa41618.zip chromium_src-71a0c6be93d9303fcdcf7a6f7f99201a0fa41618.tar.gz chromium_src-71a0c6be93d9303fcdcf7a6f7f99201a0fa41618.tar.bz2 |
Changes needed to roll libjingle r141 to chrome.
1. Setting ice username and password for P2PTransportChannel.
2. Updating XMPP Auth cookie with Auth Token
Review URL: https://chromiumcodereview.appspot.com/10382003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138334 0039d316-1c4b-4281-b951-d872f2087c98
27 files changed, 126 insertions, 79 deletions
@@ -44,7 +44,7 @@ vars = { "nacl_toolchain_revision": "8612", "pnacl_toolchain_revision": "8612", - "libjingle_revision": "136", + "libjingle_revision": "145", "libphonenumber_revision": "425", "libvpx_revision": "134182", "lss_revision": "9", diff --git a/content/renderer/media/media_stream_dependency_factory.cc b/content/renderer/media/media_stream_dependency_factory.cc index c67e858..00001b9 100644 --- a/content/renderer/media/media_stream_dependency_factory.cc +++ b/content/renderer/media/media_stream_dependency_factory.cc @@ -13,7 +13,6 @@ #include "content/renderer/p2p/ipc_socket_factory.h" #include "content/renderer/p2p/port_allocator.h" #include "jingle/glue/thread_wrapper.h" -#include "third_party/libjingle/source/talk/app/webrtc/peerconnection.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" class P2PPortAllocatorFactory : public webrtc::PortAllocatorFactoryInterface { diff --git a/content/renderer/media/media_stream_dependency_factory.h b/content/renderer/media/media_stream_dependency_factory.h index 57d9b3c..e632aa3 100644 --- a/content/renderer/media/media_stream_dependency_factory.h +++ b/content/renderer/media/media_stream_dependency_factory.h @@ -10,7 +10,7 @@ #include "base/basictypes.h" #include "base/memory/ref_counted.h" #include "content/common/content_export.h" -#include "third_party/libjingle/source/talk/app/webrtc/peerconnection.h" +#include "third_party/libjingle/source/talk/app/webrtc/peerconnectioninterface.h" #include "webkit/glue/p2p_transport.h" namespace content { diff --git a/content/renderer/media/mock_media_stream_dependency_factory.cc b/content/renderer/media/mock_media_stream_dependency_factory.cc index 9810b3a..47af829 100644 --- a/content/renderer/media/mock_media_stream_dependency_factory.cc +++ b/content/renderer/media/mock_media_stream_dependency_factory.cc @@ -185,11 +185,12 @@ class MockSessionDescription : public SessionDescriptionInterface { NOTIMPLEMENTED(); return 0; } - virtual const IceCandidateColletion* candidates( + virtual const IceCandidateCollection* candidates( size_t mediasection_index) const OVERRIDE { NOTIMPLEMENTED(); return NULL; } + virtual bool ToString(std::string* out) const OVERRIDE { *out = sdp_; return true; diff --git a/content/renderer/media/mock_peer_connection_impl.h b/content/renderer/media/mock_peer_connection_impl.h index 6615acc..9b61747 100644 --- a/content/renderer/media/mock_peer_connection_impl.h +++ b/content/renderer/media/mock_peer_connection_impl.h @@ -10,7 +10,7 @@ #include "base/basictypes.h" #include "base/compiler_specific.h" #include "base/memory/scoped_ptr.h" -#include "third_party/libjingle/source/talk/app/webrtc/peerconnection.h" +#include "third_party/libjingle/source/talk/app/webrtc/peerconnectioninterface.h" class MockMediaStreamDependencyFactory; diff --git a/content/renderer/media/peer_connection_handler_base.h b/content/renderer/media/peer_connection_handler_base.h index de7935d..87cff04 100644 --- a/content/renderer/media/peer_connection_handler_base.h +++ b/content/renderer/media/peer_connection_handler_base.h @@ -12,7 +12,7 @@ #include "base/message_loop_proxy.h" #include "content/common/content_export.h" #include "third_party/libjingle/source/talk/app/webrtc/mediastream.h" -#include "third_party/libjingle/source/talk/app/webrtc/peerconnection.h" +#include "third_party/libjingle/source/talk/app/webrtc/peerconnectioninterface.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebMediaStreamDescriptor.h" class MediaStreamDependencyFactory; diff --git a/content/renderer/media/peer_connection_handler_jsep_unittest.cc b/content/renderer/media/peer_connection_handler_jsep_unittest.cc index b7b04f6..be2e3b2 100644 --- a/content/renderer/media/peer_connection_handler_jsep_unittest.cc +++ b/content/renderer/media/peer_connection_handler_jsep_unittest.cc @@ -12,7 +12,7 @@ #include "content/renderer/media/mock_peer_connection_impl.h" #include "content/renderer/media/peer_connection_handler_jsep.h" #include "testing/gtest/include/gtest/gtest.h" -#include "third_party/libjingle/source/talk/app/webrtc/peerconnection.h" +#include "third_party/libjingle/source/talk/app/webrtc/peerconnectioninterface.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebICECandidateDescriptor.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebICEOptions.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebMediaHints.h" diff --git a/content/renderer/media/peer_connection_handler_unittest.cc b/content/renderer/media/peer_connection_handler_unittest.cc index a8b877b..3f1c998 100644 --- a/content/renderer/media/peer_connection_handler_unittest.cc +++ b/content/renderer/media/peer_connection_handler_unittest.cc @@ -15,7 +15,7 @@ #include "content/renderer/media/rtc_video_decoder.h" #include "jingle/glue/thread_wrapper.h" #include "testing/gtest/include/gtest/gtest.h" -#include "third_party/libjingle/source/talk/app/webrtc/peerconnection.h" +#include "third_party/libjingle/source/talk/app/webrtc/peerconnectioninterface.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebMediaStreamDescriptor.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebMediaStreamSource.h" diff --git a/content/renderer/p2p/p2p_transport_impl.cc b/content/renderer/p2p/p2p_transport_impl.cc index 9a67e67..7a13997 100644 --- a/content/renderer/p2p/p2p_transport_impl.cc +++ b/content/renderer/p2p/p2p_transport_impl.cc @@ -12,6 +12,8 @@ #include "jingle/glue/thread_wrapper.h" #include "jingle/glue/utils.h" #include "net/base/net_errors.h" +#include "third_party/libjingle/source/talk/base/helpers.h" +#include "third_party/libjingle/source/talk/p2p/base/constants.h" #include "third_party/libjingle/source/talk/p2p/base/p2ptransportchannel.h" #include "third_party/libjingle/source/talk/p2p/client/basicportallocator.h" @@ -75,7 +77,10 @@ bool P2PTransportImpl::Init(WebKit::WebFrame* web_frame, DCHECK(!channel_.get()); channel_.reset(new cricket::P2PTransportChannel( - name, 0, NULL, allocator_.get())); + 0, NULL, allocator_.get())); + channel_->SetIceUfrag( + talk_base::CreateRandomString(cricket::ICE_UFRAG_LENGTH)); + channel_->SetIcePwd(talk_base::CreateRandomString(cricket::ICE_PWD_LENGTH)); channel_->SignalRequestSignaling.connect( this, &P2PTransportImpl::OnRequestSignaling); channel_->SignalCandidateReady.connect( diff --git a/content/renderer/p2p/port_allocator.cc b/content/renderer/p2p/port_allocator.cc index 610f61b..a85c92d 100644 --- a/content/renderer/p2p/port_allocator.cc +++ b/content/renderer/p2p/port_allocator.cc @@ -70,17 +70,22 @@ P2PPortAllocator::P2PPortAllocator( P2PPortAllocator::~P2PPortAllocator() { } -cricket::PortAllocatorSession* P2PPortAllocator::CreateSession( - const std::string& channel_name, - int component) { - return new P2PPortAllocatorSession(this, channel_name, component); +cricket::PortAllocatorSession* P2PPortAllocator::CreateSessionInternal( + int component, + const std::string& ice_username_fragment, + const std::string& ice_password) { + return new P2PPortAllocatorSession( + this, component, ice_username_fragment, ice_password); } P2PPortAllocatorSession::P2PPortAllocatorSession( P2PPortAllocator* allocator, - const std::string& channel_name, - int component) - : cricket::BasicPortAllocatorSession(allocator, channel_name, component), + int component, + const std::string& ice_username_fragment, + const std::string& ice_password) + : cricket::BasicPortAllocatorSession( + allocator, component, + ice_username_fragment, ice_password), allocator_(allocator), relay_session_attempts_(0), relay_udp_port_(0), @@ -221,7 +226,7 @@ void P2PPortAllocatorSession::AllocateRelaySession() { WebString::fromUTF8("X-Google-Relay-Auth"), WebString::fromUTF8(allocator_->config_.relay_password)); request.addHTTPHeaderField(WebString::fromUTF8("X-Stream-Type"), - WebString::fromUTF8(channel_name())); + WebString::fromUTF8("chromoting")); relay_session_request_->loadAsynchronously(request, this); } diff --git a/content/renderer/p2p/port_allocator.h b/content/renderer/p2p/port_allocator.h index ab0198d..5aa34db 100644 --- a/content/renderer/p2p/port_allocator.h +++ b/content/renderer/p2p/port_allocator.h @@ -34,9 +34,10 @@ class P2PPortAllocator : public cricket::BasicPortAllocator { const webkit_glue::P2PTransport::Config& config); virtual ~P2PPortAllocator(); - virtual cricket::PortAllocatorSession* CreateSession( - const std::string& channel_name, - int component) OVERRIDE; + virtual cricket::PortAllocatorSession* CreateSessionInternal( + int component, + const std::string& ice_username_fragment, + const std::string& ice_password) OVERRIDE; private: friend class P2PPortAllocatorSession; @@ -53,8 +54,9 @@ class P2PPortAllocatorSession : public cricket::BasicPortAllocatorSession, public: P2PPortAllocatorSession( P2PPortAllocator* allocator, - const std::string& channel_name, - int candidate); + int component, + const std::string& ice_username_fragment, + const std::string& ice_password); virtual ~P2PPortAllocatorSession(); // WebKit::WebURLLoaderClient overrides. diff --git a/jingle/glue/channel_socket_adapter_unittest.cc b/jingle/glue/channel_socket_adapter_unittest.cc index 40a196f..867aeea 100644 --- a/jingle/glue/channel_socket_adapter_unittest.cc +++ b/jingle/glue/channel_socket_adapter_unittest.cc @@ -30,7 +30,7 @@ const int kTestError = -32123; class MockTransportChannel : public cricket::TransportChannel { public: MockTransportChannel() - : cricket::TransportChannel("", 0) { + : cricket::TransportChannel(0) { set_writable(true); set_readable(true); } diff --git a/jingle/glue/utils.cc b/jingle/glue/utils.cc index f18e523..26dda92 100644 --- a/jingle/glue/utils.cc +++ b/jingle/glue/utils.cc @@ -42,7 +42,7 @@ bool SocketAddressToIPEndPoint(const talk_base::SocketAddress& address_lj, std::string SerializeP2PCandidate(const cricket::Candidate& candidate) { // TODO(sergeyu): Use SDP to format candidates? DictionaryValue value; - value.SetString("ip", candidate.address().IPAsString()); + value.SetString("ip", candidate.address().ipaddr().ToString()); value.SetInteger("port", candidate.address().port()); value.SetString("type", candidate.type()); value.SetString("protocol", candidate.protocol()); diff --git a/jingle/notifier/base/gaia_token_pre_xmpp_auth.cc b/jingle/notifier/base/gaia_token_pre_xmpp_auth.cc index 5e22667..36e1688 100644 --- a/jingle/notifier/base/gaia_token_pre_xmpp_auth.cc +++ b/jingle/notifier/base/gaia_token_pre_xmpp_auth.cc @@ -69,7 +69,8 @@ void GaiaTokenPreXmppAuth::StartPreXmppAuth( const buzz::Jid& jid, const talk_base::SocketAddress& server, const talk_base::CryptString& pass, - const std::string& auth_cookie) { + const std::string& auth_mechanism, + const std::string& auth_token) { SignalAuthDone(); } @@ -93,8 +94,12 @@ buzz::CaptchaChallenge GaiaTokenPreXmppAuth::GetCaptchaChallenge() const { return buzz::CaptchaChallenge(); } -std::string GaiaTokenPreXmppAuth::GetAuthCookie() const { - return std::string(); +std::string GaiaTokenPreXmppAuth::GetAuthToken() const { + return token_; +} + +std::string GaiaTokenPreXmppAuth::GetAuthMechanism() const { + return auth_mechanism_; } std::string GaiaTokenPreXmppAuth::ChooseBestSaslMechanism( diff --git a/jingle/notifier/base/gaia_token_pre_xmpp_auth.h b/jingle/notifier/base/gaia_token_pre_xmpp_auth.h index a2f98f7..6abf3a6 100644 --- a/jingle/notifier/base/gaia_token_pre_xmpp_auth.h +++ b/jingle/notifier/base/gaia_token_pre_xmpp_auth.h @@ -30,7 +30,8 @@ class GaiaTokenPreXmppAuth : public buzz::PreXmppAuth { virtual void StartPreXmppAuth(const buzz::Jid& jid, const talk_base::SocketAddress& server, const talk_base::CryptString& pass, - const std::string& auth_cookie) OVERRIDE; + const std::string& auth_mechanism, + const std::string& auth_token) OVERRIDE; virtual bool IsAuthDone() const OVERRIDE; @@ -42,7 +43,9 @@ class GaiaTokenPreXmppAuth : public buzz::PreXmppAuth { virtual buzz::CaptchaChallenge GetCaptchaChallenge() const OVERRIDE; - virtual std::string GetAuthCookie() const OVERRIDE; + virtual std::string GetAuthToken() const OVERRIDE; + + virtual std::string GetAuthMechanism() const OVERRIDE; // buzz::SaslHandler implementation. diff --git a/jingle/notifier/base/notifier_options_util.cc b/jingle/notifier/base/notifier_options_util.cc index 67620a0..93bd173 100644 --- a/jingle/notifier/base/notifier_options_util.cc +++ b/jingle/notifier/base/notifier_options_util.cc @@ -7,6 +7,7 @@ #include "base/logging.h" #include "jingle/notifier/base/const_communicator.h" #include "jingle/notifier/base/notifier_options.h" +#include "talk/xmpp/constants.h" #include "talk/xmpp/jid.h" namespace notifier { @@ -23,7 +24,7 @@ buzz::XmppClientSettings MakeXmppClientSettings( xmpp_client_settings.set_resource("chrome-sync"); xmpp_client_settings.set_host(jid.domain()); xmpp_client_settings.set_use_tls(buzz::TLS_ENABLED); - xmpp_client_settings.set_auth_cookie( + xmpp_client_settings.set_auth_token(buzz::AUTH_MECHANISM_GOOGLE_TOKEN, notifier_options.invalidate_xmpp_login ? token + "bogus" : token); xmpp_client_settings.set_token_service("chromiumsync"); diff --git a/jingle/notifier/base/xmpp_connection_unittest.cc b/jingle/notifier/base/xmpp_connection_unittest.cc index 1c37bde..e410378 100644 --- a/jingle/notifier/base/xmpp_connection_unittest.cc +++ b/jingle/notifier/base/xmpp_connection_unittest.cc @@ -47,17 +47,19 @@ class MockPreXmppAuth : public buzz::PreXmppAuth { std::string(const std::vector<std::string>&, bool)); MOCK_METHOD1(CreateSaslMechanism, buzz::SaslMechanism*(const std::string&)); - MOCK_METHOD4(StartPreXmppAuth, + MOCK_METHOD5(StartPreXmppAuth, void(const buzz::Jid&, const talk_base::SocketAddress&, const talk_base::CryptString&, + const std::string&, const std::string&)); MOCK_CONST_METHOD0(IsAuthDone, bool()); MOCK_CONST_METHOD0(IsAuthorized, bool()); MOCK_CONST_METHOD0(HadError, bool()); MOCK_CONST_METHOD0(GetError, int()); MOCK_CONST_METHOD0(GetCaptchaChallenge, buzz::CaptchaChallenge()); - MOCK_CONST_METHOD0(GetAuthCookie, std::string()); + MOCK_CONST_METHOD0(GetAuthToken, std::string()); + MOCK_CONST_METHOD0(GetAuthMechanism, std::string()); }; class MockXmppConnectionDelegate : public XmppConnection::Delegate { @@ -113,7 +115,7 @@ TEST_F(XmppConnectionTest, ImmediateFailure) { } TEST_F(XmppConnectionTest, PreAuthFailure) { - EXPECT_CALL(*mock_pre_xmpp_auth_, StartPreXmppAuth(_, _, _, _)); + EXPECT_CALL(*mock_pre_xmpp_auth_, StartPreXmppAuth(_, _, _, _,_)); EXPECT_CALL(*mock_pre_xmpp_auth_, IsAuthDone()).WillOnce(Return(true)); EXPECT_CALL(*mock_pre_xmpp_auth_, IsAuthorized()).WillOnce(Return(false)); EXPECT_CALL(*mock_pre_xmpp_auth_, HadError()).WillOnce(Return(true)); @@ -132,10 +134,11 @@ TEST_F(XmppConnectionTest, PreAuthFailure) { } TEST_F(XmppConnectionTest, FailureAfterPreAuth) { - EXPECT_CALL(*mock_pre_xmpp_auth_, StartPreXmppAuth(_, _, _, _)); + EXPECT_CALL(*mock_pre_xmpp_auth_, StartPreXmppAuth(_, _, _, _,_)); EXPECT_CALL(*mock_pre_xmpp_auth_, IsAuthDone()).WillOnce(Return(true)); EXPECT_CALL(*mock_pre_xmpp_auth_, IsAuthorized()).WillOnce(Return(true)); - EXPECT_CALL(*mock_pre_xmpp_auth_, GetAuthCookie()).WillOnce(Return("")); + EXPECT_CALL(*mock_pre_xmpp_auth_, GetAuthMechanism()).WillOnce(Return("")); + EXPECT_CALL(*mock_pre_xmpp_auth_, GetAuthToken()).WillOnce(Return("")); EXPECT_CALL(mock_xmpp_connection_delegate_, OnError(buzz::XmppEngine::ERROR_NONE, 0, NULL)); diff --git a/jingle/notifier/communicator/single_login_attempt.cc b/jingle/notifier/communicator/single_login_attempt.cc index dfaa03a..b4cae89 100644 --- a/jingle/notifier/communicator/single_login_attempt.cc +++ b/jingle/notifier/communicator/single_login_attempt.cc @@ -157,7 +157,7 @@ void SingleLoginAttempt::TryConnect( buzz::STR_EMPTY); buzz::PreXmppAuth* pre_xmpp_auth = new GaiaTokenPreXmppAuth( - jid.Str(), client_settings.auth_cookie(), + jid.Str(), client_settings.auth_token(), client_settings.token_service(), login_settings_.auth_mechanism()); xmpp_connection_.reset( diff --git a/remoting/client/plugin/pepper_port_allocator.cc b/remoting/client/plugin/pepper_port_allocator.cc index e632d57..ae0a3a5 100644 --- a/remoting/client/plugin/pepper_port_allocator.cc +++ b/remoting/client/plugin/pepper_port_allocator.cc @@ -32,8 +32,9 @@ class PepperPortAllocatorSession public: PepperPortAllocatorSession( cricket::HttpPortAllocatorBase* allocator, - const std::string& channel_name, int component, + const std::string& ice_username_fragment, + const std::string& ice_password, const std::vector<talk_base::SocketAddress>& stun_hosts, const std::vector<std::string>& relay_hosts, const std::string& relay_token, @@ -73,15 +74,16 @@ class PepperPortAllocatorSession PepperPortAllocatorSession::PepperPortAllocatorSession( cricket::HttpPortAllocatorBase* allocator, - const std::string& channel_name, int component, + const std::string& ice_username_fragment, + const std::string& ice_password, const std::vector<talk_base::SocketAddress>& stun_hosts, const std::vector<std::string>& relay_hosts, const std::string& relay_token, const pp::InstanceHandle& instance) - : cricket::HttpPortAllocatorSessionBase( - allocator, channel_name, component, stun_hosts, - relay_hosts, relay_token, ""), + : HttpPortAllocatorSessionBase( + allocator, component, ice_username_fragment, ice_password, + stun_hosts, relay_hosts, relay_token, ""), instance_(instance), stun_address_resolver_(instance_), stun_port_(0), @@ -204,7 +206,7 @@ void PepperPortAllocatorSession::SendSessionRequest( std::stringstream headers; headers << "X-Talk-Google-Relay-Auth: " << relay_token() << "\n\r"; headers << "X-Google-Relay-Auth: " << relay_token() << "\n\r"; - headers << "X-StreamType: " << channel_name() << "\n\r"; + headers << "X-Stream-Type: " << "chromoting" << "\n\r"; request_info.SetHeaders(headers.str()); int result = relay_url_loader_->Open(request_info, pp::CompletionCallback( @@ -328,12 +330,13 @@ PepperPortAllocator::PepperPortAllocator( PepperPortAllocator::~PepperPortAllocator() { } -cricket::PortAllocatorSession* PepperPortAllocator::CreateSession( - const std::string& channel_name, - int component) { - return new PepperPortAllocatorSession( - this, channel_name, component, stun_hosts(), - relay_hosts(), relay_token(), instance_); +cricket::PortAllocatorSession* PepperPortAllocator::CreateSessionInternal( + int component, + const std::string& ice_username_fragment, + const std::string& ice_password) { + return new PepperPortAllocatorSession( + this, component, ice_username_fragment, ice_password, + stun_hosts(), relay_hosts(), relay_token(), instance_); } } // namespace remoting diff --git a/remoting/client/plugin/pepper_port_allocator.h b/remoting/client/plugin/pepper_port_allocator.h index c9a5dbd..914adde 100644 --- a/remoting/client/plugin/pepper_port_allocator.h +++ b/remoting/client/plugin/pepper_port_allocator.h @@ -28,9 +28,10 @@ class PepperPortAllocator : public cricket::HttpPortAllocatorBase { virtual ~PepperPortAllocator(); // cricket::HttpPortAllocatorBase overrides. - virtual cricket::PortAllocatorSession* CreateSession( - const std::string& channel_name, - int component) OVERRIDE; + virtual cricket::PortAllocatorSession* CreateSessionInternal( + int component, + const std::string& ice_username_fragment, + const std::string& ice_password) OVERRIDE; private: PepperPortAllocator( diff --git a/remoting/host/host_port_allocator.cc b/remoting/host/host_port_allocator.cc index 2ec59e7..ad3a685 100644 --- a/remoting/host/host_port_allocator.cc +++ b/remoting/host/host_port_allocator.cc @@ -22,8 +22,9 @@ class HostPortAllocatorSession public: HostPortAllocatorSession( cricket::HttpPortAllocatorBase* allocator, - const std::string& channel_name, int component, + const std::string& ice_username_fragment, + const std::string& ice_password, const std::vector<talk_base::SocketAddress>& stun_hosts, const std::vector<std::string>& relay_hosts, const std::string& relay, @@ -48,14 +49,16 @@ class HostPortAllocatorSession HostPortAllocatorSession::HostPortAllocatorSession( cricket::HttpPortAllocatorBase* allocator, - const std::string& channel_name, int component, + const std::string& ice_username_fragment, + const std::string& ice_password, const std::vector<talk_base::SocketAddress>& stun_hosts, const std::vector<std::string>& relay_hosts, const std::string& relay, const scoped_refptr<net::URLRequestContextGetter>& url_context) : HttpPortAllocatorSessionBase( - allocator, channel_name, component, stun_hosts, relay_hosts, relay, ""), + allocator, component, ice_username_fragment, ice_password, + stun_hosts, relay_hosts, relay, ""), url_context_(url_context) { } @@ -87,7 +90,7 @@ void HostPortAllocatorSession::SendSessionRequest(const std::string& host, url_fetcher->SetRequestContext(url_context_); url_fetcher->SetHeader("X-Talk-Google-Relay-Auth", relay_token()); url_fetcher->SetHeader("X-Google-Relay-Auth", relay_token()); - url_fetcher->SetHeader("X-Stream-Type", channel_name()); + url_fetcher->SetHeader("X-Stream-Type", "chromoting"); url_fetcher->Start(base::Bind(&HostPortAllocatorSession::OnSessionRequestDone, base::Unretained(this), url_fetcher.get())); url_fetchers_.insert(url_fetcher.release()); @@ -154,12 +157,13 @@ HostPortAllocator::HostPortAllocator( HostPortAllocator::~HostPortAllocator() { } -cricket::PortAllocatorSession* HostPortAllocator::CreateSession( - const std::string& channel_name, - int component) { +cricket::PortAllocatorSession* HostPortAllocator::CreateSessionInternal( + int component, + const std::string& ice_username_fragment, + const std::string& ice_password) { return new HostPortAllocatorSession( - this, channel_name, component, stun_hosts(), - relay_hosts(), relay_token(), url_context_); + this, component, ice_username_fragment, ice_password, + stun_hosts(), relay_hosts(), relay_token(), url_context_); } } // namespace remoting diff --git a/remoting/host/host_port_allocator.h b/remoting/host/host_port_allocator.h index 868102f..d694058 100644 --- a/remoting/host/host_port_allocator.h +++ b/remoting/host/host_port_allocator.h @@ -33,9 +33,10 @@ class HostPortAllocator : public cricket::HttpPortAllocatorBase { virtual ~HostPortAllocator(); // cricket::HttpPortAllocatorBase overrides. - virtual cricket::PortAllocatorSession* CreateSession( - const std::string& channel_name, - int component) OVERRIDE; + virtual cricket::PortAllocatorSession* CreateSessionInternal( + int component, + const std::string& ice_username_fragment, + const std::string& ice_password) OVERRIDE; private: HostPortAllocator( diff --git a/remoting/jingle_glue/xmpp_signal_strategy.cc b/remoting/jingle_glue/xmpp_signal_strategy.cc index 5cac0fc..5969817 100644 --- a/remoting/jingle_glue/xmpp_signal_strategy.cc +++ b/remoting/jingle_glue/xmpp_signal_strategy.cc @@ -61,7 +61,7 @@ void XmppSignalStrategy::Connect() { settings.set_resource(resource_name_); settings.set_use_tls(buzz::TLS_ENABLED); settings.set_token_service(auth_token_service_); - settings.set_auth_cookie(auth_token_); + settings.set_auth_token(buzz::AUTH_MECHANISM_GOOGLE_TOKEN, auth_token_); settings.set_server(talk_base::SocketAddress("talk.google.com", 5222)); buzz::AsyncSocket* socket = new XmppSocketAdapter(settings, false); @@ -221,7 +221,7 @@ buzz::PreXmppAuth* XmppSignalStrategy::CreatePreXmppAuth( } return new notifier::GaiaTokenPreXmppAuth( - jid.Str(), settings.auth_cookie(), settings.token_service(), mechanism); + jid.Str(), settings.auth_token(), settings.token_service(), mechanism); } } // namespace remoting diff --git a/remoting/protocol/jingle_messages.cc b/remoting/protocol/jingle_messages.cc index 104d7f3..044e183 100644 --- a/remoting/protocol/jingle_messages.cc +++ b/remoting/protocol/jingle_messages.cc @@ -118,7 +118,7 @@ XmlElement* FormatCandidate(const JingleMessage::NamedCandidate& candidate) { new XmlElement(QName(kP2PTransportNamespace, "candidate")); result->SetAttr(QName(kEmptyNamespace, "name"), candidate.name); result->SetAttr(QName(kEmptyNamespace, "address"), - candidate.candidate.address().IPAsString()); + candidate.candidate.address().ipaddr().ToString()); result->SetAttr(QName(kEmptyNamespace, "port"), base::IntToString(candidate.candidate.address().port())); result->SetAttr(QName(kEmptyNamespace, "type"), candidate.candidate.type()); diff --git a/remoting/protocol/libjingle_transport_factory.cc b/remoting/protocol/libjingle_transport_factory.cc index 526e669..ba7baec 100644 --- a/remoting/protocol/libjingle_transport_factory.cc +++ b/remoting/protocol/libjingle_transport_factory.cc @@ -14,6 +14,7 @@ #include "remoting/protocol/transport_config.h" #include "third_party/libjingle/source/talk/base/basicpacketsocketfactory.h" #include "third_party/libjingle/source/talk/base/network.h" +#include "third_party/libjingle/source/talk/p2p/base/constants.h" #include "third_party/libjingle/source/talk/p2p/base/p2ptransportchannel.h" #include "third_party/libjingle/source/talk/p2p/client/basicportallocator.h" #include "third_party/libjingle/source/talk/p2p/client/httpportallocator.h" @@ -73,6 +74,8 @@ class LibjingleStreamTransport : public StreamTransport, EventHandler* event_handler_; StreamTransport::ConnectedCallback callback_; scoped_ptr<ChannelAuthenticator> authenticator_; + std::string ice_username_fragment_; + std::string ice_password_; scoped_ptr<cricket::P2PTransportChannel> channel_; @@ -87,7 +90,10 @@ LibjingleStreamTransport::LibjingleStreamTransport( bool incoming_only) : port_allocator_(port_allocator), incoming_only_(incoming_only), - event_handler_(NULL) { + event_handler_(NULL), + ice_username_fragment_( + talk_base::CreateRandomString(cricket::ICE_UFRAG_LENGTH)), + ice_password_(talk_base::CreateRandomString(cricket::ICE_PWD_LENGTH)) { } LibjingleStreamTransport::~LibjingleStreamTransport() { @@ -130,7 +136,9 @@ void LibjingleStreamTransport::Connect( // Create P2PTransportChannel, attach signal handlers and connect it. // TODO(sergeyu): Specify correct component ID for the channel. channel_.reset(new cricket::P2PTransportChannel( - name_, 0, NULL, port_allocator_)); + 0, NULL, port_allocator_)); + channel_->SetIceUfrag(ice_username_fragment_); + channel_->SetIcePwd(ice_password_); channel_->SignalRequestSignaling.connect( this, &LibjingleStreamTransport::OnRequestSignaling); channel_->SignalCandidateReady.connect( diff --git a/third_party/libjingle/README.chromium b/third_party/libjingle/README.chromium index ceea655..8716060 100644 --- a/third_party/libjingle/README.chromium +++ b/third_party/libjingle/README.chromium @@ -1,8 +1,8 @@ Name: Libjingle library. Used for p2p voice and video communication. Short Name: libjingle URL: http://code.google.com/p/libjingle/ -Version: 0.6.17 -Revision: 135 +Version: 0.6.18 +Revision: 141 License: BSD License File: source/COPYING Security Critical: yes diff --git a/third_party/libjingle/libjingle.gyp b/third_party/libjingle/libjingle.gyp index 74a16b2..4ceeeee5 100644 --- a/third_party/libjingle/libjingle.gyp +++ b/third_party/libjingle/libjingle.gyp @@ -208,6 +208,8 @@ 'source/talk/base/checks.h', 'source/talk/base/common.cc', 'source/talk/base/common.h', + 'source/talk/base/crc32.cc', + 'source/talk/base/crc32.h', 'source/talk/base/criticalsection.h', 'source/talk/base/cryptstring.h', 'source/talk/base/diskcache.cc', @@ -238,8 +240,9 @@ 'source/talk/base/json.cc', 'source/talk/base/json.h', 'source/talk/base/linked_ptr.h', + 'source/talk/base/md5.cc', 'source/talk/base/md5.h', - 'source/talk/base/md5c.c', + 'source/talk/base/md5digest.h', 'source/talk/base/messagedigest.cc', 'source/talk/base/messagedigest.h', 'source/talk/base/messagehandler.cc', @@ -263,8 +266,9 @@ 'source/talk/base/ratetracker.h', 'source/talk/base/scoped_ptr.h', 'source/talk/base/sec_buffer.h', - 'source/talk/base/sha1.c', + 'source/talk/base/sha1.cc', 'source/talk/base/sha1.h', + 'source/talk/base/sha1digest.h', 'source/talk/base/signalthread.cc', 'source/talk/base/signalthread.h', 'source/talk/base/sigslot.h', @@ -519,15 +523,15 @@ 'source/talk/app/webrtc/mediastreamproxy.h', 'source/talk/app/webrtc/mediastreamsignaling.cc', 'source/talk/app/webrtc/mediastreamsignaling.h', + 'source/talk/app/webrtc/mediastreamtrack.h', 'source/talk/app/webrtc/mediastreamtrackproxy.cc', 'source/talk/app/webrtc/mediastreamtrackproxy.h', - 'source/talk/app/webrtc/mediatrackimpl.h', - 'source/talk/app/webrtc/notifierimpl.h', + 'source/talk/app/webrtc/notifier.h', + 'source/talk/app/webrtc/peerconnection.cc', 'source/talk/app/webrtc/peerconnection.h', - 'source/talk/app/webrtc/peerconnectionfactoryimpl.cc', - 'source/talk/app/webrtc/peerconnectionfactoryimpl.h', - 'source/talk/app/webrtc/peerconnectionimpl.cc', - 'source/talk/app/webrtc/peerconnectionimpl.h', + 'source/talk/app/webrtc/peerconnectionfactory.cc', + 'source/talk/app/webrtc/peerconnectionfactory.h', + 'source/talk/app/webrtc/peerconnectioninterface.h', 'source/talk/app/webrtc/portallocatorfactory.cc', 'source/talk/app/webrtc/portallocatorfactory.h', 'source/talk/app/webrtc/roaperrorcodes.h', @@ -537,7 +541,7 @@ 'source/talk/app/webrtc/roapsession.h', 'source/talk/app/webrtc/roapsignaling.cc', 'source/talk/app/webrtc/roapsignaling.h', - 'source/talk/app/webrtc/streamcollectionimpl.h', + 'source/talk/app/webrtc/streamcollection.h', 'source/talk/app/webrtc/videorendererimpl.cc', 'source/talk/app/webrtc/videotrack.cc', 'source/talk/app/webrtc/videotrack.h', @@ -595,6 +599,8 @@ 'source/talk/session/phone/ssrcmuxfilter.cc', 'source/talk/session/phone/ssrcmuxfilter.h', 'source/talk/session/phone/streamparams.cc', + 'source/talk/session/phone/typingmonitor.h', + 'source/talk/session/phone/typingmonitor.cc', 'source/talk/session/phone/videocapturer.cc', 'source/talk/session/phone/videocapturer.h', 'source/talk/session/phone/videocommon.cc', |