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

Unified Diff: net/quic/congestion_control/cubic.cc

Issue 1535363003: Switch to standard integer types in net/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: stddef Created 5 years 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 | « net/quic/congestion_control/cubic.h ('k') | net/quic/congestion_control/cubic_bytes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/congestion_control/cubic.cc
diff --git a/net/quic/congestion_control/cubic.cc b/net/quic/congestion_control/cubic.cc
index d07af1716fd454b2825394ba8eb6b84bee4e1b92..6cd6557677447f45f89b4d52ef5cd9afdf76f134 100644
--- a/net/quic/congestion_control/cubic.cc
+++ b/net/quic/congestion_control/cubic.cc
@@ -8,7 +8,6 @@
#include <algorithm>
#include <cmath>
-#include "base/basictypes.h"
#include "base/logging.h"
#include "net/quic/quic_flags.h"
#include "net/quic/quic_protocol.h"
@@ -27,10 +26,10 @@ const int kCubeScale = 40; // 1024*1024^3 (first 1024 is from 0.100^3)
// where 0.100 is 100 ms which is the scaling
// round trip time.
const int kCubeCongestionWindowScale = 410;
-const uint64 kCubeFactor =
+const uint64_t kCubeFactor =
(UINT64_C(1) << kCubeScale) / kCubeCongestionWindowScale;
-const uint32 kDefaultNumConnections = 2;
+const uint32_t kDefaultNumConnections = 2;
const float kBeta = 0.7f; // Default Cubic backoff factor.
// Additional backoff factor when loss occurs in the concave part of the Cubic
// curve. This additional backoff factor is expected to give up bandwidth to
@@ -136,9 +135,9 @@ QuicPacketCount Cubic::CongestionWindowAfterAck(
time_to_origin_point_ = 0;
origin_point_congestion_window_ = current_congestion_window;
} else {
- time_to_origin_point_ =
- static_cast<uint32>(cbrt(kCubeFactor * (last_max_congestion_window_ -
- current_congestion_window)));
+ time_to_origin_point_ = static_cast<uint32_t>(
+ cbrt(kCubeFactor *
+ (last_max_congestion_window_ - current_congestion_window)));
origin_point_congestion_window_ = last_max_congestion_window_;
}
} else {
@@ -157,11 +156,11 @@ QuicPacketCount Cubic::CongestionWindowAfterAck(
// Change the time unit from microseconds to 2^10 fractions per second. Take
// the round trip time in account. This is done to allow us to use shift as a
// divide operator.
- int64 elapsed_time =
+ int64_t elapsed_time =
(current_time.Add(delay_min).Subtract(epoch_).ToMicroseconds() << 10) /
kNumMicrosPerSecond;
- int64 offset = time_to_origin_point_ - elapsed_time;
+ int64_t offset = time_to_origin_point_ - elapsed_time;
QuicPacketCount delta_congestion_window =
(kCubeCongestionWindowScale * offset * offset * offset) >> kCubeScale;
« no previous file with comments | « net/quic/congestion_control/cubic.h ('k') | net/quic/congestion_control/cubic_bytes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698