Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Unified Diff: net/quic/core/quic_protocol.h

Issue 2229703003: Introduce TTL in QuicReceivedPacket. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@129359661
Patch Set: git pull from upper stream Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/quic/core/quic_protocol.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/quic_protocol.h
diff --git a/net/quic/core/quic_protocol.h b/net/quic/core/quic_protocol.h
index 34e6a407267f8a900e407b6f44bf34d5d374622c..6290ccf199af313850a223289b5f5f0dd36a4357 100644
--- a/net/quic/core/quic_protocol.h
+++ b/net/quic/core/quic_protocol.h
@@ -1264,7 +1264,7 @@ typedef std::vector<QuicFrame> QuicFrames;
class NET_EXPORT_PRIVATE QuicData {
public:
QuicData(const char* buffer, size_t length);
- QuicData(char* buffer, size_t length, bool owns_buffer);
+ QuicData(const char* buffer, size_t length, bool owns_buffer);
virtual ~QuicData();
base::StringPiece AsStringPiece() const {
@@ -1316,7 +1316,7 @@ class NET_EXPORT_PRIVATE QuicPacket : public QuicData {
class NET_EXPORT_PRIVATE QuicEncryptedPacket : public QuicData {
public:
QuicEncryptedPacket(const char* buffer, size_t length);
- QuicEncryptedPacket(char* buffer, size_t length, bool owns_buffer);
+ QuicEncryptedPacket(const char* buffer, size_t length, bool owns_buffer);
// Clones the packet into a new packet which owns the buffer.
QuicEncryptedPacket* Clone() const;
@@ -1337,10 +1337,16 @@ class NET_EXPORT_PRIVATE QuicEncryptedPacket : public QuicData {
class NET_EXPORT_PRIVATE QuicReceivedPacket : public QuicEncryptedPacket {
public:
QuicReceivedPacket(const char* buffer, size_t length, QuicTime receipt_time);
- QuicReceivedPacket(char* buffer,
+ QuicReceivedPacket(const char* buffer,
size_t length,
QuicTime receipt_time,
bool owns_buffer);
+ QuicReceivedPacket(const char* buffer,
+ size_t length,
+ QuicTime receipt_time,
+ bool owns_buffer,
+ int ttl,
+ bool ttl_valid);
// Clones the packet into a new packet which owns the buffer.
QuicReceivedPacket* Clone() const;
@@ -1348,6 +1354,9 @@ class NET_EXPORT_PRIVATE QuicReceivedPacket : public QuicEncryptedPacket {
// Returns the time at which the packet was received.
QuicTime receipt_time() const { return receipt_time_; }
+ // This is the TTL of the packet, assuming ttl_vaild_ is true.
+ int ttl() const { return ttl_; }
+
// By default, gtest prints the raw bytes of an object. The bool data
// member (in the base class QuicData) causes this object to have padding
// bytes, which causes the default gtest object printer to read
@@ -1358,6 +1367,7 @@ class NET_EXPORT_PRIVATE QuicReceivedPacket : public QuicEncryptedPacket {
private:
const QuicTime receipt_time_;
+ int ttl_;
DISALLOW_COPY_AND_ASSIGN(QuicReceivedPacket);
};
« no previous file with comments | « no previous file | net/quic/core/quic_protocol.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698