Reformat the WebRTC code base
Running clang-format with chromium's style guide. The goal is n-fold: * providing consistency and readability (that's what code guidelines are for) * preventing noise with presubmit checks and git cl format * building on the previous point: making it easier to automatically fix format issues * you name it Please consider using git-hyper-blame to ignore this commit. Bug: webrtc:9340 Change-Id: I694567c4cdf8cee2860958cfe82bfaf25848bb87 Reviewed-on: https://webrtc-review.googlesource.com/81185 Reviewed-by: Patrik Höglund <phoglund@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23660}
This commit is contained in:
@ -23,7 +23,7 @@
|
||||
namespace rtc {
|
||||
class Network;
|
||||
struct PacketOptions;
|
||||
}
|
||||
} // namespace rtc
|
||||
|
||||
namespace cricket {
|
||||
class Connection;
|
||||
@ -68,13 +68,12 @@ class PortInterface {
|
||||
virtual void PrepareAddress() = 0;
|
||||
|
||||
// Returns the connection to the given address or NULL if none exists.
|
||||
virtual Connection* GetConnection(
|
||||
const rtc::SocketAddress& remote_addr) = 0;
|
||||
virtual Connection* GetConnection(const rtc::SocketAddress& remote_addr) = 0;
|
||||
|
||||
// Creates a new connection to the given address.
|
||||
enum CandidateOrigin { ORIGIN_THIS_PORT, ORIGIN_OTHER_PORT, ORIGIN_MESSAGE };
|
||||
virtual Connection* CreateConnection(
|
||||
const Candidate& remote_candidate, CandidateOrigin origin) = 0;
|
||||
virtual Connection* CreateConnection(const Candidate& remote_candidate,
|
||||
CandidateOrigin origin) = 0;
|
||||
|
||||
// Functions on the underlying socket(s).
|
||||
virtual int SetOption(rtc::Socket::Option opt, int value) = 0;
|
||||
@ -87,25 +86,32 @@ class PortInterface {
|
||||
|
||||
// Sends the given packet to the given address, provided that the address is
|
||||
// that of a connection or an address that has sent to us already.
|
||||
virtual int SendTo(const void* data, size_t size,
|
||||
virtual int SendTo(const void* data,
|
||||
size_t size,
|
||||
const rtc::SocketAddress& addr,
|
||||
const rtc::PacketOptions& options, bool payload) = 0;
|
||||
const rtc::PacketOptions& options,
|
||||
bool payload) = 0;
|
||||
|
||||
// Indicates that we received a successful STUN binding request from an
|
||||
// address that doesn't correspond to any current connection. To turn this
|
||||
// into a real connection, call CreateConnection.
|
||||
sigslot::signal6<PortInterface*, const rtc::SocketAddress&,
|
||||
ProtocolType, IceMessage*, const std::string&,
|
||||
bool> SignalUnknownAddress;
|
||||
sigslot::signal6<PortInterface*,
|
||||
const rtc::SocketAddress&,
|
||||
ProtocolType,
|
||||
IceMessage*,
|
||||
const std::string&,
|
||||
bool>
|
||||
SignalUnknownAddress;
|
||||
|
||||
// Sends a response message (normal or error) to the given request. One of
|
||||
// these methods should be called as a response to SignalUnknownAddress.
|
||||
// NOTE: You MUST call CreateConnection BEFORE SendBindingResponse.
|
||||
virtual void SendBindingResponse(StunMessage* request,
|
||||
const rtc::SocketAddress& addr) = 0;
|
||||
virtual void SendBindingErrorResponse(
|
||||
StunMessage* request, const rtc::SocketAddress& addr,
|
||||
int error_code, const std::string& reason) = 0;
|
||||
virtual void SendBindingErrorResponse(StunMessage* request,
|
||||
const rtc::SocketAddress& addr,
|
||||
int error_code,
|
||||
const std::string& reason) = 0;
|
||||
|
||||
// Signaled when this port decides to delete itself because it no longer has
|
||||
// any usefulness.
|
||||
@ -119,8 +125,9 @@ class PortInterface {
|
||||
// through their respective connection and instead delivers every packet
|
||||
// through this port.
|
||||
virtual void EnablePortPackets() = 0;
|
||||
sigslot::signal4<PortInterface*, const char*, size_t,
|
||||
const rtc::SocketAddress&> SignalReadPacket;
|
||||
sigslot::
|
||||
signal4<PortInterface*, const char*, size_t, const rtc::SocketAddress&>
|
||||
SignalReadPacket;
|
||||
|
||||
// Emitted each time a packet is sent on this port.
|
||||
sigslot::signal1<const rtc::SentPacket&> SignalSentPacket;
|
||||
|
||||
Reference in New Issue
Block a user