| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "net/ssl/ssl_client_session_cache.h" | 5 #include "net/ssl/ssl_client_session_cache.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/containers/flat_set.h" | 9 #include "base/containers/flat_set.h" |
| 10 #include "base/memory/memory_coordinator_client_registry.h" | 10 #include "base/memory/memory_coordinator_client_registry.h" |
| 11 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
| 12 #include "base/time/clock.h" | 12 #include "base/time/clock.h" |
| 13 #include "base/time/default_clock.h" | 13 #include "base/time/default_clock.h" |
| 14 #include "base/trace_event/process_memory_dump.h" | 14 #include "base/trace_event/process_memory_dump.h" |
| 15 #include "net/cert/x509_util_openssl.h" | |
| 16 #include "third_party/boringssl/src/include/openssl/ssl.h" | 15 #include "third_party/boringssl/src/include/openssl/ssl.h" |
| 17 #include "third_party/boringssl/src/include/openssl/x509.h" | |
| 18 | 16 |
| 19 namespace net { | 17 namespace net { |
| 20 | 18 |
| 21 SSLClientSessionCache::SSLClientSessionCache(const Config& config) | 19 SSLClientSessionCache::SSLClientSessionCache(const Config& config) |
| 22 : clock_(new base::DefaultClock), | 20 : clock_(new base::DefaultClock), |
| 23 config_(config), | 21 config_(config), |
| 24 cache_(config.max_entries), | 22 cache_(config.max_entries), |
| 25 lookups_since_flush_(0) { | 23 lookups_since_flush_(0) { |
| 26 memory_pressure_listener_.reset(new base::MemoryPressureListener(base::Bind( | 24 memory_pressure_listener_.reset(new base::MemoryPressureListener(base::Bind( |
| 27 &SSLClientSessionCache::OnMemoryPressure, base::Unretained(this)))); | 25 &SSLClientSessionCache::OnMemoryPressure, base::Unretained(this)))); |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 Flush(); | 193 Flush(); |
| 196 break; | 194 break; |
| 197 } | 195 } |
| 198 } | 196 } |
| 199 | 197 |
| 200 void SSLClientSessionCache::OnPurgeMemory() { | 198 void SSLClientSessionCache::OnPurgeMemory() { |
| 201 Flush(); | 199 Flush(); |
| 202 } | 200 } |
| 203 | 201 |
| 204 } // namespace net | 202 } // namespace net |
| OLD | NEW |