summaryrefslogtreecommitdiffstats
path: root/remoting/protocol/libjingle_transport_factory.cc
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-22 19:49:21 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-22 19:49:21 +0000
commit71a0c6be93d9303fcdcf7a6f7f99201a0fa41618 (patch)
tree3dcc118a2e8296be5230f373e4939c73f69d6821 /remoting/protocol/libjingle_transport_factory.cc
parente101fc3da10d9ac1ab490ae13adbd5d25e74eb9a (diff)
downloadchromium_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
Diffstat (limited to 'remoting/protocol/libjingle_transport_factory.cc')
-rw-r--r--remoting/protocol/libjingle_transport_factory.cc12
1 files changed, 10 insertions, 2 deletions
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(