diff options
author | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-26 04:20:12 +0000 |
---|---|---|
committer | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-26 04:20:12 +0000 |
commit | 8bb746373531af59d55280eda9f890cf26a0bbf0 (patch) | |
tree | 268bb2df8487157a4a8e7fe500f3628c9bb62cdb | |
parent | 50a6843f28404fbabcfda2182b78a017b4cdc838 (diff) | |
download | chromium_src-8bb746373531af59d55280eda9f890cf26a0bbf0.zip chromium_src-8bb746373531af59d55280eda9f890cf26a0bbf0.tar.gz chromium_src-8bb746373531af59d55280eda9f890cf26a0bbf0.tar.bz2 |
Roll libjingle 132:135
Review URL: https://chromiumcodereview.appspot.com/10209008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134065 0039d316-1c4b-4281-b951-d872f2087c98
29 files changed, 125 insertions, 425 deletions
@@ -41,7 +41,7 @@ vars = { "nacl_toolchain_revision": "8169", "pnacl_toolchain_revision": "8169", - "libjingle_revision": "132", + "libjingle_revision": "135", "libphonenumber_revision": "425", "libvpx_revision": "125647", "lss_revision": "9", diff --git a/chrome/browser/autofill/autofill_xml_parser.h b/chrome/browser/autofill/autofill_xml_parser.h index eceba5c..21a60a9 100644 --- a/chrome/browser/autofill/autofill_xml_parser.h +++ b/chrome/browser/autofill/autofill_xml_parser.h @@ -10,6 +10,7 @@ #include <vector> #include "base/basictypes.h" +#include "base/compiler_specific.h" #include "chrome/browser/autofill/field_types.h" #include "chrome/browser/autofill/form_structure.h" #include "third_party/expat/files/lib/expat.h" diff --git a/chrome/browser/autofill/autofill_xml_parser_unittest.cc b/chrome/browser/autofill/autofill_xml_parser_unittest.cc index 51888e2..a0a1024 100644 --- a/chrome/browser/autofill/autofill_xml_parser_unittest.cc +++ b/chrome/browser/autofill/autofill_xml_parser_unittest.cc @@ -5,6 +5,7 @@ #include <string> #include <vector> +#include "base/memory/scoped_ptr.h" #include "chrome/browser/autofill/autofill_xml_parser.h" #include "chrome/browser/autofill/field_types.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/chrome/browser/autofill/form_structure.cc b/chrome/browser/autofill/form_structure.cc index 4229af3..1c8b7c9 100644 --- a/chrome/browser/autofill/form_structure.cc +++ b/chrome/browser/autofill/form_structure.cc @@ -8,6 +8,7 @@ #include "base/basictypes.h" #include "base/logging.h" +#include "base/memory/scoped_ptr.h" #include "base/sha1.h" #include "base/string_number_conversions.h" #include "base/string_util.h" diff --git a/content/renderer/media/mock_media_stream_dependency_factory.cc b/content/renderer/media/mock_media_stream_dependency_factory.cc index 7d54d11..05ea585 100644 --- a/content/renderer/media/mock_media_stream_dependency_factory.cc +++ b/content/renderer/media/mock_media_stream_dependency_factory.cc @@ -133,6 +133,14 @@ class MockSessionDescription : public SessionDescriptionInterface { NOTIMPLEMENTED(); return NULL; } + virtual std::string session_id() const OVERRIDE { + NOTIMPLEMENTED(); + return ""; + } + virtual std::string session_version() const OVERRIDE { + NOTIMPLEMENTED(); + return ""; + } virtual bool AddCandidate(const IceCandidateInterface* candidate) OVERRIDE { NOTIMPLEMENTED(); return false; diff --git a/content/renderer/media/mock_peer_connection_impl.cc b/content/renderer/media/mock_peer_connection_impl.cc index 2b893ba..f0eb845 100644 --- a/content/renderer/media/mock_peer_connection_impl.cc +++ b/content/renderer/media/mock_peer_connection_impl.cc @@ -84,6 +84,13 @@ void MockPeerConnectionImpl::RemoveStream(LocalMediaStreamInterface* stream) { stream_label_.clear(); } +bool MockPeerConnectionImpl::RemoveStream(const std::string& label) { + if (stream_label_ != label) + return false; + stream_label_.clear(); + return true; +} + void MockPeerConnectionImpl::CommitStreamChanges() { stream_changes_committed_ = true; } diff --git a/content/renderer/media/mock_peer_connection_impl.h b/content/renderer/media/mock_peer_connection_impl.h index a5e85a1..62b7b31 100644 --- a/content/renderer/media/mock_peer_connection_impl.h +++ b/content/renderer/media/mock_peer_connection_impl.h @@ -30,6 +30,7 @@ class MockPeerConnectionImpl : public PeerConnectionInterface { remote_streams() OVERRIDE; virtual void AddStream(LocalMediaStreamInterface* stream) OVERRIDE; virtual void RemoveStream(LocalMediaStreamInterface* stream) OVERRIDE; + virtual bool RemoveStream(const std::string& label) OVERRIDE; virtual void CommitStreamChanges() OVERRIDE; virtual void Close() OVERRIDE; virtual ReadyState ready_state() OVERRIDE; diff --git a/content/renderer/p2p/ipc_socket_factory.h b/content/renderer/p2p/ipc_socket_factory.h index 1e41977..bf91656 100644 --- a/content/renderer/p2p/ipc_socket_factory.h +++ b/content/renderer/p2p/ipc_socket_factory.h @@ -6,6 +6,7 @@ #define CONTENT_RENDERER_P2P_IPC_SOCKET_FACTORY_H_ #include "base/basictypes.h" +#include "base/compiler_specific.h" #include "content/common/content_export.h" #include "third_party/libjingle/source/talk/base/packetsocketfactory.h" diff --git a/content/renderer/p2p/p2p_transport_impl.cc b/content/renderer/p2p/p2p_transport_impl.cc index 8554981..9a67e67 100644 --- a/content/renderer/p2p/p2p_transport_impl.cc +++ b/content/renderer/p2p/p2p_transport_impl.cc @@ -75,7 +75,7 @@ bool P2PTransportImpl::Init(WebKit::WebFrame* web_frame, DCHECK(!channel_.get()); channel_.reset(new cricket::P2PTransportChannel( - name, "", NULL, allocator_.get())); + name, 0, NULL, allocator_.get())); 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 b22a88b..610f61b 100644 --- a/content/renderer/p2p/port_allocator.cc +++ b/content/renderer/p2p/port_allocator.cc @@ -71,16 +71,16 @@ P2PPortAllocator::~P2PPortAllocator() { } cricket::PortAllocatorSession* P2PPortAllocator::CreateSession( - const std::string& name, - const std::string& session_type) { - return new P2PPortAllocatorSession(this, name, session_type); + const std::string& channel_name, + int component) { + return new P2PPortAllocatorSession(this, channel_name, component); } P2PPortAllocatorSession::P2PPortAllocatorSession( P2PPortAllocator* allocator, - const std::string& name, - const std::string& session_type) - : cricket::BasicPortAllocatorSession(allocator, name, session_type), + const std::string& channel_name, + int component) + : cricket::BasicPortAllocatorSession(allocator, channel_name, component), allocator_(allocator), relay_session_attempts_(0), relay_udp_port_(0), @@ -125,8 +125,7 @@ void P2PPortAllocatorSession::didFail(WebKit::WebURLLoader* loader, void P2PPortAllocatorSession::GetPortConfigurations() { // Add an empty configuration synchronously, so a local connection // can be started immediately. - ConfigReady(new cricket::PortConfiguration( - talk_base::SocketAddress(), username(), password(), "")); + ConfigReady(new cricket::PortConfiguration(talk_base::SocketAddress())); ResolveStunServerAddress(); AllocateRelaySession(); @@ -221,10 +220,8 @@ void P2PPortAllocatorSession::AllocateRelaySession() { request.addHTTPHeaderField( WebString::fromUTF8("X-Google-Relay-Auth"), WebString::fromUTF8(allocator_->config_.relay_password)); - request.addHTTPHeaderField(WebString::fromUTF8("X-Session-Type"), - WebString::fromUTF8(session_type())); request.addHTTPHeaderField(WebString::fromUTF8("X-Stream-Type"), - WebString::fromUTF8(name())); + WebString::fromUTF8(channel_name())); relay_session_request_->loadAsynchronously(request, this); } @@ -285,8 +282,7 @@ void P2PPortAllocatorSession::ParseRelayResponse() { void P2PPortAllocatorSession::AddConfig() { cricket::PortConfiguration* config = - new cricket::PortConfiguration(stun_server_address_, - username(), password(), ""); + new cricket::PortConfiguration(stun_server_address_); if (relay_ip_.ip() != 0) { cricket::PortConfiguration::PortList ports; diff --git a/content/renderer/p2p/port_allocator.h b/content/renderer/p2p/port_allocator.h index 350d876..ab0198d 100644 --- a/content/renderer/p2p/port_allocator.h +++ b/content/renderer/p2p/port_allocator.h @@ -6,6 +6,7 @@ #define CONTENT_RENDERER_P2P_PORT_ALLOCATOR_H_ #include "base/memory/ref_counted.h" +#include "base/memory/scoped_ptr.h" #include "net/base/net_util.h" #include "third_party/libjingle/source/talk/p2p/client/basicportallocator.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLLoaderClient.h" @@ -34,8 +35,8 @@ class P2PPortAllocator : public cricket::BasicPortAllocator { virtual ~P2PPortAllocator(); virtual cricket::PortAllocatorSession* CreateSession( - const std::string& name, - const std::string& session_type) OVERRIDE; + const std::string& channel_name, + int component) OVERRIDE; private: friend class P2PPortAllocatorSession; @@ -52,8 +53,8 @@ class P2PPortAllocatorSession : public cricket::BasicPortAllocatorSession, public: P2PPortAllocatorSession( P2PPortAllocator* allocator, - const std::string& name, - const std::string& session_type); + const std::string& channel_name, + int candidate); virtual ~P2PPortAllocatorSession(); // WebKit::WebURLLoaderClient overrides. diff --git a/jingle/glue/channel_socket_adapter.cc b/jingle/glue/channel_socket_adapter.cc index 19158a4..b68a5fbc 100644 --- a/jingle/glue/channel_socket_adapter.cc +++ b/jingle/glue/channel_socket_adapter.cc @@ -136,7 +136,10 @@ void TransportChannelSocketAdapter::Close(int error_code) { } void TransportChannelSocketAdapter::OnNewPacket( - cricket::TransportChannel* channel, const char* data, size_t data_size) { + cricket::TransportChannel* channel, + const char* data, + size_t data_size, + int flags) { DCHECK_EQ(MessageLoop::current(), message_loop_); DCHECK_EQ(channel, channel_); if (!read_callback_.is_null()) { diff --git a/jingle/glue/channel_socket_adapter.h b/jingle/glue/channel_socket_adapter.h index a39ef60..b5ed635 100644 --- a/jingle/glue/channel_socket_adapter.h +++ b/jingle/glue/channel_socket_adapter.h @@ -50,7 +50,9 @@ class TransportChannelSocketAdapter : public net::Socket, private: void OnNewPacket(cricket::TransportChannel* channel, - const char* data, size_t data_size); + const char* data, + size_t data_size, + int flags); void OnWritableState(cricket::TransportChannel* channel); void OnChannelDestroyed(cricket::TransportChannel* channel); diff --git a/jingle/glue/channel_socket_adapter_unittest.cc b/jingle/glue/channel_socket_adapter_unittest.cc index 7f5f3ee..40a196f 100644 --- a/jingle/glue/channel_socket_adapter_unittest.cc +++ b/jingle/glue/channel_socket_adapter_unittest.cc @@ -30,12 +30,12 @@ const int kTestError = -32123; class MockTransportChannel : public cricket::TransportChannel { public: MockTransportChannel() - : cricket::TransportChannel("", "") { + : cricket::TransportChannel("", 0) { set_writable(true); set_readable(true); } - MOCK_METHOD2(SendPacket, int(const char *data, size_t len)); + MOCK_METHOD3(SendPacket, int(const char* data, size_t len, int flags)); MOCK_METHOD2(SetOption, int(talk_base::Socket::Option opt, int value)); MOCK_METHOD0(GetError, int()); }; @@ -72,7 +72,7 @@ TEST_F(TransportChannelSocketAdapterTest, Read) { int result = target_->Read(buffer, kBufferSize, callback_); ASSERT_EQ(net::ERR_IO_PENDING, result); - channel_.SignalReadPacket(&channel_, kTestData, kTestDataSize); + channel_.SignalReadPacket(&channel_, kTestData, kTestDataSize, 0); EXPECT_EQ(kTestDataSize, callback_result_); } @@ -94,7 +94,7 @@ TEST_F(TransportChannelSocketAdapterTest, ReadClose) { TEST_F(TransportChannelSocketAdapterTest, Write) { scoped_refptr<IOBuffer> buffer(new IOBuffer(kTestDataSize)); - EXPECT_CALL(channel_, SendPacket(buffer->data(), kTestDataSize)) + EXPECT_CALL(channel_, SendPacket(buffer->data(), kTestDataSize, 0)) .WillOnce(Return(kTestDataSize)); int result = target_->Write(buffer, kTestDataSize, callback_); @@ -106,7 +106,7 @@ TEST_F(TransportChannelSocketAdapterTest, Write) { TEST_F(TransportChannelSocketAdapterTest, WritePending) { scoped_refptr<IOBuffer> buffer(new IOBuffer(kTestDataSize)); - EXPECT_CALL(channel_, SendPacket(buffer->data(), kTestDataSize)) + EXPECT_CALL(channel_, SendPacket(buffer->data(), kTestDataSize, 0)) .Times(1) .WillOnce(Return(SOCKET_ERROR)); diff --git a/jingle/glue/utils.cc b/jingle/glue/utils.cc index 03730ad..f18e523 100644 --- a/jingle/glue/utils.cc +++ b/jingle/glue/utils.cc @@ -11,7 +11,7 @@ #include "base/values.h" #include "net/base/ip_endpoint.h" #include "net/base/net_util.h" -#include "third_party/libjingle/overrides/talk/base/byteorder.h" +#include "third_party/libjingle/source/talk/base/byteorder.h" #include "third_party/libjingle/source/talk/base/socketaddress.h" #include "third_party/libjingle/source/talk/p2p/base/candidate.h" @@ -42,7 +42,6 @@ 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("name", candidate.name()); value.SetString("ip", candidate.address().IPAsString()); value.SetInteger("port", candidate.address().port()); value.SetString("type", candidate.type()); @@ -67,7 +66,6 @@ bool DeserializeP2PCandidate(const std::string& candidate_str, DictionaryValue* dic_value = static_cast<DictionaryValue*>(value.get()); - std::string name; std::string ip; int port; std::string type; @@ -77,8 +75,7 @@ bool DeserializeP2PCandidate(const std::string& candidate_str, double preference; int generation; - if (!dic_value->GetString("name", &name) || - !dic_value->GetString("ip", &ip) || + if (!dic_value->GetString("ip", &ip) || !dic_value->GetInteger("port", &port) || !dic_value->GetString("type", &type) || !dic_value->GetString("protocol", &protocol) || @@ -89,7 +86,6 @@ bool DeserializeP2PCandidate(const std::string& candidate_str, return false; } - candidate->set_name(name); candidate->set_address(talk_base::SocketAddress(ip, port)); candidate->set_type(type); candidate->set_protocol(protocol); diff --git a/jingle/notifier/listener/push_notifications_subscribe_task.cc b/jingle/notifier/listener/push_notifications_subscribe_task.cc index a4d3b21c..5dc7d08 100644 --- a/jingle/notifier/listener/push_notifications_subscribe_task.cc +++ b/jingle/notifier/listener/push_notifications_subscribe_task.cc @@ -7,6 +7,7 @@ #include <string> #include "base/logging.h" +#include "base/memory/scoped_ptr.h" #include "jingle/notifier/listener/notification_constants.h" #include "jingle/notifier/listener/xml_element_util.h" #include "talk/base/task.h" diff --git a/remoting/client/plugin/pepper_packet_socket_factory.h b/remoting/client/plugin/pepper_packet_socket_factory.h index 50da2f7..ec9634f 100644 --- a/remoting/client/plugin/pepper_packet_socket_factory.h +++ b/remoting/client/plugin/pepper_packet_socket_factory.h @@ -5,6 +5,7 @@ #ifndef REMOTING_CLIENT_PLUGIN_PEPPER_PACKET_SOCKET_FACTORY_H_ #define REMOTING_CLIENT_PLUGIN_PEPPER_PACKET_SOCKET_FACTORY_H_ +#include "base/compiler_specific.h" #include "ppapi/cpp/instance_handle.h" #include "third_party/libjingle/source/talk/base/packetsocketfactory.h" diff --git a/remoting/jingle_glue/xmpp_socket_adapter.h b/remoting/jingle_glue/xmpp_socket_adapter.h index 953cbcc..8ee58d4 100644 --- a/remoting/jingle_glue/xmpp_socket_adapter.h +++ b/remoting/jingle_glue/xmpp_socket_adapter.h @@ -7,6 +7,8 @@ #include <string> +#include "base/basictypes.h" +#include "base/compiler_specific.h" #include "third_party/libjingle/source/talk/base/asyncsocket.h" #include "third_party/libjingle/source/talk/xmpp/asyncsocket.h" #include "third_party/libjingle/source/talk/xmpp/xmppclientsettings.h" diff --git a/remoting/protocol/jingle_messages.cc b/remoting/protocol/jingle_messages.cc index aea59a8..104d7f3 100644 --- a/remoting/protocol/jingle_messages.cc +++ b/remoting/protocol/jingle_messages.cc @@ -8,7 +8,6 @@ #include "base/string_number_conversions.h" #include "remoting/base/constants.h" #include "remoting/protocol/content_description.h" -#include "third_party/libjingle/source/talk/p2p/base/candidate.h" #include "third_party/libjingle/source/talk/xmllite/xmlelement.h" using buzz::QName; @@ -72,7 +71,7 @@ const NameMapElement<JingleMessage::Reason> kReasons[] = { }; bool ParseCandidate(const buzz::XmlElement* element, - cricket::Candidate* candidate) { + JingleMessage::NamedCandidate* candidate) { DCHECK(element->Name() == QName(kP2PTransportNamespace, "candidate")); const std::string& name = element->Attr(QName(kEmptyNamespace, "name")); @@ -101,39 +100,53 @@ bool ParseCandidate(const buzz::XmlElement* element, return false; } - candidate->set_name(name); - candidate->set_address(talk_base::SocketAddress(address, port)); - candidate->set_type(type); - candidate->set_protocol(protocol); - candidate->set_username(username); - candidate->set_password(password); - candidate->set_preference(static_cast<float>(preference)); - candidate->set_generation(generation); + candidate->name = name; + + candidate->candidate.set_address(talk_base::SocketAddress(address, port)); + candidate->candidate.set_type(type); + candidate->candidate.set_protocol(protocol); + candidate->candidate.set_username(username); + candidate->candidate.set_password(password); + candidate->candidate.set_preference(static_cast<float>(preference)); + candidate->candidate.set_generation(generation); return true; } -XmlElement* FormatCandidate(const cricket::Candidate& candidate) { +XmlElement* FormatCandidate(const JingleMessage::NamedCandidate& candidate) { XmlElement* result = new XmlElement(QName(kP2PTransportNamespace, "candidate")); - result->SetAttr(QName(kEmptyNamespace, "name"), candidate.name()); + result->SetAttr(QName(kEmptyNamespace, "name"), candidate.name); result->SetAttr(QName(kEmptyNamespace, "address"), - candidate.address().IPAsString()); + candidate.candidate.address().IPAsString()); result->SetAttr(QName(kEmptyNamespace, "port"), - base::IntToString(candidate.address().port())); - result->SetAttr(QName(kEmptyNamespace, "type"), candidate.type()); - result->SetAttr(QName(kEmptyNamespace, "protocol"), candidate.protocol()); - result->SetAttr(QName(kEmptyNamespace, "username"), candidate.username()); - result->SetAttr(QName(kEmptyNamespace, "password"), candidate.password()); + base::IntToString(candidate.candidate.address().port())); + result->SetAttr(QName(kEmptyNamespace, "type"), candidate.candidate.type()); + result->SetAttr(QName(kEmptyNamespace, "protocol"), + candidate.candidate.protocol()); + result->SetAttr(QName(kEmptyNamespace, "username"), + candidate.candidate.username()); + result->SetAttr(QName(kEmptyNamespace, "password"), + candidate.candidate.password()); result->SetAttr(QName(kEmptyNamespace, "preference"), - base::DoubleToString(candidate.preference())); + base::DoubleToString(candidate.candidate.preference())); result->SetAttr(QName(kEmptyNamespace, "generation"), - base::IntToString(candidate.generation())); + base::IntToString(candidate.candidate.generation())); return result; } } // namespace +JingleMessage::NamedCandidate::NamedCandidate() { +} + +JingleMessage::NamedCandidate::NamedCandidate( + const std::string& name, + const cricket::Candidate& candidate) + : name(name), + candidate(candidate) { +} + // static bool JingleMessage::IsJingleMessage(const buzz::XmlElement* stanza) { return @@ -262,7 +275,7 @@ bool JingleMessage::ParseXml(const buzz::XmlElement* stanza, transport_tag->FirstNamed(qn_candidate); candidate_tag != NULL; candidate_tag = candidate_tag->NextNamed(qn_candidate)) { - cricket::Candidate candidate; + NamedCandidate candidate; if (!ParseCandidate(candidate_tag, &candidate)) { *error = "Failed to parse candidates"; return false; @@ -330,7 +343,7 @@ scoped_ptr<buzz::XmlElement> JingleMessage::ToXml() const { XmlElement* transport_tag = new XmlElement(QName(kP2PTransportNamespace, "transport"), true); content_tag->AddElement(transport_tag); - for (std::list<cricket::Candidate>::const_iterator it = candidates.begin(); + for (std::list<NamedCandidate>::const_iterator it = candidates.begin(); it != candidates.end(); ++it) { transport_tag->AddElement(FormatCandidate(*it)); } diff --git a/remoting/protocol/jingle_messages.h b/remoting/protocol/jingle_messages.h index f404912..43dca4a 100644 --- a/remoting/protocol/jingle_messages.h +++ b/remoting/protocol/jingle_messages.h @@ -9,11 +9,9 @@ #include <string> #include "base/memory/scoped_ptr.h" +#include "third_party/libjingle/source/talk/p2p/base/candidate.h" #include "third_party/libjingle/source/talk/xmllite/xmlelement.h" -namespace cricket { -class Candidate; -} // namespace cricket namespace remoting { namespace protocol { @@ -43,6 +41,15 @@ struct JingleMessage { INCOMPATIBLE_PARAMETERS, }; + struct NamedCandidate { + NamedCandidate(); + NamedCandidate(const std::string& name, + const cricket::Candidate& candidate); + + std::string name; + cricket::Candidate candidate; + }; + JingleMessage(); JingleMessage(const std::string& to_value, ActionType action_value, @@ -65,7 +72,7 @@ struct JingleMessage { std::string sid; scoped_ptr<ContentDescription> description; - std::list<cricket::Candidate> candidates; + std::list<NamedCandidate> candidates; // Content of session-info messages. scoped_ptr<buzz::XmlElement> info; diff --git a/remoting/protocol/jingle_session.cc b/remoting/protocol/jingle_session.cc index 548f0c6..bd3d720 100644 --- a/remoting/protocol/jingle_session.cc +++ b/remoting/protocol/jingle_session.cc @@ -246,7 +246,8 @@ void JingleSession::Close() { void JingleSession::OnTransportCandidate(Transport* transport, const cricket::Candidate& candidate) { - pending_candidates_.push_back(candidate); + pending_candidates_.push_back(JingleMessage::NamedCandidate( + transport->name(), candidate)); if (!transport_infos_timer_.IsRunning()) { // Delay sending the new candidates in case we get more candidates @@ -438,15 +439,15 @@ void JingleSession::OnSessionInfo(const JingleMessage& message, } void JingleSession::ProcessTransportInfo(const JingleMessage& message) { - for (std::list<cricket::Candidate>::const_iterator it = + for (std::list<JingleMessage::NamedCandidate>::const_iterator it = message.candidates.begin(); it != message.candidates.end(); ++it) { - ChannelsMap::iterator channel = channels_.find(it->name()); + ChannelsMap::iterator channel = channels_.find(it->name); if (channel == channels_.end()) { - LOG(WARNING) << "Received candidate for unknown channel " << it->name(); + LOG(WARNING) << "Received candidate for unknown channel " << it->name; continue; } - channel->second->AddRemoteCandidate(*it); + channel->second->AddRemoteCandidate(it->candidate); } } diff --git a/remoting/protocol/jingle_session.h b/remoting/protocol/jingle_session.h index cf18003..0d6311a 100644 --- a/remoting/protocol/jingle_session.h +++ b/remoting/protocol/jingle_session.h @@ -147,7 +147,7 @@ class JingleSession : public Session, ChannelsMap channels_; base::OneShotTimer<JingleSession> transport_infos_timer_; - std::list<cricket::Candidate> pending_candidates_; + std::list<JingleMessage::NamedCandidate> pending_candidates_; DISALLOW_COPY_AND_ASSIGN(JingleSession); }; diff --git a/remoting/protocol/libjingle_transport_factory.cc b/remoting/protocol/libjingle_transport_factory.cc index 2c16101..189757d 100644 --- a/remoting/protocol/libjingle_transport_factory.cc +++ b/remoting/protocol/libjingle_transport_factory.cc @@ -155,10 +155,12 @@ void LibjingleStreamTransport::Connect( port_allocator_->SetPortRange(config_.min_port, config_.max_port); - // Create P2PTransportChannel, attach signal handlers and connect it. DCHECK(!channel_.get()); + + // Create P2PTransportChannel, attach signal handlers and connect it. + // TODO(sergeyu): Specify correct component ID for the channel. channel_.reset(new cricket::P2PTransportChannel( - name_, "", NULL, port_allocator_.get())); + name_, 0, NULL, port_allocator_.get())); channel_->SignalRequestSignaling.connect( this, &LibjingleStreamTransport::OnRequestSignaling); channel_->SignalCandidateReady.connect( @@ -247,10 +249,9 @@ void LibjingleStreamTransport::OnRouteChange( LOG(FATAL) << "Failed to convert peer IP address."; } - DCHECK(channel->GetP2PChannel()); - DCHECK(channel->GetP2PChannel()->best_connection()); + DCHECK(channel_->best_connection()); const cricket::Candidate& local_candidate = - channel->GetP2PChannel()->best_connection()->local_candidate(); + channel_->best_connection()->local_candidate(); if (!jingle_glue::SocketAddressToIPEndPoint( local_candidate.address(), &route.local_address)) { LOG(FATAL) << "Failed to convert local IP address."; diff --git a/third_party/libjingle/README.chromium b/third_party/libjingle/README.chromium index efd5f22..ceea655 100644 --- a/third_party/libjingle/README.chromium +++ b/third_party/libjingle/README.chromium @@ -2,7 +2,7 @@ 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: 132 +Revision: 135 License: BSD License File: source/COPYING Security Critical: yes diff --git a/third_party/libjingle/libjingle.gyp b/third_party/libjingle/libjingle.gyp index f140c9e..d1234d9 100644 --- a/third_party/libjingle/libjingle.gyp +++ b/third_party/libjingle/libjingle.gyp @@ -8,18 +8,18 @@ ], 'target_defaults': { 'defines': [ - 'FEATURE_ENABLE_SSL', - 'FEATURE_ENABLE_VOICEMAIL', # TODO(ncarter): Do we really need this? - '_USE_32BIT_TIME_T', - 'LOGGING_INSIDE_LIBJINGLE', 'EXPAT_RELATIVE_PATH', - 'JSONCPP_RELATIVE_PATH', - 'WEBRTC_RELATIVE_PATH', + 'FEATURE_ENABLE_SSL', + 'GTEST_RELATIVE_PATH', + 'HAVE_SRTP', 'HAVE_WEBRTC_VIDEO', 'HAVE_WEBRTC_VOICE', + 'JSONCPP_RELATIVE_PATH', + 'LOGGING_INSIDE_LIBJINGLE', 'NO_SOUND_SYSTEM', - 'HAVE_SRTP', 'SRTP_RELATIVE_PATH', + 'WEBRTC_RELATIVE_PATH', + '_USE_32BIT_TIME_T', ], 'configurations': { 'Debug': { @@ -33,6 +33,7 @@ 'include_dirs': [ './overrides', './source', + '../../testing/gtest/include', '../../third_party/libyuv/include', ], 'dependencies': [ @@ -47,11 +48,13 @@ 'include_dirs': [ './overrides', './source', + '../../testing/gtest/include', ], 'defines': [ 'FEATURE_ENABLE_SSL', 'FEATURE_ENABLE_VOICEMAIL', 'EXPAT_RELATIVE_PATH', + 'GTEST_RELATIVE_PATH', 'JSONCPP_RELATIVE_PATH', 'WEBRTC_RELATIVE_PATH', 'NO_SOUND_SYSTEM', @@ -173,8 +176,6 @@ 'overrides/talk/base/logging.cc', 'overrides/talk/base/logging.h', - 'overrides/talk/base/scoped_ptr.h', - # TODO(ronghuawu): Remove below overrides once below bug is fixed: # http://crbug.com/115702 'overrides/talk/base/messagequeue.cc', @@ -261,6 +262,7 @@ 'source/talk/base/ratelimiter.h', 'source/talk/base/ratetracker.cc', '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.h', diff --git a/third_party/libjingle/overrides/talk/base/byteorder.h b/third_party/libjingle/overrides/talk/base/byteorder.h deleted file mode 100644 index 513a8c8..0000000 --- a/third_party/libjingle/overrides/talk/base/byteorder.h +++ /dev/null @@ -1,192 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, Google Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef TALK_BASE_BYTEORDER_H__ -#define TALK_BASE_BYTEORDER_H__ - -#ifdef POSIX -#include <arpa/inet.h> -#endif - -#ifdef WIN32 -#include <stdlib.h> -#include <winsock2.h> -#endif - -#include "talk/base/basictypes.h" - -namespace talk_base { - -// Reading and writing of little and big-endian numbers from memory -// TODO: Add HostEndian #defines (HE) -// TODO: Consider NetworkEndian as synonym for BigEndian, for clarity in use. -// TODO: Consider creating optimized versions, such as direct read/writes of -// integers in host-endian format, when the platform supports it. - -inline void Set8(void* memory, size_t offset, uint8 v) { - static_cast<uint8*>(memory)[offset] = v; -} -inline uint8 Get8(const void* memory, size_t offset) { - return static_cast<const uint8*>(memory)[offset]; -} - -inline void SetBE16(void* memory, uint16 v) { - Set8(memory, 0, static_cast<uint8>(v >> 8)); - Set8(memory, 1, static_cast<uint8>(v >> 0)); -} -inline void SetBE32(void* memory, uint32 v) { - Set8(memory, 0, static_cast<uint8>(v >> 24)); - Set8(memory, 1, static_cast<uint8>(v >> 16)); - Set8(memory, 2, static_cast<uint8>(v >> 8)); - Set8(memory, 3, static_cast<uint8>(v >> 0)); -} -inline void SetBE64(void* memory, uint64 v) { - Set8(memory, 0, static_cast<uint8>(v >> 56)); - Set8(memory, 1, static_cast<uint8>(v >> 48)); - Set8(memory, 2, static_cast<uint8>(v >> 40)); - Set8(memory, 3, static_cast<uint8>(v >> 32)); - Set8(memory, 4, static_cast<uint8>(v >> 24)); - Set8(memory, 5, static_cast<uint8>(v >> 16)); - Set8(memory, 6, static_cast<uint8>(v >> 8)); - Set8(memory, 7, static_cast<uint8>(v >> 0)); -} -inline uint16 GetBE16(const void* memory) { - return (static_cast<uint16>(Get8(memory, 0)) << 8) - | (static_cast<uint16>(Get8(memory, 1)) << 0); -} -inline uint32 GetBE32(const void* memory) { - return (static_cast<uint32>(Get8(memory, 0)) << 24) - | (static_cast<uint32>(Get8(memory, 1)) << 16) - | (static_cast<uint32>(Get8(memory, 2)) << 8) - | (static_cast<uint32>(Get8(memory, 3)) << 0); -} -inline uint64 GetBE64(const void* memory) { - return (static_cast<uint64>(Get8(memory, 0)) << 56) - | (static_cast<uint64>(Get8(memory, 1)) << 48) - | (static_cast<uint64>(Get8(memory, 2)) << 40) - | (static_cast<uint64>(Get8(memory, 3)) << 32) - | (static_cast<uint64>(Get8(memory, 4)) << 24) - | (static_cast<uint64>(Get8(memory, 5)) << 16) - | (static_cast<uint64>(Get8(memory, 6)) << 8) - | (static_cast<uint64>(Get8(memory, 7)) << 0); -} - -inline void SetLE16(void* memory, uint16 v) { - Set8(memory, 1, static_cast<uint8>(v >> 8)); - Set8(memory, 0, static_cast<uint8>(v >> 0)); -} -inline void SetLE32(void* memory, uint32 v) { - Set8(memory, 3, static_cast<uint8>(v >> 24)); - Set8(memory, 2, static_cast<uint8>(v >> 16)); - Set8(memory, 1, static_cast<uint8>(v >> 8)); - Set8(memory, 0, static_cast<uint8>(v >> 0)); -} -inline void SetLE64(void* memory, uint64 v) { - Set8(memory, 7, static_cast<uint8>(v >> 56)); - Set8(memory, 6, static_cast<uint8>(v >> 48)); - Set8(memory, 5, static_cast<uint8>(v >> 40)); - Set8(memory, 4, static_cast<uint8>(v >> 32)); - Set8(memory, 3, static_cast<uint8>(v >> 24)); - Set8(memory, 2, static_cast<uint8>(v >> 16)); - Set8(memory, 1, static_cast<uint8>(v >> 8)); - Set8(memory, 0, static_cast<uint8>(v >> 0)); -} -inline uint16 GetLE16(const void* memory) { - return (static_cast<uint16>(Get8(memory, 1)) << 8) - | (static_cast<uint16>(Get8(memory, 0)) << 0); -} -inline uint32 GetLE32(const void* memory) { - return (static_cast<uint32>(Get8(memory, 3)) << 24) - | (static_cast<uint32>(Get8(memory, 2)) << 16) - | (static_cast<uint32>(Get8(memory, 1)) << 8) - | (static_cast<uint32>(Get8(memory, 0)) << 0); -} -inline uint64 GetLE64(const void* memory) { - return (static_cast<uint64>(Get8(memory, 7)) << 56) - | (static_cast<uint64>(Get8(memory, 6)) << 48) - | (static_cast<uint64>(Get8(memory, 5)) << 40) - | (static_cast<uint64>(Get8(memory, 4)) << 32) - | (static_cast<uint64>(Get8(memory, 3)) << 24) - | (static_cast<uint64>(Get8(memory, 2)) << 16) - | (static_cast<uint64>(Get8(memory, 1)) << 8) - | (static_cast<uint64>(Get8(memory, 0)) << 0); -} - -// Check if the current host is big endian. -inline bool IsHostBigEndian() { - static const int number = 1; - return (0 == *reinterpret_cast<const char*>(&number)); -} - -inline uint16 HostToNetwork16(uint16 n) { -#ifdef WIN32 - // This and below _byteswap_* are to remove the dependency to ws2_32.dll - // especially for chrome, where we don't load the ws2_32.dll in the render - // process. This is correct only on little-endian machines. - return _byteswap_ushort(n); -#else - return htons(n); -#endif -} - -inline uint32 HostToNetwork32(uint32 n) { -#ifdef WIN32 - return _byteswap_ulong(n); -#else - return htonl(n); -#endif -} - -inline uint64 HostToNetwork64(uint64 n) { - // If the host is little endian, GetBE64 converts n to big network endian. - return IsHostBigEndian() ? n : GetBE64(&n); -} - -inline uint16 NetworkToHost16(uint16 n) { -#ifdef WIN32 - return _byteswap_ushort(n); -#else - return ntohs(n); -#endif -} - -inline uint32 NetworkToHost32(uint32 n) { -#ifdef WIN32 - return _byteswap_ulong(n); -#else - return ntohl(n); -#endif -} - -inline uint64 NetworkToHost64(uint64 n) { - // If the host is little endian, GetBE64 converts n to little endian. - return IsHostBigEndian() ? n : GetBE64(&n); -} - -} // namespace talk_base - -#endif // TALK_BASE_BYTEORDER_H__ diff --git a/third_party/libjingle/overrides/talk/base/scoped_ptr.h b/third_party/libjingle/overrides/talk/base/scoped_ptr.h deleted file mode 100644 index 3d396d1..0000000 --- a/third_party/libjingle/overrides/talk/base/scoped_ptr.h +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// This file overrides the inclusion of talk/base/memory/scoped_ptr.h. We use -// a version of scoped_ptr from Chromium base, to avoid multiple definitions. - -#ifndef OVERRIDES_TALK_BASE_SCOPED_PTR_H_ -#define OVERRIDES_TALK_BASE_SCOPED_PTR_H_ - -#include "base/memory/scoped_ptr.h" -#include "talk/base/common.h" - -namespace talk_base { - -using ::scoped_ptr; -using ::scoped_array; - -} // namespace talk_base - -#endif // OVERRIDES_TALK_BASE_SCOPED_PTR_H_ diff --git a/third_party/libjingle/overrides/talk/base/win32.cc b/third_party/libjingle/overrides/talk/base/win32.cc deleted file mode 100644 index e69de29..0000000 --- a/third_party/libjingle/overrides/talk/base/win32.cc +++ /dev/null diff --git a/third_party/libjingle/overrides/talk/base/win32.h b/third_party/libjingle/overrides/talk/base/win32.h deleted file mode 100644 index 9c6ea3f..0000000 --- a/third_party/libjingle/overrides/talk/base/win32.h +++ /dev/null @@ -1,133 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, Google Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef TALK_BASE_WIN32_H_ -#define TALK_BASE_WIN32_H_ - -#ifdef WIN32 - -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include <winsock2.h> -#include <windows.h> - -#ifndef SECURITY_MANDATORY_LABEL_AUTHORITY -// Add defines that we use if we are compiling against older sdks -#define SECURITY_MANDATORY_MEDIUM_RID (0x00002000L) -#define TokenIntegrityLevel static_cast<TOKEN_INFORMATION_CLASS>(0x19) -typedef struct _TOKEN_MANDATORY_LABEL { - SID_AND_ATTRIBUTES Label; -} TOKEN_MANDATORY_LABEL, *PTOKEN_MANDATORY_LABEL; -#endif // SECURITY_MANDATORY_LABEL_AUTHORITY - -#undef SetPort - -#include <string> - -#include "talk/base/stringutils.h" -#include "talk/base/basictypes.h" - -namespace talk_base { - -const char* win32_inet_ntop(int af, const void *src, char* dst, socklen_t size); -int win32_inet_pton(int af, const char* src, void *dst); - -/////////////////////////////////////////////////////////////////////////////// - -inline std::wstring ToUtf16(const char* utf8, size_t len) { - int len16 = ::MultiByteToWideChar(CP_UTF8, 0, utf8, len, NULL, 0); - wchar_t* ws = STACK_ARRAY(wchar_t, len16); - ::MultiByteToWideChar(CP_UTF8, 0, utf8, len, ws, len16); - return std::wstring(ws, len16); -} - -inline std::wstring ToUtf16(const std::string& str) { - return ToUtf16(str.data(), str.length()); -} - -inline std::string ToUtf8(const wchar_t* wide, size_t len) { - int len8 = ::WideCharToMultiByte(CP_UTF8, 0, wide, len, NULL, 0, NULL, NULL); - char* ns = STACK_ARRAY(char, len8); - ::WideCharToMultiByte(CP_UTF8, 0, wide, len, ns, len8, NULL, NULL); - return std::string(ns, len8); -} - -inline std::string ToUtf8(const std::wstring& wstr) { - return ToUtf8(wstr.data(), wstr.length()); -} - -// Convert FILETIME to time_t -void FileTimeToUnixTime(const FILETIME& ft, time_t* ut); - -// Convert time_t to FILETIME -void UnixTimeToFileTime(const time_t& ut, FILETIME * ft); - -// Convert a Utf8 path representation to a non-length-limited Unicode pathname. -bool Utf8ToWindowsFilename(const std::string& utf8, std::wstring* filename); - -// Convert a FILETIME to a UInt64 -inline uint64 ToUInt64(const FILETIME& ft) { - ULARGE_INTEGER r = {ft.dwLowDateTime, ft.dwHighDateTime}; - return r.QuadPart; -} - -enum WindowsMajorVersions { - kWindows2000 = 5, - kWindowsVista = 6, -}; -bool GetOsVersion(int* major, int* minor, int* build); - -inline bool IsWindowsVistaOrLater() { - int major; - return (GetOsVersion(&major, NULL, NULL) && major >= kWindowsVista); -} - -inline bool IsWindowsXpOrLater() { - int major, minor; - return (GetOsVersion(&major, &minor, NULL) && - (major >= kWindowsVista || - (major == kWindows2000 && minor >= 1))); -} - -// Determine the current integrity level of the process. -bool GetCurrentProcessIntegrityLevel(int* level); - -inline bool IsCurrentProcessLowIntegrity() { - int level; - return (GetCurrentProcessIntegrityLevel(&level) && - level < SECURITY_MANDATORY_MEDIUM_RID); -} - -bool AdjustCurrentProcessPrivilege(const TCHAR* privilege, bool to_enable); - -/////////////////////////////////////////////////////////////////////////////// - -} // namespace talk_base - -#endif // WIN32 -#endif // TALK_BASE_WIN32_H_ |