Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // This file defines some basic types used by the P2P-related IPC | 5 // This file defines some basic types used by the P2P-related IPC |
| 6 // messages. | 6 // messages. |
| 7 | 7 |
| 8 #ifndef CONTENT_COMMON_P2P_SOCKET_TYPE_H_ | 8 #ifndef CONTENT_COMMON_P2P_SOCKET_TYPE_H_ |
| 9 #define CONTENT_COMMON_P2P_SOCKET_TYPE_H_ | 9 #define CONTENT_COMMON_P2P_SOCKET_TYPE_H_ |
| 10 | 10 |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/time/time.h" | |
| 13 #include "net/base/ip_endpoint.h" | 14 #include "net/base/ip_endpoint.h" |
| 14 | 15 |
| 15 namespace content { | 16 namespace content { |
| 16 | 17 |
| 17 enum P2PSocketOption { | 18 enum P2PSocketOption { |
| 18 P2P_SOCKET_OPT_RCVBUF, // Receive buffer size. | 19 P2P_SOCKET_OPT_RCVBUF, // Receive buffer size. |
| 19 P2P_SOCKET_OPT_SNDBUF, // Send buffer size. | 20 P2P_SOCKET_OPT_SNDBUF, // Send buffer size. |
| 20 P2P_SOCKET_OPT_DSCP, // DSCP code. | 21 P2P_SOCKET_OPT_DSCP, // DSCP code. |
| 21 P2P_SOCKET_OPT_MAX | 22 P2P_SOCKET_OPT_MAX |
| 22 }; | 23 }; |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 43 const net::IPEndPoint& ip_address) | 44 const net::IPEndPoint& ip_address) |
| 44 : hostname(hostname), ip_address(ip_address) { | 45 : hostname(hostname), ip_address(ip_address) { |
| 45 } | 46 } |
| 46 | 47 |
| 47 std::string hostname; | 48 std::string hostname; |
| 48 net::IPEndPoint ip_address; | 49 net::IPEndPoint ip_address; |
| 49 }; | 50 }; |
| 50 | 51 |
| 51 // Stuct which keeps track of metrics during a send operation on P2P sockets. | 52 // Stuct which keeps track of metrics during a send operation on P2P sockets. |
| 52 // Currently, it only carries packet_id but could be expanded to include | 53 // Currently, it only carries packet_id but could be expanded to include |
| 53 // timestamps when packet arrives at various points. | 54 // timestamps when packet arrives at various points. |
|
no sievers
2015/09/21 19:45:42
nit: you might want to update the comment, or shor
Stefan
2015/09/22 07:51:36
Significantly shortened.
| |
| 54 struct P2PSendPacketMetrics { | 55 struct P2PSendPacketMetrics { |
| 55 P2PSendPacketMetrics() : packet_id(0) {} | 56 P2PSendPacketMetrics() {} |
| 56 explicit P2PSendPacketMetrics(uint64_t packet_id) : packet_id(packet_id) {} | 57 P2PSendPacketMetrics(uint64_t packet_id, |
| 58 int32_t transport_sequence_number, | |
| 59 base::TimeTicks send_time) | |
| 60 : packet_id(packet_id), | |
| 61 transport_sequence_number(transport_sequence_number), | |
| 62 send_time(send_time) {} | |
| 57 | 63 |
| 58 uint64_t packet_id; | 64 uint64_t packet_id = 0; |
| 65 // Transport sequence number is a sequential packet counter written in the | |
| 66 // RTP header and used by RTP receivers to ACK received packets. It is sent | |
| 67 // back with a corresponding send time to WebRTC in the browser process so | |
| 68 // that it can be combined with ACKs to compute inter-packet delay variations. | |
| 69 int32_t transport_sequence_number = -1; | |
| 70 base::TimeTicks send_time; | |
| 59 }; | 71 }; |
| 60 | 72 |
| 61 } // namespace content | 73 } // namespace content |
| 62 | 74 |
| 63 #endif // CONTENT_COMMON_P2P_SOCKET_TYPE_H_ | 75 #endif // CONTENT_COMMON_P2P_SOCKET_TYPE_H_ |
| OLD | NEW |