diff options
author | tommi <tommi@webrtc.org> | 2016-01-14 04:56:59 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-01-14 12:57:03 +0000 |
commit | e5e0e57bdfd8831b2ad917e7990e273fdfe26af4 (patch) | |
tree | ce7a5d4d5419ef1c2aea4f00ec0356b42570760c | |
parent | 688e308a353c27803a66803230235638f4dd1f2b (diff) | |
download | webrtc-e5e0e57bdfd8831b2ad917e7990e273fdfe26af4.tar.gz |
Revert of Connect TurnPort and TCPPort to AsyncPacketSocket::SignalSentPacket. (patchset #3 id:40001 of https://codereview.webrtc.org/1577873003/ )
Reason for revert:
Broke Chrome:
https://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_compile_dbg_ng/builds/143025/steps/compile%20%28with%20patch%29/logs/stdio
FAILED: cd ../../third_party/libjingle; python ../../native_client/build/build_nexe.py --root ../.. --product-dir ../../out/Debug/xyz --config-name Debug -t ../../native_client/toolchain/ --arch pnacl --build newlib_plib --name ../../out/Debug/gen/tc_pnacl_newlib/lib/libjingle_nacl.a --objdir ../../out/Debug/obj/third_party/libjingle/libjingle_nacl.gen/pnacl_newlib-pnacl/libjingle_nacl "--include-dirs=../../out/Debug/gen/tc_pnacl_newlib/include ../.. \"../../out/Debug/gen\" ./source ../ ../../native_client_sdk/src/libraries ../../native_client_sdk/src/libraries/nacl_io/include ../../native_client_sdk/src/libraries/third_party/newlib-extras ../expat/files/lib ../boringssl/src/include" "--compile_flags=-O2 -g -Wall -fdiagnostics-show-option -Werror -Wno-unused-function -Wno-char-subscripts -Wno-c++11-extensions -Wno-unnamed-type-template-args -Wno-extra-semi -Wno-unused-private-field -Wno-char-subscripts -Wno-unused-function \"-std=gnu++11\" " --gomadir /b/build/goma "--defines=\"__STDC_LIMIT_MACROS=1\" \"__STDC_FORMAT_MACROS=1\" \"_GNU_SOURCE=1\" \"_POSIX_C_SOURCE=199506\" \"_XOPEN_SOURCE=600\" \"DYNAMIC_ANNOTATIONS_ENABLED=1\" \"DYNAMIC_ANNOTATIONS_PREFIX=NACL_\" \"NACL_BUILD_ARCH=x86\" V8_DEPRECATION_WARNINGS \"CLD_VERSION=2\" \"_FILE_OFFSET_BITS=64\" CHROMIUM_BUILD \"CR_CLANG_REVISION=255169-1\" COMPONENT_BUILD UI_COMPOSITOR_IMAGE_TRANSPORT \"USE_AURA=1\" \"USE_ASH=1\" \"USE_PANGO=1\" \"USE_CAIRO=1\" \"USE_DEFAULT_RENDER_THEME=1\" \"USE_LIBJPEG_TURBO=1\" \"USE_X11=1\" \"IMAGE_LOADER_EXTENSION=1\" \"ENABLE_WEBRTC=1\" \"ENABLE_MEDIA_ROUTER=1\" USE_PROPRIETARY_CODECS ENABLE_PEPPER_CDMS ENABLE_CONFIGURATION_POLICY ENABLE_NOTIFICATIONS \"ENABLE_HIDPI=1\" \"ENABLE_TOPCHROME_MD=1\" USE_UDEV DONT_EMBED_BUILD_METADATA \"DCHECK_ALWAYS_ON=1\" FIELDTRIAL_TESTING_ENABLED \"ENABLE_TASK_MANAGER=1\" \"ENABLE_EXTENSIONS=1\" \"ENABLE_PDF=1\" \"ENABLE_PLUGINS=1\" \"ENABLE_SESSION_SERVICE=1\" \"ENABLE_THEMES=1\" \"ENABLE_AUTOFILL_DIALOG=1\" \"ENABLE_BACKGROUND=1\" \"ENABLE_PRINTING=1\" \"ENABLE_PRINT_PREVIEW=1\" \"ENABLE_SPELLCHECK=1\" \"ENABLE_CAPTIVE_PORTAL_DETECTION=1\" \"ENABLE_APP_LIST=1\" \"ENABLE_SUPERVISED_USERS=1\" \"ENABLE_MDNS=1\" \"ENABLE_SERVICE_DISCOVERY=1\" V8_USE_EXTERNAL_STARTUP_DATA FULL_SAFE_BROWSING SAFE_BROWSING_CSD SAFE_BROWSING_DB_LOCAL EXPAT_RELATIVE_PATH FEATURE_ENABLE_SSL GTEST_RELATIVE_PATH HAVE_OPENSSL_SSL_H NO_MAIN_THREAD_WRAPPING NO_SOUND_SYSTEM WEBRTC_POSIX SRTP_RELATIVE_PATH SSL_USE_OPENSSL USE_WEBRTC_DEV_BRANCH \"timezone=_timezone\" XML_STATIC \"USE_LIBPCI=1\" \"USE_OPENSSL=1\" \"USE_OPENSSL_CERTS=1\"" "--link_flags=-B../../out/Debug/gen/tc_pnacl_newlib/lib " "--source-list=../../out/gypfiles/third_party/libjingle/pnacl_newlib.libjingle_nacl.source_list.gypcmd"
In file included from ../webrtc/p2p/base/tcpport.cc:67:
../webrtc/p2p/base/tcpport.h:50:23: error: 'CreateConnection' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
virtual Connection* CreateConnection(const Candidate& address,
^
../webrtc/p2p/base/portinterface.h:71:23: note: overridden virtual function is here
virtual Connection* CreateConnection(
^
In file included from ../webrtc/p2p/base/tcpport.cc:67:
../webrtc/p2p/base/tcpport.h:53:16: error: 'PrepareAddress' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
virtual void PrepareAddress();
^
../webrtc/p2p/base/portinterface.h:63:16: note: overridden virtual function is here
virtual void PrepareAddress() = 0;
^
(etc)
Original issue's description:
> Connect TurnPort and TCPPort to AsyncPacketSocket::SignalSentPacket.
>
> To reduce the risk of future mistakes when connecting Ports, Port::OnSentPacket was made pure virtual to ensure that new implementations take care of it.
>
> BUG=4173
> R=pthatcher@webrtc.org
>
> Committed: https://crrev.com/7307952a5bf63311e5f9a2a90089a06177e42716
> Cr-Commit-Position: refs/heads/master@{#11247}
TBR=pthatcher@webrtc.org,stefan@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=4173
Review URL: https://codereview.webrtc.org/1586063002
Cr-Commit-Position: refs/heads/master@{#11249}
-rw-r--r-- | webrtc/p2p/base/p2ptransportchannel.cc | 3 | ||||
-rw-r--r-- | webrtc/p2p/base/p2ptransportchannel.h | 2 | ||||
-rw-r--r-- | webrtc/p2p/base/port.cc | 4 | ||||
-rw-r--r-- | webrtc/p2p/base/port.h | 6 | ||||
-rw-r--r-- | webrtc/p2p/base/port_unittest.cc | 4 | ||||
-rw-r--r-- | webrtc/p2p/base/portinterface.h | 2 | ||||
-rw-r--r-- | webrtc/p2p/base/relayport.cc | 2 | ||||
-rw-r--r-- | webrtc/p2p/base/relayport.h | 7 | ||||
-rw-r--r-- | webrtc/p2p/base/stunport.cc | 2 | ||||
-rw-r--r-- | webrtc/p2p/base/tcpport.cc | 7 | ||||
-rw-r--r-- | webrtc/p2p/base/tcpport.h | 3 | ||||
-rw-r--r-- | webrtc/p2p/base/turnport.cc | 7 | ||||
-rw-r--r-- | webrtc/p2p/base/turnport.h | 2 |
13 files changed, 12 insertions, 39 deletions
diff --git a/webrtc/p2p/base/p2ptransportchannel.cc b/webrtc/p2p/base/p2ptransportchannel.cc index 952cfab747..c58a235f2d 100644 --- a/webrtc/p2p/base/p2ptransportchannel.cc +++ b/webrtc/p2p/base/p2ptransportchannel.cc @@ -1424,7 +1424,8 @@ void P2PTransportChannel::OnReadPacket(Connection* connection, } } -void P2PTransportChannel::OnSentPacket(const rtc::SentPacket& sent_packet) { +void P2PTransportChannel::OnSentPacket(PortInterface* port, + const rtc::SentPacket& sent_packet) { ASSERT(worker_thread_ == rtc::Thread::Current()); SignalSentPacket(this, sent_packet); diff --git a/webrtc/p2p/base/p2ptransportchannel.h b/webrtc/p2p/base/p2ptransportchannel.h index f2e9315343..3927b17659 100644 --- a/webrtc/p2p/base/p2ptransportchannel.h +++ b/webrtc/p2p/base/p2ptransportchannel.h @@ -232,7 +232,7 @@ class P2PTransportChannel : public TransportChannelImpl, void OnConnectionStateChange(Connection* connection); void OnReadPacket(Connection *connection, const char *data, size_t len, const rtc::PacketTime& packet_time); - void OnSentPacket(const rtc::SentPacket& sent_packet); + void OnSentPacket(PortInterface* port, const rtc::SentPacket& sent_packet); void OnReadyToSend(Connection* connection); void OnConnectionDestroyed(Connection *connection); diff --git a/webrtc/p2p/base/port.cc b/webrtc/p2p/base/port.cc index 9dd5c83fed..f6a30097f8 100644 --- a/webrtc/p2p/base/port.cc +++ b/webrtc/p2p/base/port.cc @@ -310,6 +310,10 @@ void Port::OnReadPacket( } } +void Port::OnSentPacket(const rtc::SentPacket& sent_packet) { + PortInterface::SignalSentPacket(this, sent_packet); +} + void Port::OnReadyToSend() { AddressMap::iterator iter = connections_.begin(); for (; iter != connections_.end(); ++iter) { diff --git a/webrtc/p2p/base/port.h b/webrtc/p2p/base/port.h index 436b1e7faa..57608b5b14 100644 --- a/webrtc/p2p/base/port.h +++ b/webrtc/p2p/base/port.h @@ -280,11 +280,7 @@ class Port : public PortInterface, public rtc::MessageHandler, const std::string& remote_ufrag); // Called when a packet has been sent to the socket. - // This is made pure virtual to notify subclasses of Port that they MUST - // listen to AsyncPacketSocket::SignalSentPacket and then call - // PortInterface::OnSentPacket. - virtual void OnSentPacket(rtc::AsyncPacketSocket* socket, - const rtc::SentPacket& sent_packet) = 0; + void OnSentPacket(const rtc::SentPacket& sent_packet); // Called when the socket is currently able to send. void OnReadyToSend(); diff --git a/webrtc/p2p/base/port_unittest.cc b/webrtc/p2p/base/port_unittest.cc index 449021ad9f..34806d9a79 100644 --- a/webrtc/p2p/base/port_unittest.cc +++ b/webrtc/p2p/base/port_unittest.cc @@ -204,10 +204,6 @@ class TestPort : public Port { } private: - void OnSentPacket(rtc::AsyncPacketSocket* socket, - const rtc::SentPacket& sent_packet) { - PortInterface::SignalSentPacket(sent_packet); - } rtc::scoped_ptr<ByteBuffer> last_stun_buf_; rtc::scoped_ptr<IceMessage> last_stun_msg_; int type_preference_ = 0; diff --git a/webrtc/p2p/base/portinterface.h b/webrtc/p2p/base/portinterface.h index e83879f3b7..d1c371d356 100644 --- a/webrtc/p2p/base/portinterface.h +++ b/webrtc/p2p/base/portinterface.h @@ -116,7 +116,7 @@ class PortInterface { const rtc::SocketAddress&> SignalReadPacket; // Emitted each time a packet is sent on this port. - sigslot::signal1<const rtc::SentPacket&> SignalSentPacket; + sigslot::signal2<PortInterface*, const rtc::SentPacket&> SignalSentPacket; virtual std::string ToString() const = 0; diff --git a/webrtc/p2p/base/relayport.cc b/webrtc/p2p/base/relayport.cc index 19883a3121..88adcf2f88 100644 --- a/webrtc/p2p/base/relayport.cc +++ b/webrtc/p2p/base/relayport.cc @@ -754,7 +754,7 @@ void RelayEntry::OnReadPacket( void RelayEntry::OnSentPacket(rtc::AsyncPacketSocket* socket, const rtc::SentPacket& sent_packet) { - port_->OnSentPacket(socket, sent_packet); + port_->OnSentPacket(sent_packet); } void RelayEntry::OnReadyToSend(rtc::AsyncPacketSocket* socket) { diff --git a/webrtc/p2p/base/relayport.h b/webrtc/p2p/base/relayport.h index fdbf6e6f98..4b74b91ade 100644 --- a/webrtc/p2p/base/relayport.h +++ b/webrtc/p2p/base/relayport.h @@ -29,7 +29,7 @@ class RelayConnection; // is created. The RelayEntry will try to reach the remote destination // by connecting to all available server addresses in a pre defined // order with a small delay in between. When a connection is -// successful all other connection attempts are aborted. +// successful all other connection attemts are aborted. class RelayPort : public Port { public: typedef std::pair<rtc::Socket::Option, int> OptionValue; @@ -96,11 +96,6 @@ class RelayPort : public Port { ProtocolType proto, const rtc::PacketTime& packet_time); - // The OnSentPacket callback is left empty here since they are handled by - // RelayEntry. - void OnSentPacket(rtc::AsyncPacketSocket* socket, - const rtc::SentPacket& sent_packet) override {} - private: friend class RelayEntry; diff --git a/webrtc/p2p/base/stunport.cc b/webrtc/p2p/base/stunport.cc index 8f37dd5218..67cf789da8 100644 --- a/webrtc/p2p/base/stunport.cc +++ b/webrtc/p2p/base/stunport.cc @@ -340,7 +340,7 @@ void UDPPort::OnReadPacket(rtc::AsyncPacketSocket* socket, void UDPPort::OnSentPacket(rtc::AsyncPacketSocket* socket, const rtc::SentPacket& sent_packet) { - PortInterface::SignalSentPacket(sent_packet); + Port::OnSentPacket(sent_packet); } void UDPPort::OnReadyToSend(rtc::AsyncPacketSocket* socket) { diff --git a/webrtc/p2p/base/tcpport.cc b/webrtc/p2p/base/tcpport.cc index 6a64174f00..23afc2f031 100644 --- a/webrtc/p2p/base/tcpport.cc +++ b/webrtc/p2p/base/tcpport.cc @@ -258,7 +258,6 @@ void TCPPort::OnNewConnection(rtc::AsyncPacketSocket* socket, incoming.socket = new_socket; incoming.socket->SignalReadPacket.connect(this, &TCPPort::OnReadPacket); incoming.socket->SignalReadyToSend.connect(this, &TCPPort::OnReadyToSend); - incoming.socket->SignalSentPacket.connect(this, &TCPPort::OnSentPacket); LOG_J(LS_VERBOSE, this) << "Accepted connection from " << incoming.addr.ToSensitiveString(); @@ -287,12 +286,6 @@ void TCPPort::OnReadPacket(rtc::AsyncPacketSocket* socket, Port::OnReadPacket(data, size, remote_addr, PROTO_TCP); } -void TCPPort::OnSentPacket(rtc::AsyncPacketSocket* socket, - const rtc::SentPacket& sent_packet) { - ASSERT(socket == socket_); - PortInterface::SignalSentPacket(sent_packet); -} - void TCPPort::OnReadyToSend(rtc::AsyncPacketSocket* socket) { Port::OnReadyToSend(); } diff --git a/webrtc/p2p/base/tcpport.h b/webrtc/p2p/base/tcpport.h index b298a17e9c..568dc65f3d 100644 --- a/webrtc/p2p/base/tcpport.h +++ b/webrtc/p2p/base/tcpport.h @@ -96,9 +96,6 @@ class TCPPort : public Port { const rtc::SocketAddress& remote_addr, const rtc::PacketTime& packet_time); - void OnSentPacket(rtc::AsyncPacketSocket* socket, - const rtc::SentPacket& sent_packet) override; - void OnReadyToSend(rtc::AsyncPacketSocket* socket); void OnAddressReady(rtc::AsyncPacketSocket* socket, diff --git a/webrtc/p2p/base/turnport.cc b/webrtc/p2p/base/turnport.cc index 5ed93dd1d8..022207aa5b 100644 --- a/webrtc/p2p/base/turnport.cc +++ b/webrtc/p2p/base/turnport.cc @@ -351,8 +351,6 @@ bool TurnPort::CreateTurnClientSocket() { socket_->SignalReadyToSend.connect(this, &TurnPort::OnReadyToSend); - socket_->SignalSentPacket.connect(this, &TurnPort::OnSentPacket); - // TCP port is ready to send stun requests after the socket is connected, // while UDP port is ready to do so once the socket is created. if (server_address_.proto == PROTO_TCP) { @@ -584,11 +582,6 @@ void TurnPort::OnReadPacket( } } -void TurnPort::OnSentPacket(rtc::AsyncPacketSocket* socket, - const rtc::SentPacket& sent_packet) { - PortInterface::SignalSentPacket(sent_packet); -} - void TurnPort::OnReadyToSend(rtc::AsyncPacketSocket* socket) { if (ready()) { Port::OnReadyToSend(); diff --git a/webrtc/p2p/base/turnport.h b/webrtc/p2p/base/turnport.h index 4d83806a37..a19f67632e 100644 --- a/webrtc/p2p/base/turnport.h +++ b/webrtc/p2p/base/turnport.h @@ -106,8 +106,6 @@ class TurnPort : public Port { const rtc::SocketAddress& remote_addr, const rtc::PacketTime& packet_time); - virtual void OnSentPacket(rtc::AsyncPacketSocket* socket, - const rtc::SentPacket& sent_packet); virtual void OnReadyToSend(rtc::AsyncPacketSocket* socket); virtual bool SupportsProtocol(const std::string& protocol) const { // Turn port only connects to UDP candidates. |