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

Side by Side Diff: net/quic/congestion_control/timestamp_receiver.cc

Issue 447093004: Land Recent QUIC Changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed indenation in QuicFramer.cc Created 6 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "net/quic/congestion_control/timestamp_receiver.h"
6
7 #include <utility>
8
9 #include "base/basictypes.h"
10
11 namespace net {
12
13 TimestampReceiver::TimestampReceiver() {
14 }
15
16 TimestampReceiver::~TimestampReceiver() {
17 }
18
19 bool TimestampReceiver::GenerateCongestionFeedback(
20 QuicCongestionFeedbackFrame* feedback) {
21 if (received_packet_times_.size() <= 1) {
22 // Don't waste resources by sending a feedback frame for only one packet.
23 return false;
24 }
25 feedback->type = kTimestamp;
26
27 // Copy our current receive set to our feedback message, we will not resend
28 // this data if it is lost.
29 feedback->timestamp.received_packet_times = received_packet_times_;
30
31 // Prepare for the next set of arriving packets by clearing our current set.
32 received_packet_times_.clear();
33 return true;
34 }
35
36 void TimestampReceiver::RecordIncomingPacket(
37 QuicByteCount /*bytes*/,
38 QuicPacketSequenceNumber sequence_number,
39 QuicTime timestamp) {
40 received_packet_times_.insert(std::make_pair(sequence_number, timestamp));
41 }
42
43 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/congestion_control/timestamp_receiver.h ('k') | net/quic/congestion_control/timestamp_receiver_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698