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

Unified Diff: net/socket/client_socket_pool.cc

Issue 9861032: Close idle connections / SPDY sessions when needed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add instrumentation Created 8 years, 9 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
Index: net/socket/client_socket_pool.cc
diff --git a/net/socket/client_socket_pool.cc b/net/socket/client_socket_pool.cc
index a1967efdbab2b12a340ad7cb37e8af1596d82f45..871ff6165786f5b4b06e8fa8089c0a918158efb3 100644
--- a/net/socket/client_socket_pool.cc
+++ b/net/socket/client_socket_pool.cc
@@ -21,6 +21,24 @@ int g_used_idle_socket_timeout_s = 300; // 5 minutes
namespace net {
+LayeredPool::LayeredPool() {
+ magic_value_ = 0xDEADBEEF;
+}
+
+LayeredPool::~LayeredPool() {
+ magic_value_ = 0;
eroman 2012/03/28 18:02:50 Two comments: (1) Define the magic values as an
Ryan Hamilton 2012/03/28 18:15:44 Done!
+ stack_trace_ = base::debug::StackTrace();
+}
+
+void crash(base::debug::StackTrace trace) {
+ CHECK(false);
+}
+
+void LayeredPool::CrashIfFreed() {
+ if (magic_value_ != 0xDEADBEEF)
+ crash(stack_trace_);
eroman 2012/03/28 18:02:50 OK, so you will want to do some extra work here. S
Ryan Hamilton 2012/03/28 18:15:44 AH! Awesome. I kinda thought that adding the Sta
+}
+
// static
base::TimeDelta ClientSocketPool::unused_idle_socket_timeout() {
return base::TimeDelta::FromSeconds(g_unused_idle_socket_timeout_s);

Powered by Google App Engine
This is Rietveld 408576698