| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_MANAGER_IMPL_H_ | 5 #ifndef NET_SOCKET_CLIENT_SOCKET_POOL_MANAGER_IMPL_H_ |
| 6 #define NET_SOCKET_CLIENT_SOCKET_POOL_MANAGER_IMPL_H_ | 6 #define NET_SOCKET_CLIENT_SOCKET_POOL_MANAGER_IMPL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <type_traits> | 10 #include <type_traits> |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 namespace internal { | 37 namespace internal { |
| 38 | 38 |
| 39 // A helper class for auto-deleting Values in the destructor. | 39 // A helper class for auto-deleting Values in the destructor. |
| 40 template <typename Key, typename Value> | 40 template <typename Key, typename Value> |
| 41 class OwnedPoolMap : public std::map<Key, Value> { | 41 class OwnedPoolMap : public std::map<Key, Value> { |
| 42 public: | 42 public: |
| 43 OwnedPoolMap() { | 43 OwnedPoolMap() { |
| 44 static_assert(std::is_pointer<Value>::value, "value must be a pointer"); | 44 static_assert(std::is_pointer<Value>::value, "value must be a pointer"); |
| 45 } | 45 } |
| 46 | 46 |
| 47 ~OwnedPoolMap() { | 47 ~OwnedPoolMap() { base::STLDeleteValues(this); } |
| 48 STLDeleteValues(this); | |
| 49 } | |
| 50 }; | 48 }; |
| 51 | 49 |
| 52 } // namespace internal | 50 } // namespace internal |
| 53 | 51 |
| 54 class ClientSocketPoolManagerImpl : public base::NonThreadSafe, | 52 class ClientSocketPoolManagerImpl : public base::NonThreadSafe, |
| 55 public ClientSocketPoolManager, | 53 public ClientSocketPoolManager, |
| 56 public CertDatabase::Observer { | 54 public CertDatabase::Observer { |
| 57 public: | 55 public: |
| 58 ClientSocketPoolManagerImpl( | 56 ClientSocketPoolManagerImpl( |
| 59 NetLog* net_log, | 57 NetLog* net_log, |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 SSLSocketPoolMap ssl_socket_pools_for_https_proxies_; | 125 SSLSocketPoolMap ssl_socket_pools_for_https_proxies_; |
| 128 HTTPProxySocketPoolMap http_proxy_socket_pools_; | 126 HTTPProxySocketPoolMap http_proxy_socket_pools_; |
| 129 SSLSocketPoolMap ssl_socket_pools_for_proxies_; | 127 SSLSocketPoolMap ssl_socket_pools_for_proxies_; |
| 130 | 128 |
| 131 DISALLOW_COPY_AND_ASSIGN(ClientSocketPoolManagerImpl); | 129 DISALLOW_COPY_AND_ASSIGN(ClientSocketPoolManagerImpl); |
| 132 }; | 130 }; |
| 133 | 131 |
| 134 } // namespace net | 132 } // namespace net |
| 135 | 133 |
| 136 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_MANAGER_IMPL_H_ | 134 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_MANAGER_IMPL_H_ |
| OLD | NEW |