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

Unified Diff: net/socket/client_socket_pool_base.cc

Issue 7255002: Revert 90373 - Warmth of a connection (cwnd) is estimated by the amount of data written to the so... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 6 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 | « net/socket/client_socket_pool_base.h ('k') | net/socket/client_socket_pool_base_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/client_socket_pool_base.cc
===================================================================
--- net/socket/client_socket_pool_base.cc (revision 90388)
+++ net/socket/client_socket_pool_base.cc (working copy)
@@ -4,14 +4,11 @@
#include "net/socket/client_socket_pool_base.h"
-#include <math.h>
#include "base/compiler_specific.h"
#include "base/format_macros.h"
-#include "base/logging.h"
#include "base/message_loop.h"
#include "base/metrics/stats_counters.h"
#include "base/stl_util-inl.h"
-#include "base/string_number_conversions.h"
#include "base/string_util.h"
#include "base/time.h"
#include "base/values.h"
@@ -35,33 +32,10 @@
// after a certain timeout has passed without receiving an ACK.
bool g_connect_backup_jobs_enabled = true;
-double g_socket_reuse_policy_penalty_exponent = -1;
-int g_socket_reuse_policy = -1;
-
} // namespace
namespace net {
-int GetSocketReusePolicy() {
- return g_socket_reuse_policy;
-}
-
-void SetSocketReusePolicy(int policy) {
- DCHECK_GE(policy, 0);
- DCHECK_LE(policy, 2);
- if (policy > 2 || policy < 0) {
- LOG(ERROR) << "Invalid socket reuse policy";
- return;
- }
-
- double exponents[] = { 0, 0.25, -1 };
- g_socket_reuse_policy_penalty_exponent = exponents[policy];
- g_socket_reuse_policy = policy;
-
- VLOG(1) << "Setting g_socket_reuse_policy_penalty_exponent = "
- << g_socket_reuse_policy_penalty_exponent;
-}
-
ConnectJob::ConnectJob(const std::string& group_name,
base::TimeDelta timeout_duration,
Delegate* delegate,
@@ -389,7 +363,6 @@
const Request* request, Group* group) {
std::list<IdleSocket>* idle_sockets = group->mutable_idle_sockets();
std::list<IdleSocket>::iterator idle_socket_it = idle_sockets->end();
- double max_score = -1;
// Iterate through the idle sockets forwards (oldest to newest)
// * Delete any disconnected ones.
@@ -406,22 +379,7 @@
if (it->socket->WasEverUsed()) {
// We found one we can reuse!
- double score = 0;
- int64 bytes_read = it->socket->NumBytesRead();
- double num_kb = static_cast<double>(bytes_read) / 1024.0;
- int idle_time_sec = (base::TimeTicks::Now() - it->start_time).InSeconds();
- idle_time_sec = std::max(1, idle_time_sec);
-
- if (g_socket_reuse_policy_penalty_exponent >= 0 && num_kb >= 0) {
- score = num_kb / pow(idle_time_sec,
- g_socket_reuse_policy_penalty_exponent);
- }
-
- // Equality to prefer recently used connection.
- if (score >= max_score) {
- idle_socket_it = it;
- max_score = score;
- }
+ idle_socket_it = it;
}
++it;
Property changes on: net/socket/client_socket_pool_base.cc
___________________________________________________________________
Added: svn:mergeinfo
« no previous file with comments | « net/socket/client_socket_pool_base.h ('k') | net/socket/client_socket_pool_base_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698