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

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

Issue 816543004: Update from https://crrev.com/308996 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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/proxy/proxy_resolver_v8.cc ('k') | net/quic/crypto/crypto_server_test.cc » ('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 55ce8037cedb0c8ede254df8023f89286814f61a..58b538576a85ec7cd857b01086fe460bb7407e4f 100644
--- a/net/quic/congestion_control/cubic.cc
+++ b/net/quic/congestion_control/cubic.cc
@@ -4,12 +4,14 @@
#include "net/quic/congestion_control/cubic.h"
+#include <math.h>
#include <algorithm>
#include "base/basictypes.h"
#include "base/logging.h"
#include "base/time/time.h"
#include "net/quic/congestion_control/cube_root.h"
+#include "net/quic/quic_flags.h"
#include "net/quic/quic_protocol.h"
using std::max;
@@ -80,7 +82,6 @@ void Cubic::Reset() {
void Cubic::UpdateCongestionControlStats(QuicPacketCount new_cubic_mode_cwnd,
QuicPacketCount new_reno_mode_cwnd) {
-
QuicPacketCount highest_new_cwnd = max(new_cubic_mode_cwnd,
new_reno_mode_cwnd);
if (last_congestion_window_ < highest_new_cwnd) {
@@ -135,8 +136,17 @@ QuicPacketCount Cubic::CongestionWindowAfterAck(
time_to_origin_point_ = 0;
origin_point_congestion_window_ = current_congestion_window;
} else {
- time_to_origin_point_ = CubeRoot::Root(kCubeFactor *
- (last_max_congestion_window_ - current_congestion_window));
+ if (FLAGS_quic_use_std_cbrt) {
+ time_to_origin_point_ = static_cast<uint32>(
+ cbrt(kCubeFactor *
+ (last_max_congestion_window_ - current_congestion_window)));
+ } else {
+ // TODO(rjshade): Remove CubeRoot source when removing
+ // FLAGS_quic_use_std_cbrt.
+ time_to_origin_point_ =
+ CubeRoot::Root(kCubeFactor * (last_max_congestion_window_ -
+ current_congestion_window));
+ }
origin_point_congestion_window_ =
last_max_congestion_window_;
}
« no previous file with comments | « net/proxy/proxy_resolver_v8.cc ('k') | net/quic/crypto/crypto_server_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698