Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef NET_SOCKET_CLIENT_SOCKET_POOL_HISTOGRAMS_H_ | 5 #ifndef NET_SOCKET_CLIENT_SOCKET_POOL_HISTOGRAMS_H_ |
| 6 #define NET_SOCKET_CLIENT_SOCKET_POOL_HISTOGRAMS_H_ | 6 #define NET_SOCKET_CLIENT_SOCKET_POOL_HISTOGRAMS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/histogram.h" | 11 #include "base/time.h" |
|
Lei Zhang
2010/09/30 01:15:18
nit: sort alphabetically.
| |
| 12 #include "base/ref_counted.h" | 12 #include "base/ref_counted.h" |
| 13 | 13 |
| 14 class Histogram; | |
| 15 | |
| 14 namespace net { | 16 namespace net { |
| 15 | 17 |
| 16 class ClientSocketPoolHistograms | 18 class ClientSocketPoolHistograms |
| 17 : public base::RefCounted<ClientSocketPoolHistograms> { | 19 : public base::RefCounted<ClientSocketPoolHistograms> { |
| 18 public: | 20 public: |
| 19 ClientSocketPoolHistograms(const std::string& pool_name); | 21 ClientSocketPoolHistograms(const std::string& pool_name); |
| 20 | 22 |
| 21 void AddSocketType(int socket_reuse_type) const; | 23 void AddSocketType(int socket_reuse_type) const; |
| 22 void AddRequestTime(base::TimeDelta time) const; | 24 void AddRequestTime(base::TimeDelta time) const; |
| 23 void AddUnusedIdleTime(base::TimeDelta time) const; | 25 void AddUnusedIdleTime(base::TimeDelta time) const; |
| 24 void AddReusedIdleTime(base::TimeDelta time) const; | 26 void AddReusedIdleTime(base::TimeDelta time) const; |
| 25 | 27 |
| 26 private: | 28 private: |
| 27 friend class base::RefCounted<ClientSocketPoolHistograms>; | 29 friend class base::RefCounted<ClientSocketPoolHistograms>; |
| 28 ~ClientSocketPoolHistograms() {} | 30 virtual ~ClientSocketPoolHistograms(); |
| 29 | 31 |
| 30 scoped_refptr<Histogram> socket_type_; | 32 scoped_refptr<Histogram> socket_type_; |
| 31 scoped_refptr<Histogram> request_time_; | 33 scoped_refptr<Histogram> request_time_; |
| 32 scoped_refptr<Histogram> unused_idle_time_; | 34 scoped_refptr<Histogram> unused_idle_time_; |
| 33 scoped_refptr<Histogram> reused_idle_time_; | 35 scoped_refptr<Histogram> reused_idle_time_; |
| 34 | 36 |
| 35 bool is_http_proxy_connection_; | 37 bool is_http_proxy_connection_; |
| 36 bool is_socks_connection_; | 38 bool is_socks_connection_; |
| 37 }; | 39 }; |
| 38 | 40 |
| 39 } // namespace net | 41 } // namespace net |
| 40 | 42 |
| 41 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_HISTOGRAMS_H_ | 43 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_HISTOGRAMS_H_ |
| OLD | NEW |